From cc6ddc3e533a1af7c9451e6c85944070047011c1 Mon Sep 17 00:00:00 2001 From: javad-jafari Date: Fri, 19 Jul 2024 17:09:59 -0400 Subject: [PATCH 01/92] feat(fa.po): src/running-the-course/course-structure.md segment --- po/fa.po | 15629 ++++++++++++++++++++++++++--------------------------- 1 file changed, 7597 insertions(+), 8032 deletions(-) diff --git a/po/fa.po b/po/fa.po index a89fd09a06f..85906b7f1a0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-01-24T13:24:49+01:00\n" +"POT-Creation-Date: 2024-06-07T18:15:11+03:30\n" "PO-Revision-Date: 2023-08-08 21:41+0330\n" "Last-Translator: danny \n" "Language-Team: Persian\n" @@ -20,15 +20,15 @@ msgstr "به Comprehensive Rust خوش آمدید 🦀" msgid "Running the Course" msgstr "اجرای دوره" -#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:1 msgid "Course Structure" msgstr "مباحث دوره" -#: src/SUMMARY.md src/running-the-course/keyboard-shortcuts.md +#: src/SUMMARY.md src/running-the-course/keyboard-shortcuts.md:1 msgid "Keyboard Shortcuts" msgstr "میان‌برهای صفحه کلید" -#: src/SUMMARY.md src/running-the-course/translations.md +#: src/SUMMARY.md src/running-the-course/translations.md:1 msgid "Translations" msgstr "ترجمه" @@ -52,100 +52,127 @@ msgstr "اجرای cargo روی ماشین local" msgid "Day 1: Morning" msgstr "روز اول: صبح" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:15 +#: src/running-the-course/course-structure.md:34 +#: src/running-the-course/course-structure.md:52 +#: src/running-the-course/course-structure.md:69 src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md +#: src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/hello-world.md src/hello-world/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:16 +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md:1 #, fuzzy msgid "Hello, World" msgstr "سلام دنیا" -#: src/SUMMARY.md src/hello-world/what-is-rust.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md:1 msgid "What is Rust?" msgstr "زبان Rust چیست؟" -#: src/SUMMARY.md src/hello-world/benefits.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md:1 msgid "Benefits of Rust" -msgstr "" +msgstr "فواید زبان راست" -#: src/SUMMARY.md src/hello-world/playground.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md:1 msgid "Playground" msgstr "" -#: src/SUMMARY.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:17 +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "" -#: src/SUMMARY.md src/types-and-values/variables.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md:1 msgid "Variables" msgstr "متغیرها" -#: src/SUMMARY.md src/types-and-values/values.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md:1 msgid "Values" msgstr "" -#: src/SUMMARY.md src/types-and-values/arithmetic.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md:1 msgid "Arithmetic" msgstr "" -#: src/SUMMARY.md src/types-and-values/strings.md -msgid "Strings" -msgstr "رشته‌ها" - -#: src/SUMMARY.md src/types-and-values/inference.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md:1 msgid "Type Inference" msgstr "تعیین تایپ ضمنی" -#: src/SUMMARY.md src/types-and-values/exercise.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md:1 #, fuzzy msgid "Exercise: Fibonacci" msgstr "تمرین: عبارت را بسنجید" -#: src/SUMMARY.md src/types-and-values/solution.md -#: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md -#: src/references/solution.md src/user-defined-types/solution.md -#: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md -#: src/std-traits/solution.md src/memory-management/solution.md -#: src/smart-pointers/solution.md src/borrowing/solution.md -#: src/slices-and-lifetimes/solution.md src/iterators/solution.md -#: src/modules/solution.md src/testing/solution.md -#: src/error-handling/solution.md src/unsafe-rust/solution.md +#: src/SUMMARY.md src/types-and-values/solution.md:1 +#: src/control-flow-basics/solution.md:1 src/tuples-and-arrays/solution.md:1 +#: src/references/solution.md:1 src/user-defined-types/solution.md:1 +#: src/pattern-matching/solution.md:1 src/methods-and-traits/solution.md:1 +#: src/generics/solution.md:1 src/std-types/solution.md:1 +#: src/std-traits/solution.md:1 src/memory-management/solution.md:1 +#: src/smart-pointers/solution.md:1 src/borrowing/solution.md:1 +#: src/lifetimes/solution.md:1 src/iterators/solution.md:1 +#: src/modules/solution.md:1 src/testing/solution.md:1 +#: src/error-handling/solution.md:1 src/unsafe-rust/solution.md:1 #, fuzzy msgid "Solution" msgstr "راه حل‌ها" -#: src/SUMMARY.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:18 +#: src/welcome-day-1.md src/control-flow-basics.md #, fuzzy msgid "Control Flow Basics" msgstr "کنترل جریان" -#: src/SUMMARY.md src/control-flow-basics/conditionals.md -msgid "Conditionals" -msgstr "" +#: src/SUMMARY.md +#, fuzzy +msgid "`if` Expressions" +msgstr "عبارات `if`" -#: src/SUMMARY.md src/control-flow-basics/loops.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md:1 msgid "Loops" msgstr "" -#: src/SUMMARY.md src/control-flow-basics/break-continue.md +#: src/SUMMARY.md src/control-flow-basics/loops/for.md:1 +#, fuzzy +msgid "`for`" +msgstr "حلقه‌های `for`" + +#: src/SUMMARY.md src/control-flow-basics/loops/loop.md:1 +msgid "`loop`" +msgstr "" + +#: src/SUMMARY.md src/control-flow-basics/break-continue.md:1 msgid "`break` and `continue`" msgstr "`break` و `continue`" -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes.md +#: src/SUMMARY.md src/control-flow-basics/break-continue/labels.md:1 +msgid "Labels" +msgstr "" + +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md:1 msgid "Blocks and Scopes" msgstr "" -#: src/SUMMARY.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md:1 +msgid "Scopes and Shadowing" +msgstr "محدوده‌ها و سایه‌گذاری" + +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md:1 msgid "Functions" msgstr "توابع" -#: src/SUMMARY.md src/control-flow-basics/macros.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/macros.md:1 msgid "Macros" msgstr "" -#: src/SUMMARY.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md:1 msgid "Exercise: Collatz Sequence" msgstr "" @@ -153,76 +180,97 @@ msgstr "" msgid "Day 1: Afternoon" msgstr "روز ۱: بعد از ظهر" -#: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:25 +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md msgid "Tuples and Arrays" -msgstr "" +msgstr "تاپل ها و آرایه ها" + +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md:1 +msgid "Arrays" +msgstr "آرایه‌ها" + +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md:1 +msgid "Tuples" +msgstr "تاپل‌ها" -#: src/SUMMARY.md src/tuples-and-arrays/iteration.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md:1 #, fuzzy msgid "Array Iteration" msgstr "تکرار کننده" -#: src/SUMMARY.md src/tuples-and-arrays/match.md src/pattern-matching.md -msgid "Pattern Matching" -msgstr "تطبیق الگو" - -#: src/SUMMARY.md src/tuples-and-arrays/destructuring.md -#: src/pattern-matching/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md:1 #, fuzzy -msgid "Destructuring" +msgid "Patterns and Destructuring" msgstr "تخریب Enumها" -#: src/SUMMARY.md src/tuples-and-arrays/exercise.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md:1 msgid "Exercise: Nested Arrays" msgstr "" -#: src/SUMMARY.md src/references.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:26 +#: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "مراجع" -#: src/SUMMARY.md src/references/shared.md +#: src/SUMMARY.md src/references.md src/references/shared.md:1 #, fuzzy msgid "Shared References" msgstr "مراجع" -#: src/SUMMARY.md src/references/exclusive.md +#: src/SUMMARY.md src/references.md src/references/exclusive.md:1 #, fuzzy msgid "Exclusive References" msgstr "ارجاعات تعلیق شده" -#: src/SUMMARY.md src/references/exercise.md +#: src/SUMMARY.md +#, fuzzy +msgid "Slices: `&[T]`" +msgstr "برش‌ها" + +#: src/SUMMARY.md src/references.md src/references/strings.md:5 +msgid "Strings" +msgstr "رشته‌ها" + +#: src/SUMMARY.md src/references.md src/references/exercise.md:1 msgid "Exercise: Geometry" msgstr "" -#: src/SUMMARY.md src/user-defined-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:27 +#: src/welcome-day-1-afternoon.md src/user-defined-types.md msgid "User-Defined Types" -msgstr "" +msgstr "نوع داده تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md:1 #, fuzzy msgid "Named Structs" msgstr "ساختارها" -#: src/SUMMARY.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md:5 msgid "Tuple Structs" msgstr "ساختار‌های چند‌گانه (Tuple Structs)" -#: src/SUMMARY.md src/user-defined-types/enums.md -#: src/pattern-matching/destructuring.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md:1 +#: src/pattern-matching/destructuring-enums.md:1 msgid "Enums" msgstr "Enums" -#: src/SUMMARY.md src/user-defined-types/static-and-const.md -#, fuzzy -msgid "Static and Const" -msgstr "نمادهای ایستا و ثابت" +#: src/SUMMARY.md src/user-defined-types.md +msgid "Static" +msgstr "" + +#: src/SUMMARY.md +msgid "Const" +msgstr "" -#: src/SUMMARY.md src/user-defined-types/aliases.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md:1 msgid "Type Aliases" msgstr "" -#: src/SUMMARY.md src/user-defined-types/exercise.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/exercise.md:1 #, fuzzy msgid "Exercise: Elevator Events" msgstr "تمرین: عبارت را بسنجید" @@ -231,80 +279,123 @@ msgstr "تمرین: عبارت را بسنجید" msgid "Day 2: Morning" msgstr "روز دوم: صبح" -#: src/SUMMARY.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:35 +#: src/welcome-day-2.md src/pattern-matching.md +msgid "Pattern Matching" +msgstr "تطبیق الگو" + +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md:1 +msgid "Matching Values" +msgstr "" + +#: src/SUMMARY.md src/pattern-matching.md +msgid "Destructuring Structs" +msgstr "تخریب ساختارها" + +#: src/SUMMARY.md src/pattern-matching.md +#, fuzzy +msgid "Destructuring Enums" +msgstr "تخریب Enumها" + +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md:1 #, fuzzy msgid "Let Control Flow" msgstr "کنترل جریان" -#: src/SUMMARY.md src/pattern-matching/exercise.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md:1 msgid "Exercise: Expression Evaluation" msgstr "تمرین: عبارت را بسنجید" -#: src/SUMMARY.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:36 +#: src/welcome-day-2.md src/methods-and-traits.md #, fuzzy msgid "Methods and Traits" -msgstr "Read and Write" +msgstr "متد ها و تریت ها" -#: src/SUMMARY.md src/methods-and-traits/methods.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md:1 msgid "Methods" msgstr "متدها" -#: src/SUMMARY.md src/methods-and-traits/traits.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md:1 msgid "Traits" msgstr "صفت‌ها" -#: src/SUMMARY.md src/methods-and-traits/deriving.md +#: src/SUMMARY.md src/methods-and-traits/traits/implementing.md:1 +#, fuzzy +msgid "Implementing Traits" +msgstr "پیاده سازی صفات (Traits) ناامن" + +#: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md:1 +msgid "Supertraits" +msgstr "" + +#: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md:1 +#, fuzzy +msgid "Associated Types" +msgstr "تایپ‌های عددی" + +#: src/SUMMARY.md src/methods-and-traits.md +#: src/methods-and-traits/deriving.md:1 #, fuzzy msgid "Deriving" msgstr "صفات استنتاجی (Deriving Traits)" -#: src/SUMMARY.md src/methods-and-traits/trait-objects.md -msgid "Trait Objects" -msgstr "آبجکت‌های موصوفی (Trait Objects)" - -#: src/SUMMARY.md src/methods-and-traits/exercise.md +#: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" msgstr "" -#: src/SUMMARY.md src/generics.md +#: src/SUMMARY.md +msgid "Day 2: Afternoon" +msgstr "روز دوم: عصر" + +#: src/SUMMARY.md src/running-the-course/course-structure.md:43 +#: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" msgstr "جنریک‌ها" -#: src/SUMMARY.md src/generics/generic-functions.md +#: src/SUMMARY.md src/generics.md src/generics/generic-functions.md:1 #, fuzzy msgid "Generic Functions" msgstr "توابع خارجی (Extern Functions)" -#: src/SUMMARY.md src/generics/generic-data.md +#: src/SUMMARY.md src/generics.md src/generics/generic-data.md:1 msgid "Generic Data Types" msgstr "انواع داده‌ها جنریک (Generic Data Types)" -#: src/SUMMARY.md src/generics/trait-bounds.md +#: src/SUMMARY.md src/generics/generic-traits.md:1 +#, fuzzy +msgid "Generic Traits" +msgstr "جنریک‌ها" + +#: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md:1 msgid "Trait Bounds" msgstr "صفات مرزی (Trait Bounds)" -#: src/SUMMARY.md src/generics/impl-trait.md +#: src/SUMMARY.md src/generics/impl-trait.md:1 msgid "`impl Trait`" msgstr "" -#: src/SUMMARY.md src/generics/exercise.md +#: src/SUMMARY.md src/generics/dyn-trait.md:1 +#, fuzzy +msgid "`dyn Trait`" +msgstr "صفات Async" + +#: src/SUMMARY.md src/generics/exercise.md:1 msgid "Exercise: Generic `min`" msgstr "" -#: src/SUMMARY.md -msgid "Day 2: Afternoon" -msgstr "روز دوم: عصر" - -#: src/SUMMARY.md src/std-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:44 +#: src/welcome-day-2-afternoon.md src/std-types.md #, fuzzy msgid "Standard Library Types" -msgstr "کتابخانه‌های استاندارد" +msgstr "کتابخانه استاندارد انواع داده" -#: src/SUMMARY.md src/std-types/std.md +#: src/SUMMARY.md src/std-types.md src/std-types/std.md:1 msgid "Standard Library" msgstr "کتابخانه‌های استاندارد" -#: src/SUMMARY.md src/std-types/docs.md +#: src/SUMMARY.md src/std-types.md src/std-types/docs.md:1 #, fuzzy msgid "Documentation" msgstr "تست‌ سندها" @@ -317,48 +408,51 @@ msgstr "" msgid "`Result`" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/android/aidl/types/primitives.md:14 +#: src/android/interoperability/cpp/type-mapping.md:5 #, fuzzy msgid "`String`" msgstr "String" -#: src/SUMMARY.md src/std-types/vec.md +#: src/SUMMARY.md src/std-types/vec.md:1 msgid "`Vec`" msgstr "" -#: src/SUMMARY.md src/std-types/hashmap.md src/bare-metal/no_std.md +#: src/SUMMARY.md src/std-types/hashmap.md:1 src/bare-metal/no_std.md msgid "`HashMap`" msgstr "" -#: src/SUMMARY.md src/std-types/exercise.md +#: src/SUMMARY.md src/std-types.md src/std-types/exercise.md:1 #, fuzzy msgid "Exercise: Counter" msgstr "تمرین‌ها" -#: src/SUMMARY.md src/std-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:45 +#: src/welcome-day-2-afternoon.md src/std-traits.md #, fuzzy msgid "Standard Library Traits" -msgstr "کتابخانه‌های استاندارد" +msgstr "کتابخانه استاندارد برای تریت ها" -#: src/SUMMARY.md src/std-traits/comparisons.md src/async.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md:1 +#: src/concurrency/welcome-async.md msgid "Comparisons" msgstr "" -#: src/SUMMARY.md src/std-traits/operators.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md:1 #, fuzzy msgid "Operators" msgstr "تکرار کننده" -#: src/SUMMARY.md src/std-traits/from-and-into.md +#: src/SUMMARY.md src/std-traits/from-and-into.md:1 msgid "`From` and `Into`" msgstr "" -#: src/SUMMARY.md src/std-traits/casting.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md:1 #, fuzzy msgid "Casting" msgstr "تست‌کردن" -#: src/SUMMARY.md src/std-traits/read-and-write.md +#: src/SUMMARY.md src/std-traits/read-and-write.md:1 msgid "`Read` and `Write`" msgstr "" @@ -366,11 +460,11 @@ msgstr "" msgid "`Default`, struct update syntax" msgstr "" -#: src/SUMMARY.md src/std-traits/closures.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md:1 msgid "Closures" msgstr "" -#: src/SUMMARY.md src/std-traits/exercise.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md:1 #, fuzzy msgid "Exercise: ROT13" msgstr "تمرین‌ها" @@ -379,24 +473,26 @@ msgstr "تمرین‌ها" msgid "Day 3: Morning" msgstr "روز سوم: صبح" -#: src/SUMMARY.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:53 +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" -#: src/SUMMARY.md src/memory-management/review.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/review.md:1 msgid "Review of Program Memory" msgstr "" -#: src/SUMMARY.md src/memory-management/approaches.md +#: src/SUMMARY.md src/memory-management.md +#: src/memory-management/approaches.md:1 #, fuzzy msgid "Approaches to Memory Management" msgstr "مدیریت حافظه خودکار" -#: src/SUMMARY.md src/memory-management/ownership.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md:1 msgid "Ownership" msgstr "مالکیت" -#: src/SUMMARY.md src/memory-management/move.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/move.md:1 msgid "Move Semantics" msgstr "مفاهیم جابه‌جایی" @@ -404,7 +500,8 @@ msgstr "مفاهیم جابه‌جایی" msgid "`Clone`" msgstr "" -#: src/SUMMARY.md src/memory-management/copy-types.md +#: src/SUMMARY.md src/memory-management.md +#: src/memory-management/copy-types.md:1 #, fuzzy msgid "Copy Types" msgstr "تایپ‌های مرکب" @@ -414,24 +511,30 @@ msgstr "تایپ‌های مرکب" msgid "`Drop`" msgstr "رها کردن" -#: src/SUMMARY.md src/memory-management/exercise.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md:1 msgid "Exercise: Builder Type" msgstr "" -#: src/SUMMARY.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:54 +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" -msgstr "" +msgstr "اشاره‌گرهای هوشمند" -#: src/SUMMARY.md src/smart-pointers/box.md -#: src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/smart-pointers/box.md:1 +#: src/android/interoperability/cpp/type-mapping.md:9 msgid "`Box`" msgstr "" -#: src/SUMMARY.md src/smart-pointers/rc.md +#: src/SUMMARY.md src/smart-pointers/rc.md:1 msgid "`Rc`" msgstr "" -#: src/SUMMARY.md src/smart-pointers/exercise.md +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/trait-objects.md:1 +#, fuzzy +msgid "Owned Trait Objects" +msgstr "آبجکت‌های موصوفی (Trait Objects)" + +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/exercise.md:1 msgid "Exercise: Binary Tree" msgstr "" @@ -439,61 +542,57 @@ msgstr "" msgid "Day 3: Afternoon" msgstr "روز سوم: عصر" -#: src/SUMMARY.md src/borrowing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:61 +#: src/welcome-day-3-afternoon.md src/borrowing.md msgid "Borrowing" msgstr "قرض گرفتن" -#: src/SUMMARY.md src/borrowing/shared.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/shared.md:1 #, fuzzy msgid "Borrowing a Value" msgstr "قرض گرفتن" -#: src/SUMMARY.md src/borrowing/borrowck.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/borrowck.md:1 #, fuzzy msgid "Borrow Checking" msgstr "قرض گرفتن" -#: src/SUMMARY.md src/borrowing/interior-mutability.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/examples.md:1 +msgid "Borrow Errors" +msgstr "" + +#: src/SUMMARY.md src/borrowing.md src/borrowing/interior-mutability.md:1 #, fuzzy msgid "Interior Mutability" msgstr "قابلیت همکاری" -#: src/SUMMARY.md src/borrowing/exercise.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/exercise.md:1 #, fuzzy msgid "Exercise: Health Statistics" msgstr "آمارهای سلامتی" -#: src/SUMMARY.md src/slices-and-lifetimes.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:62 +#: src/welcome-day-3-afternoon.md src/lifetimes.md #, fuzzy -msgid "Slices and Lifetimes" +msgid "Lifetimes" msgstr "چرخه حیات" -#: src/SUMMARY.md -#, fuzzy -msgid "Slices: `&[T]`" -msgstr "برش‌ها" - -#: src/SUMMARY.md src/slices-and-lifetimes/str.md -#, fuzzy -msgid "String References" -msgstr "ارجاعات تعلیق شده" - -#: src/SUMMARY.md src/slices-and-lifetimes/lifetime-annotations.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/lifetime-annotations.md:1 #, fuzzy msgid "Lifetime Annotations" msgstr "طول عمر در فراخوانی‌ توابع" -#: src/SUMMARY.md +#: src/SUMMARY.md src/lifetimes.md #, fuzzy msgid "Lifetime Elision" msgstr "چرخه حیات" -#: src/SUMMARY.md +#: src/SUMMARY.md src/lifetimes.md #, fuzzy msgid "Struct Lifetimes" msgstr "چرخه حیات" -#: src/SUMMARY.md src/slices-and-lifetimes/exercise.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/exercise.md:1 msgid "Exercise: Protobuf Parsing" msgstr "" @@ -502,15 +601,16 @@ msgstr "" msgid "Day 4: Morning" msgstr "روز اول: صبح" -#: src/SUMMARY.md src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:70 +#: src/welcome-day-4.md src/iterators.md msgid "Iterators" msgstr "" -#: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md +#: src/SUMMARY.md src/iterators/iterator.md:1 src/bare-metal/no_std.md msgid "`Iterator`" msgstr "" -#: src/SUMMARY.md src/iterators/intoiterator.md +#: src/SUMMARY.md src/iterators/intoiterator.md:1 msgid "`IntoIterator`" msgstr "" @@ -519,19 +619,20 @@ msgstr "" msgid "`FromIterator`" msgstr "FromIterator" -#: src/SUMMARY.md src/iterators/exercise.md +#: src/SUMMARY.md src/iterators.md src/iterators/exercise.md:1 msgid "Exercise: Iterator Method Chaining" msgstr "" -#: src/SUMMARY.md src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:71 +#: src/welcome-day-4.md src/modules.md src/modules/modules.md:1 msgid "Modules" msgstr "ماژول‌ها" -#: src/SUMMARY.md src/modules/filesystem.md +#: src/SUMMARY.md src/modules.md src/modules/filesystem.md:1 msgid "Filesystem Hierarchy" msgstr "سلسله‌ مراتب فایل‌سیستم" -#: src/SUMMARY.md src/modules/visibility.md +#: src/SUMMARY.md src/modules.md src/modules/visibility.md:1 msgid "Visibility" msgstr "قابلیت دید" @@ -539,40 +640,29 @@ msgstr "قابلیت دید" msgid "`use`, `super`, `self`" msgstr "" -#: src/SUMMARY.md src/modules/exercise.md +#: src/SUMMARY.md src/modules.md src/modules/exercise.md:1 msgid "Exercise: Modules for a GUI Library" msgstr "" -#: src/SUMMARY.md src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:72 +#: src/welcome-day-4.md src/testing.md src/chromium/testing.md msgid "Testing" msgstr "تست‌کردن" -#: src/SUMMARY.md +#: src/SUMMARY.md src/testing.md msgid "Test Modules" msgstr "تست‌ ماژول‌ها" -#: src/SUMMARY.md src/testing/other.md +#: src/SUMMARY.md src/testing.md src/testing/other.md:1 #, fuzzy msgid "Other Types of Tests" msgstr "منابع دیگر" -#: src/SUMMARY.md src/testing/useful-crates.md -msgid "Useful Crates" -msgstr "جعبه‌های (Crates) کاربردی" - -#: src/SUMMARY.md src/testing/googletest.md -msgid "GoogleTest" -msgstr "" - -#: src/SUMMARY.md src/testing/mocking.md -msgid "Mocking" -msgstr "" - -#: src/SUMMARY.md src/testing/lints.md +#: src/SUMMARY.md src/testing.md src/testing/lints.md:1 msgid "Compiler Lints and Clippy" msgstr "" -#: src/SUMMARY.md src/testing/exercise.md +#: src/SUMMARY.md src/testing.md src/testing/exercise.md:1 #, fuzzy msgid "Exercise: Luhn Algorithm" msgstr "الگوریتم Luhn" @@ -582,20 +672,21 @@ msgstr "الگوریتم Luhn" msgid "Day 4: Afternoon" msgstr "روز ۱: بعد از ظهر" -#: src/SUMMARY.md src/error-handling.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:79 +#: src/welcome-day-4-afternoon.md src/error-handling.md msgid "Error Handling" msgstr "مدیریت خطا (Error Handling)" -#: src/SUMMARY.md src/error-handling/panics.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/panics.md:1 msgid "Panics" msgstr "پانیک‌ها" -#: src/SUMMARY.md src/error-handling/try.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try.md:1 #, fuzzy msgid "Try Operator" msgstr "تکرار کننده" -#: src/SUMMARY.md src/error-handling/try-conversions.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md:1 #, fuzzy msgid "Try Conversions" msgstr "تبدیل‌های غیر صریح" @@ -605,7 +696,7 @@ msgstr "تبدیل‌های غیر صریح" msgid "`Error` Trait" msgstr "صفت‌های بیشتر" -#: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md +#: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md:1 msgid "`thiserror` and `anyhow`" msgstr "" @@ -613,38 +704,40 @@ msgstr "" msgid "Exercise: Rewriting with `Result`" msgstr "" -#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:80 +#: src/welcome-day-4-afternoon.md src/unsafe-rust.md +#: src/unsafe-rust/unsafe.md:1 msgid "Unsafe Rust" msgstr "Rust ناایمن" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md #, fuzzy msgid "Unsafe" msgstr "Rust ناایمن" -#: src/SUMMARY.md src/unsafe-rust/dereferencing.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/dereferencing.md:1 msgid "Dereferencing Raw Pointers" msgstr "عدم ارجاع به اشاره گرهای خام" -#: src/SUMMARY.md src/unsafe-rust/mutable-static.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/mutable-static.md:1 msgid "Mutable Static Variables" msgstr "متغیرهای ثابت قابل تغییر" -#: src/SUMMARY.md src/unsafe-rust/unions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unions.md:1 msgid "Unions" msgstr "نوع داده چندگانه" -#: src/SUMMARY.md src/unsafe-rust/unsafe-functions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe-functions.md:1 #, fuzzy msgid "Unsafe Functions" msgstr "فراخوانی متدهای ناامن" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md #, fuzzy msgid "Unsafe Traits" msgstr "پیاده سازی صفات (Traits) ناامن" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md #, fuzzy msgid "Exercise: FFI Wrapper" msgstr "امن بودن FFI Wrapper" @@ -673,19 +766,28 @@ msgstr "کتابخانه" msgid "AIDL" msgstr "AIDL" +#: src/SUMMARY.md src/android/aidl/birthday-service.md:1 +msgid "Birthday Service Tutorial" +msgstr "" + #: src/SUMMARY.md msgid "Interface" msgstr "رابط (Interface)" #: src/SUMMARY.md -msgid "Implementation" -msgstr "پیاده سازی" +msgid "Service API" +msgstr "" + +#: src/SUMMARY.md +#, fuzzy +msgid "Service" +msgstr "سرور" #: src/SUMMARY.md msgid "Server" msgstr "سرور" -#: src/SUMMARY.md src/android/aidl/deploy.md +#: src/SUMMARY.md src/android/aidl/example-service/deploy.md:1 msgid "Deploy" msgstr "دیپلوی" @@ -693,11 +795,52 @@ msgstr "دیپلوی" msgid "Client" msgstr "کاربر" -#: src/SUMMARY.md src/android/aidl/changing.md +#: src/SUMMARY.md src/android/aidl/example-service/changing-definition.md:1 msgid "Changing API" msgstr "تغییر دادن API" -#: src/SUMMARY.md src/android/logging.md src/bare-metal/aps/logging.md +#: src/SUMMARY.md +#, fuzzy +msgid "Updating Implementations" +msgstr "پیاده سازی" + +#: src/SUMMARY.md +#, fuzzy +msgid "AIDL Types" +msgstr "انواع" + +#: src/SUMMARY.md src/android/aidl/types/primitives.md:1 +msgid "Primitive Types" +msgstr "" + +#: src/SUMMARY.md src/android/aidl/types/arrays.md:1 +#, fuzzy +msgid "Array Types" +msgstr "آرایه‌ها" + +#: src/SUMMARY.md src/android/aidl/types/objects.md:1 +#, fuzzy +msgid "Sending Objects" +msgstr "آبجکت‌های موصوفی (Trait Objects)" + +#: src/SUMMARY.md src/android/aidl/types/parcelables.md:1 +#, fuzzy +msgid "Parcelables" +msgstr "متغیرها" + +#: src/SUMMARY.md src/android/aidl/types/file-descriptor.md:1 +msgid "Sending Files" +msgstr "" + +#: src/SUMMARY.md src/android/testing/googletest.md:1 +msgid "GoogleTest" +msgstr "" + +#: src/SUMMARY.md src/android/testing/mocking.md:1 +msgid "Mocking" +msgstr "" + +#: src/SUMMARY.md src/android/logging.md src/bare-metal/aps/logging.md:1 msgid "Logging" msgstr "لاگ" @@ -717,11 +860,11 @@ msgstr "فراخوانی C با Bindgen" msgid "Calling Rust from C" msgstr "فراخوانی Rust از C" -#: src/SUMMARY.md src/android/interoperability/cpp.md +#: src/SUMMARY.md src/android/interoperability/cpp.md:1 msgid "With C++" msgstr "با C++" -#: src/SUMMARY.md src/android/interoperability/cpp/bridge.md +#: src/SUMMARY.md src/android/interoperability/cpp/bridge.md:1 #, fuzzy msgid "The Bridge Module" msgstr "تست‌ ماژول‌ها" @@ -731,7 +874,7 @@ msgstr "تست‌ ماژول‌ها" msgid "Rust Bridge" msgstr "Rust در اندروید" -#: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md +#: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md:1 msgid "Generated C++" msgstr "" @@ -739,26 +882,26 @@ msgstr "" msgid "C++ Bridge" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md +#: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md:1 #, fuzzy msgid "Shared Types" msgstr "تایپ‌های عددی" -#: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md +#: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md:1 msgid "Shared Enums" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md +#: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md:1 #, fuzzy msgid "Rust Error Handling" msgstr "مدیریت خطا (Error Handling)" -#: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md +#: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md:1 #, fuzzy msgid "C++ Error Handling" msgstr "مدیریت خطا (Error Handling)" -#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md:1 msgid "Additional Types" msgstr "" @@ -778,9 +921,12 @@ msgstr "" msgid "With Java" msgstr "با جاوا" -#: src/SUMMARY.md src/exercises/android/morning.md -#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md -#: src/exercises/concurrency/morning.md src/exercises/concurrency/afternoon.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:155 +#: src/running-the-course/course-structure.md:165 +#: src/exercises/android/morning.md src/exercises/bare-metal/morning.md +#: src/exercises/bare-metal/afternoon.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md +#: src/concurrency/async-exercises.md msgid "Exercises" msgstr "تمرین‌ها" @@ -801,28 +947,28 @@ msgstr "" msgid "Unsafe Code" msgstr "Rust ناایمن" -#: src/SUMMARY.md src/chromium/build-rules/depending.md +#: src/SUMMARY.md src/chromium/build-rules/depending.md:1 msgid "Depending on Rust Code from Chromium C++" msgstr "" -#: src/SUMMARY.md src/chromium/build-rules/vscode.md +#: src/SUMMARY.md src/chromium/build-rules/vscode.md:1 msgid "Visual Studio Code" msgstr "" -#: src/SUMMARY.md src/exercises/chromium/third-party.md +#: src/SUMMARY.md src/exercises/chromium/third-party.md:1 #, fuzzy msgid "Exercise" msgstr "تمرین‌ها" -#: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md +#: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md:1 msgid "`rust_gtest_interop` Library" msgstr "" -#: src/SUMMARY.md src/chromium/testing/build-gn.md +#: src/SUMMARY.md src/chromium/testing/build-gn.md:1 msgid "GN Rules for Rust Tests" msgstr "" -#: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md +#: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md:1 msgid "`chromium::import!` Macro" msgstr "" @@ -831,16 +977,17 @@ msgstr "" msgid "Interoperability with C++" msgstr "قابلیت همکاری" -#: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md +#: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md:1 #, fuzzy msgid "Example Bindings" msgstr "مثال‌ها" -#: src/SUMMARY.md src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/SUMMARY.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:1 msgid "Limitations of CXX" msgstr "" -#: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md +#: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md:1 #, fuzzy msgid "CXX Error Handling" msgstr "مدیریت خطا (Error Handling)" @@ -868,35 +1015,37 @@ msgid "Configuring Cargo.toml" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:1 msgid "Configuring `gnrt_config.toml`" msgstr "" -#: src/SUMMARY.md src/chromium/adding-third-party-crates/downloading-crates.md +#: src/SUMMARY.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:1 msgid "Downloading Crates" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:1 msgid "Generating `gn` Build Rules" msgstr "" -#: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md +#: src/SUMMARY.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:1 msgid "Resolving Problems" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:1 msgid "Build Scripts Which Generate Code" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:1 msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:1 msgid "Depending on a Crate" msgstr "" @@ -908,7 +1057,8 @@ msgstr "" msgid "Checking into Chromium Source Code" msgstr "" -#: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md +#: src/SUMMARY.md +#: src/chromium/adding-third-party-crates/keeping-up-to-date.md:1 msgid "Keeping Crates Up to Date" msgstr "" @@ -933,7 +1083,7 @@ msgstr "" msgid "A Minimal Example" msgstr "یک مثال ساده" -#: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md +#: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md:1 msgid "`alloc`" msgstr "" @@ -941,7 +1091,7 @@ msgstr "" msgid "Microcontrollers" msgstr "میکروکنترلرها" -#: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md +#: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md:1 msgid "Raw MMIO" msgstr "Raw MMIO" @@ -961,16 +1111,16 @@ msgstr "Board Support Crates" msgid "The Type State Pattern" msgstr "انواع State Pattern" -#: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md +#: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md:1 msgid "`embedded-hal`" msgstr "" -#: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md +#: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md:1 #, fuzzy msgid "`probe-rs` and `cargo-embed`" msgstr "probe-rs, cargo-embed" -#: src/SUMMARY.md src/bare-metal/microcontrollers/debugging.md +#: src/SUMMARY.md src/bare-metal/microcontrollers/debugging.md:1 msgid "Debugging" msgstr "اشکال یابی (Debugging)" @@ -978,12 +1128,15 @@ msgstr "اشکال یابی (Debugging)" msgid "Other Projects" msgstr "باقی پروژه‌ها" -#: src/SUMMARY.md src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md +#: src/SUMMARY.md src/exercises/bare-metal/compass.md:1 +#: src/exercises/bare-metal/solutions-morning.md:3 msgid "Compass" msgstr "قطب‌نما" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/solutions.md:1 +#: src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/solutions.md:1 msgid "Solutions" msgstr "راه حل‌ها" @@ -995,7 +1148,7 @@ msgstr "با Bare Metal: عصر" msgid "Application Processors" msgstr "پردازنده‌های برنامه" -#: src/SUMMARY.md src/bare-metal/aps/entry-point.md +#: src/SUMMARY.md src/bare-metal/aps/entry-point.md:1 msgid "Getting Ready to Rust" msgstr "آماده شدن برای Rust" @@ -1019,7 +1172,7 @@ msgstr "صفت‌های بیشتر" msgid "A Better UART Driver" msgstr "یک درایور بهتر UART" -#: src/SUMMARY.md src/bare-metal/aps/better-uart/bitflags.md +#: src/SUMMARY.md src/bare-metal/aps/better-uart/bitflags.md:1 msgid "Bitflags" msgstr "پرچم‌های بیتی (Bitflags)" @@ -1027,7 +1180,7 @@ msgstr "پرچم‌های بیتی (Bitflags)" msgid "Multiple Registers" msgstr "رجیستر‌های چندگانه" -#: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md +#: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md:1 msgid "Driver" msgstr "درایور" @@ -1035,27 +1188,31 @@ msgstr "درایور" msgid "Using It" msgstr "استفاده از آن" -#: src/SUMMARY.md src/bare-metal/aps/exceptions.md +#: src/SUMMARY.md src/bare-metal/aps/exceptions.md:1 msgid "Exceptions" msgstr "استثناها" -#: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md +#: src/SUMMARY.md +msgid "Useful Crates" +msgstr "جعبه‌های (Crates) کاربردی" + +#: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md:1 msgid "`zerocopy`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md +#: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md:1 msgid "`aarch64-paging`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md +#: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md:1 msgid "`buddy_system_allocator`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md +#: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md:1 msgid "`tinyvec`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/spin.md +#: src/SUMMARY.md src/bare-metal/useful-crates/spin.md:1 msgid "`spin`" msgstr "" @@ -1072,23 +1229,39 @@ msgstr "درایور RTC" msgid "Concurrency: Morning" msgstr "همزمانی: صبح" -#: src/SUMMARY.md src/concurrency/threads.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:151 +#: src/concurrency/welcome.md src/concurrency/threads.md msgid "Threads" msgstr "تردها" -#: src/SUMMARY.md src/concurrency/scoped-threads.md +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md:1 +#, fuzzy +msgid "Plain Threads" +msgstr "تردها" + +#: src/SUMMARY.md src/concurrency/threads.md +#: src/concurrency/threads/scoped.md:1 msgid "Scoped Threads" msgstr "محدوده تردها" -#: src/SUMMARY.md src/concurrency/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:152 +#: src/concurrency/welcome.md src/concurrency/channels.md msgid "Channels" msgstr "کانال‌ها" -#: src/SUMMARY.md src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md:1 +#, fuzzy +msgid "Senders and Receivers" +msgstr "متد دریافتی" + +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/unbounded.md:1 msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" -#: src/SUMMARY.md src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/bounded.md:1 msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1096,42 +1269,53 @@ msgstr "کانال‌های محدود" msgid "`Send` and `Sync`" msgstr "" -#: src/SUMMARY.md src/concurrency/send-sync/send.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:1 +#, fuzzy +msgid "Marker Traits" +msgstr "صفت‌های بیشتر" + +#: src/SUMMARY.md src/concurrency/send-sync/send.md:1 msgid "`Send`" msgstr "" -#: src/SUMMARY.md src/concurrency/send-sync/sync.md +#: src/SUMMARY.md src/concurrency/send-sync/sync.md:1 msgid "`Sync`" msgstr "" -#: src/SUMMARY.md src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/examples.md:1 msgid "Examples" msgstr "مثال‌ها" -#: src/SUMMARY.md src/concurrency/shared_state.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:154 +#: src/concurrency/welcome.md src/concurrency/shared-state.md msgid "Shared State" msgstr "ناحیه‌های مشترک" -#: src/SUMMARY.md src/concurrency/shared_state/arc.md +#: src/SUMMARY.md src/concurrency/shared-state/arc.md:1 msgid "`Arc`" msgstr "" -#: src/SUMMARY.md src/concurrency/shared_state/mutex.md +#: src/SUMMARY.md src/concurrency/shared-state/mutex.md:1 msgid "`Mutex`" msgstr "" -#: src/SUMMARY.md src/memory-management/review.md -#: src/error-handling/try-conversions.md -#: src/concurrency/shared_state/example.md +#: src/SUMMARY.md src/memory-management/review.md:16 +#: src/error-handling/try-conversions.md:23 src/concurrency/shared-state.md +#: src/concurrency/shared-state/example.md:1 msgid "Example" msgstr "مثال" -#: src/SUMMARY.md src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/dining-philosophers.md:1 +#: src/concurrency/sync-exercises/solutions.md:3 +#: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/link-checker.md:1 msgid "Multi-threaded Link Checker" msgstr "جستجوگر پیوند چند تِردی" @@ -1139,69 +1323,80 @@ msgstr "جستجوگر پیوند چند تِردی" msgid "Concurrency: Afternoon" msgstr "همزمانی: عصر" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:162 +#: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" msgstr "مبانی Async" -#: src/SUMMARY.md src/async/async-await.md +#: src/SUMMARY.md src/concurrency/async/async-await.md:1 msgid "`async`/`await`" msgstr "" -#: src/SUMMARY.md src/async/futures.md +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md:1 msgid "Futures" msgstr "Futures" -#: src/SUMMARY.md src/async/runtimes.md +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md:1 msgid "Runtimes" msgstr "Runtimes" -#: src/SUMMARY.md src/async/runtimes/tokio.md +#: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md:1 msgid "Tokio" msgstr "Tokio" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md src/async/tasks.md -#: src/exercises/concurrency/chat-app.md +#: src/SUMMARY.md src/concurrency/sync-exercises/link-checker.md:119 +#: src/concurrency/async.md src/concurrency/async/tasks.md:1 +#: src/concurrency/async-exercises/chat-app.md:143 msgid "Tasks" msgstr "Task" -#: src/SUMMARY.md src/async/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:163 +#: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md +#, fuzzy +msgid "Channels and Control Flow" +msgstr "کنترل جریان پیشرفته" + +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/channels.md:1 msgid "Async Channels" msgstr "کانال‌های Async" -#: src/SUMMARY.md -msgid "Control Flow" -msgstr "کنترل جریان" - -#: src/SUMMARY.md src/async/control-flow/join.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/join.md:1 msgid "Join" msgstr "Join" -#: src/SUMMARY.md src/async/control-flow/select.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/select.md:1 msgid "Select" msgstr "Select" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md:164 +#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" msgstr "مشکل‌ها" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" msgstr "مسدود کردن Executor" -#: src/SUMMARY.md src/async/pitfalls/pin.md +#: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md:1 msgid "`Pin`" msgstr "" -#: src/SUMMARY.md src/async/pitfalls/async-traits.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/async-traits.md:1 msgid "Async Traits" msgstr "صفات Async" -#: src/SUMMARY.md src/async/pitfalls/cancellation.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/cancellation.md:1 msgid "Cancellation" msgstr "لغو" -#: src/SUMMARY.md src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/SUMMARY.md src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/chat-app.md:1 +#: src/concurrency/async-exercises/solutions.md:102 msgid "Broadcast Chat Application" msgstr "پخش برنامه چت" @@ -1213,6 +1408,7 @@ msgstr "کلمات آخر" msgid "Thanks!" msgstr "سپاس!" +#. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md msgid "Glossary" msgstr "واژه نامه" @@ -1228,14 +1424,11 @@ msgstr "اعتبارها" #: src/index.md #, fuzzy msgid "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" -"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" -"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" -"[GitHub contributors](https://img.shields.io/github/contributors/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." -"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." -"com/google/comprehensive-rust/stargazers)" +"![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square) ![GitHub contributors]" +"(https://img.shields.io/github/contributors/google/comprehensive-rust?" +"style=flat-square) ![GitHub stars](https://img.shields.io/github/stars/" +"google/comprehensive-rust?style=flat-square)" msgstr "" "[![GitHub contributors](https://img.shields.io/github/contributors/google/" "comprehensive-rust?style=flat-square)](https://github.com/google/" @@ -1250,19 +1443,24 @@ msgid "" "topics like generics and error handling." msgstr "" "این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این " -"این دوره طیف کامل‌ای از Rust را پوشش میدهد, از syntax پایه تا مباحث پیشرفته " +"این دوره طیف کاملی از Rust را پوشش میدهد, از syntax پایه تا مباحث پیشرفته " "پیشرفته مانند جنریک و مدیریت خطاها." #: src/index.md +#, fuzzy msgid "" -"The latest version of the course can be found at . If you are reading somewhere else, please check there " +"The latest version of the course can be found at https://google.github.io/" +"comprehensive-rust/. If you are reading somewhere else, please check there " "for updates." msgstr "" "آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " "نیز بررسی کنید." +#: src/index.md +msgid "The course is also available as a PDF." +msgstr "" + #: src/index.md msgid "" "The goal of the course is to teach you Rust. We assume you don't know " @@ -1297,9 +1495,10 @@ msgstr "" "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md +#, fuzzy msgid "" -"[Android](android.md): a half-day course on using Rust for Android platform " -"development (AOSP). This includes interoperability with C, C++, and Java." +"Android: a half-day course on using Rust for Android platform development " +"(AOSP). This includes interoperability with C, C++, and Java." msgstr "" "[Android](android.md): دوره نیم روزه استفاده از Rust برای پلتفرم " "اندرویدتوسعه (AOSP). این شامل قابلیت همکاری با C، C++ و " @@ -1308,30 +1507,30 @@ msgstr "" #: src/index.md #, fuzzy msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium " -"based browsers. This includes interoperability with C++ and how to include " -"third-party crates in Chromium." +"Chromium: a half-day course on using Rust within Chromium based browsers. " +"This includes interoperability with C++ and how to include third-party " +"crates in Chromium." msgstr "" "[Android](android.md): دوره نیم روزه استفاده از Rust برای پلتفرم " "اندرویدتوسعه (AOSP). این شامل قابلیت همکاری با C، C++ و " "جاوا می شود." #: src/index.md +#, fuzzy msgid "" -"[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal " -"(embedded) development. Both microcontrollers and application processors are " -"covered." +"Bare-metal: a whole-day class on using Rust for bare-metal (embedded) " +"development. Both microcontrollers and application processors are covered." msgstr "" "[Bare-metal](bare-metal.md): یک دوره یک روزه درباره استفاده از راست برای " "توسعه bare-metal(embedded). هر دوی میکروکنترلر‌ها و هم پردازشگر هایی با " "کارایی خاص پوشش داده میشود." #: src/index.md +#, fuzzy msgid "" -"[Concurrency](concurrency.md): a whole-day class on concurrency in Rust. We " -"cover both classical concurrency (preemptively scheduling using threads and " -"mutexes) and async/await concurrency (cooperative multitasking using " -"futures)." +"Concurrency: a whole-day class on concurrency in Rust. We cover both " +"classical concurrency (preemptively scheduling using threads and mutexes) " +"and async/await concurrency (cooperative multitasking using futures)." msgstr "" "[Concurrency](concurrency.md): یک دوره یک روزه درباره همروندی (Concurrency) " "در Rust. ما هر دو همزمانی کلاسیک (برنامه ریزی پیشگیرانه با استفاده از نخ ها " @@ -1351,10 +1550,10 @@ msgstr "" "چندتا از اهداف خارج از این دوره عبارتند از:" #: src/index.md +#, fuzzy msgid "" -"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) instead." +"Learning how to develop macros: please see Chapter 19.5 in the Rust Book and " +"Rust by Example instead." msgstr "" "برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" "(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" @@ -1393,7 +1592,7 @@ msgstr "" "اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " "پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." -#: src/running-the-course.md src/running-the-course/course-structure.md +#: src/running-the-course.md src/running-the-course/course-structure.md:3 msgid "This page is for the course instructor." msgstr "این صفحه برای مدرس دوره است." @@ -1469,13 +1668,13 @@ msgstr "" "نخواهد بود." #: src/running-the-course.md +#, fuzzy msgid "" "On the day of your course, show up to the room a little early to set things " "up. We recommend presenting directly using `mdbook serve` running on your " -"laptop (see the [installation instructions](https://github.com/google/" -"comprehensive-rust#building)). This ensures optimal performance with no lag " -"as you change pages. Using your laptop will also allow you to fix typos as " -"you or the course participants spot them." +"laptop (see the installation instructions). This ensures optimal performance " +"with no lag as you change pages. Using your laptop will also allow you to " +"fix typos as you or the course participants spot them." msgstr "" "در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " "توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " @@ -1511,12 +1710,11 @@ msgstr "" "اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md +#, fuzzy msgid "" -"Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We " -"would love to hear what worked well for you and what can be made better. " -"Your students are also very welcome to [send us feedback](https://github.com/" -"google/comprehensive-rust/discussions/100)!" +"Please provide feedback afterwards so that we can keep improving the course. " +"We would love to hear what worked well for you and what can be made better. " +"Your students are also very welcome to send us feedback!" msgstr "" "لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" "rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " @@ -1524,198 +1722,229 @@ msgstr "" "شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" "github.com/google/comprehensive-rust/discussions/100) !" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:5 msgid "Rust Fundamentals" msgstr "مبانی Rust" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:7 #, fuzzy msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " -"days are fast paced and we cover a lot of ground!" +"The first four days make up Rust Fundamentals. The days are fast paced and " +"we cover a lot of ground!" msgstr "" "سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " "سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم:" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:10 +#: src/running-the-course/course-structure.md:146 #, fuzzy msgid "Course schedule:" msgstr "مباحث دوره" -#: src/running-the-course/course-structure.md -msgid "Day 1 Morning (3 hours, including breaks)" -msgstr "" +#: src/running-the-course/course-structure.md:11 +msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" +msgstr "" + +#: src/running-the-course/course-structure.md:13 +#: src/running-the-course/course-structure.md:23 +#: src/running-the-course/course-structure.md:32 +#: src/running-the-course/course-structure.md:41 +#: src/running-the-course/course-structure.md:50 +#: src/running-the-course/course-structure.md:59 +#: src/running-the-course/course-structure.md:67 +#: src/running-the-course/course-structure.md:77 +#: src/running-the-course/course-structure.md:149 +#: src/running-the-course/course-structure.md:160 src/welcome-day-1.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4.md +#: src/welcome-day-4-afternoon.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "Segment" +msgstr "بخش" + +#: src/running-the-course/course-structure.md:13 +#: src/running-the-course/course-structure.md:23 +#: src/running-the-course/course-structure.md:32 +#: src/running-the-course/course-structure.md:41 +#: src/running-the-course/course-structure.md:50 +#: src/running-the-course/course-structure.md:59 +#: src/running-the-course/course-structure.md:67 +#: src/running-the-course/course-structure.md:77 +#: src/running-the-course/course-structure.md:149 +#: src/running-the-course/course-structure.md:160 src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md +#: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md +#: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +#, fuzzy +msgid "Duration" +msgstr "پیاده سازی" -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-1.md) (5 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:15 src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "5 minutes" +msgstr "۵ دقیقه" + +#: src/running-the-course/course-structure.md:16 +#: src/running-the-course/course-structure.md:153 src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/user-defined-types.md src/methods-and-traits.md +#: src/modules.md src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/shared-state.md +msgid "15 minutes" +msgstr "۱۵ دقیقه" + +#: src/running-the-course/course-structure.md:17 +#: src/running-the-course/course-structure.md:18 +#: src/running-the-course/course-structure.md:71 src/welcome-day-1.md +#: src/welcome-day-4.md +msgid "40 minutes" +msgstr "۴۰ دقیقه" + +#: src/running-the-course/course-structure.md:21 +msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" +msgstr "بعد از ظهر روز ۱ (۲ ساعت و ۳۵ دقیقه،شامل وقت استراحت)" + +#: src/running-the-course/course-structure.md:25 src/welcome-day-1-afternoon.md +msgid "35 minutes" +msgstr "۳۵ دقیقه" + +#: src/running-the-course/course-structure.md:26 +#: src/running-the-course/course-structure.md:54 +#: src/running-the-course/course-structure.md:61 +#: src/running-the-course/course-structure.md:79 +#: src/running-the-course/course-structure.md:164 +#: src/welcome-day-1-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md +#: src/concurrency/welcome-async.md +msgid "55 minutes" +msgstr "۵۵ دقیقه" + +#: src/running-the-course/course-structure.md:27 +#: src/running-the-course/course-structure.md:36 +#: src/running-the-course/course-structure.md:62 src/welcome-day-1-afternoon.md +#: src/welcome-day-2.md src/welcome-day-3-afternoon.md +msgid "50 minutes" +msgstr "۵۰ دقیقه" + +#: src/running-the-course/course-structure.md:30 +msgid "Day 2 Morning (2 hours and 10 minutes, including breaks)" +msgstr "صبح روز ۲ (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" + +#: src/running-the-course/course-structure.md:34 +#: src/running-the-course/course-structure.md:52 +#: src/running-the-course/course-structure.md:69 src/hello-world.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/welcome-day-2.md src/methods-and-traits.md src/std-types.md +#: src/welcome-day-3.md src/borrowing.md src/welcome-day-4.md src/modules.md +#: src/testing.md src/error-handling.md +msgid "3 minutes" +msgstr "۳ دقیقه" + +#: src/running-the-course/course-structure.md:35 +#: src/running-the-course/course-structure.md:53 src/welcome-day-2.md +#: src/welcome-day-3.md +msgid "1 hour" +msgstr "۱ ساعت" -#: src/running-the-course/course-structure.md -msgid "[Hello, World](../hello-world.md) (20 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:39 +msgid "Day 2 Afternoon (4 hours and 5 minutes, including breaks)" +msgstr "بعدازظهر روز ۲ (۴ ساعت و ۵ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md -msgid "[Types and Values](../types-and-values.md) (1 hour and 5 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:43 +#: src/running-the-course/course-structure.md:70 +#: src/running-the-course/course-structure.md:72 src/welcome-day-2-afternoon.md +#: src/welcome-day-4.md +msgid "45 minutes" +msgstr "۴۵ دقیقه" -#: src/running-the-course/course-structure.md -msgid "[Control Flow Basics](../control-flow-basics.md) (1 hour)" -msgstr "" +#: src/running-the-course/course-structure.md:44 src/welcome-day-2-afternoon.md +msgid "1 hour and 20 minutes" +msgstr "۱ ساعت و ۲۰ دقیقه" -#: src/running-the-course/course-structure.md -msgid "Day 1 Afternoon (2 hours and 55 minutes, including breaks)" -msgstr "" +#: src/running-the-course/course-structure.md:45 src/welcome-day-2-afternoon.md +msgid "1 hour and 40 minutes" +msgstr "۱ ساعت ۴۰ دقیقه" -#: src/running-the-course/course-structure.md -msgid "[Tuples and Arrays](../tuples-and-arrays.md) (1 hour)" -msgstr "" +#: src/running-the-course/course-structure.md:48 +msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" +msgstr "صبح روز ۳ (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md -msgid "[References](../references.md) (50 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:57 +msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" +msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md -msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:65 +msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" +msgstr "صبح روز ۴ (۲ ساعت و ۴۰ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md -msgid "Day 2 Morning (3 hours and 5 minutes, including breaks)" -msgstr "" +#: src/running-the-course/course-structure.md:75 +msgid "Day 4 Afternoon (2 hours and 10 minutes, including breaks)" +msgstr "بعدازظهر روز ۴ (۲ ساعت و ۱۰ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-2.md) (3 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:80 src/welcome-day-4-afternoon.md +msgid "1 hour and 5 minutes" +msgstr "ساعت و ۵ دقیقه" + +#: src/running-the-course/course-structure.md:85 +msgid "Deep Dives" +msgstr "عمیق تر شدن" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:87 #, fuzzy -msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" +msgid "" +"In addition to the 4-day class on Rust Fundamentals, we cover some more " +"specialized topics:" msgstr "" -"به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -"Rust اطلاعات بیشتری کسب کنید." +"علاوه بر کلاس 3 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " +"دهیم:" -#: src/running-the-course/course-structure.md -msgid "[Methods and Traits](../methods-and-traits.md) (55 minutes)" -msgstr "" +#: src/running-the-course/course-structure.md:90 +msgid "Rust in Android" +msgstr "Rust در اندروید" -#: src/running-the-course/course-structure.md -msgid "[Generics](../generics.md) (45 minutes)" +#: src/running-the-course/course-structure.md:92 +#, fuzzy +msgid "" +"The Rust in Android deep dive is a half-day course on using Rust for Android " +"platform development. This includes interoperability with C, C++, and Java." msgstr "" +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " +"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " +"با C، C++ و جاوا می‌شود." -#: src/running-the-course/course-structure.md -msgid "Day 2 Afternoon (3 hours, including breaks)" +#: src/running-the-course/course-structure.md:96 +#, fuzzy +msgid "" +"You will need an AOSP checkout. Make a checkout of the course repository on " +"the same machine and move the `src/android/` directory into the root of your " +"AOSP checkout. This will ensure that the Android build system sees the " +"`Android.bp` files in `src/android/`." msgstr "" +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" +"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" +"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" +"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " +"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." -#: src/running-the-course/course-structure.md -msgid "[Standard Library Types](../std-types.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 3 Morning (2 hours and 15 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-3.md) (3 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Memory Management](../memory-management.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Smart Pointers](../smart-pointers.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 3 Afternoon (2 hours and 20 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Borrowing](../borrowing.md) (1 hour)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "" -"[Slices and Lifetimes](../slices-and-lifetimes.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Morning (3 hours and 5 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-4.md) (3 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Iterators](../iterators.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Modules](../modules.md) (40 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Testing](../testing.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Afternoon (2 hours, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Error Handling](../error-handling.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Deep Dives" -msgstr "عمیق تر شدن" - -#: src/running-the-course/course-structure.md -#, fuzzy -msgid "" -"In addition to the 4-day class on Rust Fundamentals, we cover some more " -"specialized topics:" -msgstr "" -"علاوه بر کلاس 3 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " -"دهیم:" - -#: src/running-the-course/course-structure.md -msgid "Rust in Android" -msgstr "Rust در اندروید" - -#: src/running-the-course/course-structure.md -msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using " -"Rust for Android platform development. This includes interoperability with " -"C, C++, and Java." -msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " -"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " -"با C، C++ و جاوا می‌شود." - -#: src/running-the-course/course-structure.md -msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/" -"download/downloading). Make a checkout of the [course repository](https://" -"github.com/google/comprehensive-rust) on the same machine and move the `src/" -"android/` directory into the root of your AOSP checkout. This will ensure " -"that the Android build system sees the `Android.bp` files in `src/android/`." -msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" -"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" -"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" -"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " -"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." - -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:101 msgid "" "Ensure that `adb sync` works with your emulator or real device and pre-build " "all Android examples using `src/android/build_all.sh`. Read the script to " @@ -1726,65 +1955,67 @@ msgstr "" "بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " "که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:108 #, fuzzy msgid "Rust in Chromium" msgstr "Rust در اندروید" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:110 msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " -"using Rust as part of the Chromium browser. It includes using Rust in " -"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " -"and C++ interoperability." +"The Rust in Chromium deep dive is a half-day course on using Rust as part of " +"the Chromium browser. It includes using Rust in Chromium's `gn` build " +"system, bringing in third-party libraries (\"crates\") and C++ " +"interoperability." msgstr "" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:115 msgid "" "You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. " -"Ensure that you can run the Chromium browser that you've built." +"recommended for speed but any build will work. Ensure that you can run the " +"Chromium browser that you've built." msgstr "" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:119 msgid "Bare-Metal Rust" msgstr "Rust بر روی سخت افزار بدون سیستم عامل" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:121 +#, fuzzy msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " -"using Rust for bare-metal (embedded) development. Both microcontrollers and " -"application processors are covered." +"The Bare-Metal Rust deep dive is a full day class on using Rust for bare-" +"metal (embedded) development. Both microcontrollers and application " +"processors are covered." msgstr "" "دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " "دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " "سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " "کارایی خاص را پوشش می دهد. " -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:125 +#, fuzzy msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit]" -"(https://microbit.org/) v2 development board ahead of time. Everybody will " -"need to install a number of packages as described on the [welcome page](../" -"bare-metal.md)." +"For the microcontroller part, you will need to buy the BBC micro:bit v2 " +"development board ahead of time. Everybody will need to install a number of " +"packages as described on the welcome page." msgstr "" "برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " "v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" "(../bare-metal.md) توضیح داده شده نصب کنند." -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:130 msgid "Concurrency in Rust" msgstr "همزمانی در Rust" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:132 +#, fuzzy msgid "" -"The [Concurrency in Rust](../concurrency.md) deep dive is a full day class " -"on classical as well as `async`/`await` concurrency." +"The Concurrency in Rust deep dive is a full day class on classical as well " +"as `async`/`await` concurrency." msgstr "" "دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی " "کلاسیک و همچنین همزمانی `async`/`await` است. " -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:135 msgid "" "You will need a fresh crate set up and the dependencies downloaded and ready " "to go. You can then copy/paste the examples into `src/main.rs` to experiment " @@ -1794,11 +2025,48 @@ msgstr "" "باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " "آزمایش کنید:" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:147 +msgid "Morning (3 hours and 20 minutes, including breaks)" +msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" + +#: src/running-the-course/course-structure.md:151 +#: src/running-the-course/course-structure.md:154 +#: src/running-the-course/course-structure.md:162 src/pattern-matching.md +#: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async-exercises.md +msgid "30 minutes" +msgstr "۳۰ دقیقه" + +#: src/running-the-course/course-structure.md:152 +#: src/running-the-course/course-structure.md:163 src/methods-and-traits.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/borrowing.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "20 minutes" +msgstr "۲۰ دقیقه"" + +#: src/running-the-course/course-structure.md:153 src/concurrency/welcome.md +msgid "Send and Sync" +msgstr "ارسال و همگام سازی" + +#: src/running-the-course/course-structure.md:155 +#: src/running-the-course/course-structure.md:165 src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "1 hour and 10 minutes" +msgstr "۱ ساعت و ۱۰ دقیفه" + +#: src/running-the-course/course-structure.md:158 +msgid "Afternoon (3 hours and 20 minutes, including breaks)" +msgstr "بعدازظهر (۳ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" + +#: src/running-the-course/course-structure.md:170 msgid "Format" msgstr "فرمت" -#: src/running-the-course/course-structure.md +#: src/running-the-course/course-structure.md:172 msgid "" "The course is meant to be very interactive and we recommend letting the " "questions drive the exploration of Rust!" @@ -1806,43 +2074,31 @@ msgstr "" "این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " "Rust را هدایت کنند!" -#: src/running-the-course/keyboard-shortcuts.md +#: src/running-the-course/keyboard-shortcuts.md:3 msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "چندین میانبر صفحه کلید مفید در mdBook وجود دارد:" -#: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Left" -msgstr "Arrow-Left" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the previous page." +#: src/running-the-course/keyboard-shortcuts.md:5 +#, fuzzy +msgid "Arrow-Left: Navigate to the previous page." msgstr ": به صفحه قبلی هدایت می کند" -#: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Right" -msgstr "Arrow-Right" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the next page." +#: src/running-the-course/keyboard-shortcuts.md:6 +#, fuzzy +msgid "Arrow-Right: Navigate to the next page." msgstr "به صفحه بعدی هدایت می کند" -#: src/running-the-course/keyboard-shortcuts.md src/cargo/code-samples.md -msgid "Ctrl + Enter" -msgstr "Ctrl + Enter" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Execute the code sample that has focus." +#: src/running-the-course/keyboard-shortcuts.md:7 +#, fuzzy +msgid "Ctrl + Enter: Execute the code sample that has focus." msgstr "اجرای نمونه کدی که بر روی آن قرار گرفته است." -#: src/running-the-course/keyboard-shortcuts.md -msgid "s" -msgstr "s" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Activate the search bar." +#: src/running-the-course/keyboard-shortcuts.md:8 +#, fuzzy +msgid "s: Activate the search bar." msgstr "نوار جستجو را فعال می کند." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:3 msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" @@ -1850,77 +2106,43 @@ msgstr "" "این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " "است:" -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:6 msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " -"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " -"[@henrif75](https://github.com/henrif75)." +"Brazilian Portuguese by @rastringer, @hugojacob, @joaovicmendes, and " +"@henrif75." msgstr "" -"[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " -"[@henrif75](https://github.com/henrif75)." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:8 msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " -"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" -"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" -"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), [@SketchK](https://github.com/SketchK), and [@nodmp]" -"(https://github.com/nodmp)." +"Chinese (Simplified) by @suetfei, @wnghl, @anlunx, @kongy, @noahdragon, " +"@superwhd, @SketchK, and @nodmp." msgstr "" -"[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " -"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " -"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " -"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." -"com/nodmp)." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:10 msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " -"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen), and [@johnathan79717](https://github.com/" -"johnathan79717)." +"Chinese (Traditional) by @hueich, @victorhsieh, @mingyc, @kuanhungchen, and " +"@johnathan79717." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." -#: src/running-the-course/translations.md -msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), and " -"[@jooyunghan](https://github.com/jooyunghan)." +#: src/running-the-course/translations.md:12 +msgid "Korean by @keispace, @jiyongp, @jooyunghan, and @namhyung." msgstr "" -"[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " -"[@jooyunghan](https://github.com/jooyunghan)." -#: src/running-the-course/translations.md -msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" -"(https://github.com/deavid)." +#: src/running-the-course/translations.md:13 +msgid "Spanish by @deavid." msgstr "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" -"(https://github.com/deavid)." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:15 msgid "" "Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:17 msgid "Incomplete Translations" msgstr "ترجمه‌های ناقص" -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:19 msgid "" "There is a large number of in-progress translations. We link to the most " "recently updated translations:" @@ -1928,46 +2150,31 @@ msgstr "" "تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " "پیوند می دهیم:" -#: src/running-the-course/translations.md -msgid "" -"[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" -"(https://github.com/raselmandol)." +#: src/running-the-course/translations.md:22 +msgid "Bengali by @raselmandol." msgstr "" -"[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol]" -"(https://github.com/raselmandol)." -#: src/running-the-course/translations.md -msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS) and [@vcaen](https://github.com/vcaen)." +#: src/running-the-course/translations.md:23 +msgid "French by @KookaS, @vcaen and @AdrienBaudemont." msgstr "" -"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" -"(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." -#: src/running-the-course/translations.md -msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" -"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +#: src/running-the-course/translations.md:24 +msgid "German by @Throvn and @ronaldfw." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" -"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." -#: src/running-the-course/translations.md -msgid "" -"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) and [@momotaro1105](https://github.com/" -"momotaro1105)." +#: src/running-the-course/translations.md:25 +msgid "Japanese by @CoinEZ-JPN and @momotaro1105." msgstr "" -"[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" -"momotaro1105)." -#: src/running-the-course/translations.md +#: src/running-the-course/translations.md:26 +msgid "Italian by @henrythebuilder and @detro." +msgstr "" + +#: src/running-the-course/translations.md:28 +#, fuzzy msgid "" -"If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " -"get going. Translations are coordinated on the [issue tracker](https://" -"github.com/google/comprehensive-rust/issues/282)." +"If you want to help with this effort, please see our instructions for how to " +"get going. Translations are coordinated on the issue tracker." msgstr "" "اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" "google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " @@ -1975,12 +2182,12 @@ msgstr "" "comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md +#, fuzzy msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc." -"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " -"and run Rust applications. Here we want to give a brief overview of what " -"Cargo is and how it fits into the wider ecosystem and how it fits into this " -"training." +"When you start reading about Rust, you will soon meet Cargo, the standard " +"tool used in the Rust ecosystem to build and run Rust applications. Here we " +"want to give a brief overview of what Cargo is and how it fits into the " +"wider ecosystem and how it fits into this training." msgstr "" "وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." "rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " @@ -1993,7 +2200,8 @@ msgid "Installation" msgstr "راهنمای نصب" #: src/cargo.md -msgid "**Please follow the instructions on .**" +#, fuzzy +msgid "**Please follow the instructions on https://rustup.rs/.**" msgstr "**لطفا دستورالعمل را اجرا کنید .**" #: src/cargo.md @@ -2007,14 +2215,13 @@ msgstr "" "توانید از آن برای نصب نسخه های مختلف کامپایلر استفاده کنید." #: src/cargo.md +#, fuzzy msgid "" "After installing Rust, you should configure your editor or IDE to work with " -"Rust. Most editors do this by talking to [rust-analyzer](https://rust-" -"analyzer.github.io/), which provides auto-completion and jump-to-definition " -"functionality for [VS Code](https://code.visualstudio.com/), [Emacs](https://" -"rust-analyzer.github.io/manual.html#emacs), [Vim/Neovim](https://rust-" -"analyzer.github.io/manual.html#vimneovim), and many others. There is also a " -"different IDE available called [RustRover](https://www.jetbrains.com/rust/)." +"Rust. Most editors do this by talking to rust-analyzer, which provides auto-" +"completion and jump-to-definition functionality for VS Code, Emacs, Vim/" +"Neovim, and many others. There is also a different IDE available called " +"RustRover." msgstr "" "پس از نصب Rust، باید ویرایشگر یا IDE خود را برای کار با Rust پیکربندی کنید. " "اکثر ویرایشگرها این کار را با ارتباط گرفتن با [rust-analyzer](https://rust-" @@ -2025,28 +2232,28 @@ msgstr "" "متفاوت به نام [RustRover](https://www.jetbrains.com/rust/) در دسترس است." #: src/cargo.md +#, fuzzy msgid "" -"On Debian/Ubuntu, you can also install Cargo, the Rust source and the [Rust " -"formatter](https://github.com/rust-lang/rustfmt) via `apt`. However, this " -"gets you an outdated rust version and may lead to unexpected behavior. The " -"command would be:" +"On Debian/Ubuntu, you can also install Cargo, the Rust source and the Rust " +"formatter via `apt`. However, this gets you an outdated rust version and may " +"lead to unexpected behavior. The command would be:" msgstr "" "در دبیان/اوبونتو، می‌توانید Cargo و Rust و [Rust formatter](https://github." "com/rust-lang/rustfmt) را نیز از طریق `apt` نصب کنید. با این حال، این به شما " "یک نسخه قدیمی Rust را جهت نصب می دهد و ممکن است منجر به رفتار غیرمنتظره " "برنامه شود. command مورد نظر این خواهد بود:" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:1 msgid "The Rust Ecosystem" msgstr "اکوسیستم رراست" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:3 msgid "" "The Rust ecosystem consists of a number of tools, of which the main ones are:" msgstr "" "اکوسیستم Rust از تعدادی ابزار تشکیل شده است که مهمترین آنها عبارتند از:" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:5 msgid "" "`rustc`: the Rust compiler which turns `.rs` files into binaries and other " "intermediate formats." @@ -2054,19 +2261,20 @@ msgstr "" "`rustc`: کامپایلر Rust که فایل‌های `.rs` را به باینری و سایر فرمت‌های میانی " "تبدیل می‌کند. " -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:8 +#, fuzzy msgid "" "`cargo`: the Rust dependency manager and build tool. Cargo knows how to " -"download dependencies, usually hosted on , and it will " -"pass them to `rustc` when building your project. Cargo also comes with a " -"built-in test runner which is used to execute unit tests." +"download dependencies, usually hosted on https://crates.io, and it will pass " +"them to `rustc` when building your project. Cargo also comes with a built-in " +"test runner which is used to execute unit tests." msgstr "" "`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " "وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " "هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " "دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:13 #, fuzzy msgid "" "`rustup`: the Rust toolchain installer and updater. This tool is used to " @@ -2081,15 +2289,14 @@ msgstr "" "Rust را دانلود کند. همچنین می‌توانید چندین نسخه Rust را به‌طور هم‌زمان نصب " "کنید و `rustup` به شما امکان می‌دهد در صورت نیاز بین آنها جابه‌جا شوید." -#: src/cargo/rust-ecosystem.md src/hello-world/hello-world.md -#: src/tuples-and-arrays/tuples-and-arrays.md src/references/exclusive.md -#: src/pattern-matching/destructuring.md src/memory-management/move.md -#: src/error-handling/try.md src/android/setup.md src/concurrency/threads.md -#: src/async/async-await.md +#: src/cargo/rust-ecosystem.md:21 src/types-and-values/hello-world.md:26 +#: src/references/exclusive.md:20 src/memory-management/move.md:153 +#: src/error-handling/try.md:53 src/android/setup.md +#: src/concurrency/async/async-await.md:26 msgid "Key points:" msgstr "نکات کلیدی:" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:23 msgid "" "Rust has a rapid release schedule with a new release coming out every six " "weeks. New releases maintain backwards compatibility with old releases --- " @@ -2099,12 +2306,12 @@ msgstr "" "منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " "علاوه قابلیت‌های جدید را فعال می‌کنند." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:27 msgid "" "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:29 msgid "" "New features are being tested on \"nightly\", \"beta\" is what becomes " "\"stable\" every six weeks." @@ -2112,29 +2319,31 @@ msgstr "" "ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " "هفته \"stable\" می شود." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:32 +#, fuzzy msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc." -"rust-lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative registries, git, folders, " +"and more." msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:35 +#, fuzzy msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has editions: the current edition is Rust 2021. Previous editions " +"were Rust 2015 and Rust 2018." msgstr "" "Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " "نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:38 msgid "" "The editions are allowed to make backwards incompatible changes to the " "language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:41 msgid "" "To prevent breaking code, editions are opt-in: you select the edition for " "your crate via the `Cargo.toml` file." @@ -2142,7 +2351,7 @@ msgstr "" "برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " "مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:44 msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." @@ -2150,7 +2359,7 @@ msgstr "" "برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " "برای نسخه های مختلف را ترکیب کنند." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:47 msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." @@ -2158,7 +2367,7 @@ msgstr "" "لازم به ذکر است که استفاده از کامپایلر به طور مستقیم و نه از طریق `cargo` " "بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:50 #, fuzzy msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " @@ -2169,54 +2378,47 @@ msgstr "" "قابلیت دارای بسیاری از ویژگی های پیشرفته زیر است و محدود به همین موارد " "نمی‌شود:" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:53 msgid "Project/package structure" msgstr "ساختار پروژه/بسته" -#: src/cargo/rust-ecosystem.md -msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +#: src/cargo/rust-ecosystem.md:54 +msgid "workspaces" msgstr "" -"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:55 msgid "Dev Dependencies and Runtime Dependency management/caching" msgstr "وابستگی های Dev و وابستگی‌های Runtime Management/Caching." -#: src/cargo/rust-ecosystem.md -msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +#: src/cargo/rust-ecosystem.md:56 +msgid "build scripting" msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" -#: src/cargo/rust-ecosystem.md -msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" -msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +#: src/cargo/rust-ecosystem.md:57 +#, fuzzy +msgid "global installation" +msgstr "راهنمای نصب" -#: src/cargo/rust-ecosystem.md +#: src/cargo/rust-ecosystem.md:58 +#, fuzzy msgid "" -"It is also extensible with sub command plugins as well (such as [cargo " -"clippy](https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as cargo " +"clippy)." msgstr "" "همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" "lang/rust-clippy)) قابل توسعه است." -#: src/cargo/rust-ecosystem.md -msgid "" -"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +#: src/cargo/rust-ecosystem.md:60 +#, fuzzy +msgid "Read more from the official Cargo Book" msgstr "" "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:1 msgid "Code Samples in This Training" msgstr "نمونه کد در این آموزش" -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:3 msgid "" "For this training, we will mostly explore the Rust language through examples " "which can be executed through your browser. This makes the setup much easier " @@ -2226,7 +2428,7 @@ msgstr "" "مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " "کند و تجربه ای ثابت را برای همه تضمین می کند." -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:7 msgid "" "Installing Cargo is still encouraged: it will make it easier for you to do " "the exercises. On the last day, we will do a larger exercise which shows you " @@ -2236,23 +2438,22 @@ msgstr "" "کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " "چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:11 msgid "The code blocks in this course are fully interactive:" msgstr "بلوک های کد در این دوره کاملاً تعاملی(interactive) هستند:" -#: src/cargo/code-samples.md src/cargo/running-locally.md +#: src/cargo/code-samples.md:15 src/cargo/running-locally.md:46 msgid "\"Edit me!\"" msgstr "" -#: src/cargo/code-samples.md -msgid "You can use " -msgstr "همان طور که مشاهده می‌کنید" - -#: src/cargo/code-samples.md -msgid " to execute the code when focus is in the text box." +#: src/cargo/code-samples.md:19 +#, fuzzy +msgid "" +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." msgstr "برای اجرای کد زمانی که focus در text box است." -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:24 msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" @@ -2260,7 +2461,7 @@ msgstr "" "اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " "کد به دلایل مختلف قابل ویرایش نیستند:" -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:27 msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." @@ -2268,7 +2469,7 @@ msgstr "" "همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " "کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." -#: src/cargo/code-samples.md +#: src/cargo/code-samples.md:30 msgid "" "The embedded playgrounds lose their state the moment you navigate away from " "the page! This is the reason that the students should solve the exercises " @@ -2278,17 +2479,17 @@ msgstr "" "خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " "استفاده از local Rust installation یا از طریق زPlayground حل کنند." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:1 msgid "Running Code Locally with Cargo" msgstr "اجرای کد به صورت Locally با Cargo" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:3 +#, fuzzy msgid "" "If you want to experiment with the code on your own system, then you will " -"need to first install Rust. Do this by following the [instructions in the " -"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " -"should give you a working `rustc` and `cargo`. At the time of writing, the " -"latest stable Rust release has these version numbers:" +"need to first install Rust. Do this by following the instructions in the " +"Rust Book. This should give you a working `rustc` and `cargo`. At the time " +"of writing, the latest stable Rust release has these version numbers:" msgstr "" "اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " "این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" @@ -2296,7 +2497,7 @@ msgstr "" "`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " "این version numberها است:" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:16 msgid "" "You can use any later version too since Rust maintains backwards " "compatibility." @@ -2304,7 +2505,7 @@ msgstr "" "شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " "های قبلی را حفظ می‌کند." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:18 msgid "" "With this in place, follow these steps to build a Rust binary from one of " "the examples in this training:" @@ -2312,26 +2513,26 @@ msgstr "" "با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " "باینری Rust بسازید:" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:21 msgid "Click the \"Copy to clipboard\" button on the example you want to copy." msgstr "" "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:23 msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" "از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " "استفاده کنید:" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:30 msgid "" "Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" "به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " "کنید:" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:41 msgid "" "Replace the boiler-plate code in `src/main.rs` with your own code. For " "example, using the example on the previous page, make `src/main.rs` look like" @@ -2339,11 +2540,11 @@ msgstr "" "کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " "استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:50 msgid "Use `cargo run` to build and run your updated binary:" msgstr "برای ساختن و اجرای باینری به روز شده خود از `cargo run` استفاده کنید:" -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:60 msgid "" "Use `cargo check` to quickly check your project for errors, use `cargo " "build` to compile it without running it. You will find the output in `target/" @@ -2355,7 +2556,7 @@ msgstr "" "debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " "شده در `target/release/` از `cargo build --release` استفاده کنید." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:65 msgid "" "You can add dependencies for your project by editing `Cargo.toml`. When you " "run `cargo` commands, it will automatically download and compile missing " @@ -2365,7 +2566,7 @@ msgstr "" "هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " "نیاز را برای شما دانلود و کامپایل می‌کند." -#: src/cargo/running-locally.md +#: src/cargo/running-locally.md:73 msgid "" "Try to encourage the class participants to install Cargo and use a local " "editor. It will make their life easier since they will have a normal " @@ -2413,35 +2614,15 @@ msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "" -#: src/welcome-day-1.md src/welcome-day-1-afternoon.md src/welcome-day-2.md -#: src/welcome-day-2-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4.md -#: src/welcome-day-4-afternoon.md -msgid "In this session:" -msgstr "" - -#: src/welcome-day-1.md -msgid "[Welcome](./welcome-day-1.md) (5 minutes)" -msgstr "" - -#: src/welcome-day-1.md -msgid "[Hello, World](./hello-world.md) (20 minutes)" -msgstr "" - -#: src/welcome-day-1.md -msgid "[Types and Values](./types-and-values.md) (1 hour and 5 minutes)" -msgstr "" - #: src/welcome-day-1.md -msgid "[Control Flow Basics](./control-flow-basics.md) (1 hour)" -msgstr "" - -#: src/welcome-day-1.md src/welcome-day-2-afternoon.md -msgid "Including 10 minute breaks, this session should take about 3 hours" +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 5 " +"minutes. It contains:" msgstr "" #: src/welcome-day-1.md @@ -2506,314 +2687,212 @@ msgid "" "schedule. Feel free to be flexible and adjust as necessary!" msgstr "" +#: src/hello-world.md src/concurrency/send-sync.md +msgid "This segment should take about 15 minutes. It contains:" +msgstr "این بخش 15 دقیقه زمان می برد. این بخش شامل:" + #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md #: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/slices-and-lifetimes.md -#: src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md -msgid "In this segment:" -msgstr "" - -#: src/hello-world.md -msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Hello, World](./hello-world/hello-world.md) (5 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Playground](./hello-world/playground.md) (2 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "This segment should take about 20 minutes" -msgstr "" +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/concurrency/sync-exercises.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "Slide" +msgstr "اسلاید" + +#: src/hello-world.md src/references.md src/user-defined-types.md +#: src/pattern-matching.md src/methods-and-traits.md src/generics.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "10 minutes" +msgstr "10 دقیقه" + +#: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md +msgid "2 minutes" +msgstr "2 دقیقه" -#: src/hello-world/what-is-rust.md -msgid "" -"Rust is a new programming language which had its [1.0 release in 2015]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +#: src/hello-world/what-is-rust.md:3 +msgid "Rust is a new programming language which had its 1.0 release in 2015:" msgstr "" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:5 msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" "زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:6 msgid "`rustc` uses LLVM as its backend." msgstr "`rustc` از `LLVM` به عنوان بک‌اند خود استفاده می‌کند." -#: src/hello-world/what-is-rust.md -msgid "" -"Rust supports many [platforms and architectures](https://doc.rust-lang.org/" -"nightly/rustc/platform-support.html):" +#: src/hello-world/what-is-rust.md:7 +msgid "Rust supports many platforms and architectures:" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" -"rustc/platform-support.html) پشتیبانی می کند :" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:9 msgid "x86, ARM, WebAssembly, ..." msgstr "x86, ARM, WebAssembly, ..." -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:10 msgid "Linux, Mac, Windows, ..." msgstr "Linux, Mac, Windows, ..." -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:11 msgid "Rust is used for a wide range of devices:" msgstr ":راست برای طیف گسترده‌ای از دستگاه‌ها استفاده می‌شود" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:12 msgid "firmware and boot loaders," msgstr "میان‌افزار (firmware) و بوت‌لودرها (boot loaders)" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:13 msgid "smart displays," msgstr "نمایشگر‌های هوشمند" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:14 msgid "mobile phones," msgstr "تلفن‌های همراه" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:15 msgid "desktops," msgstr "رایانه‌های رومیزی" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:16 msgid "servers." msgstr "سرورها" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:21 msgid "Rust fits in the same area as C++:" msgstr "Rust در همان حوزه C++ قرار می‌گیرد:" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:23 msgid "High flexibility." msgstr "" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:24 msgid "High level of control." msgstr "" -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:25 msgid "" "Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:26 msgid "Has no runtime or garbage collection." msgstr " فاقد ران‌تایم (runtime) یا جمع‌آوری زباله (garbage collection) است." -#: src/hello-world/what-is-rust.md +#: src/hello-world/what-is-rust.md:27 msgid "Focuses on reliability and safety without sacrificing performance." msgstr "بر قابلیت اطمینان و ایمنی بدون قربانی کردن عملکرد تمرکز دارد." -#: src/hello-world/hello-world.md -msgid "" -"Let us jump into the simplest possible Rust program, a classic Hello World " -"program:" -msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " -"بپردازیم:" - -#: src/hello-world/hello-world.md -msgid "\"Hello 🌍!\"" -msgstr "" - -#: src/hello-world/hello-world.md -msgid "What you see:" -msgstr "آنچه شما می‌بینید:" - -#: src/hello-world/hello-world.md -msgid "Functions are introduced with `fn`." -msgstr " توابع با `fn` معرفی می‌شوند." - -#: src/hello-world/hello-world.md -msgid "Blocks are delimited by curly braces like in C and C++." -msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " -"می‌شوند." - -#: src/hello-world/hello-world.md -msgid "The `main` function is the entry point of the program." -msgstr "تابع `main` نقطه ورود برنامه است." - -#: src/hello-world/hello-world.md -msgid "Rust has hygienic macros, `println!` is an example of this." -msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک " -"نمونه از این است." - -#: src/hello-world/hello-world.md -msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." -msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " -"باشند." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"This slide tries to make the students comfortable with Rust code. They will " -"see a ton of it over the next four days so we start small with something " -"familiar." -msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " -"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." - -#: src/hello-world/hello-world.md -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/hello-world.md -msgid "Rust is modern with full support for things like Unicode." -msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند یونیکد است." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"Rust uses macros for situations where you want to have a variable number of " -"arguments (no function [overloading](../control-flow-basics/functions.md))." -msgstr "" -"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از " -"آرگومان‌ها داشته باشید (بدون [اورلودینگ](basic-syntax/functions-interlude.md) " -"تابع)." - -#: src/hello-world/hello-world.md -msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers " -"from the scope they are used in. Rust macros are actually only [partially " -"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/hello-world.md -msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented " -"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " -"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/benefits.md +#: src/hello-world/benefits.md:3 msgid "Some unique selling points of Rust:" msgstr "برخی از نقاط قوت منحصر به فرد زبان Rust:" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:5 msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:7 msgid "No uninitialized variables." msgstr "هیچ متغیر مقدار‌دهی نشده‌ای (`uninitialized`) وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:8 msgid "No double-frees." msgstr "هیچ آزادسازی دوباره‌ای وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:9 msgid "No use-after-free." msgstr "هیچ استفاده‌ای پس از آزادسازی وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:10 msgid "No `NULL` pointers." msgstr "هیچ اشاره‌گر `NULL` وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:11 msgid "No forgotten locked mutexes." msgstr "هیچ موتکس قفل شدهِ فراموش شده‌ای وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:12 msgid "No data races between threads." msgstr " هیچ وضعیت رقابتی (`data races`) بین رشته‌ها وجود ندارد." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:13 msgid "No iterator invalidation." msgstr "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:15 msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:17 msgid "Array access is bounds checked." msgstr "دسترسی به آرایه با بررسی محدوده چک می‌شود." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:18 msgid "Integer overflow is defined (panic or wrap-around)." msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wrap-around`)." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:20 msgid "" "_Modern language features_ - as expressive and ergonomic as higher-level " "languages" msgstr "" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:22 msgid "Enums and pattern matching." msgstr "Enumها و تطابق الگوها." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:23 msgid "Generics." msgstr "جنریک‌ها." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:24 msgid "No overhead FFI." msgstr "FFI بدون سربار" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:25 msgid "Zero-cost abstractions." msgstr "انتزاع‌هایی بدون هزینه" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:26 msgid "Great compiler errors." msgstr "خطاهای کامپایل عالیست." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:27 msgid "Built-in dependency manager." msgstr "مدیر وابستگی درون-ساختی" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:28 msgid "Built-in support for testing." msgstr "پشتیبانی درون-ساختی از تست نویسی" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:29 msgid "Excellent Language Server Protocol support." msgstr "پشتیبانی عالی از LSP‌." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:34 msgid "" "Do not spend much time here. All of these points will be covered in more " "depth later." msgstr "" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:37 msgid "" "Make sure to ask the class which languages they have experience with. " "Depending on the answer you can highlight different features of Rust:" @@ -2821,7 +2900,7 @@ msgstr "" "حتما از کلاس بپرسید که با چه زبان‌هایی تجربه دارند. بسته به پاسخ، می توانید " "ویژگی‌های مختلف Rust را برجسته کنید::" -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:40 msgid "" "Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " "via the borrow checker. You get performance like in C and C++, but you don't " @@ -2834,7 +2913,7 @@ msgstr "" "دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " "با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." -#: src/hello-world/benefits.md +#: src/hello-world/benefits.md:45 msgid "" "Experience with Java, Go, Python, JavaScript...: You get the same memory " "safety as in those languages, plus a similar high-level language feeling. In " @@ -2847,34 +2926,33 @@ msgstr "" "جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " "می‌کنید." -#: src/hello-world/playground.md +#: src/hello-world/playground.md:3 msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " -"run short Rust programs, and is the basis for the examples and exercises in " -"this course. Try running the \"hello-world\" program it starts with. It " -"comes with a few handy features:" +"The Rust Playground provides an easy way to run short Rust programs, and is " +"the basis for the examples and exercises in this course. Try running the " +"\"hello-world\" program it starts with. It comes with a few handy features:" msgstr "" -#: src/hello-world/playground.md +#: src/hello-world/playground.md:8 msgid "" "Under \"Tools\", use the `rustfmt` option to format your code in the " "\"standard\" way." msgstr "" -#: src/hello-world/playground.md +#: src/hello-world/playground.md:11 msgid "" "Rust has two main \"profiles\" for generating code: Debug (extra runtime " "checks, less optimization) and Release (fewer runtime checks, lots of " "optimization). These are accessible under \"Debug\" at the top." msgstr "" -#: src/hello-world/playground.md +#: src/hello-world/playground.md:15 msgid "" "If you're interested, use \"ASM\" under \"...\" to see the generated " "assembly code." msgstr "" -#: src/hello-world/playground.md +#: src/hello-world/playground.md:21 msgid "" "As students head into the break, encourage them to open up the playground " "and experiment a little. Encourage them to keep the tab open and try things " @@ -2883,174 +2961,246 @@ msgid "" "assembly." msgstr "" -#: src/types-and-values.md -msgid "[Variables](./types-and-values/variables.md) (5 minutes)" +#: src/types-and-values.md src/control-flow-basics.md src/modules.md +msgid "This segment should take about 40 minutes. It contains:" msgstr "" -#: src/types-and-values.md -msgid "[Values](./types-and-values/values.md) (10 minutes)" +#: src/types-and-values/hello-world.md:3 +msgid "" +"Let us jump into the simplest possible Rust program, a classic Hello World " +"program:" msgstr "" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " +"بپردازیم:" -#: src/types-and-values.md -msgid "[Arithmetic](./types-and-values/arithmetic.md) (5 minutes)" +#: src/types-and-values/hello-world.md:8 +msgid "\"Hello 🌍!\"" msgstr "" -#: src/types-and-values.md -msgid "[Strings](./types-and-values/strings.md) (10 minutes)" -msgstr "" +#: src/types-and-values/hello-world.md:12 +msgid "What you see:" +msgstr "آنچه شما می‌بینید:" -#: src/types-and-values.md -msgid "[Type Inference](./types-and-values/inference.md) (5 minutes)" -msgstr "" +#: src/types-and-values/hello-world.md:14 +msgid "Functions are introduced with `fn`." +msgstr " توابع با `fn` معرفی می‌شوند." -#: src/types-and-values.md -msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (30 minutes)" +#: src/types-and-values/hello-world.md:15 +msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " +"می‌شوند." -#: src/types-and-values.md src/testing.md src/unsafe-rust.md -msgid "This segment should take about 1 hour and 5 minutes" -msgstr "" +#: src/types-and-values/hello-world.md:16 +msgid "The `main` function is the entry point of the program." +msgstr "تابع `main` نقطه ورود برنامه است." -#: src/types-and-values/variables.md -#, fuzzy -msgid "" -"Rust provides type safety via static typing. Variable bindings are made with " -"`let`:" +#: src/types-and-values/hello-world.md:17 +msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " -"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust دارای ماکروهای hygienic است، `println!` یک " +"نمونه از این است." -#: src/types-and-values/variables.md src/control-flow-basics/loops.md -#: src/control-flow-basics/break-continue.md -#: src/control-flow-basics/blocks-and-scopes.md -msgid "\"x: {x}\"" +#: src/types-and-values/hello-world.md:18 +msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " +"باشند." -#: src/types-and-values/variables.md +#: src/types-and-values/hello-world.md:23 +#, fuzzy msgid "" -"// x = 20;\n" -" // println!(\"x: {x}\");\n" +"This slide tries to make the students comfortable with Rust code. They will " +"see a ton of it over the next four days so we start small with something " +"familiar." msgstr "" +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " +"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." -#: src/types-and-values/variables.md +#: src/types-and-values/hello-world.md:28 msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by " -"default. Add the `mut` keyword to allow changes." -msgstr "" +"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/types-and-values/hello-world.md:31 +msgid "Rust is modern with full support for things like Unicode." +msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند یونیکد است." + +#: src/types-and-values/hello-world.md:33 +#, fuzzy +msgid "" +"Rust uses macros for situations where you want to have a variable number of " +"arguments (no function overloading)." +msgstr "" +"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از " +"آرگومان‌ها داشته باشید (بدون [اورلودینگ](basic-syntax/functions-interlude.md) " +"تابع)." + +#: src/types-and-values/hello-world.md:36 +#, fuzzy +msgid "" +"Macros being 'hygienic' means they don't accidentally capture identifiers " +"from the scope they are used in. Rust macros are actually only partially " +"hygienic." +msgstr "" +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " +"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html هستند." + +#: src/types-and-values/hello-world.md:40 +#, fuzzy +msgid "" +"Rust is multi-paradigm. For example, it has powerful object-oriented " +"programming features, and, while it is not a functional language, it " +"includes a range of functional concepts." +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/types-and-values/variables.md:3 +#, fuzzy +msgid "" +"Rust provides type safety via static typing. Variable bindings are made with " +"`let`:" +msgstr "" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " +"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" + +#: src/types-and-values/variables.md:9 src/control-flow-basics/loops/for.md:9 +#: src/control-flow-basics/blocks-and-scopes.md:17 +msgid "\"x: {x}\"" +msgstr "" + +#: src/types-and-values/variables.md:10 +msgid "// x = 20; // println!(\"x: {x}\");" +msgstr "" -#: src/types-and-values/variables.md +#: src/types-and-values/variables.md:18 +msgid "" +"Uncomment the `x = 20` to demonstrate that variables are immutable by " +"default. Add the `mut` keyword to allow changes." +msgstr "" + +#: src/types-and-values/variables.md:21 msgid "" "The `i32` here is the type of the variable. This must be known at compile " "time, but type inference (covered later) allows the programmer to omit it in " "many cases." msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:3 msgid "" "Here are some basic built-in types, and the syntax for literal values of " "each type." msgstr "" -#: src/types-and-values/values.md src/tuples-and-arrays/tuples-and-arrays.md -#: src/unsafe-rust/exercise.md +#: src/types-and-values/values.md:6 src/unsafe-rust/exercise.md:16 msgid "Types" msgstr "انواع" -#: src/types-and-values/values.md src/tuples-and-arrays/tuples-and-arrays.md +#: src/types-and-values/values.md:6 msgid "Literals" msgstr "مقادیر ثابت" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:8 msgid "Signed integers" msgstr "اعداد صحیح علامت‌دار" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:8 msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:8 msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "" "-10, 0, 1_000, 123_i64" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:9 msgid "Unsigned integers" msgstr "اعداد صحیح مثبت" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:9 msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:9 msgid "`0`, `123`, `10_u16`" msgstr "" "0, 123, 10_u16" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:10 msgid "Floating point numbers" msgstr "اعداد با ممیز شناور" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:10 msgid "`f32`, `f64`" msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:10 msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" "3.14, -10.0e20, 2_f32" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:11 msgid "Unicode scalar values" msgstr "مقادیر عددی یونیکد" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:11 src/android/aidl/types/primitives.md:9 msgid "`char`" msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:11 msgid "`'a'`, `'α'`, `'∞'`" msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:12 msgid "Booleans" msgstr "بولین‌ها" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:12 src/android/aidl/types/primitives.md:7 msgid "`bool`" msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:12 msgid "`true`, `false`" msgstr "" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:14 msgid "The types have widths as follows:" msgstr "اندازه تایپ‌ها به شرح زیر است:" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:16 msgid "`iN`, `uN`, and `fN` are _N_ bits wide," msgstr "`iN`, `uN`و `fN` به اندازه _N_ حافظه اشغال می‌کنند.," -#: src/types-and-values/values.md +#: src/types-and-values/values.md:17 msgid "`isize` and `usize` are the width of a pointer," msgstr "`isize` و `usize` به اندازه یک اشاره‌گر حافظه اشغال می‌کنند," -#: src/types-and-values/values.md +#: src/types-and-values/values.md:18 msgid "`char` is 32 bits wide," msgstr "`char` به اندازه 32 بیت حافظه اشغال می‌کنند.," -#: src/types-and-values/values.md +#: src/types-and-values/values.md:19 msgid "`bool` is 8 bits wide." msgstr "`bool` به اندازه 8 بیت حافظه اشغال می‌کنند." -#: src/types-and-values/values.md +#: src/types-and-values/values.md:24 msgid "There are a few syntaxes which are not shown above:" msgstr "موارد اندکی وجود دارند که در بالا نشان داده نشده است:" -#: src/types-and-values/values.md +#: src/types-and-values/values.md:26 msgid "" "All underscores in numbers can be left out, they are for legibility only. So " "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " @@ -3061,29 +3211,29 @@ msgstr "" "(یا `10_00`) نوشته شود و `123_i64` " "می‌تواند به صورت `123i64` نوشته شود.»" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:9 msgid "\"result: {}\"" msgstr "" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:16 msgid "" "This is the first time we've seen a function other than `main`, but the " "meaning should be clear: it takes three integers, and returns an integer. " "Functions will be covered in more detail later." msgstr "" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:20 msgid "Arithmetic is very similar to other languages, with similar precedence." msgstr "" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:22 msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " "actually undefined, and might do different things on different platforms or " "compilers. In Rust, it's defined." msgstr "" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:26 msgid "" "Change the `i32`'s to `i16` to see an integer overflow, which panics " "(checked) in a debug build and wraps in a release build. There are other " @@ -3092,97 +3242,17 @@ msgid "" "a)`." msgstr "" -#: src/types-and-values/arithmetic.md +#: src/types-and-values/arithmetic.md:31 msgid "" "In fact, the compiler will detect overflow of constant expressions, which is " "why the example requires a separate function." msgstr "" -#: src/types-and-values/strings.md -msgid "" -"Rust has two types to represent strings, both of which will be covered in " -"more depth later. Both _always_ store UTF-8 encoded strings." -msgstr "" - -#: src/types-and-values/strings.md -#, fuzzy -msgid "`String` - a modifiable, owned string." -msgstr "`String` یک بافر رشته‌ای قابل تغییر است." - -#: src/types-and-values/strings.md -msgid "`&str` - a read-only string. String literals have this type." -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"Greetings\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"🪐\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\", \"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"final sentence: {}\"" -msgstr "" - -#: src/types-and-values/strings.md src/async/control-flow/join.md -msgid "\"{:?}\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "//println!(\"{:?}\", &sentence[12..13]);\n" -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"This slide introduces strings. Everything here will be covered in more depth " -"later, but this is enough for subsequent slides and exercises to use strings." -msgstr "" - -#: src/types-and-values/strings.md -msgid "Invalid UTF-8 in a string is UB, and this not allowed in safe Rust." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"`String` is a user-defined type with a constructor (`::new()`) and methods " -"like `s.push_str(..)`." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"The `&` in `&str` indicates that this is a reference. We will cover " -"references later, so for now just think of `&str` as a unit meaning \"a read-" -"only string\"." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"The commented-out line is indexing into the string by byte position. " -"`12..13` does not end on a character boundary, so the program panics. Adjust " -"it to a range that does, based on the error message." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`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/types-and-values/inference.md +#: src/types-and-values/inference.md:3 msgid "Rust will look at how the variable is _used_ to determine the type:" msgstr "زبان Rust برای تعیین نوع متغیر به نحوه استفاده از آن نگاه می‌کند:" -#: src/types-and-values/inference.md +#: src/types-and-values/inference.md:29 msgid "" "This slide demonstrates how the Rust compiler infers types based on " "constraints given by variable declarations and usages." @@ -3190,7 +3260,7 @@ msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " -#: src/types-and-values/inference.md +#: src/types-and-values/inference.md:32 msgid "" "It is very important to emphasize that variables declared like this are not " "of some sort of dynamic \"any type\" that can hold any data. The machine " @@ -3204,132 +3274,89 @@ msgstr "" "اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " "تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " -#: src/types-and-values/inference.md +#: src/types-and-values/inference.md:37 msgid "" "When nothing constrains the type of an integer literal, Rust defaults to " "`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " "floating-point literals default to `f64`." msgstr "" -#: src/types-and-values/inference.md -msgid "// ERROR: no implementation for `{float} == {integer}`\n" +#: src/types-and-values/inference.md:46 +msgid "// ERROR: no implementation for `{float} == {integer}`" msgstr "" -#: src/types-and-values/exercise.md +#: src/types-and-values/exercise.md:3 msgid "" -"The first and second Fibonacci numbers are both `1`. For n>2, the n'th " -"Fibonacci number is calculated recursively as the sum of the n-1'th and " -"n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -#: src/types-and-values/exercise.md +#: src/types-and-values/exercise.md:6 msgid "" "Write a function `fib(n)` that calculates the n'th Fibonacci number. When " "will this function panic?" msgstr "" -#: src/types-and-values/exercise.md -msgid "// The base case.\n" +#: src/types-and-values/exercise.md:12 +msgid "// The base case." msgstr "" -#: src/types-and-values/exercise.md src/control-flow-basics/exercise.md +#: src/types-and-values/exercise.md:13 src/types-and-values/exercise.md:16 +#: src/control-flow-basics/exercise.md:27 +#: src/control-flow-basics/exercise.md:31 #, fuzzy msgid "\"Implement this\"" msgstr "پیاده سازی" -#: src/types-and-values/exercise.md -msgid "// The recursive case.\n" -msgstr "" - -#: src/types-and-values/exercise.md src/types-and-values/solution.md -msgid "\"fib(n) = {}\"" -msgstr "" - -#: src/control-flow-basics.md -msgid "[Conditionals](./control-flow-basics/conditionals.md) (5 minutes)" -msgstr "" - -#: src/control-flow-basics.md -msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" -msgstr "" - -#: src/control-flow-basics.md -msgid "" -"[break and continue](./control-flow-basics/break-continue.md) (5 minutes)" +#: src/types-and-values/exercise.md:15 +msgid "// The recursive case." msgstr "" -#: src/control-flow-basics.md -msgid "" -"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (10 minutes)" +#: src/types-and-values/exercise.md:22 src/types-and-values/solution.md:14 +msgid "\"fib({n}) = {}\"" msgstr "" #: src/control-flow-basics.md -msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" -msgstr "" +#, fuzzy +msgid "if Expressions" +msgstr "عبارت if" -#: src/control-flow-basics.md -msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" +#: src/control-flow-basics.md src/pattern-matching.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md +msgid "4 minutes" msgstr "" #: src/control-flow-basics.md -msgid "" -"[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (30 minutes)" -msgstr "" - -#: src/control-flow-basics.md src/tuples-and-arrays.md src/borrowing.md -msgid "This segment should take about 1 hour" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" -msgstr "بسیاری از دستور زبان Rust مشابه زبان‌های C، C++ یا Java خواهد بود:" - -#: src/control-flow-basics/conditionals.md #, fuzzy -msgid "Blocks are delimited by curly braces." -msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." - -#: src/control-flow-basics/conditionals.md -msgid "" -"Line comments are started with `//`, block comments are delimited by `/* ... " -"*/`." -msgstr "" -"کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " -"می‌شوند." - -#: src/control-flow-basics/conditionals.md -msgid "Keywords like `if` and `while` work the same." -msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." - -#: src/control-flow-basics/conditionals.md -msgid "Variable assignment is done with `=`, comparison is done with `==`." -msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." +msgid "break and continue" +msgstr "`break` و `continue`" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:1 msgid "`if` expressions" msgstr "عبارات `if`" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:3 +#, fuzzy msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" -"if-expr.html#if-expressions) exactly like `if` statements in other languages:" +"You use `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-basics/conditionals.md -msgid "\"small\"" +#: src/control-flow-basics/if.md:11 +msgid "\"zero!\"" msgstr "" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:13 msgid "\"biggish\"" msgstr "" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:15 msgid "\"huge\"" msgstr "" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:20 msgid "" "In addition, you can use `if` as an expression. The last expression of each " "block becomes the value of the `if` expression:" @@ -3337,15 +3364,19 @@ msgstr "" "در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " "هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:26 +msgid "\"small\"" +msgstr "" + +#: src/control-flow-basics/if.md:26 msgid "\"large\"" msgstr "" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:27 msgid "\"number size: {}\"" msgstr "" -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:34 #, fuzzy msgid "" "Because `if` is an expression and must have a particular type, both of its " @@ -3356,97 +3387,94 @@ msgstr "" "و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " "`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد. " -#: src/control-flow-basics/conditionals.md +#: src/control-flow-basics/if.md:38 msgid "" "When `if` is used in an expression, the expression must have a `;` to " "separate it from the next statement. Remove the `;` before `println!` to see " "the compiler error." msgstr "" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops.md:3 msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" msgstr "" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops.md:5 #, fuzzy msgid "`while`" msgstr "حلقه‌های `while`" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops.md:7 #, fuzzy msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) works much like in other languages, executing the " -"loop body as long as the condition is true." +"The `while` keyword works much like in other languages, executing the loop " +"body as long as the condition is true." msgstr "" "[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند:" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops.md:18 msgid "\"Final x: {x}\"" msgstr "" -#: src/control-flow-basics/loops.md -#, fuzzy -msgid "`for`" -msgstr "حلقه‌های `for`" - -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md:3 msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " -"over ranges of values:" +"The `for` loop iterates over ranges of values or the items in a collection:" msgstr "" -#: src/control-flow-basics/loops.md -msgid "`loop`" +#: src/control-flow-basics/loops/for.md:13 +msgid "\"elem: {elem}\"" msgstr "" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md:20 msgid "" -"The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " -"loops forever, until a `break`." -msgstr "" - -#: src/control-flow-basics/loops.md -msgid "\"{i}\"" +"Under the hood `for` loops use a concept called \"iterators\" to handle " +"iterating over different kinds of ranges/collections. Iterators will be " +"discussed in more detail later." msgstr "" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md:23 msgid "" -"We will discuss iteration later; for now, just stick to range expressions." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -#: src/control-flow-basics/loops.md -msgid "" -"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." +#: src/control-flow-basics/loops/loop.md:3 +msgid "The `loop` statement just loops forever, until a `break`." msgstr "" -#: src/control-flow-basics/break-continue.md -#, fuzzy -msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). For " -"`loop`, this can take an optional expression that becomes the value of the " -"`loop` expression." +#: src/control-flow-basics/loops/loop.md:11 +msgid "\"{i}\"" msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," -#: src/control-flow-basics/break-continue.md -msgid "" -"If you want to immediately start the next iteration use [`continue`](https://" -"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +#: src/control-flow-basics/break-continue.md:3 +#, fuzzy +msgid "If you want to immediately start the next iteration use `continue`." msgstr "" "اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc." "rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " "استفاده کنید." -#: src/control-flow-basics/break-continue.md -msgid "\"{result}\"" +#: src/control-flow-basics/break-continue.md:6 +#, fuzzy +msgid "" +"If you want to exit any kind of loop early, use `break`. For `loop`, this " +"can take an optional expression that becomes the value of the `loop` " +"expression." +msgstr "" +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," + +#: src/control-flow-basics/break-continue.md:22 src/std-traits/exercise.md:23 +#: src/std-traits/solution.md:29 src/smart-pointers/trait-objects.md:95 +#: src/smart-pointers/trait-objects.md:96 +#: src/borrowing/interior-mutability.md:47 src/modules/exercise.md:136 +#: src/modules/solution.md:78 src/android/build-rules/library.md:44 +#: src/android/interoperability/cpp/rust-bridge.md:17 +#: src/concurrency/async-pitfalls/cancellation.md:59 +msgid "\"{}\"" msgstr "" -#: src/control-flow-basics/break-continue.md +#: src/control-flow-basics/break-continue/labels.md:3 msgid "" "Both `continue` and `break` can optionally take a label argument which is " "used to break out of nested loops:" @@ -3454,16 +3482,11 @@ msgstr "" "کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " "برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" -#: src/control-flow-basics/break-continue.md -msgid "\"x: {x}, i: {i}\"" +#: src/control-flow-basics/break-continue/labels.md:19 +msgid "\"elements searched: {elements_searched}\"" msgstr "" -#: src/control-flow-basics/break-continue.md -msgid "" -"In this case we break the outer loop after 3 iterations of the inner loop." -msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." - -#: src/control-flow-basics/break-continue.md +#: src/control-flow-basics/break-continue/labels.md:25 msgid "" "Note that `loop` is the only looping construct which returns a non-trivial " "value. This is because it's guaranteed to be entered at least once (unlike " @@ -3473,11 +3496,11 @@ msgstr "" "را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " "(برخلاف حلقه‌های `while` و `for`)." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes.md:3 msgid "Blocks" msgstr "بلوک‌ها" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes.md:5 #, fuzzy msgid "" "A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " @@ -3487,25 +3510,30 @@ msgstr "" "یک بلاک در Rust میتواند حاوی چندین عبارات باشد. هر بلاک دارای یک مقدار و یک " "نوع بازگشتی است که مربوط به آخرین عبارت در ان بلاک می‌باشد:" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes.md:14 msgid "\"y: {y}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes.md:21 msgid "" "If the last expression ends with `;`, then the resulting value and type is " "`()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." -#: src/control-flow-basics/blocks-and-scopes.md -msgid "Scopes and Shadowing" -msgstr "محدوده‌ها و سایه‌گذاری" +#: src/control-flow-basics/blocks-and-scopes.md:26 +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-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:3 msgid "A variable's scope is limited to the enclosing block." msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:5 msgid "" "You can shadow variables, both those from outer scopes and variables from " "the same scope:" @@ -3513,43 +3541,36 @@ msgstr "" "شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " "هم متغیرهایی که از اسکوپ یکسان هستند:" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:11 msgid "\"before: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md src/std-traits/from-and-into.md -#: src/slices-and-lifetimes/solution.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:13 +#: src/generics/exercise.md:18 src/generics/solution.md:20 +#: src/std-traits/from-and-into.md:7 src/std-traits/from-and-into.md:19 +#: src/lifetimes/solution.md:225 msgid "\"hello\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:14 msgid "\"inner scope: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:17 msgid "\"shadowed in inner scope: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:20 msgid "\"after: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md -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-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:26 msgid "" "Show that a variable's scope is limited by adding a `b` in the inner block " "in the last example, and then trying to access it outside that block." msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:28 #, fuzzy msgid "" "Shadowing is different from mutation, because after shadowing both " @@ -3560,12 +3581,12 @@ msgstr "" "های حافظه هر دو متغیر همزمان وجود دارند. هر دو تحت یک نام در دسترس هستند، " "بسته به اینکه در کجا در کد از آن استفاده می کنید." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:31 #, fuzzy msgid "A shadowing variable can have a different type." msgstr "یک متغیر سایه‌دار می تواند انواع داده‌ای متفاوتی داشته باشد." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md:32 msgid "" "Shadowing looks obscure at first, but is convenient for holding on to values " "after `.unwrap()`." @@ -3573,7 +3594,7 @@ msgstr "" "سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `.unwrap()` مناسب است." -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:22 msgid "" "Declaration parameters are followed by a type (the reverse of some " "programming languages), then a return type." @@ -3581,7 +3602,7 @@ msgstr "" "بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " "برخی از زبان‌های برنامه‌نویسی)." -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:24 #, fuzzy msgid "" "The last expression in a function body (or any block) becomes the return " @@ -3593,7 +3614,7 @@ msgstr "" "گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " "عبارت حذف کنید." -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:28 msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " "compiler will infer this if the `-> ()` return type is omitted." @@ -3602,1053 +3623,852 @@ msgstr "" "را برمی‌گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " "کامپایلر این را استنتاج خواهد کرد که هیچ نوع برگشتی وجود ندارد." -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:30 #, fuzzy msgid "" "Overloading is not supported -- each function has a single implementation." msgstr "هر تابع فقط یک پیاده سازی دارد:" -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:31 msgid "" "Always takes a fixed number of parameters. Default arguments are not " "supported. Macros can be used to support variadic functions." msgstr "" -#: src/control-flow-basics/functions.md +#: src/control-flow-basics/functions.md:33 #, fuzzy msgid "" "Always takes a single set of parameter types. These types can be generic, " "which will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:3 msgid "" "Macros are expanded into Rust code during compilation, and can take a " "variable number of arguments. They are distinguished by a `!` at the end. " "The Rust standard library includes an assortment of useful macros." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:7 msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " -"described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." +"described in `std::fmt`." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:9 msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:11 msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:12 msgid "" "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " "panic." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:14 msgid "" "`unreachable!()` marks a bit of code as unreachable. If executed, it will " "panic." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:32 msgid "\"{n}! = {}\"" msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:39 msgid "" "The takeaway from this section is that these common conveniences exist, and " "how to use them. Why they are defined as macros, and what they expand to, is " "not especially critical." msgstr "" -#: src/control-flow-basics/macros.md +#: src/control-flow-basics/macros.md:43 msgid "" "The course does not cover defining macros, but a later section will describe " "use of derive macros." msgstr "" -#: src/control-flow-basics/exercise.md +#: src/control-flow-basics/exercise.md:3 msgid "" -"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " -"defined as follows, for an arbitrary n" +"The Collatz Sequence is defined as follows, for an arbitrary n1 " +"greater than zero:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "1" +#: src/control-flow-basics/exercise.md:6 +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -#: src/control-flow-basics/exercise.md -msgid " greater than zero:" +#: src/control-flow-basics/exercise.md:7 +msgid "If _ni_ is even, then _ni+1 = ni / 2_." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "If _n" +#: src/control-flow-basics/exercise.md:8 +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "i" +#: src/control-flow-basics/exercise.md:10 +msgid "For example, beginning with _n1_ = 3:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ is 1, then the sequence terminates at _n" +#: src/control-flow-basics/exercise.md:12 +msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_." +#: src/control-flow-basics/exercise.md:13 +msgid "10 is even, so _n3_ = 10 / 2 = 5;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ is even, then _n" +#: src/control-flow-basics/exercise.md:14 +msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "i+1" +#: src/control-flow-basics/exercise.md:15 +msgid "16 is even, so _n5_ = 16 / 2 = 8;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid " = n" +#: src/control-flow-basics/exercise.md:16 +msgid "8 is even, so _n6_ = 8 / 2 = 4;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid " / 2_." +#: src/control-flow-basics/exercise.md:17 +msgid "4 is even, so _n7_ = 4 / 2 = 2;" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ is odd, then _n" +#: src/control-flow-basics/exercise.md:18 +msgid "2 is even, so _n8_ = 1; and" msgstr "" -#: src/control-flow-basics/exercise.md -msgid " = 3 * n" +#: src/control-flow-basics/exercise.md:19 +msgid "the sequence terminates." msgstr "" -#: src/control-flow-basics/exercise.md -msgid " + 1_." +#: src/control-flow-basics/exercise.md:21 +msgid "" +"Write a function to calculate the length of the collatz sequence for a given " +"initial `n`." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "For example, beginning with _n" +#: src/control-flow-basics/exercise.md:25 src/control-flow-basics/solution.md:4 +msgid "/// Determine the length of the collatz sequence beginning at `n`." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 3:" +#: src/control-flow-basics/solution.md:20 src/concurrency/threads/scoped.md:11 +#: src/concurrency/threads/scoped.md:30 +msgid "\"Length: {}\"" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "3 is odd, so _n" -msgstr "" +#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md +#, fuzzy +msgid "Welcome Back" +msgstr "خوش آمدید" -#: src/control-flow-basics/exercise.md -msgid "2" +#: src/welcome-day-1-afternoon.md +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 35 " +"minutes. It contains:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 3 + 1 = 10;" +#: src/tuples-and-arrays.md +msgid "This segment should take about 35 minutes. It contains:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "10 is even, so _n" +#: src/tuples-and-arrays/arrays.md:16 +#, fuzzy +msgid "" +"A value of the array type `[T; N]` holds `N` (a compile-time constant) " +"elements of the same type `T`. Note that the length of the array is _part of " +"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " +"different types. Slices, which have a size determined at runtime, are " +"covered later." msgstr "" +"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " +"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " +"نظر گرفته می‌شوند." -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "3" +#: src/tuples-and-arrays/arrays.md:22 +msgid "" +"Try accessing an out-of-bounds array element. Array accesses are checked at " +"runtime. Rust can usually optimize these checks away, and they can be " +"avoided using unsafe Rust." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 10 / 2 = 5;" -msgstr "" +#: src/tuples-and-arrays/arrays.md:26 +msgid "We can use literals to assign values to arrays." +msgstr "ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." -#: src/control-flow-basics/exercise.md -msgid "5 is odd, so _n" +#: src/tuples-and-arrays/arrays.md:28 +msgid "" +"The `println!` macro asks for the debug implementation with the `?` format " +"parameter: `{}` gives the default output, `{:?}` gives the debug output. " +"Types such as integers and strings implement the default output, but arrays " +"only implement the debug output. This means that we must use debug output " +"here." msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " +"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " +"خروجی دیباگ استفاده کنیم." -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "4" +#: src/tuples-and-arrays/arrays.md:33 +msgid "" +"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " +"easier to read." msgstr "" +"اضافه کردن `#`، مانند `{a:#?}`، یک " +"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 5 + 1 = 16;" -msgstr "" +#: src/tuples-and-arrays/tuples.md:16 +msgid "Like arrays, tuples have a fixed length." +msgstr "مانند آرایه‌ها، تاپل‌ها نیز دارای طول ثابت هستند." -#: src/control-flow-basics/exercise.md -msgid "16 is even, so _n" -msgstr "" +#: src/tuples-and-arrays/tuples.md:18 +msgid "Tuples group together values of different types into a compound type." +msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع مرکب کنار هم قرار می‌دهند." -#: src/control-flow-basics/exercise.md -msgid "5" +#: src/tuples-and-arrays/tuples.md:20 +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/control-flow-basics/exercise.md -msgid "_ = 16 / 2 = 8;" +#: src/tuples-and-arrays/tuples.md:23 +msgid "" +"The empty tuple `()` is referred to as the \"unit type\" and signifies " +"absence of a return value, akin to `void` in other languages." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "8 is even, so _n" +#: src/tuples-and-arrays/iteration.md:3 +msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "" -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "6" +#: src/tuples-and-arrays/iteration.md:19 +msgid "" +"This functionality uses the `IntoIterator` trait, but we haven't covered " +"that yet." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 8 / 2 = 4;" +#: src/tuples-and-arrays/iteration.md:22 +msgid "" +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" +"` macros. These are always checked while, debug-only variants like " +"`debug_assert!` compile to nothing in release builds." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "4 is even, so _n" +#: src/tuples-and-arrays/destructuring.md:3 +msgid "" +"When working with tuples and other structured values it's common to want to " +"extract the inner values into local variables. This can be done manually by " +"directly accessing the inner values:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "7" +#: src/tuples-and-arrays/destructuring.md:11 +#: src/tuples-and-arrays/destructuring.md:21 +msgid "\"left: {left}, right: {right}\"" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 4 / 2 = 2;" +#: src/tuples-and-arrays/destructuring.md:15 +msgid "" +"However, Rust also supports using pattern matching to destructure a larger " +"value into its constituent parts:" msgstr "" -#: src/control-flow-basics/exercise.md -msgid "2 is even, so _n" +#: src/tuples-and-arrays/destructuring.md:28 +msgid "" +"The patterns used here are \"irrefutable\", meaning that the compiler can " +"statically verify that the value on the right of `=` has the same structure " +"as the pattern." msgstr "" -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "8" +#: src/tuples-and-arrays/destructuring.md:31 +msgid "" +"A variable name is an irrefutable pattern that always matches any value, " +"hence why we can also use `let` to declare a single variable." msgstr "" -#: src/control-flow-basics/exercise.md -msgid "_ = 1; and" -msgstr "" - -#: src/control-flow-basics/exercise.md -msgid "the sequence terminates." +#: src/tuples-and-arrays/destructuring.md:33 +msgid "" +"Rust also supports using patterns in conditionals, allowing for equality " +"comparison and destructuring to happen at the same time. This form of " +"pattern matching will be discussed in more detail later." msgstr "" -#: src/control-flow-basics/exercise.md +#: src/tuples-and-arrays/destructuring.md:36 msgid "" -"Write a function to calculate the length of the collatz sequence for a given " -"initial `n`." +"Edit the examples above to show the compiler error when the pattern doesn't " +"match the value being matched on." msgstr "" -#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md -msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" +#: src/tuples-and-arrays/exercise.md:3 +msgid "Arrays can contain other arrays:" msgstr "" -#: src/control-flow-basics/solution.md src/concurrency/scoped-threads.md -msgid "\"Length: {}\"" +#: src/tuples-and-arrays/exercise.md:9 +msgid "What is the type of this variable?" msgstr "" -#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md +#: src/tuples-and-arrays/exercise.md:11 #, fuzzy -msgid "Welcome Back" -msgstr "خوش آمدید" - -#: src/welcome-day-1-afternoon.md -msgid "[Tuples and Arrays](./tuples-and-arrays.md) (1 hour)" -msgstr "" - -#: src/welcome-day-1-afternoon.md -msgid "[References](./references.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-1-afternoon.md -msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-1-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 55 " -"minutes" +"Use an array such as the above to write a function `transpose` which will " +"transpose a matrix (turn rows into columns):" msgstr "" +"از کد بالا برای نوشتن تابع `pretty_print` که یک ماتریس " +"را به صورت `pretty-print` چاپ می‌کند و تابع `transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها " +"تبدیل می‌کند) استفاده کنید: " -#: src/tuples-and-arrays.md +#: src/tuples-and-arrays/exercise.md:22 +#, fuzzy msgid "" -"[Tuples and Arrays](./tuples-and-arrays/tuples-and-arrays.md) (10 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Pattern Matching](./tuples-and-arrays/match.md) (10 minutes)" +"Copy the code below to https://play.rust-lang.org/ and implement the " +"function. This function only operates on 3x3 matrices." msgstr "" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" -#: src/tuples-and-arrays.md -msgid "[Destructuring](./tuples-and-arrays/destructuring.md) (5 minutes)" +#: src/tuples-and-arrays/exercise.md:26 src/borrowing/exercise.md:14 +#: src/unsafe-rust/exercise.md:51 +msgid "// TODO: remove this when you're done with your implementation." msgstr "" -#: src/tuples-and-arrays.md -msgid "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (30 minutes)" +#: src/tuples-and-arrays/exercise.md:36 src/tuples-and-arrays/exercise.md:44 +#: src/tuples-and-arrays/solution.md:17 src/tuples-and-arrays/solution.md:25 +msgid "//" msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "" -"Tuples and arrays are the first \"compound\" types we have seen. All " -"elements of an array have the same type, while tuples can accommodate " -"different types. Both types have a size fixed at compile time." +#: src/tuples-and-arrays/exercise.md:53 src/tuples-and-arrays/solution.md:34 +msgid "// \\<\\-- the comment makes rustfmt add a newline" msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md -msgid "Arrays" -msgstr "آرایه‌ها" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`[T; N]`" -msgstr "[T; N]" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`[20, 30, 40]`, `[0; 3]`" +#: src/tuples-and-arrays/exercise.md:58 src/tuples-and-arrays/solution.md:39 +msgid "\"matrix: {:#?}\"" msgstr "" -"[20, 30, 40], [0; 3]" -#: src/tuples-and-arrays/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md -msgid "Tuples" -msgstr "تاپل‌ها" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`()`, `(T,)`, `(T1, T2)`, ..." +#: src/tuples-and-arrays/exercise.md:60 src/tuples-and-arrays/solution.md:41 +msgid "\"transposed: {:#?}\"" msgstr "" -"(), (T,), " -"(T1, T2), …" -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`()`, `('x',)`, `('x', 1.2)`, ..." +#: src/references.md src/smart-pointers.md src/borrowing.md +#: src/error-handling.md src/concurrency/async-pitfalls.md +msgid "This segment should take about 55 minutes. It contains:" msgstr "" -"(), ('x',), " -"('x', 1.2), …" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Array assignment and access:" -msgstr "انتساب و دسترسی به آرایه:" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Tuple assignment and access:" -msgstr "انتساب و دسترسی به تاپل:" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Arrays:" -msgstr "آرایه‌ها:" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references.md #, fuzzy -msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) " -"elements of the same type `T`. Note that the length of the array is _part of " -"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " -"different types. Slices, which have a size determined at runtime, are " -"covered later." -msgstr "" -"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " -"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " -"نظر گرفته می‌شوند." +msgid "Slices: &\\[T\\]" +msgstr "برش‌ها" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references/shared.md:3 msgid "" -"Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be " -"avoided using unsafe Rust." +"A reference provides a way to access another value without taking " +"responsibility for the value, and is also called \"borrowing\". Shared " +"references are read-only, and the referenced data cannot change." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "We can use literals to assign values to arrays." -msgstr "ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." - -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references/shared.md:20 msgid "" -"The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. " -"Types such as integers and strings implement the default output, but arrays " -"only implement the debug output. This means that we must use debug output " -"here." +"A shared reference to a type `T` has type `&T`. A reference value is made " +"with the `&` operator. The `*` operator \"dereferences\" a reference, " +"yielding its value." msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " -"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " -"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " -"خروجی دیباگ استفاده کنیم." -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references/shared.md:24 +msgid "Rust will statically forbid dangling references:" +msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) را ممنوع می‌کند:" + +#: src/references/shared.md:38 msgid "" -"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " -"easier to read." +"A reference is said to \"borrow\" the value it refers to, and this is a good " +"model for students not familiar with pointers: code can use the reference to " +"access the value, but is still \"owned\" by the original variable. The " +"course will get into more detail on ownership in day 3." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک " -"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Tuples:" -msgstr ":تاپل‌ها" -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Like arrays, tuples have a fixed length." -msgstr "مانند آرایه‌ها، تاپل‌ها نیز دارای طول ثابت هستند." - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "Tuples group together values of different types into a compound type." -msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع مرکب کنار هم قرار می‌دهند." - -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references/shared.md:43 msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, " -"e.g. `t.0`, `t.1`." +"References are implemented as pointers, and a key advantage is that they can " +"be much smaller than the thing they point to. Students familiar with C or C+" +"+ will recognize references as pointers. Later parts of the course will " +"cover how Rust prevents the memory-safety bugs that come from using raw " +"pointers." msgstr "" -"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " -"`t.0`، `t.1` دسترسی پیدا کرد." -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy +#: src/references/shared.md:48 msgid "" -"The empty tuple `()` is also known as the \"unit type\". It is both a type, " -"and the only valid value of that type --- that is to say both the type and " -"its 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." +"Rust does not automatically create references for you - the `&` is always " +"required." msgstr "" -"تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " -"این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن " -"به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه " -"یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید " -"بعدی خواهیم دید. " -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/references/shared.md:51 #, fuzzy msgid "" -"You can think of it as `void` that can be familiar to you from other " -"programming languages." -msgstr "" -"می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " -"برنامه‌نویسی برایتان آشنا باشد." - -#: src/tuples-and-arrays/iteration.md -msgid "The `for` statement supports iterating over arrays (but not tuples)." +"Rust will auto-dereference in some cases, in particular when invoking " +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " +"متدها (`ref_x.count_ones()` را امتحان کنید)." -#: src/tuples-and-arrays/iteration.md +#: src/references/shared.md:54 msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered " -"that yet." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " +"Note that this re-binds `r`, so that it refers to something else. This is " +"different from C++, where assignment to a reference changes the referenced " +"value." msgstr "" -#: src/tuples-and-arrays/iteration.md +#: src/references/shared.md:58 msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked while, debug-only variants like " -"`debug_assert!` compile to nothing in release builds." +"A shared reference does not allow modifying the value it refers to, even if " +"that value was mutable. Try `*r = 'X'`." msgstr "" -#: src/tuples-and-arrays/match.md +#: src/references/shared.md:61 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/tuples-and-arrays/match.md -msgid "The patterns can be simple values, similarly to `switch` in C and C++:" -msgstr "" -"الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و C++:" - -#: src/tuples-and-arrays/match.md -msgid "'x'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "'q'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "\"Quitting\"" -msgstr "" - -#: src/tuples-and-arrays/match.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'a'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "'s'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "'w'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "'d'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "\"Moving around\"" -msgstr "" - -#: src/tuples-and-arrays/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md -msgid "'0'" -msgstr "" - -#: src/tuples-and-arrays/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md -msgid "'9'" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "\"Number input\"" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "\"Lowercase: {key}\"" -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "\"Something else\"" +"Rust is tracking the lifetimes of all references to ensure they live long " +"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " +"a reference to `point`, but `point` will be deallocated when the function " +"returns, so this will not compile." msgstr "" -#: src/tuples-and-arrays/match.md -msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be irrefutable, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." +#: src/references/shared.md:66 +msgid "We will talk more about borrowing when we get to ownership." msgstr "" +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " +"خواهیم کرد." -#: src/tuples-and-arrays/match.md -#, fuzzy +#: src/references/exclusive.md:3 msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Exclusive references, also known as mutable references, allow changing the " +"value they refer to. They have type `&mut T`." msgstr "" -"مثل دستور `if let`، باید همه شاخه تطبیق باید از نوع یکسانی را داشته باشند. " -"نوع عبارت در آخر بلوک تعیین می‌شود، البته اگر وجود داشته باشد. در مثال بالا، " -"نوع `()` است." -#: src/tuples-and-arrays/match.md +#: src/references/exclusive.md:22 msgid "" -"A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "A match guard causes the arm to match only if the condition is true." +"\"Exclusive\" means that only this reference can be used to access the " +"value. No other references (shared or exclusive) can exist at the same time, " +"and the referenced value cannot be accessed while the exclusive reference " +"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " +"alive." msgstr "" -#: src/tuples-and-arrays/match.md src/user-defined-types/named-structs.md -#: src/user-defined-types/enums.md src/methods-and-traits/methods.md -msgid "Key Points:" -msgstr "نکات کلیدی:" - -#: src/tuples-and-arrays/match.md +#: src/references/exclusive.md:27 +#, fuzzy msgid "" -"You might point out how some specific characters are being used when in a " -"pattern" +"Be sure to note the difference between `let mut x_coord: &i32` and `let " +"x_coord: &mut i32`. The first one represents a shared reference which can be " +"bound to different values, while the second represents an exclusive " +"reference to a mutable value." msgstr "" -"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" - -#: src/tuples-and-arrays/match.md -msgid "`|` as an `or`" -msgstr "`|` به عنوان `or`" +"توجه داشته باشید که تفاوت بین `let mut ref_x: &i32` و " +"`let ref_x: &mut i32` را به خاطر بسپارید. اولی نمایانگر " +"یک مرجع قابل تغییر است که می‌تواند به مقادیر مختلفی ارجاع داده شود، در حالی " +"که دومی یک مرجع به یک مقدار قابل تغییر را نشان می‌دهد." -#: src/tuples-and-arrays/match.md -msgid "`..` can expand as much as it needs to be" -msgstr "`..` برای تعیین همه محدوده یا تا جایی که میتوان گسترش یابد" +#: src/references/slices.md:1 +msgid "Slices" +msgstr "برش‌ها" -#: src/tuples-and-arrays/match.md -msgid "`1..=5` represents an inclusive range" -msgstr "" -"1..=5 نمایانگر یک محدوده خاص " -"است." +#: src/references/slices.md:3 +msgid "A slice gives you a view into a larger collection:" +msgstr "یک برش به شما امکان می‌دهد نما (view) از یک مجموعه بزرگتر داشته باشید:" -#: src/tuples-and-arrays/match.md -msgid "`_` is a wild card" -msgstr "`_` یک wildcard (هر حالتی) است." +#: src/references/slices.md:18 +msgid "Slices borrow data from the sliced type." +msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض می‌گیرند." -#: src/tuples-and-arrays/match.md -msgid "" -"Match guards as a separate syntax feature are important and necessary when " -"we wish to concisely express more complex ideas than patterns alone would " -"allow." +#: src/references/slices.md:19 +msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"گارد های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " -"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" -#: src/tuples-and-arrays/match.md +#: src/references/slices.md:24 msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"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." +"We create a slice by borrowing `a` and specifying the starting and ending " +"indexes in brackets." msgstr "" -"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " -"عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " -"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " -"عبارت `match` اصلی ندارد." - -#: src/tuples-and-arrays/match.md -msgid "" -"The condition defined in the guard applies to every expression in a pattern " -"with an `|`." -msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." +"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " +"براکت‌ها، برش (slice) ایجاد می‌کنیم." -#: src/tuples-and-arrays/destructuring.md +#: src/references/slices.md:27 msgid "" -"Destructuring is a way of extracting data from a data structure by writing a " -"pattern that is matched up to the data structure, binding variables to " -"subcomponents of the data structure." -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -#, fuzzy -msgid "You can destructure tuples and arrays by matching on their elements:" -msgstr "" -"می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." - -#: src/tuples-and-arrays/destructuring.md -msgid "\"on Y axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"on X axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"left of Y axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"below X axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"first quadrant\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"Tell me about {triple:?}\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"First is 0, y = {y}, and z = {z}\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"First is 1 and the rest were ignored\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"All elements were ignored\"" +"If the slice starts at index 0, Rust’s range syntax allows us to drop the " +"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " +"identical." msgstr "" +"اگر برش از شاخص ۰ شروع شود، سینتکس راست به ما اجازه می‌دهد شاخص شروع را حذف " +"کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0..a." +"len()]` و `&a[..a.len()]` یکسان هستند." -#: src/tuples-and-arrays/destructuring.md -#, fuzzy -msgid "Create a new array pattern using `_` to represent an element." -msgstr "یک الگوی جدید با استفاده از `_` برای نمایش یک عنصر ایجاد کنید." - -#: src/tuples-and-arrays/destructuring.md -msgid "Add more values to the array." -msgstr "مقادیر بیشتری را به آرایه اضافه کنید." - -#: src/tuples-and-arrays/destructuring.md +#: src/references/slices.md:31 msgid "" -"Point out that how `..` will expand to account for different number of " -"elements." -msgstr "" -"اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " -"یافت." - -#: src/tuples-and-arrays/destructuring.md -msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" -msgstr "" -"مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " -"`[a@..,b]` را نشان دهید." - -#: src/tuples-and-arrays/exercise.md -msgid "Arrays can contain other arrays:" -msgstr "" - -#: src/tuples-and-arrays/exercise.md -msgid "What is the type of this variable?" +"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/tuples-and-arrays/exercise.md -#, fuzzy +#: src/references/slices.md:34 msgid "" -"Use an array such as the above to write a function `transpose` which will " -"transpose a matrix (turn rows into columns):" +"To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" -"از کد بالا برای نوشتن تابع `pretty_print` که یک ماتریس " -"را به صورت `pretty-print` چاپ می‌کند و تابع `transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها " -"تبدیل می‌کند) استفاده کنید: " - -#: src/tuples-and-arrays/exercise.md -msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." +"یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " +"استفاده کنیم." -#: src/tuples-and-arrays/exercise.md +#: src/references/slices.md:36 msgid "" -"Copy the code below to and implement the " -"functions:" -msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" - -#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md -#: src/unsafe-rust/exercise.md -msgid "// TODO: remove this when you're done with your implementation.\n" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "// <-- the comment makes rustfmt add a newline\n" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"matrix: {:#?}\"" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"transposed: {:#?}\"" +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " +"(`&[i32]`) no longer mentions the array length. This allows us to perform " +"computation on slices of different sizes." msgstr "" +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " +"`s` (`&[i32]`) دیگر طول آرایه را " +"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " +"انجام دهیم." -#: src/tuples-and-arrays/solution.md -msgid "//\n" +#: src/references/slices.md:40 +#, fuzzy +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/references.md -msgid "[Shared References](./references/shared.md) (10 minutes)" +#: src/references/slices.md:43 +#, fuzzy +msgid "" +"The question about modifying `a[3]` can spark an interesting discussion, but " +"the answer is that for memory safety reasons you cannot do it through `a` at " +"this point in the execution, but you can read the data from both `a` and `s` " +"safely. It works before you created the slice, and again after the " +"`println`, when the slice is no longer used." msgstr "" +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " +"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " +"داده‌ها را از هر دو `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد. " -#: src/references.md -msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" -msgstr "" +#: src/references/strings.md:7 +msgid "We can now understand the two string types in Rust:" +msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" -#: src/references.md -msgid "[Exercise: Geometry](./references/exercise.md) (30 minutes)" +#: src/references/strings.md:9 +msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgstr "" -#: src/references.md src/user-defined-types.md src/pattern-matching.md -msgid "This segment should take about 50 minutes" +#: src/references/strings.md:10 +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "" -#: src/references/shared.md -msgid "" -"A reference provides a way to access another value without taking " -"responsibility for the value, and is also called \"borrowing\". Shared " -"references are read-only, and the referenced data cannot change." +#: src/references/strings.md:17 src/std-traits/read-and-write.md:36 +msgid "\"World\"" msgstr "" -#: src/references/shared.md -msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made " -"with the `&` operator. The `*` operator \"dereferences\" a reference, " -"yielding its value." +#: src/references/strings.md:18 +msgid "\"s1: {s1}\"" msgstr "" -#: src/references/shared.md -msgid "Rust will statically forbid dangling references:" -msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) را ممنوع می‌کند:" +#: src/references/strings.md:20 +#, fuzzy +msgid "\"Hello \"" +msgstr "سلام دنیا" -#: src/references/shared.md -msgid "" -"A reference is said to \"borrow\" the value it refers to, and this is a good " -"model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The " -"course will get into more detail on ownership in day 3." +#: src/references/strings.md:21 src/references/strings.md:23 +#: src/memory-management/move.md:9 +msgid "\"s2: {s2}\"" msgstr "" -#: src/references/shared.md -msgid "" -"References are implemented as pointers, and a key advantage is that they can " -"be much smaller than the thing they point to. Students familiar with C or C+" -"+ will recognize references as pointers. Later parts of the course will " -"cover how Rust prevents the memory-safety bugs that come from using raw " -"pointers." +#: src/references/strings.md:26 +msgid "\"s3: {s3}\"" msgstr "" -#: src/references/shared.md +#: src/references/strings.md:33 +#, fuzzy msgid "" -"Rust does not automatically create references for you - the `&` is always " -"required." +"`&str` introduces a string slice, which is an immutable reference to UTF-8 " +"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/references/shared.md +#: src/references/strings.md:37 #, fuzzy msgid "" -"Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.count_ones()`). There is no need for an `->` operator like " -"in C++." +"Rust's `String` type is a wrapper around a vector of bytes. As with a " +"`Vec`, it is owned." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " -"متدها (`ref_x.count_ones()` را امتحان کنید)." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " +"بایت‌هاست. مانند `Vec`، یک نوع Owned است." -#: src/references/shared.md +#: src/references/strings.md:40 +#, fuzzy msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " -"Note that this re-binds `r`, so that it refers to something else. This is " -"different from C++, where assignment to a reference changes the referenced " -"value." +"As with many other types `String::from()` creates a string from a string " +"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/references/shared.md +#: src/references/strings.md:44 +#, fuzzy msgid "" -"A shared reference does not allow modifying the value it refers to, even if " -"that value was mutable. Try `*r = 'X'`." +"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!()` یک راه راحت برای ایجاد یک رشته Owned " +"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"()` است." -#: src/references/shared.md +#: src/references/strings.md:47 msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." -msgstr "" - -#: src/references/shared.md -msgid "We will talk more about borrowing when we get to ownership." +"You can borrow `&str` slices from `String` via `&` and optionally range " +"selection. If you select a byte range that is not aligned to character " +"boundaries, the expression will panic. The `chars` iterator iterates over " +"characters and is preferred over trying to get character boundaries right." msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " -"خواهیم کرد." -#: src/references/exclusive.md +#: src/references/strings.md:52 +#, fuzzy msgid "" -"Exclusive references, also known as mutable references, allow changing the " -"value they refer to. They have type `&mut T`." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " +"one that always points to a valid string in memory. Rust `String` is a rough " +"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 استفاده نمی کند)." -#: src/references/exclusive.md -msgid "" -"\"Exclusive\" means that only this reference can be used to access the " -"value. No other references (shared or exclusive) can exist at the same time, " -"and the referenced value cannot be accessed while the exclusive reference " -"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " -"alive." +#: src/references/strings.md:57 +#, fuzzy +msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" -#: src/references/exclusive.md -#, fuzzy +#: src/references/strings.md:67 msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let " -"x_coord: &mut i32`. The first one represents a shared reference which can be " -"bound to different values, while the second represents an exclusive " -"reference to a mutable value." +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" -"توجه داشته باشید که تفاوت بین `let mut ref_x: &i32` و " -"`let ref_x: &mut i32` را به خاطر بسپارید. اولی نمایانگر " -"یک مرجع قابل تغییر است که می‌تواند به مقادیر مختلفی ارجاع داده شود، در حالی " -"که دومی یک مرجع به یک مقدار قابل تغییر را نشان می‌دهد." +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " +"== \"\\\\n\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " +"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" -#: src/references/exercise.md +#: src/references/exercise.md:3 msgid "" "We will create a few utility functions for 3-dimensional geometry, " "representing a point as `[f64;3]`. It is up to you to determine the function " "signatures." msgstr "" -#: src/references/exercise.md +#: src/references/exercise.md:7 msgid "" "// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" -"// root, like `v.sqrt()`.\n" +"coordinates // and taking the square root. Use the `sqrt()` method to " +"calculate the square // root, like `v.sqrt()`." msgstr "" -#: src/references/exercise.md +#: src/references/exercise.md:15 msgid "" -"// Normalize a vector by calculating its magnitude and dividing all of its\n" -"// coordinates by that magnitude.\n" +"// Normalize a vector by calculating its magnitude and dividing all of " +"its // coordinates by that magnitude." msgstr "" -#: src/references/exercise.md -msgid "// Use the following `main` to test your work.\n" +#: src/references/exercise.md:23 +msgid "// Use the following `main` to test your work." msgstr "" -#: src/references/exercise.md src/references/solution.md +#: src/references/exercise.md:27 src/references/solution.md:22 msgid "\"Magnitude of a unit vector: {}\"" msgstr "" -#: src/references/exercise.md src/references/solution.md +#: src/references/exercise.md:30 src/references/solution.md:25 msgid "\"Magnitude of {v:?}: {}\"" msgstr "" -#: src/references/exercise.md src/references/solution.md +#: src/references/exercise.md:32 src/references/solution.md:27 msgid "\"Magnitude of {v:?} after normalization: {}\"" msgstr "" -#: src/references/solution.md -msgid "/// Calculate the magnitude of the given vector.\n" +#: src/references/solution.md:4 +msgid "/// Calculate the magnitude of the given vector." msgstr "" -#: src/references/solution.md +#: src/references/solution.md:12 msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its " -"direction.\n" +"/// Change the magnitude of the vector to 1.0 without changing its direction." msgstr "" -#: src/user-defined-types.md -msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" +#: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md +msgid "This segment should take about 50 minutes. It contains:" msgstr "" -#: src/user-defined-types.md -msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "" -"[Static and Const](./user-defined-types/static-and-const.md) (5 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "" -"[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" -msgstr "" - -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:12 msgid "\"{} is {} years old\"" msgstr "" -#: src/user-defined-types/named-structs.md -#: src/android/interoperability/with-c/bindgen.md +#: src/user-defined-types/named-structs.md:16 +#: src/android/interoperability/with-c/bindgen.md:87 msgid "\"Peter\"" msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:22 msgid "\"Avery\"" msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:27 msgid "\"Jackie\"" msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:35 +#: src/user-defined-types/enums.md:29 src/pattern-matching/match.md:38 +#: src/methods-and-traits/methods.md:69 +msgid "Key Points:" +msgstr "نکات کلیدی:" + +#: src/user-defined-types/named-structs.md:37 msgid "Structs work like in C or C++." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:38 msgid "Like in C++, and unlike in C, no typedef is needed to define a type." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:39 msgid "Unlike in C++, there is no inheritance between structs." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:40 msgid "" "This may be a good time to let people know there are different types of " "structs." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:42 msgid "" "Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:45 msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:47 msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" -#: src/user-defined-types/named-structs.md +#: src/user-defined-types/named-structs.md:49 msgid "" "The syntax `..avery` allows us to copy the majority of the fields from the " "old struct without having to explicitly type it all out. It must always be " "the last element." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:7 msgid "If the field names are unimportant, you can use a tuple struct:" msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:14 msgid "\"({}, {})\"" msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:18 msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:25 msgid "\"Ask a rocket scientist at NASA\"" msgstr "" -#: src/user-defined-types/tuple-structs.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/bare-metal/microcontrollers/type-state.md -#: src/async/pitfalls/cancellation.md -msgid "// ...\n" +#: src/user-defined-types/tuple-structs.md:29 +#: src/android/interoperability/cpp/cpp-bridge.md:50 +#: src/bare-metal/microcontrollers/type-state.md:14 +#: src/concurrency/async-pitfalls/cancellation.md:99 +#: src/concurrency/async-pitfalls/cancellation.md:102 +msgid "// ..." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:41 msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:43 msgid "The number is measured in some units: `Newtons` in the example above." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:44 msgid "" "The value passed some validation when it was created, so you no longer have " "to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:47 msgid "" "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " "single field in the newtype." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:49 msgid "" "Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "for instance using booleans as integers." msgstr "" -#: src/user-defined-types/tuple-structs.md +#: src/user-defined-types/tuple-structs.md:51 msgid "Operator overloading is discussed on Day 3 (generics)." msgstr "" -#: src/user-defined-types/tuple-structs.md -msgid "" -"The example is a subtle reference to the [Mars Climate Orbiter](https://en." -"wikipedia.org/wiki/Mars_Climate_Orbiter) failure." +#: src/user-defined-types/tuple-structs.md:52 +msgid "The example is a subtle reference to the Mars Climate Orbiter failure." msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:3 msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" @@ -4656,48 +4476,48 @@ msgstr "" "کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " "است:" -#: src/user-defined-types/enums.md -msgid "// Simple variant\n" +#: src/user-defined-types/enums.md:15 +msgid "// Simple variant" msgstr "" -#: src/user-defined-types/enums.md -msgid "// Tuple variant\n" +#: src/user-defined-types/enums.md:16 +msgid "// Tuple variant" msgstr "" -#: src/user-defined-types/enums.md -msgid "// Struct variant\n" +#: src/user-defined-types/enums.md:17 +msgid "// Struct variant" msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:22 msgid "\"On this turn: {:?}\"" msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:31 #, fuzzy msgid "Enumerations allow you to collect a set of values under one type." msgstr "" "`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " "تحت یک نوع جمع آوری کنید." -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:32 msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:34 msgid "" "`PlayerMove` is a type with three variants. In addition to the payloads, " "Rust will store a discriminant so that it knows at runtime which variant is " "in a `PlayerMove` value." msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:37 #, fuzzy msgid "This might be a good time to compare structs and enums:" msgstr "الان زمان خوبی برای مقایسه ساختارها و `Enum`هاست:" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:38 #, fuzzy msgid "" "In both, you can have a simple version without fields (unit struct) or one " @@ -4706,7 +4526,7 @@ msgstr "" "در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " "مختلف فیلد (variant payloads) داشته باشید." -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:40 #, fuzzy msgid "" "You could even implement the different variants of an enum with separate " @@ -4717,15 +4537,15 @@ msgstr "" "کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " "نخواهند بود." -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:43 msgid "Rust uses minimal space to store the discriminant." msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:44 msgid "If necessary, it stores an integer of the smallest required size" msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " "invalid bit patterns to encode the discriminant (the \"niche " @@ -4733,14 +4553,14 @@ msgid "" "integer or `NULL` for the `None` variant." msgstr "" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:49 msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" "شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " "را کنترل کنید:" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:67 msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." @@ -4748,13 +4568,14 @@ msgstr "" "بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " "بایت جا می‌شود." -#: src/user-defined-types/enums.md src/user-defined-types/static-and-const.md -#: src/memory-management/review.md src/memory-management/move.md -#: src/smart-pointers/box.md src/borrowing/shared.md +#: src/user-defined-types/enums.md:70 src/user-defined-types/static.md:27 +#: src/memory-management/review.md:51 src/memory-management/move.md:100 +#: src/memory-management/copy-types.md:57 src/smart-pointers/box.md:85 +#: src/borrowing/shared.md:33 msgid "More to Explore" msgstr "برای کاوش بیشتر" -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:72 msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." @@ -4762,17 +4583,17 @@ msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:74 +#, fuzzy msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" -"option/#representation), Rust guarantees that `size_of::()` equals " -"`size_of::>()`." +"Null pointer optimization: For some types, Rust guarantees that `size_of::" +"()` equals `size_of::>()`." msgstr "" "بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" ">()` است." -#: src/user-defined-types/enums.md +#: src/user-defined-types/enums.md:78 msgid "" "Example code if you want to show how the bitwise representation _may_ look " "like in practice. It's important to note that the compiler provides no " @@ -4782,51 +4603,11 @@ msgstr "" "به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " "نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." -#: src/user-defined-types/static-and-const.md -#, fuzzy -msgid "" -"Static and constant variables are two different ways to create globally-" -"scoped values that cannot be moved or reallocated during the execution of " -"the program." -msgstr "" -"متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " -"(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " -"دوباره تعریف شوند." - -#: src/user-defined-types/static-and-const.md -msgid "`const`" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "" -"Constant variables are evaluated at compile time and their values are " -"inlined wherever they are used:" -msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " -"استفاده می شوند، درج می شوند:" - -#: src/user-defined-types/static-and-const.md -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/user-defined-types/static-and-const.md -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/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:1 msgid "`static`" msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:3 msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" @@ -4834,23 +4615,22 @@ msgstr "" "متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " "نمی‌شوند:" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:7 #, fuzzy msgid "\"Welcome to RustOS 3.14\"" msgstr "به روز ۱ خوش آمدید" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:10 msgid "\"{BANNER}\"" msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:14 #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html), these are not inlined upon use and have an actual " -"associated memory location. This is useful for unsafe and embedded code, and " -"the variable lives through the entirety of the program execution. When a " -"globally-scoped value does not have a reason to need object identity, " +"As noted in the Rust RFC Book, these are not inlined upon use and have an " +"actual associated memory location. This is useful for unsafe and embedded " +"code, and the variable lives through the entirety of the program execution. " +"When a 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-" @@ -4859,21 +4639,14 @@ msgstr "" "اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " "استفاده از `const` ترجیح داده می‌شود." -#: src/user-defined-types/static-and-const.md -msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`." -msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." - -#: src/user-defined-types/static-and-const.md -msgid "" -"`static`, on the other hand, is much more similar to a `const` or mutable " -"global variable in C++." +#: src/user-defined-types/static.md:23 +#, fuzzy +msgid "`static` is similar to mutable global variables in C++." msgstr "" "از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " "`C++` هستند." -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:24 msgid "" "`static` provides object identity: an address in memory and state as " "required by types with interior mutability such as `Mutex`." @@ -4881,80 +4654,11 @@ msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." -#: src/user-defined-types/static-and-const.md -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/user-defined-types/static-and-const.md -msgid "Properties table:" -msgstr "جدول خاصیت‌ها:" - -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates.md -msgid "Property" -msgstr "ویژگی" - -#: src/user-defined-types/static-and-const.md -msgid "Static" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Constant" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Has an address in memory" -msgstr "دارای یک آدرس واقعی در حافظه" - -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "Yes" -msgstr "بلی" - -#: src/user-defined-types/static-and-const.md -msgid "No (inlined)" -msgstr "خیر (به صورت درون خطی)" - -#: src/user-defined-types/static-and-const.md -msgid "Lives for the entire duration of the program" -msgstr "در طول‌عمر کل برنامه زنده می‌ماند؟" - -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "No" -msgstr "خیر" - -#: src/user-defined-types/static-and-const.md -msgid "Can be mutable" -msgstr "میتوان قابل تغییر اش کرد" - -#: src/user-defined-types/static-and-const.md -msgid "Yes (unsafe)" -msgstr "بلی (unsafe)" - -#: src/user-defined-types/static-and-const.md -msgid "Evaluated at compile time" -msgstr "ارزیابی در زمان کامپایل" - -#: src/user-defined-types/static-and-const.md -msgid "Yes (initialised at compile time)" -msgstr "بلی (در زمان کامپایل ساخته می‌شود)" - -#: src/user-defined-types/static-and-const.md -msgid "Inlined wherever it is used" -msgstr "به صورت درون‌خطی هر جا که استفاده میشود قرار میگیرد" - -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:29 #, fuzzy msgid "" "Because `static` variables are accessible from any thread, they must be " -"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html), atomic or similar." +"`Sync`. Interior mutability is possible through a `Mutex`, atomic or similar." msgstr "" "از آنجایی که متغیرهای `static` از هر رشته‌ای (thread) قابل دسترسی هستند، باید " "`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang." @@ -4964,28 +4668,73 @@ msgstr "" "دارد. ما در فصل Unsafe Rust به استاتیک های قابل تغییر [mutable statics](../" "unsafe/mutable-static-variables.md) نگاه خواهیم کرد." -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md:34 #, fuzzy msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" -"داده‌های `thread_local` را با ماکروی `std::thread_local` " -"می‌توان ایجاد کرد." +"داده‌های `thread_local` را با ماکروی `std::thread_local` " +"می‌توان ایجاد کرد." + +#: src/user-defined-types/const.md:1 +msgid "`const`" +msgstr "" + +#: src/user-defined-types/const.md:3 +#, fuzzy +msgid "" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" +msgstr "" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" + +#: src/user-defined-types/const.md:26 +#, fuzzy +msgid "According to the Rust RFC Book these are inlined upon use." +msgstr "" +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html)، این موارد هنگام استفاده درج می شوند." + +#: src/user-defined-types/const.md:28 +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/user-defined-types/const.md:33 +#, fuzzy +msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" +msgstr "" +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." + +#: src/user-defined-types/const.md:34 +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/user-defined-types/aliases.md +#: src/user-defined-types/aliases.md:3 msgid "" "A type alias creates a name for another type. The two types can be used " "interchangeably." msgstr "" -#: src/user-defined-types/aliases.md -msgid "// Aliases are more useful with long, complex types:\n" +#: src/user-defined-types/aliases.md:13 +msgid "// Aliases are more useful with long, complex types:" msgstr "" -#: src/user-defined-types/aliases.md +#: src/user-defined-types/aliases.md:23 msgid "C programmers will recognize this as similar to a `typedef`." msgstr "" -#: src/user-defined-types/exercise.md +#: src/user-defined-types/exercise.md:3 msgid "" "We will create a data structure to represent an event in an elevator control " "system. It is up to you to define the types and functions to construct " @@ -4993,102 +4742,100 @@ msgid "" "with `{:?}`." msgstr "" -#: src/user-defined-types/exercise.md +#: src/user-defined-types/exercise.md:7 msgid "" "This exercise only requires creating and populating data structures so that " "`main` runs without errors. The next part of the course will cover getting " "data out of these structures." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "" -"/// An event in the elevator system that the controller must react to.\n" +#: src/user-defined-types/exercise.md:12 src/user-defined-types/solution.md:4 +msgid "/// An event in the elevator system that the controller must react to." msgstr "" -#: src/user-defined-types/exercise.md -msgid "// TODO: add required variants\n" +#: src/user-defined-types/exercise.md:15 +msgid "// TODO: add required variants" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// A direction of travel.\n" +#: src/user-defined-types/exercise.md:17 src/user-defined-types/solution.md:22 +msgid "/// A direction of travel." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// The car has arrived on the given floor.\n" +#: src/user-defined-types/exercise.md:24 src/user-defined-types/solution.md:39 +msgid "/// The car has arrived on the given floor." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// The car doors have opened.\n" +#: src/user-defined-types/exercise.md:29 src/user-defined-types/solution.md:44 +msgid "/// The car doors have opened." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// The car doors have closed.\n" +#: src/user-defined-types/exercise.md:34 src/user-defined-types/solution.md:49 +msgid "/// The car doors have closed." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:39 src/user-defined-types/solution.md:54 msgid "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +"/// A directional button was pressed in an elevator lobby on the given floor." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// A floor button was pressed in the elevator car.\n" +#: src/user-defined-types/exercise.md:44 src/user-defined-types/solution.md:59 +msgid "/// A floor button was pressed in the elevator car." msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:52 src/user-defined-types/solution.md:67 msgid "\"A ground floor passenger has pressed the up button: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:55 src/user-defined-types/solution.md:70 msgid "\"The car has arrived on the ground floor: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:56 src/user-defined-types/solution.md:71 msgid "\"The car door opened: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:58 src/user-defined-types/solution.md:73 msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:61 src/user-defined-types/solution.md:76 msgid "\"The car door closed: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#: src/user-defined-types/exercise.md:62 src/user-defined-types/solution.md:77 msgid "\"The car has arrived on the 3rd floor: {:?}\"" msgstr "" -#: src/user-defined-types/solution.md -msgid "/// A button was pressed.\n" +#: src/user-defined-types/solution.md:7 +msgid "/// A button was pressed." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// The car has arrived at the given floor.\n" +#: src/user-defined-types/solution.md:10 +msgid "/// The car has arrived at the given floor." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// The car's doors have opened.\n" +#: src/user-defined-types/solution.md:13 +msgid "/// The car's doors have opened." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// The car's doors have closed.\n" +#: src/user-defined-types/solution.md:16 +msgid "/// The car's doors have closed." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// A floor is represented as an integer.\n" +#: src/user-defined-types/solution.md:19 +msgid "/// A floor is represented as an integer." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// A user-accessible button.\n" +#: src/user-defined-types/solution.md:29 +msgid "/// A user-accessible button." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// A button in the elevator lobby on the given floor.\n" +#: src/user-defined-types/solution.md:33 +msgid "/// A button in the elevator lobby on the given floor." msgstr "" -#: src/user-defined-types/solution.md -msgid "/// A floor button within the car.\n" +#: src/user-defined-types/solution.md:36 +msgid "/// A floor button within the car." msgstr "" #: src/welcome-day-2.md @@ -5126,66 +4873,215 @@ msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" -#: src/welcome-day-2.md -msgid "[Welcome](./welcome-day-2.md) (3 minutes)" +#: src/welcome-day-2.md src/welcome-day-4-afternoon.md +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 10 " +"minutes. It contains:" msgstr "" -#: src/welcome-day-2.md -#, fuzzy -msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" +#: src/pattern-matching.md src/memory-management.md +msgid "This segment should take about 1 hour. It contains:" msgstr "" -"به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -"Rust اطلاعات بیشتری کسب کنید." -#: src/welcome-day-2.md -msgid "[Methods and Traits](./methods-and-traits.md) (55 minutes)" +#: src/pattern-matching/match.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/welcome-day-2.md -msgid "[Generics](./generics.md) (45 minutes)" +#: src/pattern-matching/match.md:6 +msgid "The patterns can be simple values, similarly to `switch` in C and C++:" +msgstr "" +"الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و C++:" + +#: src/pattern-matching/match.md:11 +msgid "'x'" +msgstr "" + +#: src/pattern-matching/match.md:13 +msgid "'q'" +msgstr "" + +#: src/pattern-matching/match.md:13 +msgid "\"Quitting\"" +msgstr "" + +#: src/pattern-matching/match.md:14 src/generics/exercise.md:15 +#: src/generics/solution.md:17 src/std-traits/solution.md:16 +#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:75 +#: src/error-handling/solution.md:60 src/error-handling/solution.md:75 +msgid "'a'" +msgstr "" + +#: src/pattern-matching/match.md:14 +msgid "'s'" +msgstr "" + +#: src/pattern-matching/match.md:14 +msgid "'w'" +msgstr "" + +#: src/pattern-matching/match.md:14 +msgid "'d'" +msgstr "" + +#: src/pattern-matching/match.md:14 +msgid "\"Moving around\"" +msgstr "" + +#: src/pattern-matching/match.md:15 src/error-handling/exercise.md:51 +#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:74 +#: src/error-handling/solution.md:51 src/error-handling/solution.md:60 +#: src/error-handling/solution.md:74 +msgid "'0'" +msgstr "" + +#: src/pattern-matching/match.md:15 src/error-handling/exercise.md:51 +#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:74 +#: src/error-handling/solution.md:51 src/error-handling/solution.md:60 +#: src/error-handling/solution.md:74 +msgid "'9'" +msgstr "" + +#: src/pattern-matching/match.md:15 +msgid "\"Number input\"" +msgstr "" + +#: src/pattern-matching/match.md:16 +msgid "\"Lowercase: {key}\"" +msgstr "" + +#: src/pattern-matching/match.md:17 +msgid "\"Something else\"" +msgstr "" + +#: src/pattern-matching/match.md:22 +msgid "" +"The `_` pattern is a wildcard pattern which matches any value. The " +"expressions _must_ be exhaustive, meaning that it covers every possibility, " +"so `_` is often used as the final catch-all case." +msgstr "" + +#: src/pattern-matching/match.md:26 +#, fuzzy +msgid "" +"Match can be used as an expression. Just like `if`, 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/welcome-day-2.md src/welcome-day-4.md +#: src/pattern-matching/match.md:30 msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 5 " -"minutes" +"A variable in the pattern (`key` in this example) will create a binding that " +"can be used within the match arm." msgstr "" -#: src/pattern-matching.md -msgid "[Destructuring](./pattern-matching/destructuring.md) (10 minutes)" +#: src/pattern-matching/match.md:33 +msgid "A match guard causes the arm to match only if the condition is true." +msgstr "" + +#: src/pattern-matching/match.md:40 +msgid "" +"You might point out how some specific characters are being used when in a " +"pattern" msgstr "" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" + +#: src/pattern-matching/match.md:42 +msgid "`|` as an `or`" +msgstr "`|` به عنوان `or`" + +#: src/pattern-matching/match.md:43 +msgid "`..` can expand as much as it needs to be" +msgstr "`..` برای تعیین همه محدوده یا تا جایی که میتوان گسترش یابد" -#: src/pattern-matching.md -msgid "[Let Control Flow](./pattern-matching/let-control-flow.md) (10 minutes)" +#: src/pattern-matching/match.md:44 +msgid "`1..=5` represents an inclusive range" msgstr "" +"1..=5 نمایانگر یک محدوده خاص " +"است." -#: src/pattern-matching.md +#: src/pattern-matching/match.md:45 +msgid "`_` is a wild card" +msgstr "`_` یک wildcard (هر حالتی) است." + +#: src/pattern-matching/match.md:47 msgid "" -"[Exercise: Expression Evaluation](./pattern-matching/exercise.md) (30 " -"minutes)" +"Match guards as a separate syntax feature are important and necessary when " +"we wish to concisely express more complex ideas than patterns alone would " +"allow." msgstr "" +"گارد های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." -#: src/pattern-matching/destructuring.md -msgid "Like tuples, structs and enums can also be destructured by matching:" +#: src/pattern-matching/match.md:49 +msgid "" +"They are not the same as separate `if` expression inside of the match arm. " +"An `if` expression inside of the branch block (after `=>`) happens after the " +"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.md:53 +msgid "" +"The condition defined in the guard applies to every expression in a pattern " +"with an `|`." +msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md:1 msgid "Structs" msgstr "ساختارها" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md:3 +msgid "Like tuples, Struct can also be destructured by matching:" +msgstr "" + +#: src/pattern-matching/destructuring-structs.md:15 msgid "\"x.0 = 1, b = {b}, y = {y}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md:16 msgid "\"y = 2, x = {i:?}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md:17 msgid "\"y = {y}, other fields were ignored\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md:25 +msgid "Change the literal values in `foo` to match with the other patterns." +msgstr "تغییر مقادیر لیترال در foo برای مطابقت با سایر الگوها." + +#: src/pattern-matching/destructuring-structs.md:26 +msgid "Add a new field to `Foo` and make changes to the pattern as needed." +msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغییرات مورد نیاز." + +#: src/pattern-matching/destructuring-structs.md:27 +msgid "" +"The distinction between a capture and a constant expression can be hard to " +"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-enums.md:3 +msgid "Like tuples, enums can also be destructured by matching:" +msgstr "" + +#: src/pattern-matching/destructuring-enums.md:5 msgid "" "Patterns can also be used to bind variables to parts of your values. This is " "how you inspect the structure of your types. Let us start with a simple " @@ -5195,19 +5091,19 @@ msgstr "" "انواع (Types) خود را بررسی می‌کنید. اجازه دهید با یک نوع `enum` ساده شروع " "کنیم:" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:18 msgid "\"cannot divide {n} into two equal parts\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:25 msgid "\"{n} divided in two is {half}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:26 msgid "\"sorry, an error happened: {msg}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:31 msgid "" "Here we have used the arms to _destructure_ the `Result` value. In the first " "arm, `half` is bound to the value inside the `Ok` variant. In the second " @@ -5217,32 +5113,14 @@ msgstr "" "کرده‌ایم. در شاخه اول، `half` به مقداری داخل نوع `Ok` متصل می شود. در شاخه " "دوم، `msg` به نوع`Err` متصل می‌شود." -#: src/pattern-matching/destructuring.md -msgid "Change the literal values in `foo` to match with the other patterns." -msgstr "تغییر مقادیر لیترال در foo برای مطابقت با سایر الگوها." - -#: src/pattern-matching/destructuring.md -msgid "Add a new field to `Foo` and make changes to the pattern as needed." -msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغییرات مورد نیاز." - -#: src/pattern-matching/destructuring.md -msgid "" -"The distinction between a capture and a constant expression can be hard to " -"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.md +#: src/pattern-matching/destructuring-enums.md:38 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.md +#: src/pattern-matching/destructuring-enums.md:40 msgid "" "You can try adding a third variant to the enum definition and displaying the " "errors when running the code. Point out the places where your code is now " @@ -5252,7 +5130,7 @@ msgstr "" "خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " "نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:43 #, fuzzy msgid "" "The values in the enum variants can only be accessed after being pattern " @@ -5262,7 +5140,7 @@ msgstr "" "فیلدهای موجود با استفاده بازوی `match` پس از `=>` " "متصل می کند." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:45 #, fuzzy msgid "" "Demonstrate what happens when the search is inexhaustive. Note the advantage " @@ -5271,100 +5149,100 @@ msgstr "" "این اتفاق را زمانی که الگوهای جستجو کامل نیستند نشان دهید. به مزیت کامپایلر " "Rust که با تایید زمانی که همه موارد رسیدگی می‌شوند، اشاره کنید." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md:47 msgid "" "Save the result of `divide_in_two` in the `result` variable and `match` it " "in a loop. That won't compile because `msg` is consumed when matched. To fix " "it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." +"it won't be consumed. This \"match ergonomics\" appeared in Rust 2018. If " +"you want to support older Rust, replace `msg` with `ref msg` in the pattern." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:3 msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:6 +#: src/pattern-matching/let-control-flow.md:10 msgid "`if let` expressions" msgstr "عبارت `if let`" -#: src/pattern-matching/let-control-flow.md -msgid "`while let` expressions" +#: src/pattern-matching/let-control-flow.md:7 +#: src/pattern-matching/let-control-flow.md:32 +#, fuzzy +msgid "`let else` expressions" msgstr "عبارت `while let`" -#: src/pattern-matching/let-control-flow.md -msgid "`match` expressions" -msgstr "عبارت `match`" +#: src/pattern-matching/let-control-flow.md:8 +msgid "`while let` expressions" +msgstr "عبارت `while let`" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:12 +#, fuzzy msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-let-expressions) lets you execute different code depending on " -"whether a value matches a pattern:" +"The `if let` expression 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/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:22 msgid "\"slept for {:?}\"" msgstr "" -#: src/pattern-matching/let-control-flow.md -#, fuzzy -msgid "`let else` expressions" -msgstr "عبارت `while let`" - -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:34 msgid "" "For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"use `let else`. The \"else\" case must diverge (`return`, `break`, or panic " "- anything but falling off the end of the block)." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:44 +#: src/pattern-matching/let-control-flow.md:107 msgid "\"got None\"" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:50 +#: src/pattern-matching/let-control-flow.md:111 msgid "\"got empty string\"" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:56 +#: src/pattern-matching/let-control-flow.md:115 msgid "\"not a hex digit\"" msgstr "" -#: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md +#: src/pattern-matching/let-control-flow.md:61 +#: src/pattern-matching/solution.md:113 msgid "\"result: {:?}\"" msgstr "" -#: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/googletest.md -#: src/testing/solution.md +#: src/pattern-matching/let-control-flow.md:61 src/generics/trait-bounds.md:16 +#: src/smart-pointers/solution.md:87 src/smart-pointers/solution.md:90 +#: src/testing/solution.md:83 src/android/testing.md +#: src/android/testing/googletest.md:11 src/android/testing/googletest.md:12 msgid "\"foo\"" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:65 +#, fuzzy msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " -"repeatedly tests a value against a pattern:" +"Like with `if let`, there is a `while let` 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/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:81 #, fuzzy msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) returns `Some(c)` until the string is empty, after " -"which it will return `None`. The `while let` lets us keep iterating through " -"all items." +"Here `String::pop` returns `Some(c)` until the string is empty, after which " +"it will return `None`. The `while let` lets us keep iterating through all " +"items." msgstr "" "در اینجا، پیماینده (iterator) توسط `v.into_iter()` یک " "مقدار را برمیگرداند, یک `Option` را در هر فراخوانی " @@ -5373,11 +5251,11 @@ msgstr "" "span> را برمی گرداند و پس از آن None را برمی گرداند. `while let` به ما امکان " "می دهد همه مارد را به صورت کامل پیمایش کنیم." -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:89 msgid "if-let" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:91 msgid "" "Unlike `match`, `if let` does not have to cover all branches. This can make " "it more concise than `match`." @@ -5386,40 +5264,40 @@ msgstr "" "پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " "کنید." -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:93 msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" "یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " "`Option` است:" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:94 msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" "برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " "الگو استفاده نمیکند." -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:96 msgid "let-else" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:98 msgid "" "`if-let`s can pile up, as shown. The `let-else` construct supports " "flattening this nested code. Rewrite the awkward version for students, so " "they can see the transformation." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:102 msgid "The rewritten version is:" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:122 #, fuzzy msgid "while-let" msgstr "حلقه `while let`" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:124 msgid "" "Point out that the `while let` loop will keep going as long as the value " "matches the pattern." @@ -5427,7 +5305,7 @@ msgstr "" "توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " "داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow.md:126 #, fuzzy msgid "" "You could rewrite the `while let` loop as an infinite loop with an if " @@ -5439,12 +5317,12 @@ msgstr "" "span> وجود ندارد، قطع می‌شود. `while let` مثل آب خوردن سناریو بالا رو برای " "شما فراهم می‌کند." -#: src/pattern-matching/exercise.md +#: src/pattern-matching/exercise.md:3 #, fuzzy msgid "Let's write a simple recursive evaluator for arithmetic expressions." msgstr "بیایید یک ارزیاب بازگشتی ساده برای عبارات حسابی بنویسیم." -#: src/pattern-matching/exercise.md +#: src/pattern-matching/exercise.md:5 #, fuzzy msgid "" "The `Box` type here is a smart pointer, and will be covered in detail later " @@ -5458,20 +5336,19 @@ msgstr "" "از عملگر `deref` برای «خارج کردن» آن استفاده کنید: `eval(*boxed_expr)`" -#: src/pattern-matching/exercise.md +#: src/pattern-matching/exercise.md:10 #, fuzzy msgid "" "Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." +"`Result` type is an enum that represents either a successful " +"value (`Ok(Value)`) or an error (`Err(String)`). We will cover this type in " +"detail later." msgstr "" "برخی از عبارات قابل ارزیابی نیستند و خطایی را برمی‌گردانند. نوع `Res` " "نشان‌دهنده یک مقدار موفقیت‌آمیز یا یک خطا با پیام است. این بسیار شبیه به " "`Result` کتابخانه استاندارد است که بعداً خواهیم دید." -#: src/pattern-matching/exercise.md +#: src/pattern-matching/exercise.md:15 #, fuzzy msgid "" "Copy and paste the code into the Rust playground, and begin implementing " @@ -5483,7 +5360,7 @@ msgstr "" "محصول نهایی باید تست‌ها را پشت سر بگذارد. ممکن است مفید باشد از `todo!()` استفاده کنید و تست‌ها را یکی یکی پاس دهید." -#: src/pattern-matching/exercise.md +#: src/pattern-matching/exercise.md:26 #, fuzzy msgid "" "If you finish early, try writing a test that results in division by zero or " @@ -5493,116 +5370,92 @@ msgstr "" "overflow) شود. چگونه می توانید این مشکل را با `Res::Err` به جای `panic` برطرف کنید؟" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An operation to perform on two subexpressions.\n" +#: src/pattern-matching/exercise.md:30 src/pattern-matching/solution.md:4 +msgid "/// An operation to perform on two subexpressions." msgstr "" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An expression, in tree form.\n" +#: src/pattern-matching/exercise.md:38 src/pattern-matching/solution.md:12 +msgid "/// An expression, in tree form." msgstr "" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An operation on two subexpressions.\n" +#: src/pattern-matching/exercise.md:42 src/pattern-matching/solution.md:16 +msgid "/// An operation on two subexpressions." msgstr "" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// A literal value\n" +#: src/pattern-matching/exercise.md:45 src/pattern-matching/solution.md:19 +msgid "/// A literal value" msgstr "" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/pattern-matching/exercise.md:104 src/pattern-matching/solution.md:40 +#: src/pattern-matching/solution.md:102 msgid "\"division by zero\"" msgstr "" -#: src/pattern-matching/solution.md +#: src/pattern-matching/solution.md:112 msgid "\"expr: {:?}\"" msgstr "" -#: src/methods-and-traits.md -msgid "[Methods](./methods-and-traits/methods.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Traits](./methods-and-traits/traits.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Deriving](./methods-and-traits/deriving.md) (5 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Trait Objects](./methods-and-traits/trait-objects.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "" -"[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "This segment should take about 55 minutes" -msgstr "" - -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:3 msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" msgstr "" -#: src/methods-and-traits/methods.md -msgid "// No receiver, a static method\n" +#: src/methods-and-traits/methods.md:14 +msgid "// No receiver, a static method" msgstr "" -#: src/methods-and-traits/methods.md -msgid "// Exclusive borrowed read-write access to self\n" +#: src/methods-and-traits/methods.md:19 +msgid "// Exclusive borrowed read-write access to self" msgstr "" -#: src/methods-and-traits/methods.md -msgid "// Shared and read-only borrowed access to self\n" +#: src/methods-and-traits/methods.md:24 +msgid "// Shared and read-only borrowed access to self" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:26 msgid "\"Recorded {} laps for {}:\"" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:28 msgid "\"Lap {idx}: {lap} sec\"" msgstr "" -#: src/methods-and-traits/methods.md -msgid "// Exclusive ownership of self\n" +#: src/methods-and-traits/methods.md:32 +msgid "// Exclusive ownership of self" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:35 msgid "\"Race {} is finished, total lap time: {}\"" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:40 msgid "\"Monaco Grand Prix\"" msgstr "" -#: src/methods-and-traits/methods.md -msgid "// race.add_lap(42);\n" +#: src/methods-and-traits/methods.md:47 +msgid "// race.add_lap(42);" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:51 msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:54 msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:56 msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:58 msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " "method becomes the owner of the object. The object will be dropped " @@ -5610,263 +5463,211 @@ msgid "" "transmitted. Complete ownership does not automatically mean mutability." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:62 msgid "`mut self`: same as above, but the method can mutate the object." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:63 msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:71 msgid "It can be helpful to introduce methods by comparing them to functions." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:72 msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:74 msgid "" "Developers may choose to use methods to take advantage of method receiver " "syntax and to help keep them more organized. By using methods we can keep " "all the implementation code in one predictable place." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:77 msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:78 msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:80 msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:82 msgid "" "Note how `self` is used like other structs and dot notation can be used to " "refer to individual fields." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:84 msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." msgstr "" -#: src/methods-and-traits/methods.md +#: src/methods-and-traits/methods.md:86 msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://" -"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " -"receiver types, such as `Box`." +"Beyond variants on `self`, there are also special wrapper types allowed to " +"be receiver types, such as `Box`." msgstr "" -#: src/methods-and-traits/traits.md +#: src/methods-and-traits/traits.md:3 msgid "" "Rust lets you abstract over types with traits. They're similar to interfaces:" msgstr "" -#: src/methods-and-traits/traits.md -msgid "\"Oh you're a cutie! What's your name? {}\"" +#: src/methods-and-traits/traits.md:7 +msgid "/// Return a sentence from this pet." msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md -msgid "\"Woof, my name is {}!\"" +#: src/methods-and-traits/traits.md:10 +msgid "/// Print a string to the terminal greeting this pet." msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md -msgid "\"Miau!\"" +#: src/methods-and-traits/traits.md:18 +msgid "" +"A trait defines a number of methods that types must have in order to " +"implement the trait." msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md -msgid "\"Fido\"" +#: src/methods-and-traits/traits.md:21 +msgid "" +"In the \"Generics\" segment, next, we will see how to build functionality " +"that is generic over all types implementing a trait." msgstr "" -#: src/methods-and-traits/traits.md -msgid "" -"A trait defines a number of methods that types must have in order to " -"implement the trait." +#: src/methods-and-traits/traits/implementing.md:8 +msgid "\"Oh you're a cutie! What's your name? {}\"" msgstr "" -#: src/methods-and-traits/traits.md -msgid "Traits are implemented in an `impl for { .. }` block." +#: src/methods-and-traits/traits/implementing.md:19 +#: src/generics/dyn-trait.md:21 src/smart-pointers/trait-objects.md:22 +msgid "\"Woof, my name is {}!\"" msgstr "" -#: src/methods-and-traits/traits.md -msgid "" -"Traits may specify pre-implemented (provided) methods and methods that users " -"are required to implement themselves. Provided methods can rely on required " -"methods. In this case, `greet` is provided, and relies on `talk`." +#: src/methods-and-traits/traits/implementing.md:24 +#: src/generics/dyn-trait.md:43 src/smart-pointers/trait-objects.md:35 +msgid "\"Fido\"" msgstr "" -#: src/methods-and-traits/deriving.md +#: src/methods-and-traits/traits/implementing.md:31 msgid "" -"Supported traits can be automatically implemented for your custom types, as " -"follows:" +"To implement `Trait` for `Type`, you use an `impl Trait for Type { .. }` " +"block." msgstr "" -#: src/methods-and-traits/deriving.md -msgid "// Default trait adds `default` constructor.\n" +#: src/methods-and-traits/traits/implementing.md:34 +msgid "" +"Unlike Go interfaces, just having matching methods is not enough: a `Cat` " +"type with a `talk()` method would not automatically satisfy `Pet` unless it " +"is in an `impl Pet` block." msgstr "" -#: src/methods-and-traits/deriving.md -msgid "// Clone trait adds `clone` method.\n" +#: src/methods-and-traits/traits/implementing.md:38 +msgid "" +"Traits may provide default implementations of some methods. Default " +"implementations can rely on all the methods of the trait. In this case, " +"`greet` is provided, and relies on `talk`." msgstr "" -#: src/methods-and-traits/deriving.md -msgid "\"EldurScrollz\"" +#: src/methods-and-traits/traits/supertraits.md:3 +msgid "" +"A trait can require that types implementing it also implement other traits, " +"called _supertraits_. Here, any type implementing `Pet` must implement " +"`Animal`." msgstr "" -#: src/methods-and-traits/deriving.md -msgid "// Debug trait adds support for printing with `{:?}`.\n" +#: src/methods-and-traits/traits/supertraits.md:30 +#: src/concurrency/async-control-flow/select.md:44 +msgid "\"Rex\"" msgstr "" -#: src/methods-and-traits/deriving.md -msgid "\"{:?} vs. {:?}\"" +#: src/methods-and-traits/traits/supertraits.md:31 +msgid "\"{} has {} legs\"" msgstr "" -#: src/methods-and-traits/deriving.md +#: src/methods-and-traits/traits/supertraits.md:37 msgid "" -"Derivation is implemented with macros, and many crates provide useful derive " -"macros to add useful functionality. For example, `serde` can derive " -"serialization support for a struct using `#[derive(Serialize)]`." +"This is sometimes called \"trait inheritance\" but students should not " +"expect this to behave like OO inheritance. It just specifies an additional " +"requirement on implementations of a trait." msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/associated-types.md:3 msgid "" -"Trait objects allow for values of different types, for instance in a " -"collection:" -msgstr "" - -#: src/methods-and-traits/trait-objects.md -msgid "\"Hello, who are you? {}\"" +"Associated types are placeholder types which are supplied by the trait " +"implementation." msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "Memory layout after allocating `pets`:" +#: src/methods-and-traits/traits/associated-types.md:25 +#: src/concurrency/async-control-flow/join.md:30 +msgid "\"{:?}\"" msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/associated-types.md:31 msgid "" -"```bob\n" -" Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" -": : : :\n" -": pets : : +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-----+-----+ .->| F | i | d | o " -"| :\n" -": | ptr | o---+---+-----+-->| o o | o o | | +----+----+----+----" -"+ :\n" -": | len | 2 | : : +-|-|-+-|-|-+ " -"`---------. :\n" -": | capacity | 2 | : : | | | | data " -"| :\n" -": +-----------+-------+ : : | | | | +-------+--|-------" -"+ :\n" -": : : | | | '-->| name | o, 4, 4 " -"| :\n" -": : : | | | | age | 5 " -"| :\n" -"`- - - - - - - - - - - - - -' : | | | +-------+----------" -"+ :\n" -" : | | " -"| :\n" -" : | | | " -"vtable :\n" -" : | | | +----------------------" -"+ :\n" -" : | | '---->| \"::talk\" " -"| :\n" -" : | | +----------------------" -"+ :\n" -" : | " -"| :\n" -" : | | " -"data :\n" -" : | | +-------+-------" -"+ :\n" -" : | '-->| lives | 9 " -"| :\n" -" : | +-------+-------" -"+ :\n" -" : " -"| :\n" -" : | " -"vtable :\n" -" : | +----------------------" -"+ :\n" -" : '---->| \"::talk\" " -"| :\n" -" : +----------------------" -"+ :\n" -" : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" -"```" +"Associated types are sometimes also called \"output types\". The key " +"observation is that the implementer, not the caller, chooses this type." msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/associated-types.md:34 msgid "" -"Types that implement a given trait may be of different sizes. This makes it " -"impossible to have things like `Vec` in the example above." +"Many standard library traits have associated types, including arithmetic " +"operators and `Iterator`." msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/deriving.md:3 msgid "" -"`dyn Pet` is a way to tell the compiler about a dynamically sized type that " -"implements `Pet`." +"Supported traits can be automatically implemented for your custom types, as " +"follows:" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"In the example, `pets` is allocated on the stack and the vector data is on " -"the heap. The two vector elements are _fat pointers_:" +#: src/methods-and-traits/deriving.md:15 +msgid "// Default trait adds `default` constructor." msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"A fat pointer is a double-width pointer. It has two components: a pointer to " -"the actual object and a pointer to the [virtual method table](https://en." -"wikipedia.org/wiki/Virtual_method_table) (vtable) for the `Pet` " -"implementation of that particular object." +#: src/methods-and-traits/deriving.md:16 +msgid "// Clone trait adds `clone` method." msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"The data for the `Dog` named Fido is the `name` and `age` fields. The `Cat` " -"has a `lives` field." +#: src/methods-and-traits/deriving.md:17 +msgid "\"EldurScrollz\"" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "Compare these outputs in the above example:" +#: src/methods-and-traits/deriving.md:18 +msgid "// Debug trait adds support for printing with `{:?}`." msgstr "" -#: src/methods-and-traits/trait-objects.md src/std-traits/closures.md -msgid "\"{} {}\"" +#: src/methods-and-traits/deriving.md:19 +msgid "\"{:?} vs. {:?}\"" msgstr "" -#: src/methods-and-traits/trait-objects.md src/std-traits/exercise.md -#: src/std-traits/solution.md src/modules/exercise.md src/modules/solution.md -#: src/android/build-rules/library.md -#: src/android/interoperability/cpp/rust-bridge.md -#: src/async/pitfalls/cancellation.md -msgid "\"{}\"" +#: src/methods-and-traits/deriving.md:26 +msgid "" +"Derivation is implemented with macros, and many crates provide useful derive " +"macros to add useful functionality. For example, `serde` can derive " +"serialization support for a struct using `#[derive(Serialize)]`." msgstr "" -#: src/methods-and-traits/exercise.md +#: src/methods-and-traits/exercise.md:1 +#, fuzzy +msgid "Exercise: Logger Trait" +msgstr "تمرین‌ها" + +#: src/methods-and-traits/exercise.md:3 msgid "" "Let's design a simple logging utility, using a trait `Logger` with a `log` " "method. Code which might log its progress can then take an `&impl Logger`. " @@ -5874,101 +5675,101 @@ msgid "" "production build it would send messages to a log server." msgstr "" -#: src/methods-and-traits/exercise.md +#: src/methods-and-traits/exercise.md:8 msgid "" "However, the `StderrLogger` given below logs all messages, regardless of " "verbosity. Your task is to write a `VerbosityFilter` type that will ignore " "messages above a maximum verbosity." msgstr "" -#: src/methods-and-traits/exercise.md +#: src/methods-and-traits/exercise.md:12 msgid "" "This is a common pattern: a struct wrapping a trait implementation and " "implementing that same trait, adding behavior in the process. What other " "kinds of wrappers might be useful in a logging utility?" msgstr "" -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md -msgid "/// Log a message at the given verbosity level.\n" +#: src/methods-and-traits/exercise.md:20 src/methods-and-traits/solution.md:7 +msgid "/// Log a message at the given verbosity level." msgstr "" -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/methods-and-traits/exercise.md:28 src/methods-and-traits/solution.md:15 msgid "\"verbosity={verbosity}: {message}\"" msgstr "" -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/methods-and-traits/exercise.md:33 src/methods-and-traits/solution.md:20 msgid "\"FYI\"" msgstr "" -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/methods-and-traits/exercise.md:34 src/methods-and-traits/solution.md:21 msgid "\"Uhoh\"" msgstr "" -#: src/methods-and-traits/exercise.md -msgid "// TODO: Define and implement `VerbosityFilter`.\n" +#: src/methods-and-traits/exercise.md:36 +msgid "// TODO: Define and implement `VerbosityFilter`." msgstr "" -#: src/methods-and-traits/solution.md -msgid "/// Only log messages up to the given verbosity level.\n" +#: src/methods-and-traits/solution.md:23 +msgid "/// Only log messages up to the given verbosity level." msgstr "" -#: src/generics.md -msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" +#: src/welcome-day-2-afternoon.md +msgid "" +"Including 10 minute breaks, this session should take about 4 hours and 5 " +"minutes. It contains:" msgstr "" -#: src/generics.md -msgid "[Generic Data Types](./generics/generic-data.md) (15 minutes)" +#: src/generics.md src/iterators.md src/testing.md +msgid "This segment should take about 45 minutes. It contains:" msgstr "" #: src/generics.md -msgid "[Trait Bounds](./generics/trait-bounds.md) (10 minutes)" -msgstr "" +msgid "impl Trait" +msgstr "صفات impl (impl Trait)" #: src/generics.md -msgid "[impl Trait](./generics/impl-trait.md) (5 minutes)" -msgstr "" +#, fuzzy +msgid "dyn Trait" +msgstr "صفات Async" #: src/generics.md -msgid "[Exercise: Generic min](./generics/exercise.md) (10 minutes)" -msgstr "" - -#: src/generics.md src/smart-pointers.md src/iterators.md src/error-handling.md -msgid "This segment should take about 45 minutes" -msgstr "" +#, fuzzy +msgid "Exercise: Generic min" +msgstr "تمرین‌ها" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:3 msgid "" "Rust supports generics, which lets you abstract algorithms or data " "structures (such as sorting or a binary tree) over the types used or stored." msgstr "" -#: src/generics/generic-functions.md -msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" +#: src/generics/generic-functions.md:7 +msgid "/// Pick `even` or `odd` depending on the value of `n`." msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:17 msgid "\"picked a number: {:?}\"" msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:18 msgid "\"picked a tuple: {:?}\"" msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:18 msgid "\"dog\"" msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:18 msgid "\"cat\"" msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:25 msgid "" "Rust infers a type for T based on the types of the arguments and return " "value." msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:27 msgid "" "This is similar to C++ templates, but Rust partially compiles the generic " "function immediately, so that function must be valid for all types matching " @@ -5977,156 +5778,198 @@ msgid "" "still considers it invalid. C++ would let you do this." msgstr "" -#: src/generics/generic-functions.md +#: src/generics/generic-functions.md:33 msgid "" "Generic code is turned into non-generic code based on the call sites. This " "is a zero-cost abstraction: you get exactly the same result as if you had " "hand-coded the data structures without the abstraction." msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:3 msgid "You can use generics to abstract over the concrete field type:" msgstr "" -#: src/generics/generic-data.md -msgid "// fn set_x(&mut self, x: T)\n" -msgstr "" - -#: src/generics/generic-data.md +#: src/generics/generic-data.md:25 msgid "\"{integer:?} and {float:?}\"" msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:26 msgid "\"coords: {:?}\"" msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:33 msgid "" "_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " "redundant?" msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:35 msgid "" "This is because it is a generic implementation section for generic type. " "They are independently generic." msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:37 msgid "It means these methods are defined for any `T`." msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:38 msgid "It is possible to write `impl Point { .. }`." msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:39 msgid "" "`Point` is still generic and you can use `Point`, but methods in this " "block will only be available for `Point`." msgstr "" -#: src/generics/generic-data.md +#: src/generics/generic-data.md:42 msgid "" "Try declaring a new variable `let p = Point { x: 5, y: 10.0 };`. Update the " "code to allow points that have elements of different types, by using two " "type variables, e.g., `T` and `U`." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/generic-traits.md:3 +msgid "" +"Traits can also be generic, just like types and functions. A trait's " +"parameters get concrete types when it is used." +msgstr "" + +#: src/generics/generic-traits.md:12 +msgid "\"Converted from integer: {from}\"" +msgstr "" + +#: src/generics/generic-traits.md:18 +msgid "\"Converted from bool: {from}\"" +msgstr "" + +#: src/generics/generic-traits.md:25 +msgid "\"{from_int:?}, {from_bool:?}\"" +msgstr "" + +#: src/generics/generic-traits.md:31 +msgid "" +"The `From` trait will be covered later in the course, but its definition in " +"the `std` docs is simple." +msgstr "" + +#: src/generics/generic-traits.md:35 +msgid "" +"Implementations of the trait do not need to cover all possible type " +"parameters. Here, `Foo::From(\"hello\")` would not compile because there is " +"no `From<&str>` implementation for `Foo`." +msgstr "" + +#: src/generics/generic-traits.md:39 +msgid "" +"Generic traits take types as \"input\", while associated types are a kind of " +"\"output\" type. A trait can have multiple implementations for different " +"input types." +msgstr "" + +#: src/generics/generic-traits.md:43 +msgid "" +"In fact, Rust requires that at most one implementation of a trait match for " +"any type T. Unlike some other languages, Rust has no heuristic for choosing " +"the \"most specific\" match. There is work on adding this support, called " +"specialization." +msgstr "" + +#: src/generics/trait-bounds.md:3 msgid "" "When working with generics, you often want to require the types to implement " "some trait, so that you can call this trait's methods." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:6 msgid "You can do this with `T: Trait` or `impl Trait`:" msgstr "" -#: src/generics/trait-bounds.md -msgid "// struct NotClonable;\n" +#: src/generics/trait-bounds.md:12 +msgid "// struct NotClonable;" msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:18 msgid "\"{pair:?}\"" msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:25 msgid "Try making a `NonClonable` and passing it to `duplicate`." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:27 msgid "When multiple traits are necessary, use `+` to join them." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:29 msgid "Show a `where` clause, students will encounter it when reading code." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:40 msgid "It declutters the function signature if you have many parameters." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:41 msgid "It has additional features making it more powerful." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:42 msgid "" "If someone asks, the extra feature is that the type on the left of \":\" can " "be arbitrary, like `Option`." msgstr "" -#: src/generics/trait-bounds.md +#: src/generics/trait-bounds.md:45 msgid "" "Note that Rust does not (yet) support specialization. For example, given the " "original `duplicate`, it is invalid to add a specialized `duplicate(a: u32)`." msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:3 msgid "" "Similar to trait bounds, an `impl Trait` syntax can be used in function " "arguments and return values:" msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:7 msgid "" -"// Syntactic sugar for:\n" -"// fn add_42_millions>(x: T) -> i32 {\n" +"// Syntactic sugar for: // fn add_42_millions\\\\>(x: T) -> " +"i32 {" msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:19 msgid "\"{many}\"" msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:21 msgid "\"{many_more}\"" msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:23 msgid "\"debuggable: {debuggable:?}\"" msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:30 msgid "" "`impl Trait` allows you to work with types which you cannot name. The " "meaning of `impl Trait` is a bit different in the different positions." msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:33 msgid "" "For a parameter, `impl Trait` is like an anonymous generic parameter with a " "trait bound." msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:36 msgid "" "For a return type, it means that the return type is some concrete type that " "implements the trait, without naming the type. This can be useful when you " "don't want to expose the concrete type in a public API." msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:40 msgid "" "Inference is hard in return position. A function returning `impl Foo` picks " "the concrete type it returns, without writing it out in the source. A " @@ -6136,158 +5979,209 @@ msgid "" ">()`." msgstr "" -#: src/generics/impl-trait.md +#: src/generics/impl-trait.md:47 msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." msgstr "" -#: src/generics/exercise.md +#: src/generics/dyn-trait.md:3 msgid "" -"In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using a `LessThan` trait." +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -#: src/generics/exercise.md src/generics/solution.md -msgid "/// Return true if self is less than other.\n" +#: src/generics/dyn-trait.md:27 src/smart-pointers/trait-objects.md:28 +msgid "\"Miau!\"" msgstr "" -#: src/generics/exercise.md -msgid "// TODO: implement the `min` function used in `main`.\n" +#: src/generics/dyn-trait.md:30 +msgid "// Uses generics and static dispatch." msgstr "" -#: src/generics/exercise.md src/generics/solution.md -msgid "\"Shapiro\"" +#: src/generics/dyn-trait.md:33 src/generics/dyn-trait.md:38 +#: src/smart-pointers/trait-objects.md:38 +msgid "\"Hello, who are you? {}\"" msgstr "" -#: src/generics/exercise.md src/generics/solution.md -msgid "\"Baumann\"" +#: src/generics/dyn-trait.md:35 +msgid "// Uses type-erasure and dynamic dispatch." msgstr "" -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Types](./std-types.md) (1 hour and 10 minutes)" +#: src/generics/dyn-trait.md:56 +msgid "" +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." msgstr "" -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" +#: src/generics/dyn-trait.md:62 +msgid "" +"When using `dyn Trait`, it instead uses dynamic dispatch through a virtual " +"method table (vtable). This means that there's a single version of `fn " +"dynamic` that is used regardless of what type of `Pet` is passed in." msgstr "" -#: src/std-types.md -msgid "[Standard Library](./std-types/std.md) (3 minutes)" +#: src/generics/dyn-trait.md:67 +msgid "" +"When using `dyn Trait`, the trait object needs to be behind some kind of " +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." msgstr "" -#: src/std-types.md -msgid "[Documentation](./std-types/docs.md) (5 minutes)" +#: src/generics/dyn-trait.md:71 +msgid "" +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." msgstr "" -#: src/std-types.md -msgid "[Option](./std-types/option.md) (10 minutes)" +#: src/generics/dyn-trait.md:79 +msgid "" +"A `dyn Trait` is considered to be \"type-erased\", because we no longer have " +"compile-time knowledge of what the concrete type is." msgstr "" -#: src/std-types.md -msgid "[Result](./std-types/result.md) (10 minutes)" +#: src/generics/exercise.md:3 +msgid "" +"In this short exercise, you will implement a generic `min` function that " +"determines the minimum of two values, using the `Ord` trait." msgstr "" -#: src/std-types.md -msgid "[String](./std-types/string.md) (10 minutes)" +#: src/generics/exercise.md:8 +msgid "// TODO: implement the `min` function used in `main`." msgstr "" -#: src/std-types.md -msgid "[Vec](./std-types/vec.md) (10 minutes)" +#: src/generics/exercise.md:15 src/generics/solution.md:17 +#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:75 +#: src/error-handling/solution.md:60 src/error-handling/solution.md:75 +msgid "'z'" msgstr "" -#: src/std-types.md -msgid "[HashMap](./std-types/hashmap.md) (10 minutes)" +#: src/generics/exercise.md:16 src/generics/solution.md:18 +msgid "'7'" +msgstr "" + +#: src/generics/exercise.md:16 src/generics/solution.md:18 +msgid "'1'" +msgstr "" + +#: src/generics/exercise.md:18 src/generics/solution.md:20 +msgid "\"goodbye\"" +msgstr "" + +#: src/generics/exercise.md:19 src/generics/solution.md:21 +msgid "\"bat\"" +msgstr "" + +#: src/generics/exercise.md:19 src/generics/solution.md:21 +msgid "\"armadillo\"" +msgstr "" + +#: src/generics/exercise.md:26 +msgid "Show students the `Ord` trait and `Ordering` enum." msgstr "" #: src/std-types.md -msgid "[Exercise: Counter](./std-types/exercise.md) (10 minutes)" +msgid "This segment should take about 1 hour and 20 minutes. It contains:" msgstr "" -#: src/std-types.md src/memory-management.md src/slices-and-lifetimes.md -msgid "This segment should take about 1 hour and 10 minutes" +#: src/std-types.md src/std-types/option.md:1 +#, fuzzy +msgid "Option" +msgstr "استثناها" + +#: src/std-types.md src/std-types/result.md:1 +msgid "Result" msgstr "" +#: src/std-types.md src/std-types/string.md:1 +msgid "String" +msgstr "String" + +#: src/std-types.md +msgid "Vec" +msgstr "Vec" + +#: src/std-types.md +msgid "HashMap" +msgstr "HashMap" + #: src/std-types.md msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -#: src/std-types/std.md +#: src/std-types/std.md:3 msgid "" "Rust comes with a standard library which helps establish a set of common " "types used by Rust libraries and programs. This way, two libraries can work " "together smoothly because they both use the same `String` type." msgstr "" -#: src/std-types/std.md +#: src/std-types/std.md:7 msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." msgstr "" -#: src/std-types/std.md +#: src/std-types/std.md:10 msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." msgstr "" -#: src/std-types/std.md +#: src/std-types/std.md:12 msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." msgstr "" -#: src/std-types/std.md +#: src/std-types/std.md:14 msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:3 msgid "Rust comes with extensive documentation. For example:" msgstr "" -#: src/std-types/docs.md -#, fuzzy -msgid "" -"All of the details about [loops](https://doc.rust-lang.org/stable/reference/" -"expressions/loop-expr.html)." +#: src/std-types/docs.md:5 +msgid "All of the details about loops." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," -#: src/std-types/docs.md -msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +#: src/std-types/docs.md:7 +msgid "Primitive types like `u8`." msgstr "" -#: src/std-types/docs.md -msgid "" -"Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" -"std/collections/struct.BinaryHeap.html)." +#: src/std-types/docs.md:9 +msgid "Standard library types like `Option` or `BinaryHeap`." msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:13 msgid "In fact, you can document your own code:" msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:16 msgid "" "/// Determine whether the first argument is divisible by the second " -"argument.\n" -"///\n" -"/// If the second argument is zero, the result is false.\n" +"argument. /// /// If the second argument is zero, the result is false." msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:27 #, fuzzy msgid "" "The contents are treated as Markdown. All published Rust library crates are " -"automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " +"automatically documented at `docs.rs` using the rustdoc tool. It is " "idiomatic to document all public items in an API using this pattern." msgstr "" "محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی " @@ -6297,92 +6191,81 @@ msgstr "" "یک API با استفاده از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه " "استفاده را مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." -#: src/std-types/docs.md +#: src/std-types/docs.md:32 msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:36 msgid "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers." msgstr "" -#: src/std-types/docs.md +#: src/std-types/docs.md:42 #, fuzzy msgid "" -"Show students the generated docs for the `rand` crate at ." +"Show students the generated docs for the `rand` crate at https://docs.rs/" +"rand." msgstr "" "دانشجویان را با مستندات تولید شده برای جعبه `rand` در [`docs.rs/rand`]" "(https://docs.rs/rand) آشنا کنید." -#: src/std-types/option.md -#, fuzzy -msgid "Option" -msgstr "استثناها" - -#: src/std-types/option.md +#: src/std-types/option.md:3 msgid "" "We have already seen some use of `Option`. It stores either a value of " -"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" -"stable/std/string/struct.String.html#method.find) returns an `Option`." +"type `T` or nothing. For example, `String::find` returns an `Option`." msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:10 msgid "\"Löwe 老虎 Léopard Gepardi\"" msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:11 msgid "'é'" msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:12 src/std-types/option.md:15 msgid "\"find returned {position:?}\"" msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:14 msgid "'Z'" msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:16 msgid "\"Character not found\"" msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:23 msgid "`Option` is widely used, not just in the standard library." msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:24 msgid "" "`unwrap` will return the value in an `Option`, or panic. `expect` is similar " "but takes an error message." msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:26 msgid "" "You can panic on None, but you can't \"accidentally\" forget to check for " "None." msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:28 msgid "" "It's common to `unwrap`/`expect` all over the place when hacking something " "together, but production code typically handles `None` in a nicer fashion." msgstr "" -#: src/std-types/option.md +#: src/std-types/option.md:30 msgid "" "The niche optimization means that `Option` often has the same size in " "memory as `T`." msgstr "" -#: src/std-types/result.md -msgid "Result" -msgstr "" - -#: src/std-types/result.md +#: src/std-types/result.md:3 msgid "" "`Result` is similar to `Option`, but indicates the success or failure of an " "operation, each with a different type. This is similar to the `Res` defined " @@ -6390,23 +6273,23 @@ msgid "" "the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:13 msgid "\"diary.txt\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:18 msgid "\"Dear diary: {contents} ({bytes} bytes)\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:20 msgid "\"Could not read file content\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:24 msgid "\"The diary could not be opened: {err}\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:33 msgid "" "As with `Option`, the successful value sits inside of `Result`, forcing the " "developer to explicitly extract it. This encourages error checking. In the " @@ -6414,299 +6297,296 @@ msgid "" "called, and this is a signal of the developer intent too." msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:37 msgid "" "`Result` documentation is a recommended read. Not during the course, but it " "is worth mentioning. It contains a lot of convenience methods and functions " "that help functional-style programming." msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md:40 msgid "" "`Result` is the standard type to implement error handling as we will see on " -"Day 3." +"Day 4." msgstr "" -#: src/std-types/string.md -msgid "String" -msgstr "String" - -#: src/std-types/string.md -msgid "" -"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is the " -"standard heap-allocated growable UTF-8 string buffer:" -msgstr "" +#: src/std-types/string.md:3 +#, fuzzy +msgid "`String` is a growable UTF-8 encoded string:" +msgstr "`String` یک بافر رشته‌ای قابل تغییر است." -#: src/std-types/string.md src/std-traits/read-and-write.md -#: src/memory-management/review.md src/testing/unit-tests.md -#: src/concurrency/scoped-threads.md +#: src/std-types/string.md:8 src/std-traits/read-and-write.md:35 +#: src/memory-management/review.md:23 src/memory-management/review.md:58 +#: src/testing/unit-tests.md:32 src/testing/unit-tests.md:37 +#: src/concurrency/threads/scoped.md:9 src/concurrency/threads/scoped.md:26 msgid "\"Hello\"" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:9 msgid "\"s1: len = {}, capacity = {}\"" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:13 msgid "'!'" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:14 msgid "\"s2: len = {}, capacity = {}\"" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:16 msgid "\"🇨🇭\"" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:17 msgid "\"s3: len = {}, number of chars = {}\"" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:21 msgid "" -"`String` implements [`Deref`](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str), which means that you can call " -"all `str` methods on a `String`." +"`String` implements `Deref`, which means that you can call all " +"`str` methods on a `String`." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:30 msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:32 msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:34 msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " "`char` can be different from what a human will consider a \"character\" due " -"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" -"unicode_segmentation/struct.Graphemes.html)." +"to grapheme clusters." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:37 msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:39 msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:41 msgid "" "We haven't discussed the `Deref` trait yet, so at this point this mostly " "explains the structure of the sidebar in the documentation." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:43 msgid "" "`String` implements `Deref` which transparently gives it " "access to `str`'s methods." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:45 msgid "Write and compare `let s3 = s1.deref();` and `let s3 = &*s1;`." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:46 msgid "" "`String` is implemented as a wrapper around a vector of bytes, many of the " "operations you see supported on vectors are also supported on `String`, but " "with some extra guarantees." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:49 msgid "Compare the different ways to index a `String`:" msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:50 msgid "" "To a character by using `s3.chars().nth(i).unwrap()` where `i` is in-bound, " "out-of-bounds." msgstr "" -#: src/std-types/string.md +#: src/std-types/string.md:52 msgid "" "To a substring by using `s3[0..4]`, where that slice is on character " "boundaries or not." msgstr "" -#: src/std-types/vec.md +#: src/std-types/string.md:54 msgid "" -"[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) is the standard " -"resizable heap-allocated buffer:" +"Many types can be converted to a string with the `to_string` method. This " +"trait is automatically implemented for all types that implement `Display`, " +"so anything that can be formatted can also be converted to a string." +msgstr "" + +#: src/std-types/vec.md:3 +msgid "`Vec` is the standard resizable heap-allocated buffer:" msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:9 msgid "\"v1: len = {}, capacity = {}\"" msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:14 msgid "\"v2: len = {}, capacity = {}\"" msgstr "" -#: src/std-types/vec.md -msgid "// Canonical macro to initialize a vector with elements.\n" +#: src/std-types/vec.md:16 +msgid "// Canonical macro to initialize a vector with elements." msgstr "" -#: src/std-types/vec.md -msgid "// Retain only the even elements.\n" +#: src/std-types/vec.md:19 +msgid "// Retain only the even elements." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:21 src/std-types/vec.md:25 msgid "\"{v3:?}\"" msgstr "" -#: src/std-types/vec.md -msgid "// Remove consecutive duplicates.\n" +#: src/std-types/vec.md:23 +msgid "// Remove consecutive duplicates." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:29 msgid "" -"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " +"`Vec` implements `Deref`, which means that you can call slice " "methods on a `Vec`." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:38 msgid "" "`Vec` is a type of collection, along with `String` and `HashMap`. The data " "it contains is stored on the heap. This means the amount of data doesn't " "need to be known at compile time. It can grow or shrink at runtime." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:41 msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " "explicitly. As always with Rust type inference, the `T` was established " "during the first `push` call." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:44 msgid "" "`vec![...]` is a canonical macro to use instead of `Vec::new()` and it " "supports adding initial elements to the vector." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:46 msgid "" "To index the vector you use `[` `]`, but they will panic if out of bounds. " "Alternatively, using `get` will return an `Option`. The `pop` function will " "remove the last element." msgstr "" -#: src/std-types/vec.md +#: src/std-types/vec.md:49 msgid "" "Slices are covered on day 3. For now, students only need to know that a " "value of type `Vec` gives access to all of the documented slice methods, too." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:3 msgid "Standard hash map with protection against HashDoS attacks:" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:10 msgid "\"Adventures of Huckleberry Finn\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:11 msgid "\"Grimms' Fairy Tales\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:12 src/std-types/hashmap.md:21 +#: src/std-types/hashmap.md:29 msgid "\"Pride and Prejudice\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:14 msgid "\"Les Misérables\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:16 msgid "\"We know about {} books, but not Les Misérables.\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:21 src/std-types/hashmap.md:29 msgid "\"Alice's Adventure in Wonderland\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:23 msgid "\"{book}: {count} pages\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:24 msgid "\"{book} is unknown.\"" msgstr "" -#: src/std-types/hashmap.md -msgid "// Use the .entry() method to insert a value if nothing is found.\n" +#: src/std-types/hashmap.md:28 +msgid "// Use the .entry() method to insert a value if nothing is found." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:34 msgid "\"{page_counts:#?}\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:41 msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:42 msgid "" "Try the following lines of code. The first line will see if a book is in the " "hashmap and if not return an alternative value. The second line will insert " "the alternative value in the hashmap if the book is not found." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:48 src/std-types/hashmap.md:60 msgid "\"Harry Potter and the Sorcerer's Stone\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:51 src/std-types/hashmap.md:61 msgid "\"The Hunger Games\"" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:54 msgid "Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:55 msgid "" -"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements `From<[(K, V); N]>`, which " +"allows us to easily initialize a hash map from a literal array:" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:65 msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:67 msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " "examples easier. Using references in collections can, of course, be done, " "but it can lead into complications with the borrow checker." msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:70 msgid "" "Try removing `to_string()` from the example above and see if it still " "compiles. Where do you think we might run into issues?" msgstr "" -#: src/std-types/hashmap.md +#: src/std-types/hashmap.md:73 msgid "" "This type has several \"method-specific\" return types, such as `std::" "collections::hash_map::Keys`. These types often appear in searches of the " @@ -6714,95 +6594,76 @@ msgid "" "to the `keys` method." msgstr "" -#: src/std-types/exercise.md +#: src/std-types/exercise.md:3 msgid "" "In this exercise you will take a very simple data structure and make it " -"generic. It uses a [`std::collections::HashMap`](https://doc.rust-lang.org/" -"stable/std/collections/struct.HashMap.html) to keep track of which values " +"generic. It uses a `std::collections::HashMap` to keep track of which values " "have been seen and how many times each one has appeared." msgstr "" -#: src/std-types/exercise.md +#: src/std-types/exercise.md:9 msgid "" "The initial version of `Counter` is hard coded to only work for `u32` " "values. Make the struct and its methods generic over the type of value being " "tracked, that way `Counter` can track any type of value." msgstr "" -#: src/std-types/exercise.md +#: src/std-types/exercise.md:13 msgid "" -"If you finish early, try using the [`entry`](https://doc.rust-lang.org/" -"stable/std/collections/struct.HashMap.html#method.entry) method to halve the " -"number of hash lookups required to implement the `count` method." +"If you finish early, try using the `entry` method to halve the number of " +"hash lookups required to implement the `count` method." msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md:20 src/std-types/solution.md:6 msgid "" -"/// Counter counts the number of times each value of type T has been seen.\n" +"/// Counter counts the number of times each value of type T has been seen." msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Create a new Counter.\n" +#: src/std-types/exercise.md:27 src/std-types/solution.md:13 +msgid "/// Create a new Counter." msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Count an occurrence of the given value.\n" +#: src/std-types/exercise.md:34 src/std-types/solution.md:18 +msgid "/// Count an occurrence of the given value." msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Return the number of times the given value has been seen.\n" +#: src/std-types/exercise.md:43 src/std-types/solution.md:23 +msgid "/// Return the number of times the given value has been seen." msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md:59 src/std-types/solution.md:39 msgid "\"saw {} values equal to {}\"" msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md:63 src/std-types/exercise.md:65 +#: src/std-types/exercise.md:66 src/std-types/solution.md:43 +#: src/std-types/solution.md:45 src/std-types/solution.md:46 msgid "\"apple\"" msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md:64 src/std-types/solution.md:44 msgid "\"orange\"" msgstr "" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md:66 src/std-types/solution.md:46 msgid "\"got {} apples\"" msgstr "" #: src/std-traits.md -msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Operators](./std-traits/operators.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[From and Into](./std-traits/from-and-into.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Casting](./std-traits/casting.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Read and Write](./std-traits/read-and-write.md) (10 minutes)" +msgid "This segment should take about 1 hour and 40 minutes. It contains:" msgstr "" #: src/std-traits.md -msgid "[Default, struct update syntax](./std-traits/default.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Closures](./std-traits/closures.md) (20 minutes)" -msgstr "" +msgid "From and Into" +msgstr "From و Into" #: src/std-traits.md -msgid "[Exercise: ROT13](./std-traits/exercise.md) (30 minutes)" -msgstr "" +#, fuzzy +msgid "Read and Write" +msgstr "Read and Write" #: src/std-traits.md -msgid "This segment should take about 1 hour and 40 minutes" +msgid "Default, struct update syntax" msgstr "" #: src/std-traits.md @@ -6815,125 +6676,117 @@ msgstr "" msgid "This section is long. Take a break midway through." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:3 msgid "" "These traits support comparisons between values. All traits can be derived " "for types containing fields that implement these traits." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:6 msgid "`PartialEq` and `Eq`" msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:8 msgid "" "`PartialEq` is a partial equivalence relation, with required method `eq` and " "provided method `ne`. The `==` and `!=` operators will call these methods." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:23 msgid "" "`Eq` is a full equivalence relation (reflexive, symmetric, and transitive) " "and implies `PartialEq`. Functions that require full equivalence will use " "`Eq` as a trait bound." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:27 msgid "`PartialOrd` and `Ord`" msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:29 msgid "" "`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " "used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:49 msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:54 msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" msgstr "" -#: src/std-traits/comparisons.md +#: src/std-traits/comparisons.md:69 msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." msgstr "" -#: src/std-traits/operators.md -msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc." -"rust-lang.org/std/ops/index.html):" +#: src/std-traits/operators.md:3 +msgid "Operator overloading is implemented via traits in `std::ops`:" msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:23 msgid "\"{:?} + {:?} = {:?}\"" msgstr "" -#: src/std-traits/operators.md src/memory-management/drop.md +#: src/std-traits/operators.md:30 src/memory-management/drop.md:48 msgid "Discussion points:" msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:32 msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:33 msgid "" "Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " "the operator is not `Copy`, you should consider overloading the operator for " "`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:36 msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:38 msgid "" "Short answer: Function type parameters are controlled by the caller, but " "associated types (like `Output`) are controlled by the implementer of a " "trait." msgstr "" -#: src/std-traits/operators.md +#: src/std-traits/operators.md:41 msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." msgstr "" -#: src/std-traits/from-and-into.md -msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions:" +#: src/std-traits/from-and-into.md:3 +msgid "Types implement `From` and `Into` to facilitate type conversions:" msgstr "" -#: src/std-traits/from-and-into.md +#: src/std-traits/from-and-into.md:11 src/std-traits/from-and-into.md:23 msgid "\"{s}, {addr}, {one}, {bigger}\"" msgstr "" -#: src/std-traits/from-and-into.md -msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " -"automatically implemented when [`From`](https://doc.rust-lang.org/std/" -"convert/trait.From.html) is implemented:" +#: src/std-traits/from-and-into.md:15 +msgid "`Into` is automatically implemented when `From` is implemented:" msgstr "" -#: src/std-traits/from-and-into.md +#: src/std-traits/from-and-into.md:30 msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." msgstr "" -#: src/std-traits/from-and-into.md +#: src/std-traits/from-and-into.md:32 msgid "" "When declaring a function argument input type like \"anything that can be " "converted into a `String`\", the rule is opposite, you should use `Into`. " @@ -6941,32 +6794,32 @@ msgid "" "implement `Into`." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:3 msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:9 msgid "\"as u16: {}\"" msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:10 msgid "\"as i16: {}\"" msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:11 msgid "\"as u8: {}\"" msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:15 msgid "" "The results of `as` are _always_ defined in Rust and consistent across " "platforms. This might not match your intuition for changing sign or casting " "to a smaller type -- check the docs, and comment for clarity." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:19 msgid "" "Casting with `as` is a relatively sharp tool that is easy to use " "incorrectly, and can be a source of subtle bugs as future maintenance work " @@ -6976,7 +6829,7 @@ msgid "" "was in the high bits)." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:25 msgid "" "For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " "over `as` to confirm that the cast is in fact infallible. For fallible " @@ -6984,238 +6837,227 @@ msgid "" "that fit differently from those that don't." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:33 msgid "Consider taking a break after this slide." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:35 msgid "" "`as` is similar to a C++ static cast. Use of `as` in cases where data might " "be lost is generally discouraged, or at least deserves an explanatory " "comment." msgstr "" -#: src/std-traits/casting.md +#: src/std-traits/casting.md:38 msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -#: src/std-traits/read-and-write.md -msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " -"abstract over `u8` sources:" +#: src/std-traits/read-and-write.md:3 +msgid "Using `Read` and `BufRead`, you can abstract over `u8` sources:" msgstr "" -#: src/std-traits/read-and-write.md +#: src/std-traits/read-and-write.md:14 msgid "b\"foo\\nbar\\nbaz\\n\"" msgstr "" -#: src/std-traits/read-and-write.md +#: src/std-traits/read-and-write.md:15 msgid "\"lines in slice: {}\"" msgstr "" -#: src/std-traits/read-and-write.md +#: src/std-traits/read-and-write.md:18 msgid "\"lines in file: {}\"" msgstr "" -#: src/std-traits/read-and-write.md -msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " -"you abstract over `u8` sinks:" +#: src/std-traits/read-and-write.md:23 +msgid "Similarly, `Write` lets you abstract over `u8` sinks:" msgstr "" -#: src/std-traits/read-and-write.md +#: src/std-traits/read-and-write.md:30 msgid "\"\\n\"" msgstr "" -#: src/std-traits/read-and-write.md src/slices-and-lifetimes/str.md -msgid "\"World\"" -msgstr "" - -#: src/std-traits/read-and-write.md +#: src/std-traits/read-and-write.md:37 msgid "\"Logged: {:?}\"" msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:1 msgid "The `Default` Trait" msgstr "" -#: src/std-traits/default.md -msgid "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " -"produces a default value for a type." +#: src/std-traits/default.md:3 +msgid "`Default` trait produces a default value for a type." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:18 msgid "\"John Smith\"" msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:24 msgid "\"{default_struct:#?}\"" msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:27 msgid "\"Y is set!\"" msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:28 msgid "\"{almost_default_struct:#?}\"" msgstr "" -#: src/std-traits/default.md src/slices-and-lifetimes/exercise.md -#: src/slices-and-lifetimes/solution.md +#: src/std-traits/default.md:31 src/lifetimes/exercise.md:211 +#: src/lifetimes/solution.md:214 msgid "\"{:#?}\"" msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:38 msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:39 msgid "" "A derived implementation will produce a value where all fields are set to " "their default values." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:41 msgid "This means all types in the struct must implement `Default` too." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:42 msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:44 msgid "The partial struct initialization works nicely with default." msgstr "" -#: src/std-traits/default.md +#: src/std-traits/default.md:45 msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -#: src/std-traits/default.md -msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" -"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" -"with-struct-update-syntax)." +#: src/std-traits/default.md:47 +msgid "The `..` syntax is called struct update syntax." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:3 msgid "" "Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"they implement special `Fn`, `FnMut`, and `FnOnce` traits:" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:10 #, fuzzy msgid "\"Calling function on {input}\"" msgstr "فراخوانی متدهای ناامن" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:16 src/std-traits/closures.md:17 msgid "\"add_3: {}\"" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:24 src/std-traits/closures.md:25 msgid "\"accumulate: {}\"" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:28 msgid "\"multiply_sum: {}\"" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:35 msgid "" "An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values, or " "perhaps captures nothing at all. It can be called multiple times " "concurrently." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:38 msgid "" "An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " "multiple times, but not concurrently." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:41 msgid "" "If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " "might consume captured values." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:44 msgid "" "`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " "I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " "use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:48 msgid "" "When you define a function that takes a closure, you should take `FnOnce` if " "you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " "the most flexibility for the caller." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:52 msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " "(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:55 msgid "" "The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " "`multiply_sum`), depending on what the closure captures." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:58 msgid "" "By default, closures will capture by reference if they can. The `move` " "keyword makes them capture by value." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/closures.md:63 src/smart-pointers/trait-objects.md:93 +#: src/smart-pointers/trait-objects.md:94 +msgid "\"{} {}\"" +msgstr "" + +#: src/std-traits/closures.md:67 msgid "\"Hi\"" msgstr "" -#: src/std-traits/closures.md -msgid "\"there\"" +#: src/std-traits/closures.md:68 +msgid "\"Greg\"" msgstr "" -#: src/std-traits/exercise.md +#: src/std-traits/exercise.md:3 msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://" -"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " -"implement the missing bits. Only rotate ASCII alphabetic characters, to " -"ensure the result is still valid UTF-8." +"In this example, you will implement the classic \"ROT13\" cipher. Copy this " +"code to the playground, and implement the missing bits. Only rotate ASCII " +"alphabetic characters, to ensure the result is still valid UTF-8." msgstr "" -#: src/std-traits/exercise.md -msgid "// Implement the `Read` trait for `RotDecoder`.\n" +#: src/std-traits/exercise.md:15 +msgid "// Implement the `Read` trait for `RotDecoder`." msgstr "" -#: src/std-traits/exercise.md src/std-traits/solution.md +#: src/std-traits/exercise.md:20 src/std-traits/exercise.md:33 +#: src/std-traits/solution.md:26 src/std-traits/solution.md:39 msgid "\"Gb trg gb gur bgure fvqr!\"" msgstr "" -#: src/std-traits/exercise.md src/std-traits/solution.md +#: src/std-traits/exercise.md:36 src/std-traits/solution.md:42 msgid "\"To get to the other side!\"" msgstr "" -#: src/std-traits/exercise.md +#: src/std-traits/exercise.md:55 msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" msgstr "" -#: src/std-traits/solution.md +#: src/std-traits/solution.md:16 msgid "'A'" msgstr "" @@ -7238,102 +7080,65 @@ msgid "Smart pointers: standard library pointer types." msgstr "" #: src/welcome-day-3.md -msgid "[Welcome](./welcome-day-3.md) (3 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Memory Management](./memory-management.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Smart Pointers](./smart-pointers.md) (45 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 15 " -"minutes" -msgstr "" - -#: src/memory-management.md -msgid "[Review of Program Memory](./memory-management/review.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md msgid "" -"[Approaches to Memory Management](./memory-management/approaches.md) (10 " -"minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Ownership](./memory-management/ownership.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Move Semantics](./memory-management/move.md) (10 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Clone](./memory-management/clone.md) (2 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Copy Types](./memory-management/copy-types.md) (5 minutes)" +"Including 10 minute breaks, this session should take about 2 hours and 20 " +"minutes. It contains:" msgstr "" -#: src/memory-management.md -msgid "[Drop](./memory-management/drop.md) (10 minutes)" +#: src/memory-management.md src/memory-management/clone.md:1 +msgid "Clone" msgstr "" #: src/memory-management.md -msgid "[Exercise: Builder Type](./memory-management/exercise.md) (20 minutes)" -msgstr "" +#, fuzzy +msgid "Drop" +msgstr "رها کردن" -#: src/memory-management/review.md +#: src/memory-management/review.md:3 msgid "Programs allocate memory in two ways:" msgstr "" -#: src/memory-management/review.md +#: src/memory-management/review.md:5 msgid "Stack: Continuous area of memory for local variables." msgstr "" "پشته: مقادیر پشت سر هم در حافظه که برای متغییر محلی (داخل یک تابع) استفاده " "میشود." -#: src/memory-management/review.md +#: src/memory-management/review.md:6 msgid "Values have fixed sizes known at compile time." msgstr "" "مقادیر دارای سایز یکسان در طول کل پشته هستند که در زمان کامپایل تعیین می‌شود." -#: src/memory-management/review.md +#: src/memory-management/review.md:7 msgid "Extremely fast: just move a stack pointer." msgstr "بسیار سریع: فقط کافیه یک اشاره‌گر را جا به جا کنیم." -#: src/memory-management/review.md +#: src/memory-management/review.md:8 msgid "Easy to manage: follows function calls." msgstr "مدیریت آسان: از فراخوانی توابع پیروی میکنند." -#: src/memory-management/review.md +#: src/memory-management/review.md:9 msgid "Great memory locality." msgstr "بهره‌وری عالی از حافظه" -#: src/memory-management/review.md +#: src/memory-management/review.md:11 msgid "Heap: Storage of values outside of function calls." msgstr "" "انباشت: حافظه از از مقادیر که خارج از جایی که فراخوانی میشود وجود دارد." -#: src/memory-management/review.md +#: src/memory-management/review.md:12 msgid "Values have dynamic sizes determined at runtime." msgstr "مقادیر سایز‌های مختلفی دارند که در زمان اجرا تعیین می‌شوند." -#: src/memory-management/review.md +#: src/memory-management/review.md:13 msgid "Slightly slower than the stack: some book-keeping needed." msgstr "به طور محسوسی کندتر از پشته است: نیاز به یک چی-کجاست دارد." -#: src/memory-management/review.md +#: src/memory-management/review.md:14 msgid "No guarantee of memory locality." msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه ندارد" -#: src/memory-management/review.md +#: src/memory-management/review.md:18 msgid "" "Creating a `String` puts fixed-sized metadata on the stack and dynamically " "sized data, the actual string, on the heap:" @@ -7341,7 +7146,7 @@ msgstr "" "یک `String` بسازید که متادیتا با سایزثابت را روی استک قرار دهد و متن اصلی " "سایزپویا را در انباشت قرار دهد." -#: src/memory-management/review.md +#: src/memory-management/review.md:44 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." @@ -7349,12 +7154,12 @@ msgstr "" "اشاره کنید که یک `String` بر پایه `Vec` است، بنابراین دارای ظرفیت و طول است " "و می تواند در صورت قابل تغییر بودن از طریق تخصیص مجدد در انباش بزرگتر کند." -#: src/memory-management/review.md +#: src/memory-management/review.md:47 +#, fuzzy msgid "" "If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" -"struct.System.html) and custom allocators can be implemented using the " -"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" +"allocated using the System Allocator and custom allocators can be " +"implemented using the Allocator API" msgstr "" "اگر دانشجویان در مورد آن بپرسند، می توانید اشاره کنید که حافظه زیربنایی " "انباشت (heap) است که با استفاده از [System Allocator](https://doc.rust-lang." @@ -7362,7 +7167,7 @@ msgstr "" "را می‌توان با استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/" "index.html) اجرا کرد." -#: src/memory-management/review.md +#: src/memory-management/review.md:53 msgid "" "We can inspect the memory layout with `unsafe` Rust. However, you should " "point out that this is rightfully unsafe!" @@ -7370,50 +7175,48 @@ msgstr "" "می‌توان با استفاده از `unsafe` در زبان راست چیدمان حافظه را بررسی کنیم. البته " "که به این موضوع که این کار خیلی ناایمن است هم اشاره کنید." -#: src/memory-management/review.md src/testing/unit-tests.md +#: src/memory-management/review.md:59 src/testing/unit-tests.md:15 msgid "' '" msgstr "" -#: src/memory-management/review.md +#: src/memory-management/review.md:60 msgid "\"world\"" msgstr "" -#: src/memory-management/review.md +#: src/memory-management/review.md:61 msgid "" -"// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" -" // undefined behavior.\n" +"// DON'T DO THIS AT HOME! For educational purposes only. // String provides " +"no guarantees about its layout, so this could lead to // undefined behavior." msgstr "" -#: src/memory-management/review.md -msgid "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" +#: src/memory-management/review.md:66 +msgid "\"capacity = {capacity}, ptr = {ptr:#x}, len = {len}\"" msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:3 msgid "Traditionally, languages have fallen into two broad categories:" msgstr "به طور سنتی، زبان‌ها به دو دسته کلی تقسیم می شوند:" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:5 msgid "Full control via manual memory management: C, C++, Pascal, ..." msgstr "" "کنترل کامل از طریق مدیریت دستی حافظه: C، C++ ، " "پاسکال، ..." -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:6 msgid "Programmer decides when to allocate or free heap memory." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:7 msgid "" "Programmer must determine whether a pointer still points to valid memory." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:8 msgid "Studies show, programmers make mistakes." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:9 msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." @@ -7421,45 +7224,45 @@ msgstr "" "ایمنی کامل از طریق مدیریت حافظه خودکار در زمان اجرا: جاوا، پایتون، Go، " "Haskell، ..." -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:11 msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:13 msgid "" "Typically implemented with reference counting, garbage collection, or RAII." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:15 msgid "Rust offers a new mix:" msgstr "زبان Rust یک ترکیبی از هر را ارائه میدهد:" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:17 msgid "" "Full control _and_ safety via compile time enforcement of correct memory " "management." msgstr "مدیریت کامل و ایمنی حافظه با مدیریت درست حافظه در زمان کامپایل" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:20 msgid "It does this with an explicit ownership concept." msgstr "این کار رو با کمک مفهوم مالکیت صریح انجام میدهد." -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:25 msgid "" "This slide is intended to help students coming from other languages to put " "Rust in context." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:28 msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " "forgetting to call `free`, calling it multiple times for the same pointer, " "or dereferencing a pointer after the memory it points to has been freed." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:32 msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " "advantage of language guarantees about calling destructors to ensure memory " @@ -7467,7 +7270,7 @@ msgid "" "tools and create similar bugs to C." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:37 msgid "" "Java, Go, and Python rely on the garbage collector to identify memory that " "is no longer reachable and discard it. This guarantees that any pointer can " @@ -7475,7 +7278,7 @@ msgid "" "GC has a runtime cost and is difficult to tune properly." msgstr "" -#: src/memory-management/approaches.md +#: src/memory-management/approaches.md:42 msgid "" "Rust's ownership and borrowing model can, in many cases, get the performance " "of C, with alloc and free operations precisely where they are required -- " @@ -7485,7 +7288,7 @@ msgid "" "(not covered in this class)." msgstr "" -#: src/memory-management/ownership.md +#: src/memory-management/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:" @@ -7493,91 +7296,87 @@ msgstr "" "همه انتساب متغیر دارای یک *اسکوپ* هستند که در آن معتبر هستند و استفاده از یک " "متغیر خارج از اسکوپ آن خطا است." -#: src/memory-management/ownership.md +#: src/memory-management/ownership.md:20 #, fuzzy msgid "" "We say that the variable _owns_ the value. Every Rust value has precisely " "one owner at all times." msgstr "ما می‌گوییم که متغیر *مالکیت* یک مقدار است." -#: src/memory-management/ownership.md +#: src/memory-management/ownership.md:23 #, fuzzy msgid "" "At the end of the scope, the variable is _dropped_ and the data is freed. A " "destructor can run here to free up resources." msgstr "در پایان اسکوپ، متغیر حذف می‌شود و داده‌ها آزاد می‌شوند." -#: src/memory-management/ownership.md +#: src/memory-management/ownership.md:29 msgid "" "Students familiar with garbage-collection implementations will know that a " "garbage collector starts with a set of \"roots\" to find all reachable " "memory. Rust's \"single owner\" principle is a similar idea." msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:3 msgid "An assignment will transfer _ownership_ between variables:" msgstr "انتساب, *مالکیت* را بین متغیرها منتقل می‌کند:" -#: src/memory-management/move.md +#: src/memory-management/move.md:7 #, fuzzy msgid "\"Hello!\"" msgstr "سلام دنیا" -#: src/memory-management/move.md src/slices-and-lifetimes/str.md -msgid "\"s2: {s2}\"" -msgstr "" - -#: src/memory-management/move.md -msgid "// println!(\"s1: {s1}\");\n" +#: src/memory-management/move.md:10 +msgid "// println!(\"s1: {s1}\");" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:14 msgid "The assignment of `s1` to `s2` transfers ownership." msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." -#: src/memory-management/move.md +#: src/memory-management/move.md:15 msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" "زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " "نیست." -#: src/memory-management/move.md +#: src/memory-management/move.md:16 msgid "When `s2` goes out of scope, the string data is freed." msgstr "زمانی که دیگر در اسکوپ `s2` نیستیم, داده‌های رشته آزاد می‌شوند." -#: src/memory-management/move.md +#: src/memory-management/move.md:18 msgid "Before move to `s2`:" msgstr "قبل از انتقال به `s2` :" -#: src/memory-management/move.md +#: src/memory-management/move.md:35 msgid "After move to `s2`:" msgstr "بعد از انتقال به `s2` :" -#: src/memory-management/move.md +#: src/memory-management/move.md:37 msgid "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n" -": : : :\n" -": s1 \"(inaccessible)\" : : :\n" -": +-----------+-------+ : : +----+----+----+----+ :\n" -": | ptr | o---+---+--+--+-->| R | u | s | t | :\n" -": | len | 4 | : | : +----+----+----+----+ :\n" -": | capacity | 4 | : | : :\n" -": +-----------+-------+ : | : :\n" -": : | `- - - - - - - - - - - - - -'\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - -.\n" +": : : :\n" +": s1 \"(inaccessible)\" : : :\n" +": +-----------+-------+ : : +----+----+----+----+----+----+ :\n" +": | ptr | o---+---+--+--+-->| H | e | l | l | o | ! | :\n" +": | len | 6 | : | : +----+----+----+----+----+----+ :\n" +": | capacity | 6 | : | : :\n" +": +-----------+-------+ : | : :\n" +": : | `- - - - - - - - - - - - - - - - - - -'\n" ": s2 : |\n" ": +-----------+-------+ : |\n" ": | ptr | o---+---+--'\n" -": | len | 4 | :\n" -": | capacity | 4 | :\n" +": | len | 6 | :\n" +": | capacity | 6 | :\n" ": +-----------+-------+ :\n" ": :\n" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:58 msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" @@ -7585,20 +7384,21 @@ msgstr "" "هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " "داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" -#: src/memory-management/move.md +#: src/memory-management/move.md:63 src/memory-management/clone.md:8 msgid "\"Hello {name}\"" msgstr "" -#: src/memory-management/move.md src/android/interoperability/java.md +#: src/memory-management/move.md:67 src/memory-management/clone.md:12 +#: src/android/interoperability/java.md:57 #, fuzzy msgid "\"Alice\"" msgstr "برش‌ها" -#: src/memory-management/move.md -msgid "// say_hello(name);\n" +#: src/memory-management/move.md:69 +msgid "// say_hello(name);" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:76 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!)." @@ -7607,7 +7407,7 @@ msgstr "" "است که در ان مقدار کپی میشود مگر که از `std::move` " "استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" -#: src/memory-management/move.md +#: src/memory-management/move.md:79 msgid "" "It is only the ownership that moves. Whether any machine code is generated " "to manipulate the data itself is a matter of optimization, and such copies " @@ -7617,22 +7417,22 @@ msgstr "" "خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " "به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." -#: src/memory-management/move.md +#: src/memory-management/move.md:83 msgid "" "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" "مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " "ببینید)." -#: src/memory-management/move.md +#: src/memory-management/move.md:85 msgid "In Rust, clones are explicit (by using `clone`)." msgstr "در Rust، کلون‌ها واضح بیان می‌شوند (با استفاده از `clone`)." -#: src/memory-management/move.md +#: src/memory-management/move.md:87 msgid "In the `say_hello` example:" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:89 msgid "" "With the first call to `say_hello`, `main` gives up ownership of `name`. " "Afterwards, `name` cannot be used anymore within `main`." @@ -7640,7 +7440,7 @@ msgstr "" "با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " "از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." -#: src/memory-management/move.md +#: src/memory-management/move.md:91 msgid "" "The heap memory allocated for `name` will be freed at the end of the " "`say_hello` function." @@ -7648,7 +7448,7 @@ msgstr "" "حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " "خواهد شد." -#: src/memory-management/move.md +#: src/memory-management/move.md:93 msgid "" "`main` can retain ownership if it passes `name` as a reference (`&name`) and " "if `say_hello` accepts a reference as a parameter." @@ -7657,7 +7457,7 @@ msgstr "" "(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " "را به عنوان پارامتر باید بپذیرد." -#: src/memory-management/move.md +#: src/memory-management/move.md:95 msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." @@ -7665,7 +7465,7 @@ msgstr "" "به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " "تابع ای که در نظر داریم (`name.clone()`) منتقل کند." -#: src/memory-management/move.md +#: src/memory-management/move.md:97 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." @@ -7674,44 +7474,44 @@ msgstr "" "زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " "هر جا که لازم هست به صورت صریح کلون را ایجاد کند." -#: src/memory-management/move.md +#: src/memory-management/move.md:102 msgid "Defensive Copies in Modern C++" msgstr "کپی‌های تدافعی در C++ مدرن" -#: src/memory-management/move.md +#: src/memory-management/move.md:104 msgid "Modern C++ solves this differently:" msgstr "C++ مدرن این مشکل را به شیوه متفاوتی حل می‌کند:" -#: src/memory-management/move.md +#: src/memory-management/move.md:107 msgid "\"Cpp\"" msgstr "" -#: src/memory-management/move.md -msgid "// Duplicate the data in s1.\n" +#: src/memory-management/move.md:108 +msgid "// Duplicate the data in s1." msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md:111 msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" "داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " "این کپی به صورت مستقل است." -#: src/memory-management/move.md +#: src/memory-management/move.md:112 msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" "حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " "جداگانه‌ای حافظه خود را آزاد میکنند." -#: src/memory-management/move.md +#: src/memory-management/move.md:114 msgid "Before copy-assignment:" msgstr "قبل از انتساب همراه کپی:" -#: src/memory-management/move.md +#: src/memory-management/move.md:130 msgid "After copy-assignment:" msgstr "بعد از انتساب همراه کپی:" -#: src/memory-management/move.md +#: src/memory-management/move.md:155 msgid "" "C++ has made a slightly different choice than Rust. Because `=` copies data, " "the string data has to be cloned. Otherwise we would get a double-free when " @@ -7722,13 +7522,13 @@ msgstr "" "این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " "آزادسازی مجدد حافظه رخ دهد." -#: src/memory-management/move.md +#: src/memory-management/move.md:159 +#, fuzzy msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " -"which is used to indicate when a value may be moved from. If the example had " -"been `s2 = std::move(s1)`, no heap allocation would take place. After the " -"move, `s1` would be in a valid but unspecified state. Unlike Rust, the " -"programmer is allowed to keep using `s1`." +"C++ also has `std::move`, which is used to indicate when a value may be " +"moved from. If the example had been `s2 = std::move(s1)`, no heap allocation " +"would take place. After the 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) است که برای انتقال " @@ -7737,7 +7537,7 @@ msgstr "" "نامشخص قرار میگرفت و برخلاف زبان Rust, توی زبان C++ " "برنامه‌نویس مجاز است که دوباره از `s1` استفاده کند." -#: src/memory-management/move.md +#: src/memory-management/move.md:164 msgid "" "Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " "which is being copied or moved." @@ -7745,59 +7545,66 @@ msgstr "" "بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " "انتقال دادن استفاده شود." -#: src/memory-management/clone.md -msgid "Clone" -msgstr "" - -#: src/memory-management/clone.md +#: src/memory-management/clone.md:3 msgid "" "Sometimes you _want_ to make a copy of a value. The `Clone` trait " "accomplishes this." msgstr "" -#: src/memory-management/clone.md +#: src/memory-management/clone.md:21 msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " -"occurring. Look for `.clone()` and a few others like `Vec::new` or `Box::" -"new`." +"occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -#: src/memory-management/clone.md +#: src/memory-management/clone.md:24 msgid "" "It's common to \"clone your way out\" of problems with the borrow checker, " "and return later to try to optimize those clones away." msgstr "" -#: src/memory-management/copy-types.md +#: src/memory-management/clone.md:27 +msgid "" +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." +msgstr "" + +#: src/memory-management/clone.md:30 +msgid "" +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." +msgstr "" + +#: src/memory-management/copy-types.md:3 msgid "" "While move semantics are the default, certain types are copied by default:" msgstr "" "در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " "صورت پیش‌فرض کپی می‌شوند:" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:16 msgid "These types implement the `Copy` trait." msgstr "این انواع‌داده ویژگی `Copy` را پیاده‌سازی کرده‌اند:" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:18 msgid "You can opt-in your own types to use copy semantics:" msgstr "البته که میتوان برای نوع‌هایی که میسازید هم مفهوم کپی را داشته باشید:" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:34 msgid "After the assignment, both `p1` and `p2` own their own data." msgstr "پس از انتساب، هر دو `p1` و `p2` داده‌های خود مستقل خود را دارند.‌" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:35 msgid "We can also use `p1.clone()` to explicitly copy the data." msgstr "" "همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها " "استفاده کنیم." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:40 msgid "Copying and cloning are not the same thing:" msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:42 msgid "" "Copying refers to bitwise copies of memory regions and does not work on " "arbitrary objects." @@ -7805,14 +7612,14 @@ msgstr "" "کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " "تعریف شده توسط شما کار نمی‌کند." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:44 msgid "" "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:45 msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." @@ -7820,16 +7627,16 @@ msgstr "" "کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " "رفتار سفارشی را فراهم می‌کند." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:47 msgid "Copying does not work on types that implement the `Drop` trait." msgstr "" "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:49 msgid "In the above example, try the following:" msgstr "در مثال بالا، موارد زیر را امتحان کنید:" -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:51 msgid "" "Add a `String` field to `struct Point`. It will not compile because `String` " "is not a `Copy` type." @@ -7837,7 +7644,7 @@ msgstr "" "یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " "یک نوع `Copy` نیست." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:53 #, fuzzy msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " @@ -7846,73 +7653,82 @@ msgstr "" "ویژگی `Copy` را از ویژگی‌های `derive` حذف کنید. خطای کامپایلر اکنون در `println!` برای `p1` است." -#: src/memory-management/copy-types.md +#: src/memory-management/copy-types.md:55 msgid "Show that it works if you clone `p1` instead." msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون کنید، کار می‌کند." -#: src/memory-management/drop.md +#: src/memory-management/copy-types.md:59 +msgid "" +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." +msgstr "" + +#: src/memory-management/drop.md:1 msgid "The `Drop` Trait" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:3 msgid "" -"Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." -"html) can specify code to run when they go out of scope:" +"Values which implement `Drop` can specify code to run when they go out of " +"scope:" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:13 msgid "\"Dropping {}\"" msgstr "" -#: src/memory-management/drop.md src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/memory-management/drop.md:18 +#: src/concurrency/sync-exercises/link-checker.md:85 +#: src/concurrency/sync-exercises/solutions.md:121 msgid "\"a\"" msgstr "" -#: src/memory-management/drop.md src/testing/googletest.md +#: src/memory-management/drop.md:20 src/android/testing/googletest.md:12 msgid "\"b\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:22 msgid "\"c\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:23 msgid "\"d\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:24 msgid "\"Exiting block B\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:26 msgid "\"Exiting block A\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:29 msgid "\"Exiting main\"" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:36 msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:37 msgid "Values are automatically dropped when they go out of scope." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:38 msgid "" "When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" "drop` implementation will be called." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:40 msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:41 msgid "" "`std::mem::drop` is just an empty function that takes any value. The " "significance is that it takes ownership of the value, so at the end of its " @@ -7920,183 +7736,172 @@ msgid "" "values earlier than they would otherwise go out of scope." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:45 msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:50 msgid "Why doesn't `Drop::drop` take `self`?" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:51 msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -#: src/memory-management/drop.md +#: src/memory-management/drop.md:53 msgid "Try replacing `drop(a)` with `a.drop()`." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:3 msgid "" "In this example, we will implement a complex data type that owns all of its " "data. We will use the \"builder pattern\" to support building a new value " "piece-by-piece, using convenience functions." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:7 msgid "Fill in the missing pieces." msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// A representation of a software package.\n" +#: src/memory-management/exercise.md:22 src/memory-management/solution.md:16 +msgid "/// A representation of a software package." msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:34 src/memory-management/solution.md:28 msgid "" -"/// Return a representation of this package as a dependency, for use in\n" -" /// building other packages.\n" +"/// Return a representation of this package as a dependency, for use in /// " +"building other packages." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:37 msgid "\"1\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:40 src/memory-management/solution.md:37 msgid "" -"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +"/// A builder for a Package. Use `build()` to create the `Package` itself." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:46 msgid "\"2\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// Set the package version.\n" +#: src/memory-management/exercise.md:49 src/memory-management/solution.md:52 +msgid "/// Set the package version." msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// Set the package authors.\n" +#: src/memory-management/exercise.md:55 src/memory-management/solution.md:58 +msgid "/// Set the package authors." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:57 msgid "\"3\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// Add an additional dependency.\n" +#: src/memory-management/exercise.md:60 src/memory-management/solution.md:64 +msgid "/// Add an additional dependency." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:62 msgid "\"4\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// Set the language. If not set, language defaults to None.\n" +#: src/memory-management/exercise.md:65 src/memory-management/solution.md:70 +msgid "/// Set the language. If not set, language defaults to None." msgstr "" -#: src/memory-management/exercise.md +#: src/memory-management/exercise.md:67 msgid "\"5\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:76 src/memory-management/solution.md:82 msgid "\"base64\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:76 src/memory-management/solution.md:82 msgid "\"0.13\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:77 src/memory-management/solution.md:83 msgid "\"base64: {base64:?}\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:79 src/memory-management/solution.md:85 msgid "\"log\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:79 src/memory-management/solution.md:85 msgid "\"0.4\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:80 src/memory-management/solution.md:86 msgid "\"log: {log:?}\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:81 src/memory-management/solution.md:87 msgid "\"serde\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:82 src/memory-management/solution.md:88 msgid "\"djmitche\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:83 src/memory-management/solution.md:89 msgid "\"4.0\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md +#: src/memory-management/exercise.md:87 src/memory-management/solution.md:93 msgid "\"serde: {serde:?}\"" msgstr "" -#: src/memory-management/solution.md +#: src/memory-management/solution.md:45 msgid "\"0.1\"" msgstr "" #: src/smart-pointers.md -msgid "[Box" -msgstr "" - -#: src/smart-pointers.md -msgid "](./smart-pointers/box.md) (10 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Rc](./smart-pointers/rc.md) (5 minutes)" +msgid "Box" msgstr "" #: src/smart-pointers.md -msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" -msgstr "" +msgid "Rc" +msgstr "Rc" -#: src/smart-pointers/box.md -msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " -"pointer to data on the heap:" +#: src/smart-pointers/box.md:3 +msgid "`Box` is an owned pointer to data on the heap:" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:9 msgid "\"five: {}\"" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:26 msgid "" -"`Box` implements `Deref`, which means that you can [call " -"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" -"trait.Deref.html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can call " +"methods from `T` directly on a `Box`." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:30 msgid "" "Recursive data types or data types with dynamic sizes need to use a `Box`:" msgstr "" -#: src/smart-pointers/box.md -msgid "/// A non-empty list: first element and the rest of the list.\n" +#: src/smart-pointers/box.md:35 +msgid "/// A non-empty list: first element and the rest of the list." msgstr "" -#: src/smart-pointers/box.md -msgid "/// An empty list.\n" +#: src/smart-pointers/box.md:37 +msgid "/// An empty list." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:44 msgid "\"{list:?}\"" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:48 msgid "" "```bob\n" " Stack Heap\n" @@ -8118,137 +7923,253 @@ msgid "" "```" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:64 msgid "" "`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " "not null." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:66 msgid "A `Box` can be useful when you:" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:67 msgid "" "have a type whose size that can't be known at compile time, but the Rust " "compiler wants to know an exact size." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:69 msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " "amounts of data on the stack, instead store the data on the heap in a `Box` " "so only the pointer is moved." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:73 msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not compute a fixed size of the struct in memory " -"(`List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the " +"struct in memory (the `List` would be of infinite size)." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:77 msgid "" "`Box` solves this problem as it has the same size as a regular pointer and " "just points at the next element of the `List` in the heap." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:80 msgid "" -"Remove the `Box` in the List definition and show the compiler error. " -"\"Recursive with indirection\" is a hint you might want to use a Box or " -"reference of some kind, instead of storing a value directly." +"Remove the `Box` in the List definition and show the compiler error. We get " +"the message \"recursive without indirection\", because for data recursion, " +"we have to use indirection, a `Box` or reference of some kind, instead of " +"storing the value directly." msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:87 msgid "Niche Optimization" msgstr "بهینه سازی Niche" -#: src/smart-pointers/box.md +#: src/smart-pointers/box.md:89 +msgid "" +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " +"This makes `Box` one of the types that allow the compiler to optimize " +"storage of some enums." +msgstr "" + +#: src/smart-pointers/box.md:93 +msgid "" +"For example, `Option>` has the same size, as just `Box`, because " +"compiler uses NULL-value to discriminate variants instead of using explicit " +"tag (\"Null Pointer Optimization\"):" +msgstr "" + +#: src/smart-pointers/box.md:103 +msgid "\"Just box\"" +msgstr "" + +#: src/smart-pointers/box.md:105 +#, fuzzy +msgid "\"Optional box\"" +msgstr "استثناها" + +#: src/smart-pointers/box.md:111 +msgid "\"Size of just_box: {}\"" +msgstr "" + +#: src/smart-pointers/box.md:112 +msgid "\"Size of optional_box: {}\"" +msgstr "" + +#: src/smart-pointers/box.md:113 +msgid "\"Size of none: {}\"" +msgstr "" + +#: src/smart-pointers/rc.md:3 +msgid "" +"`Rc` is a reference-counted shared pointer. Use this when you need to refer " +"to the same data from multiple places:" +msgstr "" + +#: src/smart-pointers/rc.md:13 +msgid "\"a: {a}\"" +msgstr "" + +#: src/smart-pointers/rc.md:14 +msgid "\"b: {b}\"" +msgstr "" + +#: src/smart-pointers/rc.md:18 +msgid "See `Arc` and `Mutex` if you are in a multi-threaded context." +msgstr "" + +#: src/smart-pointers/rc.md:19 +msgid "" +"You can _downgrade_ a shared pointer into a `Weak` pointer to create cycles " +"that will get dropped." +msgstr "" + +#: src/smart-pointers/rc.md:30 +msgid "" +"`Rc`'s count ensures that its contained value is valid for as long as there " +"are references." +msgstr "" + +#: src/smart-pointers/rc.md:32 +msgid "`Rc` in Rust is like `std::shared_ptr` in C++." +msgstr "" + +#: src/smart-pointers/rc.md:33 +msgid "" +"`Rc::clone` is cheap: it creates a pointer to the same allocation and " +"increases the reference count. Does not make a deep clone and can generally " +"be ignored when looking for performance issues in code." +msgstr "" + +#: src/smart-pointers/rc.md:36 +msgid "" +"`make_mut` actually clones the inner value if necessary (\"clone-on-write\") " +"and returns a mutable reference." +msgstr "" + +#: src/smart-pointers/rc.md:38 +msgid "Use `Rc::strong_count` to check the reference count." +msgstr "" + +#: src/smart-pointers/rc.md:39 +msgid "" +"`Rc::downgrade` gives you a _weakly reference-counted_ object to create " +"cycles that will be dropped properly (likely in combination with `RefCell`)." +msgstr "" + +#: src/smart-pointers/trait-objects.md:3 msgid "" -"A `Box` cannot be empty, so the pointer is always valid and non-`null`. This " -"allows the compiler to optimize the memory layout:" +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." +msgstr "" + +#: src/smart-pointers/trait-objects.md:43 +msgid "Memory layout after allocating `pets`:" msgstr "" -#: src/smart-pointers/box.md +#: src/smart-pointers/trait-objects.md:45 msgid "" "```bob\n" -" Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - -.\n" -": : : :\n" -": list : : :\n" -": +---------+----+----+ : : +---------+----+----+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | // | :\n" -": +---------+----+----+ : : +---------+----+----+ :\n" -": : : :\n" -": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - -'\n" +" Stack Heap\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " +"- -.\n" +": : : :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" +": | len | 2 | : | : +-------+-------+ " +"^ :\n" +": | capacity | 2 | : | : ^ " +"| :\n" +": +-----------+-------+ : | : | " +"'-------. :\n" +": : | : | data:" +"\"Dog\"| :\n" +": : | : | +-------+--|-------" +"+ :\n" +"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " +"| :\n" +" `--+-->| o o | o o-|----->| age | 5 " +"| :\n" +" : +-|---+-|---+ +-------+----------" +"+ :\n" +" : | " +"| :\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" +" | |\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" +" : | | " +"vtable :\n" +" : | | +----------------------" +"+ :\n" +" : | `----->| \"::" +"talk\" | :\n" +" : | +----------------------" +"+ :\n" +" : | " +"vtable :\n" +" : | +----------------------" +"+ :\n" +" : '----------->| \"::" +"talk\" | :\n" +" : +----------------------" +"+ :\n" +" : :\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" -#: src/smart-pointers/rc.md -msgid "" -"[`Rc`](https://doc.rust-lang.org/std/rc/struct.Rc.html) is a reference-" -"counted shared pointer. Use this when you need to refer to the same data " -"from multiple places:" -msgstr "" - -#: src/smart-pointers/rc.md -msgid "\"a: {a}\"" -msgstr "" - -#: src/smart-pointers/rc.md -msgid "\"b: {b}\"" -msgstr "" - -#: src/smart-pointers/rc.md +#: src/smart-pointers/trait-objects.md:80 msgid "" -"See [`Arc`](../concurrency/shared_state/arc.md) and [`Mutex`](https://doc." -"rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " -"context." +"Types that implement a given trait may be of different sizes. This makes it " +"impossible to have things like `Vec` in the example above." msgstr "" -#: src/smart-pointers/rc.md +#: src/smart-pointers/trait-objects.md:82 msgid "" -"You can _downgrade_ a shared pointer into a [`Weak`](https://doc.rust-lang." -"org/std/rc/struct.Weak.html) pointer to create cycles that will get dropped." +"`dyn Pet` is a way to tell the compiler about a dynamically sized type that " +"implements `Pet`." msgstr "" -#: src/smart-pointers/rc.md +#: src/smart-pointers/trait-objects.md:84 msgid "" -"`Rc`'s count ensures that its contained value is valid for as long as there " -"are references." -msgstr "" - -#: src/smart-pointers/rc.md -msgid "`Rc` in Rust is like `std::shared_ptr` in C++." +"In the example, `pets` is allocated on the stack and the vector data is on " +"the heap. The two vector elements are _fat pointers_:" msgstr "" -#: src/smart-pointers/rc.md +#: src/smart-pointers/trait-objects.md:86 msgid "" -"`Rc::clone` is cheap: it creates a pointer to the same allocation and " -"increases the reference count. Does not make a deep clone and can generally " -"be ignored when looking for performance issues in code." +"A fat pointer is a double-width pointer. It has two components: a pointer to " +"the actual object and a pointer to the virtual method table (vtable) for the " +"`Pet` implementation of that particular object." msgstr "" -#: src/smart-pointers/rc.md +#: src/smart-pointers/trait-objects.md:89 msgid "" -"`make_mut` actually clones the inner value if necessary (\"clone-on-write\") " -"and returns a mutable reference." -msgstr "" - -#: src/smart-pointers/rc.md -msgid "Use `Rc::strong_count` to check the reference count." +"The data for the `Dog` named Fido is the `name` and `age` fields. The `Cat` " +"has a `lives` field." msgstr "" -#: src/smart-pointers/rc.md -msgid "" -"`Rc::downgrade` gives you a _weakly reference-counted_ object to create " -"cycles that will be dropped properly (likely in combination with `RefCell`)." +#: src/smart-pointers/trait-objects.md:91 +msgid "Compare these outputs in the above example:" msgstr "" -#: src/smart-pointers/exercise.md +#: src/smart-pointers/exercise.md:3 msgid "" "A binary tree is a tree-type data structure where every node has two " "children (left and right). We will create a tree where each node stores a " @@ -8256,161 +8177,136 @@ msgid "" "values, and all nodes in N's right subtree will contain larger values." msgstr "" -#: src/smart-pointers/exercise.md +#: src/smart-pointers/exercise.md:8 msgid "Implement the following types, so that the given tests pass." msgstr "" -#: src/smart-pointers/exercise.md +#: src/smart-pointers/exercise.md:10 msgid "" "Extra Credit: implement an iterator over a binary tree that returns the " "values in order." msgstr "" -#: src/smart-pointers/exercise.md src/smart-pointers/solution.md -msgid "/// A node in the binary tree.\n" +#: src/smart-pointers/exercise.md:14 src/smart-pointers/solution.md:5 +msgid "/// A node in the binary tree." msgstr "" -#: src/smart-pointers/exercise.md src/smart-pointers/solution.md -msgid "/// A possibly-empty subtree.\n" +#: src/smart-pointers/exercise.md:21 src/smart-pointers/solution.md:13 +msgid "/// A possibly-empty subtree." msgstr "" -#: src/smart-pointers/exercise.md src/smart-pointers/solution.md +#: src/smart-pointers/exercise.md:25 src/smart-pointers/solution.md:17 msgid "" -"/// A container storing a set of values, using a binary tree.\n" -"///\n" -"/// If the same value is added multiple times, it is only stored once.\n" +"/// A container storing a set of values, using a binary tree. /// /// If the " +"same value is added multiple times, it is only stored once." msgstr "" -#: src/smart-pointers/exercise.md -msgid "// Implement `new`, `insert`, `len`, and `has`.\n" +#: src/smart-pointers/exercise.md:51 +msgid "// Implement `new`, `insert`, `len`, and `has` for `Subtree`." msgstr "" -#: src/smart-pointers/exercise.md src/smart-pointers/solution.md -msgid "// not a unique item\n" +#: src/smart-pointers/exercise.md:66 src/smart-pointers/solution.md:105 +msgid "// not a unique item" msgstr "" -#: src/smart-pointers/solution.md src/testing/googletest.md +#: src/smart-pointers/solution.md:89 src/android/testing/googletest.md:11 msgid "\"bar\"" msgstr "" -#: src/welcome-day-3-afternoon.md -msgid "[Borrowing](./borrowing.md) (1 hour)" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "" -"[Slices and Lifetimes](./slices-and-lifetimes.md) (1 hour and 10 minutes)" -msgstr "" - #: src/welcome-day-3-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 20 " -"minutes" -msgstr "" - -#: src/borrowing.md -msgid "[Borrowing a Value](./borrowing/shared.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Borrow Checking](./borrowing/borrowck.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Interior Mutability](./borrowing/interior-mutability.md) (10 minutes)" +"Including 10 minute breaks, this session should take about 1 hour and 55 " +"minutes. It contains:" msgstr "" -#: src/borrowing.md -msgid "[Exercise: Health Statistics](./borrowing/exercise.md) (30 minutes)" -msgstr "" - -#: src/borrowing/shared.md +#: src/borrowing/shared.md:3 msgid "" "As we saw before, instead of transferring ownership when calling a function, " "you can let a function _borrow_ the value:" msgstr "" -#: src/borrowing/shared.md +#: src/borrowing/shared.md:24 msgid "The `add` function _borrows_ two points and returns a new point." msgstr "" -#: src/borrowing/shared.md +#: src/borrowing/shared.md:25 msgid "The caller retains ownership of the inputs." msgstr "" -#: src/borrowing/shared.md +#: src/borrowing/shared.md:30 msgid "" "This slide is a review of the material on references from day 1, expanding " "slightly to include function arguments and return values." msgstr "" -#: src/borrowing/shared.md -msgid "Notes on stack returns:" +#: src/borrowing/shared.md:35 +msgid "Notes on stack returns and inlining:" msgstr "" -#: src/borrowing/shared.md +#: src/borrowing/shared.md:37 msgid "" "Demonstrate that the return from `add` is cheap because the compiler can " -"eliminate the copy operation. Change the above code to print stack addresses " -"and run it on the [Playground](https://play.rust-lang.org/?" -"version=stable&mode=release&edition=2021&gist=0cb13be1c05d7e3446686ad9947c4671) " -"or look at the assembly in [Godbolt](https://rust.godbolt.org/). In the " -"\"DEBUG\" optimization level, the addresses should change, while they stay " -"the same when changing to the \"RELEASE\" setting:" +"eliminate the copy operation, by inlining the call to add into main. Change " +"the above code to print stack addresses and run it on the Playground or look " +"at the assembly in Godbolt. In the \"DEBUG\" optimization level, the " +"addresses should change, while they stay the same when changing to the " +"\"RELEASE\" setting:" msgstr "" -#: src/borrowing/shared.md -msgid "The Rust compiler can do return value optimization (RVO)." +#: src/borrowing/shared.md:63 +msgid "" +"The Rust compiler can do automatic inlining, that can be disabled on a " +"function level with `#[inline(never)]`." msgstr "" -#: src/borrowing/shared.md +#: src/borrowing/shared.md:65 msgid "" -"In C++, copy elision has to be defined in the language specification because " -"constructors can have side effects. In Rust, this is not an issue at all. If " -"RVO did not happen, Rust will always perform a simple and efficient `memcpy` " -"copy." +"Once disabled, the printed address will change on all optimization levels. " +"Looking at Godbolt or Playground, one can see that in this case, the return " +"of the value depends on the ABI, e.g. on amd64 the two i32 that is making up " +"the point will be returned in 2 registers (eax and edx)." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:3 msgid "" "Rust's _borrow checker_ puts constraints on the ways you can borrow values. " "For a given value, at any time:" msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:6 msgid "You can have one or more shared references to the value, _or_" msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:7 msgid "You can have exactly one exclusive reference to the value." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:29 msgid "" "Note that the requirement is that conflicting references not _exist_ at the " "same point. It does not matter where the reference is dereferenced." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:31 msgid "" "The above code does not compile because `a` is borrowed as mutable (through " "`c`) and as immutable (through `b`) at the same time." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:33 msgid "" "Move the `println!` statement for `b` before the scope that introduces `c` " "to make the code compile." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:35 msgid "" "After that change, the compiler realizes that `b` is only ever used before " "the new mutable borrow of `a` through `c`. This is a feature of the borrow " "checker called \"non-lexical lifetimes\"." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:38 msgid "" "The exclusive reference constraint is quite strong. Rust uses it to ensure " "that data races do not occur. Rust also _relies_ on this constraint to " @@ -8418,7 +8314,7 @@ msgid "" "cached in a register for the lifetime of that reference." msgstr "" -#: src/borrowing/borrowck.md +#: src/borrowing/borrowck.md:42 msgid "" "The borrow checker is designed to accommodate many common patterns, such as " "taking exclusive references to different fields in a struct at the same " @@ -8426,51 +8322,80 @@ msgid "" "this often results in \"fighting with the borrow checker.\"" msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/examples.md:3 +msgid "" +"As a concrete example of how these borrowing rules prevent memory errors, " +"consider the case of modifying a collection while there are references to " +"its elements:" +msgstr "" + +#: src/borrowing/examples.md:12 +msgid "\"{elem}\"" +msgstr "" + +#: src/borrowing/examples.md:16 +msgid "Similarly, consider the case of iterator invalidation:" +msgstr "" + +#: src/borrowing/examples.md:30 +msgid "" +"In both of these cases, modifying the collection by pushing new elements " +"into it can potentially invalidate existing references to the collection's " +"elements if the collection has to reallocate." +msgstr "" + +#: src/borrowing/interior-mutability.md:3 msgid "" "In some situations, it's necessary to modify data behind a shared (read-" "only) reference. For example, a shared data structure might have an internal " "cache, and wish to update that cache from read-only methods." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:7 msgid "" "The \"interior mutability\" pattern allows exclusive (mutable) access behind " "a shared reference. The standard library provides several ways to do this, " "all while still ensuring safety, typically by performing a runtime check." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:11 msgid "`RefCell`" msgstr "" -#: src/borrowing/interior-mutability.md -msgid "\"graph: {root:#?}\"" +#: src/borrowing/interior-mutability.md:17 +#: src/borrowing/interior-mutability.md:43 +msgid "// Note that `cell` is NOT declared as mutable." +msgstr "" + +#: src/borrowing/interior-mutability.md:24 +msgid "" +"// This triggers an error at runtime. // let other = cell.borrow(); // " +"println!(\"{}\", \\*other);" msgstr "" -#: src/borrowing/interior-mutability.md -msgid "\"graph sum: {}\"" +#: src/borrowing/interior-mutability.md:29 +msgid "\"{cell:?}\"" msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:33 msgid "`Cell`" msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:35 msgid "" "`Cell` wraps a value and allows getting or setting the value, even with a " "shared reference to the `Cell`. However, it does not allow any references to " "the value. Since there are no references, borrowing rules cannot be broken." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:54 msgid "" "The main thing to take away from this slide is that Rust provides _safe_ " "ways to modify data behind a shared reference. There are a variety of ways " "to ensure that safety, and `RefCell` and `Cell` are two of them." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:58 msgid "" "`RefCell` enforces Rust's usual borrowing rules (either multiple shared " "references or a single exclusive reference) with a runtime check. In this " @@ -8478,3449 +8403,3578 @@ msgid "" "succeed." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:63 msgid "" -"`Rc` only allows shared (read-only) access to its contents, since its " -"purpose is to allow (and count) many references. But we want to modify the " -"value, so we need interior mutability." +"The extra block in the `RefCell` example is to end the borrow created by the " +"call to `borrow_mut` before we print the cell. Trying to print a borrowed " +"`RefCell` just shows the message `\"{borrowed}\"`." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability.md:67 msgid "" "`Cell` is a simpler means to ensure safety: it has a `set` method that takes " "`&self`. This needs no runtime check, but requires moving values, which can " "have its own cost." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/exercise.md:3 +msgid "" +"You're working on implementing a health-monitoring system. As part of that, " +"you need to keep track of users' health statistics." +msgstr "" + +#: src/borrowing/exercise.md:6 +msgid "" +"You'll start with a stubbed function in an `impl` block as well as a `User` " +"struct definition. Your goal is to implement the stubbed out method on the " +"`User` `struct` defined in the `impl` block." +msgstr "" + +#: src/borrowing/exercise.md:10 +#, fuzzy +msgid "" +"Copy the code below to https://play.rust-lang.org/ and fill in the missing " +"method:" +msgstr "" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" + +#: src/borrowing/exercise.md:45 +msgid "" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" +msgstr "" + +#: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 +#: src/borrowing/exercise.md:60 src/borrowing/solution.md:52 +#: src/borrowing/solution.md:58 src/borrowing/solution.md:62 +#: src/android/build-rules/library.md:44 +#: src/android/aidl/example-service/client.md:15 +msgid "\"Bob\"" +msgstr "" + +#: src/borrowing/exercise.md:51 src/borrowing/solution.md:53 +msgid "\"I'm {} and my age is {}\"" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:3 +msgid "" +"A reference has a _lifetime_, which must not \"outlive\" the value it refers " +"to. This is verified by the borrow checker." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:6 +msgid "" +"The lifetime can be implicit - this is what we have seen so far. Lifetimes " +"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " +"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " +"`Point` which is valid for at least the lifetime `a`\"." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:11 +msgid "" +"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " +"yourself. Explicit lifetime annotations create constraints where there is " +"ambiguity; the compiler verifies that there is a valid solution." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:15 +msgid "" +"Lifetimes become more complicated when considering passing values to and " +"returning values from functions." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:36 +msgid "// What is the lifetime of p3?" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:37 +msgid "\"p3: {p3:?}\"" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:44 +msgid "" +"In this example, the compiler does not know what lifetime to infer for `p3`. " +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:50 +msgid "Add `'a` appropriately to `left_most`:" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:56 +msgid "" +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " +"for at least `'a`." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:59 +msgid "" +"In common cases, lifetimes can be elided, as described on the next slide." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:1 +msgid "Lifetimes in Function Calls" +msgstr "طول عمر در فراخوانی‌ توابع" + +#: src/lifetimes/lifetime-elision.md:3 +msgid "" +"Lifetimes for function arguments and return values must be fully specified, " +"but Rust allows lifetimes to be elided in most cases with a few simple " +"rules. This is not inference -- it is just a syntactic shorthand." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:8 +msgid "Each argument which does not have a lifetime annotation is given one." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:9 +msgid "" +"If there is only one argument lifetime, it is given to all un-annotated " +"return values." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:11 +msgid "" +"If there are multiple argument lifetimes, but the first one is for `self`, " +"that lifetime is given to all un-annotated return values." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:53 +msgid "In this example, `cab_distance` is trivially elided." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:55 +msgid "" +"The `nearest` function provides another example of a function with multiple " +"references in its arguments that requires explicit annotation." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:58 +msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" +msgstr "" + +#: src/lifetimes/lifetime-elision.md:64 +msgid "" +"This won't compile, demonstrating that the annotations are checked for " +"validity by the compiler. Note that this is not the case for raw pointers " +"(unsafe), and this is a common source of errors with unsafe Rust." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:68 +msgid "" +"Students may ask when to use lifetimes. Rust borrows _always_ have " +"lifetimes. Most of the time, elision and type inference mean these don't " +"need to be written out. In more complicated cases, lifetime annotations can " +"help resolve ambiguity. Often, especially when prototyping, it's easier to " +"just work with owned data by cloning values where necessary." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:1 +msgid "Lifetimes in Data Structures" +msgstr "طول عمر در ساختمان داده" + +#: src/lifetimes/struct-lifetimes.md:3 +msgid "" +"If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:10 +msgid "\"Bye {text}!\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:14 +msgid "\"The quick brown fox jumps over the lazy dog.\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:17 +msgid "// erase(text);" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:18 +msgid "\"{fox:?}\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:19 +msgid "\"{dog:?}\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:26 +msgid "" +"In the above example, the annotation on `Highlight` enforces that the data " +"underlying the contained `&str` lives at least as long as any instance of " +"`Highlight` that uses that data." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:29 +msgid "" +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " +"the borrow checker throws an error." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:31 +msgid "" +"Types with borrowed data force users to hold on to the original data. This " +"can be useful for creating lightweight views, but it generally makes them " +"somewhat harder to use." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:34 +msgid "When possible, make data structures own their data directly." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:35 +msgid "" +"Some structs with multiple references inside can have more than one lifetime " +"annotation. This can be necessary if there is a need to describe lifetime " +"relationships between the references themselves, in addition to the lifetime " +"of the struct itself. Those are very advanced use cases." +msgstr "" + +#: src/lifetimes/exercise.md:3 +msgid "" +"In this exercise, you will build a parser for the protobuf binary encoding. " +"Don't worry, it's simpler than it seems! This illustrates a common parsing " +"pattern, passing slices of data. The underlying data itself is never copied." +msgstr "" + +#: src/lifetimes/exercise.md:8 +msgid "" +"Fully parsing a protobuf message requires knowing the types of the fields, " +"indexed by their field numbers. That is typically provided in a `proto` " +"file. In this exercise, we'll encode that information into `match` " +"statements in functions that get called for each field." +msgstr "" + +#: src/lifetimes/exercise.md:13 +msgid "We'll use the following proto:" +msgstr "" + +#: src/lifetimes/exercise.md:28 +msgid "" +"A proto message is encoded as a series of fields, one after the next. Each " +"is implemented as a \"tag\" followed by the value. The tag contains a field " +"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " +"defining how the payload should be determined from the byte stream." +msgstr "" + +#: src/lifetimes/exercise.md:33 msgid "" -"Demonstrate that reference loops can be created by adding `root` to `subtree." -"children`." +"Integers, including the tag, are represented with a variable-length encoding " +"called VARINT. Luckily, `parse_varint` is defined for you below. The given " +"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " +"to parse a message into a series of calls to those callbacks." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/lifetimes/exercise.md:38 msgid "" -"To demonstrate a runtime panic, add a `fn inc(&mut self)` that increments " -"`self.value` and calls the same method on its children. This will panic in " -"the presence of the reference loop, with `thread 'main' panicked at 'already " -"borrowed: BorrowMutError'`." +"What remains for you is to implement the `parse_field` function and the " +"`ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" -#: src/borrowing/exercise.md -msgid "" -"You're working on implementing a health-monitoring system. As part of that, " -"you need to keep track of users' health statistics." +#: src/lifetimes/exercise.md:49 src/lifetimes/solution.md:11 +msgid "\"Invalid varint\"" msgstr "" -#: src/borrowing/exercise.md -msgid "" -"You'll start with a stubbed function in an `impl` block as well as a `User` " -"struct definition. Your goal is to implement the stubbed out method on the " -"`User` `struct` defined in the `impl` block." +#: src/lifetimes/exercise.md:51 src/lifetimes/solution.md:13 +msgid "\"Invalid wire-type\"" msgstr "" -#: src/borrowing/exercise.md -#, fuzzy -msgid "" -"Copy the code below to and fill in the missing " -"method:" +#: src/lifetimes/exercise.md:53 src/lifetimes/solution.md:15 +msgid "\"Unexpected EOF\"" msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" -#: src/borrowing/exercise.md -msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +#: src/lifetimes/exercise.md:55 src/lifetimes/solution.md:17 +msgid "\"Invalid length\"" msgstr "" -#: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md src/android/aidl/client.md -msgid "\"Bob\"" +#: src/lifetimes/exercise.md:57 src/lifetimes/solution.md:19 +msgid "\"Unexpected wire-type)\"" msgstr "" -#: src/borrowing/exercise.md src/borrowing/solution.md -msgid "\"I'm {} and my age is {}\"" +#: src/lifetimes/exercise.md:59 src/lifetimes/solution.md:21 +msgid "\"Invalid string (not UTF-8)\"" msgstr "" -#: src/slices-and-lifetimes.md -msgid "[Slices: &\\[T\\]](./slices-and-lifetimes/slices.md) (10 minutes)" +#: src/lifetimes/exercise.md:62 src/lifetimes/solution.md:24 +msgid "/// A wire type as seen on the wire." msgstr "" -#: src/slices-and-lifetimes.md -msgid "[String References](./slices-and-lifetimes/str.md) (10 minutes)" +#: src/lifetimes/exercise.md:65 src/lifetimes/solution.md:27 +msgid "/// The Varint WireType indicates the value is a single VARINT." msgstr "" -#: src/slices-and-lifetimes.md +#: src/lifetimes/exercise.md:67 src/lifetimes/solution.md:29 msgid "" -"[Lifetime Annotations](./slices-and-lifetimes/lifetime-annotations.md) (10 " -"minutes)" +"//I64, -- not needed for this exercise /// The Len WireType indicates that " +"the value is a length represented as a /// VARINT followed by exactly that " +"number of bytes." msgstr "" -#: src/slices-and-lifetimes.md +#: src/lifetimes/exercise.md:71 src/lifetimes/solution.md:33 msgid "" -"[Lifetime Elision](./slices-and-lifetimes/lifetime-elision.md) (5 minutes)" +"/// The I32 WireType indicates that the value is precisely 4 bytes in /// " +"little-endian order containing a 32-bit signed integer." msgstr "" -#: src/slices-and-lifetimes.md -msgid "" -"[Struct Lifetimes](./slices-and-lifetimes/struct-lifetimes.md) (5 minutes)" +#: src/lifetimes/exercise.md:76 src/lifetimes/solution.md:38 +msgid "/// A field's value, typed based on the wire type." msgstr "" -#: src/slices-and-lifetimes.md -msgid "" -"[Exercise: Protobuf Parsing](./slices-and-lifetimes/exercise.md) (30 minutes)" +#: src/lifetimes/exercise.md:80 src/lifetimes/solution.md:42 +msgid "//I64(i64), -- not needed for this exercise" msgstr "" -#: src/slices-and-lifetimes/slices.md -msgid "Slices" -msgstr "برش‌ها" - -#: src/slices-and-lifetimes/slices.md -msgid "A slice gives you a view into a larger collection:" -msgstr "یک برش به شما امکان می‌دهد نما (view) از یک مجموعه بزرگتر داشته باشید:" - -#: src/slices-and-lifetimes/slices.md -msgid "Slices borrow data from the sliced type." -msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض می‌گیرند." - -#: src/slices-and-lifetimes/slices.md -msgid "Question: What happens if you modify `a[3]` right before printing `s`?" +#: src/lifetimes/exercise.md:85 src/lifetimes/solution.md:47 +msgid "/// A field, containing the field number and its value." msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" -#: src/slices-and-lifetimes/slices.md -msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending " -"indexes in brackets." +#: src/lifetimes/exercise.md:102 src/lifetimes/solution.md:64 +msgid "//1 => WireType::I64, -- not needed for this exercise" msgstr "" -"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " -"براکت‌ها، برش (slice) ایجاد می‌کنیم." -#: src/slices-and-lifetimes/slices.md -msgid "" -"If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " -"identical." +#: src/lifetimes/exercise.md:132 src/lifetimes/solution.md:94 +msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes." msgstr "" -"اگر برش از شاخص ۰ شروع شود، سینتکس راست به ما اجازه می‌دهد شاخص شروع را حذف " -"کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0..a." -"len()]` و `&a[..a.len()]` یکسان هستند." -#: src/slices-and-lifetimes/slices.md +#: src/lifetimes/exercise.md:140 src/lifetimes/solution.md:102 msgid "" -"The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " -"identical." +"// This is the last byte of the VARINT, so convert it to // a u64 and return " +"it." msgstr "" -"در مورد شاخص آخر نیز همینطور است، بنابراین `&a[2..a.len()]` و `&a[2..]` یکسان هستند." -#: src/slices-and-lifetimes/slices.md -msgid "" -"To easily create a slice of the full array, we can therefore use `&a[..]`." +#: src/lifetimes/exercise.md:150 src/lifetimes/solution.md:112 +msgid "// More than 7 bytes is invalid." msgstr "" -"یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " -"استفاده کنیم." -#: src/slices-and-lifetimes/slices.md -msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " -"(`&[i32]`) no longer mentions the array length. This allows us to perform " -"computation on slices of different sizes." +#: src/lifetimes/exercise.md:153 src/lifetimes/solution.md:115 +msgid "/// Convert a tag into a field number and a WireType." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " -"`s` (`&[i32]`) دیگر طول آرایه را " -"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " -"انجام دهیم." -#: src/slices-and-lifetimes/slices.md -#, fuzzy -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." +#: src/lifetimes/exercise.md:161 src/lifetimes/solution.md:122 +msgid "/// Parse a field, returning the remaining bytes" msgstr "" -"برش‌ها همیشه از یک شیء دیگر قرض می‌گیرند. در این مثال، `a` باید حداقل به اندازه طول‌عمر برش ما، زنده (در محدوده) باقی بماند. " -#: src/slices-and-lifetimes/slices.md -#, fuzzy +#: src/lifetimes/exercise.md:167 msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." +"\"Based on the wire type, build a Field, consuming as many bytes as " +"necessary.\"" msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " -"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " -"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " -"داده‌ها را از هر دو `a` و `s` به " -"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد. " -#: src/slices-and-lifetimes/str.md -msgid "" -"We can now understand the two string types in Rust: `&str` is almost like " -"`&[char]`, but with its data stored in a variable-length encoding (UTF-8)." +#: src/lifetimes/exercise.md:169 +msgid "\"Return the field, and any un-consumed bytes.\"" msgstr "" -#: src/slices-and-lifetimes/str.md -msgid "\"s1: {s1}\"" +#: src/lifetimes/exercise.md:171 src/lifetimes/solution.md:153 +msgid "" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in /// the message. /// /// The entire input is consumed." msgstr "" -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "\"Hello \"" -msgstr "سلام دنیا" - -#: src/slices-and-lifetimes/str.md -msgid "\"s3: {s3}\"" +#: src/lifetimes/exercise.md:198 +msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber." msgstr "" -#: src/slices-and-lifetimes/str.md -msgid "Rust terminology:" -msgstr "اصطلاحات راست:" - -#: src/slices-and-lifetimes/str.md -msgid "`&str` an immutable reference to a string slice." +#: src/lifetimes/solution.md:146 +msgid "// Unwrap error because `value` is definitely 4 bytes long." msgstr "" -"&str یک مرجع غیرقابل تغییر " -"به یک برش از رشته‌ است." - -#: src/slices-and-lifetimes/str.md -msgid "`String` a mutable string buffer." -msgstr "`String` یک بافر رشته‌ای قابل تغییر است." -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "" -"`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`”Hello”`), are stored in the program’s binary." +#: src/lifetimes/solution.md:187 src/lifetimes/solution.md:198 +msgid "// skip everything else" msgstr "" -"`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " -"غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " -"شده است. لیترال های رشته‌ای `String` (`”Hello”`) در " -"باینری برنامه ذخیره می‌شوند." -#: src/slices-and-lifetimes/str.md -msgid "" -"Rust’s `String` type is a wrapper around a vector of bytes. As with a " -"`Vec`, it is owned." +#: src/lifetimes/solution.md:225 src/lifetimes/solution.md:232 +#: src/lifetimes/solution.md:239 +msgid "b\"hello\"" msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " -"بایت‌هاست. مانند `Vec`، یک نوع Owned است." -#: src/slices-and-lifetimes/str.md +#: src/welcome-day-4.md #, fuzzy -msgid "" -"As with many other types `String::from()` creates a string from a string " -"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()` به آن اضافه شوند." +msgid "Welcome to Day 4" +msgstr "به روز ۱ خوش آمدید" -#: src/slices-and-lifetimes/str.md -#, fuzzy +#: src/welcome-day-4.md msgid "" -"The `format!()` macro is a convenient way to generate an owned string from " -"dynamic values. It accepts the same format specification as `println!()`." +"Today we will cover topics relating to building large-scale software in Rust:" msgstr "" -"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned " -"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" -"()` است." -#: src/slices-and-lifetimes/str.md -msgid "" -"You can borrow `&str` slices from `String` via `&` and optionally range " -"selection. If you select a byte range that is not aligned to character " -"boundaries, the expression will panic. The `chars` iterator iterates over " -"characters and is preferred over trying to get character boundaries right." +#: src/welcome-day-4.md +msgid "Iterators: a deep dive on the `Iterator` trait." msgstr "" -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " -"one that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain " -"UTF-8 encoded bytes and will never use a small-string optimization)." +#: src/welcome-day-4.md +msgid "Modules and visibility." msgstr "" -"برای برنامه‌نویسان `C++`: `&str`را " -"به عنوان `const char*` در `C++` " -"درنظر بگیرید، اما یک فرق مهم این است که در راست که همیشه به یک رشته معتبر در " -"حافظه اشاره می کند. راست نوع `String`معادل تقریبی `std::string` در `C++` است (با این تفاوت " -"که فقط می‌تواند حاوی بایت‌های رمزشده UTF-8 باشد و هرگز از بهینه‌سازی Small-" -"String استفاده نمی کند)." -#: src/slices-and-lifetimes/str.md +#: src/welcome-day-4.md #, fuzzy -msgid "Byte strings literals allow you to create a `&[u8]` value directly:" -msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" +msgid "Testing." +msgstr "تست‌کردن" -#: src/slices-and-lifetimes/lifetime-annotations.md -msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers " -"to. This is verified by the borrow checker." +#: src/welcome-day-4.md +msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/welcome-day-4.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes " -"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " -"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " -"`Point` which is valid for at least the lifetime `a`\"." +"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/welcome-day-4.md msgid "" -"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " -"yourself. Explicit lifetime annotations create constraints where there is " -"ambiguity; the compiler verifies that there is a valid solution." +"Including 10 minute breaks, this session should take about 2 hours and 40 " +"minutes. It contains:" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md -msgid "" -"Lifetimes become more complicated when considering passing values to and " -"returning values from functions." -msgstr "" +#: src/iterators.md +#, fuzzy +msgid "Iterator" +msgstr "FromIterator" -#: src/slices-and-lifetimes/lifetime-annotations.md -msgid "// What is the lifetime of p3?\n" -msgstr "" +#: src/iterators.md +#, fuzzy +msgid "IntoIterator" +msgstr "FromIterator" -#: src/slices-and-lifetimes/lifetime-annotations.md -msgid "\"p3: {p3:?}\"" -msgstr "" +#: src/iterators.md src/iterators/fromiterator.md:1 +msgid "FromIterator" +msgstr "FromIterator" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/iterators/iterator.md:3 msgid "" -"In this example, the the compiler does not know what lifetime to infer for " -"`p3`. Looking inside the function body shows that it can only safely assume " -"that `p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, " -"Rust requires explicit annotations of lifetimes on function arguments and " -"return values." +"The `Iterator` trait supports iterating over values in a collection. It " +"requires a `next` method and provides lots of methods. Many standard library " +"types implement `Iterator`, and you can implement it yourself, too:" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md -msgid "Add `'a` appropriately to `left_most`:" +#: src/iterators/iterator.md:27 +msgid "\"fib({i}): {n}\"" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/iterators/iterator.md:35 msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"The `Iterator` trait implements many common functional programming " +"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " +"the trait where you can find all the documentation about them. In Rust these " +"functions should produce the code as efficient as equivalent imperative " +"implementations." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/iterators/iterator.md:40 msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +"`IntoIterator` is the trait that makes for loops work. It is implemented by " +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md -msgid "Lifetimes in Function Calls" -msgstr "طول عمر در فراخوانی‌ توابع" - -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/iterators/intoiterator.md:3 msgid "" -"Lifetimes for function arguments and return values must be fully specified, " -"but Rust allows lifetimes to be elided in most cases with [a few simple " -"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " -"inference -- it is just a syntactic shorthand." +"The `Iterator` trait tells you how to _iterate_ once you have created an " +"iterator. The related trait `IntoIterator` defines how to create an iterator " +"for a type. It is used automatically by the `for` loop." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md -msgid "Each argument which does not have a lifetime annotation is given one." +#: src/iterators/intoiterator.md:49 +msgid "\"point = {x}, {y}\"" msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/iterators/intoiterator.md:57 msgid "" -"If there is only one argument lifetime, it is given to all un-annotated " -"return values." +"Click through to the docs for `IntoIterator`. Every implementation of " +"`IntoIterator` must declare two types:" msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md -msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, " -"that lifetime is given to all un-annotated return values." +#: src/iterators/intoiterator.md:60 +msgid "`Item`: the type to iterate over, such as `i8`," msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md -msgid "In this example, `cab_distance` is trivially elided." +#: src/iterators/intoiterator.md:61 +msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/iterators/intoiterator.md:63 msgid "" -"The `nearest` function provides another example of a function with multiple " -"references in its arguments that requires explicit annotation." +"Note that `IntoIter` and `Item` are linked: the iterator must have the same " +"`Item` type, which means that it returns `Option`" msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md -msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" +#: src/iterators/intoiterator.md:66 +msgid "The example iterates over all combinations of x and y coordinates." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/iterators/intoiterator.md:68 msgid "" -"This won't compile, demonstrating that the annotations are checked for " -"validity by the compiler. Note that this is not the case for raw pointers " -"(unsafe), and this is a common source of errors with unsafe Rust." +"Try iterating over the grid twice in `main`. Why does this fail? Note that " +"`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/iterators/intoiterator.md:71 msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have " -"lifetimes. Most of the time, elision and type inference mean these don't " -"need to be written out. In more complicated cases, lifetime annotations can " -"help resolve ambiguity. Often, especially when prototyping, it's easier to " -"just work with owned data by cloning values where necessary." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " +"reference to the `Grid` in `GridIter`." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "Lifetimes in Data Structures" -msgstr "طول عمر در ساختمان داده" - -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/iterators/intoiterator.md:74 msgid "" -"If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "" - -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "\"Bye {text}!\"" +"The same problem can occur for standard library types: `for e in " +"some_vector` will take ownership of `some_vector` and iterate over owned " +"elements from that vector. Use `for e in &some_vector` instead, to iterate " +"over references to elements of `some_vector`." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "\"The quick brown fox jumps over the lazy dog.\"" +#: src/iterators/fromiterator.md:3 +msgid "`FromIterator` lets you build a collection from an `Iterator`." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "// erase(text);\n" +#: src/iterators/fromiterator.md:9 +msgid "\"prime_squares: {prime_squares:?}\"" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "\"{fox:?}\"" +#: src/iterators/fromiterator.md:16 +msgid "`Iterator` implements" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "\"{dog:?}\"" +#: src/iterators/fromiterator.md:25 +msgid "There are two ways to specify `B` for this method:" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/iterators/fromiterator.md:27 msgid "" -"In the above example, the annotation on `Highlight` enforces that the data " -"underlying the contained `&str` lives at least as long as any instance of " -"`Highlight` that uses that data." +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/iterators/fromiterator.md:29 msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"Rewrite the example to use this form." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/iterators/fromiterator.md:32 msgid "" -"Types with borrowed data force users to hold on to the original data. This " -"can be useful for creating lightweight views, but it generally makes them " -"somewhat harder to use." -msgstr "" - -#: src/slices-and-lifetimes/struct-lifetimes.md -msgid "When possible, make data structures own their data directly." +"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " +"There are also more specialized implementations which let you do cool things " +"like convert an `Iterator>` into a `Result, E>`." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/iterators/exercise.md:3 msgid "" -"Some structs with multiple references inside can have more than one lifetime " -"annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime " -"of the struct itself. Those are very advanced use cases." +"In this exercise, you will need to find and use some of the provided methods " +"in the `Iterator` trait to implement a complex calculation." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/iterators/exercise.md:6 msgid "" -"In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " -"simpler than it seems! This illustrates a common parsing pattern, passing " -"slices of data. The underlying data itself is never copied." +"Copy the following code to https://play.rust-lang.org/ and make the tests " +"pass. Use an iterator expression and `collect` the result to construct the " +"return value." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/iterators/exercise.md:11 src/iterators/solution.md:4 msgid "" -"Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` " -"file. In this exercise, we'll encode that information into `match` " -"statements in functions that get called for each field." +"/// Calculate the differences between elements of `values` offset by " +"`offset`, /// wrapping around from the end of `values` to the " +"beginning. /// /// Element `n` of the result is `values[(n+offset)%len] - " +"values[n]`." msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "We'll use the following proto:" +#: src/modules.md src/modules/paths.md:1 +msgid "use, super, self" msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "" -"A proto message is encoded as a series of fields, one after the next. Each " -"is implemented as a \"tag\" followed by the value. The tag contains a field " -"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +#: src/modules/modules.md:3 +msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "" -"Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +#: src/modules/modules.md:5 +msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "" -"What remains for you is to implement the `parse_field` function and the " -"`ProtoMessage` trait for `Person` and `PhoneNumber`." +#: src/modules/modules.md:10 +msgid "\"In the foo module\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Invalid varint\"" +#: src/modules/modules.md:16 +msgid "\"In the bar module\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Invalid wire-type\"" +#: src/modules/modules.md:29 +msgid "" +"Packages provide functionality and include a `Cargo.toml` file that " +"describes how to build a bundle of 1+ crates." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Unexpected EOF\"" +#: src/modules/modules.md:31 +msgid "" +"Crates are a tree of modules, where a binary crate creates an executable and " +"a library crate compiles to a library." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Invalid length\"" +#: src/modules/modules.md:33 +msgid "Modules define organization, scope, and are the focus of this section." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Unexpected wire-type)\"" +#: src/modules/filesystem.md:3 +msgid "" +"Omitting the module content will tell Rust to look for it in another file:" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "\"Invalid string (not UTF-8)\"" +#: src/modules/filesystem.md:9 +msgid "" +"This tells rust that the `garden` module content is found at `src/garden." +"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" +"vegetables.rs`." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// A wire type as seen on the wire.\n" +#: src/modules/filesystem.md:13 +msgid "The `crate` root is in:" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// The Varint WireType indicates the value is a single VARINT.\n" +#: src/modules/filesystem.md:15 +msgid "`src/lib.rs` (for a library crate)" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "" -"//I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" -" /// VARINT followed by exactly that number of bytes.\n" +#: src/modules/filesystem.md:16 +msgid "`src/main.rs` (for a binary crate)" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/modules/filesystem.md:18 msgid "" -"/// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" /// little-endian order containing a 32-bit signed integer.\n" +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// A field's value, typed based on the wire type.\n" +#: src/modules/filesystem.md:22 +msgid "" +"//! This module implements the garden, including a highly performant " +"germination //! implementation." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "//I64(i64), -- not needed for this exercise\n" +#: src/modules/filesystem.md:24 +msgid "// Re-export types from this module." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// A field, containing the field number and its value.\n" +#: src/modules/filesystem.md:28 +msgid "/// Sow the given seed packets." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "//1 => WireType::I64, -- not needed for this exercise\n" +#: src/modules/filesystem.md:33 +msgid "/// Harvest the produce in the garden that is ready." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/modules/filesystem.md:43 msgid "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " +"`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/modules/filesystem.md:46 msgid "" -"// This is the last byte of the VARINT, so convert it to\n" -" // a u64 and return it.\n" +"The main reason to introduce `filename.rs` as alternative to `filename/mod." +"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "// More than 7 bytes is invalid.\n" +#: src/modules/filesystem.md:49 +msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// Convert a tag into a field number and a WireType.\n" +#: src/modules/filesystem.md:59 +msgid "" +"The place rust will look for modules can be changed with a compiler " +"directive:" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "/// Parse a field, returning the remaining bytes\n" +#: src/modules/filesystem.md:62 +msgid "\"some/path.rs\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/modules/filesystem.md:66 msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as " -"necessary.\"" +"This is useful, for example, if you would like to place tests for a module " +"in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "\"Return the field, and any un-consumed bytes.\"" +#: src/modules/visibility.md:3 +msgid "Modules are a privacy boundary:" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md -msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" -"/// the message.\n" -"///\n" -"/// The entire input is consumed.\n" +#: src/modules/visibility.md:5 +msgid "Module items are private by default (hides implementation details)." msgstr "" -#: src/slices-and-lifetimes/exercise.md -msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" +#: src/modules/visibility.md:6 +msgid "Parent and sibling items are always visible." msgstr "" -#: src/slices-and-lifetimes/solution.md -msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" +#: src/modules/visibility.md:7 +msgid "" +"In other words, if an item is visible in module `foo`, it's visible in all " +"the descendants of `foo`." msgstr "" -#: src/slices-and-lifetimes/solution.md -msgid "// skip everything else\n" +#: src/modules/visibility.md:13 +msgid "\"outer::private\"" msgstr "" -#: src/slices-and-lifetimes/solution.md -msgid "b\"hello\"" +#: src/modules/visibility.md:17 +msgid "\"outer::public\"" msgstr "" -#: src/welcome-day-4.md -#, fuzzy -msgid "Welcome to Day 4" -msgstr "به روز ۱ خوش آمدید" +#: src/modules/visibility.md:22 +msgid "\"outer::inner::private\"" +msgstr "" -#: src/welcome-day-4.md -msgid "" -"Today we will cover topics relating to building large-scale software in Rust:" +#: src/modules/visibility.md:26 +msgid "\"outer::inner::public\"" msgstr "" -#: src/welcome-day-4.md -msgid "Iterators: a deep dive on the `Iterator` trait." +#: src/modules/visibility.md:40 +msgid "Use the `pub` keyword to make modules public." msgstr "" -#: src/welcome-day-4.md -msgid "Modules and visibility." +#: src/modules/visibility.md:42 +msgid "" +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " +"of public visibility." msgstr "" -#: src/welcome-day-4.md +#: src/modules/visibility.md:45 #, fuzzy -msgid "Testing." -msgstr "تست‌کردن" +msgid "See the Rust Reference." +msgstr "مراجع" -#: src/welcome-day-4.md -msgid "Error handling: panics, `Result`, and the try operator `?`." +#: src/modules/visibility.md:47 +msgid "Configuring `pub(crate)` visibility is a common pattern." msgstr "" -#: src/welcome-day-4.md -msgid "" -"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +#: src/modules/visibility.md:48 +msgid "Less commonly, you can give visibility to a specific path." msgstr "" -#: src/welcome-day-4.md -msgid "[Welcome](./welcome-day-4.md) (3 minutes)" +#: src/modules/visibility.md:49 +msgid "" +"In any case, visibility must be granted to an ancestor module (and all of " +"its descendants)." msgstr "" -#: src/welcome-day-4.md -msgid "[Iterators](./iterators.md) (45 minutes)" +#: src/modules/paths.md:3 +msgid "" +"A module can bring symbols from another module into scope with `use`. You " +"will typically see something like this at the top of each module:" msgstr "" -#: src/welcome-day-4.md -msgid "[Modules](./modules.md) (40 minutes)" -msgstr "" +#: src/modules/paths.md:11 +msgid "Paths" +msgstr "مسیر" -#: src/welcome-day-4.md -msgid "[Testing](./testing.md) (1 hour and 5 minutes)" +#: src/modules/paths.md:13 +msgid "Paths are resolved as follows:" msgstr "" -#: src/iterators.md -msgid "[Iterator](./iterators/iterator.md) (5 minutes)" +#: src/modules/paths.md:15 +msgid "As a relative path:" msgstr "" -#: src/iterators.md -msgid "[IntoIterator](./iterators/intoiterator.md) (5 minutes)" +#: src/modules/paths.md:16 +msgid "`foo` or `self::foo` refers to `foo` in the current module," msgstr "" -#: src/iterators.md -msgid "[FromIterator](./iterators/fromiterator.md) (5 minutes)" +#: src/modules/paths.md:17 +msgid "`super::foo` refers to `foo` in the parent module." msgstr "" -#: src/iterators.md -msgid "" -"[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" +#: src/modules/paths.md:19 +msgid "As an absolute path:" msgstr "" -#: src/iterators/iterator.md -msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +#: src/modules/paths.md:20 +msgid "`crate::foo` refers to `foo` in the root of the current crate," msgstr "" -#: src/iterators/iterator.md -msgid "\"fib({i}): {n}\"" +#: src/modules/paths.md:21 +msgid "`bar::foo` refers to `foo` in the `bar` crate." msgstr "" -#: src/iterators/iterator.md +#: src/modules/paths.md:26 msgid "" -"The `Iterator` trait implements many common functional programming " -"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"It is common to \"re-export\" symbols at a shorter path. For example, the " +"top-level `lib.rs` in a crate might have" msgstr "" -#: src/iterators/iterator.md +#: src/modules/paths.md:36 msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"making `DiskStorage` and `NetworkStorage` available to other crates with a " +"convenient, short path." msgstr "" -#: src/iterators/intoiterator.md +#: src/modules/paths.md:39 msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " -"It is used automatically by the `for` loop." +"For the most part, only items that appear in a module need to be `use`'d. " +"However, a trait must be in scope to call any methods on that trait, even if " +"a type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to " +"`use std::io::Read`." msgstr "" -#: src/iterators/intoiterator.md -msgid "\"point = {x}, {y}\"" +#: src/modules/paths.md:45 +msgid "" +"The `use` statement can have a wildcard: `use std::io::*`. This is " +"discouraged because it is not clear which items are imported, and those " +"might change over time." msgstr "" -#: src/iterators/intoiterator.md +#: src/modules/exercise.md:3 msgid "" -"Click through to the docs for `IntoIterator`. Every implementation of " -"`IntoIterator` must declare two types:" +"In this exercise, you will reorganize a small GUI Library implementation. " +"This library defines a `Widget` trait and a few implementations of that " +"trait, as well as a `main` function." msgstr "" -#: src/iterators/intoiterator.md -msgid "`Item`: the type to iterate over, such as `i8`," +#: src/modules/exercise.md:7 +msgid "" +"It is typical to put each type or set of closely-related types into its own " +"module, so each widget type should get its own module." msgstr "" -#: src/iterators/intoiterator.md -msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." +#: src/modules/exercise.md:10 +#, fuzzy +msgid "Cargo Setup" +msgstr "تنظیم" + +#: src/modules/exercise.md:12 +msgid "" +"The Rust playground only supports one file, so you will need to make a Cargo " +"project on your local filesystem:" msgstr "" -#: src/iterators/intoiterator.md +#: src/modules/exercise.md:21 msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same " -"`Item` type, which means that it returns `Option`" +"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " +"files in the `src` directory." msgstr "" -#: src/iterators/intoiterator.md -msgid "The example iterates over all combinations of x and y coordinates." +#: src/modules/exercise.md:24 +msgid "Source" msgstr "" -#: src/iterators/intoiterator.md -msgid "" -"Try iterating over the grid twice in `main`. Why does this fail? Note that " -"`IntoIterator::into_iter` takes ownership of `self`." +#: src/modules/exercise.md:26 +msgid "Here's the single-module implementation of the GUI library:" msgstr "" -#: src/iterators/intoiterator.md -msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +#: src/modules/exercise.md:30 src/modules/solution.md:36 +msgid "/// Natural width of `self`." msgstr "" -#: src/iterators/intoiterator.md -msgid "" -"The same problem can occur for standard library types: `for e in " -"some_vector` will take ownership of `some_vector` and iterate over owned " -"elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." +#: src/modules/exercise.md:33 src/modules/solution.md:39 +msgid "/// Draw the widget into a buffer." msgstr "" -#: src/iterators/fromiterator.md -msgid "FromIterator" -msgstr "FromIterator" +#: src/modules/exercise.md:36 src/modules/solution.md:42 +msgid "/// Draw the widget on standard output." +msgstr "" -#: src/iterators/fromiterator.md -msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." +#: src/modules/exercise.md:40 src/modules/solution.md:46 +msgid "\"{buffer}\"" msgstr "" -#: src/iterators/fromiterator.md -msgid "\"prime_squares: {prime_squares:?}\"" +#: src/modules/exercise.md:88 +msgid "// Add 4 paddings for borders" msgstr "" -#: src/iterators/fromiterator.md -msgid "`Iterator` implements" +#: src/modules/exercise.md:100 +msgid "" +"// TODO: Change draw_into to return Result\\<(), std::fmt::Error>. Then use " +"the // ?-operator here instead of .unwrap()." msgstr "" -#: src/iterators/fromiterator.md -msgid "There are two ways to specify `B` for this method:" +#: src/modules/exercise.md:102 src/modules/exercise.md:108 +#: src/modules/solution.md:165 src/modules/solution.md:171 +msgid "\"+-{:-\\()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." +#: src/modules/exercise.md:102 src/modules/exercise.md:104 +#: src/modules/exercise.md:108 src/modules/exercise.md:122 +#: src/modules/exercise.md:126 src/modules/solution.md:110 +#: src/modules/solution.md:114 src/modules/solution.md:165 +#: src/modules/solution.md:167 src/modules/solution.md:171 +#: src/testing/unit-tests.md:27 src/testing/solution.md:89 +msgid "\"\"" msgstr "" -#: src/iterators/fromiterator.md -msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"Rewrite the example to use this form." +#: src/modules/exercise.md:103 src/modules/solution.md:166 +msgid "\"| {:^inner_width$} |\"" msgstr "" -#: src/iterators/fromiterator.md -msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +#: src/modules/exercise.md:104 src/modules/solution.md:167 +msgid "\"+={:=\\ and make the tests " -"pass. Use an iterator expression and `collect` the result to construct the " -"return value." +#: src/modules/exercise.md:114 src/modules/solution.md:100 +msgid "// add a bit of padding" msgstr "" -#: src/iterators/exercise.md src/iterators/solution.md -msgid "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" -"/// wrapping around from the end of `values` to the beginning.\n" -"///\n" -"/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" +#: src/modules/exercise.md:122 src/modules/exercise.md:126 +#: src/modules/solution.md:110 src/modules/solution.md:114 +msgid "\"+{:-\\. Then use // the ?-operator here " +"instead of .unwrap()." msgstr "" -#: src/modules/filesystem.md -msgid "" -"//! This module implements the garden, including a highly performant " -"germination\n" -"//! implementation.\n" +#: src/modules/solution.md:177 +msgid "// ---- src/main.rs ----" msgstr "" -#: src/modules/filesystem.md -msgid "// Re-export types from this module.\n" +#: src/testing/unit-tests.md:1 +msgid "Unit Tests" +msgstr "تست‌های واحد (Unit Tests)" + +#: src/testing/unit-tests.md:3 +msgid "Rust and Cargo come with a simple unit test framework:" msgstr "" -#: src/modules/filesystem.md -msgid "/// Sow the given seed packets.\n" +#: src/testing/unit-tests.md:5 +msgid "Unit tests are supported throughout your code." msgstr "" -#: src/modules/filesystem.md -msgid "/// Harvest the produce in the garden that is ready.\n" +#: src/testing/unit-tests.md:7 +msgid "Integration tests are supported via the `tests/` directory." msgstr "" -#: src/modules/filesystem.md +#: src/testing/unit-tests.md:9 msgid "" -"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " -"`module.rs`, and this is still a working alternative for editions after 2018." +"Tests are marked with `#[test]`. Unit tests are often put in a nested " +"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " +"building tests." msgstr "" -#: src/modules/filesystem.md -msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod." -"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." +#: src/testing/unit-tests.md:37 +#, fuzzy +msgid "\"Hello World\"" +msgstr "سلام دنیا" + +#: src/testing/unit-tests.md:42 +msgid "This lets you unit test private helpers." msgstr "" -#: src/modules/filesystem.md -msgid "Deeper nesting can use folders, even if the main module is a file:" +#: src/testing/unit-tests.md:43 +msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." msgstr "" -#: src/modules/filesystem.md -msgid "" -"The place rust will look for modules can be changed with a compiler " -"directive:" +#: src/testing/unit-tests.md:48 +msgid "Run the tests in the playground in order to show their results." msgstr "" -#: src/modules/filesystem.md -msgid "\"some/path.rs\"" +#: src/testing/other.md:3 +msgid "Integration Tests" +msgstr "Integration Tests" + +#: src/testing/other.md:5 +msgid "If you want to test your library as a client, use an integration test." msgstr "" -#: src/modules/filesystem.md -msgid "" -"This is useful, for example, if you would like to place tests for a module " -"in a file named `some_module_test.rs`, similar to the convention in Go." +#: src/testing/other.md:7 +msgid "Create a `.rs` file under `tests/`:" msgstr "" -#: src/modules/visibility.md -msgid "Modules are a privacy boundary:" +#: src/testing/other.md:10 +msgid "// tests/my_library.rs" msgstr "" -#: src/modules/visibility.md -msgid "Module items are private by default (hides implementation details)." +#: src/testing/other.md:19 +msgid "These tests only have access to the public API of your crate." msgstr "" -#: src/modules/visibility.md -msgid "Parent and sibling items are always visible." +#: src/testing/other.md:21 +msgid "Documentation Tests" +msgstr "تست‌ سندها" + +#: src/testing/other.md:23 +msgid "Rust has built-in support for documentation tests:" msgstr "" -#: src/modules/visibility.md +#: src/testing/other.md:26 msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all " -"the descendants of `foo`." +"/// Shortens a string to the given length. /// /// `/// # use playground::" +"shorten_string; /// assert_eq!(shorten_string(\"Hello World\", 5), " +"\"Hello\"); /// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello " +"World\"); ///`" msgstr "" -#: src/modules/visibility.md -msgid "\"outer::private\"" +#: src/testing/other.md:38 +msgid "Code blocks in `///` comments are automatically seen as Rust code." msgstr "" -#: src/modules/visibility.md -msgid "\"outer::public\"" +#: src/testing/other.md:39 +msgid "The code will be compiled and executed as part of `cargo test`." msgstr "" -#: src/modules/visibility.md -msgid "\"outer::inner::private\"" +#: src/testing/other.md:40 +msgid "" +"Adding `#` in the code will hide it from the docs, but will still compile/" +"run it." msgstr "" -#: src/modules/visibility.md -msgid "\"outer::inner::public\"" +#: src/testing/other.md:42 +#, fuzzy +msgid "Test the above code on the Rust Playground." +msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." + +#: src/testing/lints.md:3 +msgid "" +"The Rust compiler produces fantastic error messages, as well as helpful " +"built-in lints. Clippy provides even more lints, organized into groups that " +"can be enabled per-project." msgstr "" -#: src/modules/visibility.md -msgid "Use the `pub` keyword to make modules public." +#: src/testing/lints.md:14 +msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -#: src/modules/visibility.md +#: src/testing/lints.md:21 msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " -"of public visibility." +"Run the code sample and examine the error message. There are also lints " +"visible here, but those will not be shown once the code compiles. Switch to " +"the Playground site to show those lints." msgstr "" -#: src/modules/visibility.md +#: src/testing/lints.md:25 msgid "" -"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" -"privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." +"After resolving the lints, run `clippy` on the playground site to show " +"clippy warnings. Clippy has extensive documentation of its lints, and adds " +"new lints (including default-deny lints) all the time." msgstr "" -#: src/modules/visibility.md -msgid "Configuring `pub(crate)` visibility is a common pattern." +#: src/testing/lints.md:29 +msgid "" +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " +"or via your editor." msgstr "" -#: src/modules/visibility.md -msgid "Less commonly, you can give visibility to a specific path." -msgstr "" +#: src/testing/exercise.md:3 +msgid "Luhn Algorithm" +msgstr "الگوریتم Luhn" -#: src/modules/visibility.md +#: src/testing/exercise.md:5 +#, fuzzy msgid "" -"In any case, visibility must be granted to an ancestor module (and all of " -"its descendants)." +"The Luhn algorithm is used 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/modules/paths.md -msgid "use, super, self" +#: src/testing/exercise.md:9 +#, fuzzy +msgid "Ignore all spaces. Reject number with fewer than two digits." +msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی با کمتر از دو رقم را رد کنید." + +#: src/testing/exercise.md:11 +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/modules/paths.md +#: src/testing/exercise.md:14 msgid "" -"A module can bring symbols from another module into scope with `use`. You " -"will typically see something like this at the top of each module:" +"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/modules/paths.md -msgid "Paths" -msgstr "مسیر" +#: src/testing/exercise.md:17 +msgid "Sum all the undoubled and doubled digits." +msgstr "تمام ارقام دو برابر نشده و دو برابر شده را جمع کنید." -#: src/modules/paths.md -msgid "Paths are resolved as follows:" -msgstr "" +#: src/testing/exercise.md:19 +msgid "The credit card number is valid if the sum ends with `0`." +msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت اعتباری معتبر است." -#: src/modules/paths.md -msgid "As a relative path:" +#: src/testing/exercise.md:21 +msgid "" +"The provided code provides a buggy implementation of the luhn algorithm, " +"along with two basic unit tests that confirm that most the algorithm is " +"implemented correctly." msgstr "" -#: src/modules/paths.md -msgid "`foo` or `self::foo` refers to `foo` in the current module," +#: src/testing/exercise.md:25 +#, fuzzy +msgid "" +"Copy the code below to https://play.rust-lang.org/ and write additional " +"tests to uncover bugs in the provided implementation, fixing any bugs you " +"find." msgstr "" +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." -#: src/modules/paths.md -msgid "`super::foo` refers to `foo` in the parent module." +#: src/testing/exercise.md:57 src/testing/solution.md:69 +msgid "\"4263 9826 4026 9299\"" msgstr "" -#: src/modules/paths.md -msgid "As an absolute path:" +#: src/testing/exercise.md:58 src/testing/solution.md:70 +msgid "\"4539 3195 0343 6467\"" msgstr "" -#: src/modules/paths.md -msgid "`crate::foo` refers to `foo` in the root of the current crate," +#: src/testing/exercise.md:59 src/testing/solution.md:71 +msgid "\"7992 7398 713\"" msgstr "" -#: src/modules/paths.md -msgid "`bar::foo` refers to `foo` in the `bar` crate." +#: src/testing/exercise.md:64 src/testing/solution.md:76 +msgid "\"4223 9826 4026 9299\"" msgstr "" -#: src/modules/paths.md -msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the " -"top-level `lib.rs` in a crate might have" +#: src/testing/exercise.md:65 src/testing/solution.md:77 +msgid "\"4539 3195 0343 6476\"" msgstr "" -#: src/modules/paths.md -msgid "" -"making `DiskStorage` and `NetworkStorage` available to other crates with a " -"convenient, short path." +#: src/testing/exercise.md:66 src/testing/solution.md:78 +msgid "\"8273 1232 7352 0569\"" msgstr "" -#: src/modules/paths.md -msgid "" -"For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if " -"a type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to " -"`use std::io::Read`." +#: src/testing/solution.md:4 +msgid "// This is the buggy version that appears in the problem." msgstr "" -#: src/modules/paths.md -msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is " -"discouraged because it is not clear which items are imported, and those " -"might change over time." +#: src/testing/solution.md:27 +msgid "// This is the solution and passes all of the tests below." msgstr "" -#: src/modules/exercise.md -msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. " -"This library defines a `Widget` trait and a few implementations of that " -"trait, as well as a `main` function." +#: src/testing/solution.md:56 +msgid "\"1234 5678 1234 5670\"" msgstr "" -#: src/modules/exercise.md -msgid "" -"It is typical to put each type or set of closely-related types into its own " -"module, so each widget type should get its own module." +#: src/testing/solution.md:58 +msgid "\"Is {cc_number} a valid credit card number? {}\"" msgstr "" -#: src/modules/exercise.md -#, fuzzy -msgid "Cargo Setup" -msgstr "تنظیم" +#: src/testing/solution.md:59 +msgid "\"yes\"" +msgstr "" -#: src/modules/exercise.md -msgid "" -"The Rust playground only supports one file, so you will need to make a Cargo " -"project on your local filesystem:" +#: src/testing/solution.md:59 +msgid "\"no\"" msgstr "" -#: src/modules/exercise.md -msgid "" -"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " -"files in the `src` directory." +#: src/testing/solution.md:84 +msgid "\"foo 0 0\"" msgstr "" -#: src/modules/exercise.md -msgid "Source" +#: src/testing/solution.md:90 +msgid "\" \"" msgstr "" -#: src/modules/exercise.md -msgid "Here's the single-module implementation of the GUI library:" +#: src/testing/solution.md:91 +msgid "\" \"" msgstr "" -#: src/modules/exercise.md src/modules/solution.md -msgid "/// Natural width of `self`.\n" +#: src/testing/solution.md:92 +msgid "\" \"" msgstr "" -#: src/modules/exercise.md src/modules/solution.md -msgid "/// Draw the widget into a buffer.\n" +#: src/testing/solution.md:97 +msgid "\"0\"" msgstr "" -#: src/modules/exercise.md src/modules/solution.md -msgid "/// Draw the widget on standard output.\n" +#: src/testing/solution.md:102 +msgid "\" 0 0 \"" msgstr "" -#: src/modules/exercise.md src/modules/solution.md -msgid "\"{buffer}\"" +#: src/error-handling.md +#, fuzzy +msgid "Error Trait" +msgstr "صفت‌های بیشتر" + +#: src/error-handling.md +msgid "thiserror and anyhow" msgstr "" -#: src/modules/exercise.md -msgid "// Add 4 paddings for borders\n" +#: src/error-handling.md src/error-handling/exercise.md:1 +msgid "Exercise: Rewriting with Result" msgstr "" -#: src/modules/exercise.md -msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" -" // ?-operator here instead of .unwrap().\n" +#: src/error-handling/panics.md:3 +msgid "Rust handles fatal errors with a \"panic\"." msgstr "" -#: src/modules/exercise.md src/modules/solution.md -msgid "\"+-{:-. Then use\n" -" // the ?-operator here instead of .unwrap().\n" +"Note that `main` can return a `Result<(), E>` as long as it implements `std::" +"process::Termination`. In practice, this means that `E` implements `Debug`. " +"The executable will print the `Err` variant and return a nonzero exit status " +"on error." msgstr "" -#: src/modules/solution.md -msgid "// ---- src/main.rs ----\n" +#: src/error-handling/try-conversions.md:3 +msgid "" +"The effective expansion of `?` is a little more complicated than previously " +"indicated:" msgstr "" -#: src/testing.md -msgid "[Test Modules](./testing/unit-tests.md) (5 minutes)" +#: src/error-handling/try-conversions.md:10 +msgid "works the same as" msgstr "" -#: src/testing.md -msgid "[Other Types of Tests](./testing/other.md) (10 minutes)" +#: src/error-handling/try-conversions.md:19 +msgid "" +"The `From::from` call here means we attempt to convert the error type to the " +"type returned by the function. This makes it easy to encapsulate errors into " +"higher-level errors." msgstr "" -#: src/testing.md -msgid "[Useful Crates](./testing/useful-crates.md) (3 minutes)" +#: src/error-handling/try-conversions.md:42 +msgid "\"IO error: {e}\"" msgstr "" -#: src/testing.md -msgid "[GoogleTest](./testing/googletest.md) (5 minutes)" +#: src/error-handling/try-conversions.md:43 +msgid "\"Found no username in {path}\"" msgstr "" -#: src/testing.md -msgid "[Mocking](./testing/mocking.md) (5 minutes)" +#: src/error-handling/try-conversions.md:64 +msgid "//std::fs::write(\"config.dat\", \"\").unwrap();" msgstr "" -#: src/testing.md -msgid "[Compiler Lints and Clippy](./testing/lints.md) (5 minutes)" +#: src/error-handling/try-conversions.md:73 +msgid "" +"The `?` operator must return a value compatible with the return type of the " +"function. For `Result`, it means that the error types have to be compatible. " +"A function that returns `Result` can only use `?` on a value " +"of type `Result` if `ErrorOuter` and `ErrorInner` are the " +"same type or if `ErrorOuter` implements `From`." msgstr "" -#: src/testing.md -msgid "[Exercise: Luhn Algorithm](./testing/exercise.md) (30 minutes)" +#: src/error-handling/try-conversions.md:79 +msgid "" +"A common alternative to a `From` implementation is `Result::map_err`, " +"especially when the conversion only happens in one place." msgstr "" -#: src/testing/unit-tests.md -msgid "Unit Tests" -msgstr "تست‌های واحد (Unit Tests)" - -#: src/testing/unit-tests.md -msgid "Rust and Cargo come with a simple unit test framework:" +#: src/error-handling/try-conversions.md:82 +msgid "" +"There is no compatibility requirement for `Option`. A function returning " +"`Option` can use the `?` operator on `Option` for arbitrary `T` and " +"`U` types." msgstr "" -#: src/testing/unit-tests.md -msgid "Unit tests are supported throughout your code." +#: src/error-handling/try-conversions.md:86 +msgid "" +"A function that returns `Result` cannot use `?` on `Option` and vice versa. " +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" -#: src/testing/unit-tests.md -msgid "Integration tests are supported via the `tests/` directory." -msgstr "" +#: src/error-handling/error.md:1 +msgid "Dynamic Error Types" +msgstr "انواع خطاهای Dynamic" -#: src/testing/unit-tests.md +#: src/error-handling/error.md:3 msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested " -"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " -"building tests." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" -#: src/testing/unit-tests.md -#, fuzzy -msgid "\"Hello World\"" -msgstr "سلام دنیا" - -#: src/testing/unit-tests.md -msgid "This lets you unit test private helpers." +#: src/error-handling/error.md:20 src/error-handling/error.md:21 +msgid "\"count.dat\"" msgstr "" -#: src/testing/unit-tests.md -msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." +#: src/error-handling/error.md:20 +msgid "\"1i3\"" msgstr "" -#: src/testing/unit-tests.md -msgid "Run the tests in the playground in order to show their results." +#: src/error-handling/error.md:22 +msgid "\"Count: {count}\"" msgstr "" -#: src/testing/other.md -msgid "Integration Tests" -msgstr "Integration Tests" - -#: src/testing/other.md -msgid "If you want to test your library as a client, use an integration test." +#: src/error-handling/error.md:23 +msgid "\"Error: {err}\"" msgstr "" -#: src/testing/other.md -msgid "Create a `.rs` file under `tests/`:" +#: src/error-handling/error.md:31 +msgid "" +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" -#: src/testing/other.md -msgid "// tests/my_library.rs\n" +#: src/error-handling/error.md:34 +msgid "" +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" -#: src/testing/other.md -msgid "These tests only have access to the public API of your crate." +#: src/error-handling/error.md:40 +msgid "" +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed. But if you need to support the `no_std` " +"attribute, keep in mind that the `std::error::Error` trait is currently " +"compatible with `no_std` in nightly only." msgstr "" -#: src/testing/other.md -msgid "Documentation Tests" -msgstr "تست‌ سندها" - -#: src/testing/other.md -msgid "Rust has built-in support for documentation tests:" +#: src/error-handling/thiserror-and-anyhow.md:3 +msgid "" +"The `thiserror` and `anyhow` crates are widely used to simplify error " +"handling." msgstr "" -#: src/testing/other.md +#: src/error-handling/thiserror-and-anyhow.md:7 msgid "" -"/// Shortens a string to the given length.\n" -"///\n" -"/// ```\n" -"/// # use playground::shorten_string;\n" -"/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" -"/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" -"/// ```\n" +"`thiserror` is often used in libraries to create custom error types that " +"implement `From`." msgstr "" -#: src/testing/other.md -msgid "Code blocks in `///` comments are automatically seen as Rust code." +#: src/error-handling/thiserror-and-anyhow.md:9 +msgid "" +"`anyhow` is often used by applications to help with error handling in " +"functions, including adding contextual information to your errors." msgstr "" -#: src/testing/other.md -msgid "The code will be compiled and executed as part of `cargo test`." +#: src/error-handling/thiserror-and-anyhow.md:19 +msgid "\"Found no username in {0}\"" msgstr "" -#: src/testing/other.md -msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/" -"run it." +#: src/error-handling/thiserror-and-anyhow.md:25 +msgid "\"Failed to open {path}\"" msgstr "" -#: src/testing/other.md -msgid "" -"Test the above code on the [Rust Playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." +#: src/error-handling/thiserror-and-anyhow.md:27 +msgid "\"Failed to read\"" msgstr "" -#: src/testing/useful-crates.md -msgid "Rust comes with only basic support for writing tests." +#: src/error-handling/thiserror-and-anyhow.md:35 +msgid "//fs::write(\"config.dat\", \"\").unwrap();" msgstr "" -#: src/testing/useful-crates.md -msgid "Here are some additional crates which we recommend for writing tests:" +#: src/error-handling/thiserror-and-anyhow.md:37 +msgid "\"Username: {username}\"" msgstr "" -#: src/testing/useful-crates.md -msgid "" -"[googletest](https://docs.rs/googletest): Comprehensive test assertion " -"library in the tradition of GoogleTest for C++." +#: src/error-handling/thiserror-and-anyhow.md:38 +msgid "\"Error: {err:?}\"" msgstr "" -#: src/testing/useful-crates.md -msgid "[proptest](https://docs.rs/proptest): Property-based testing for Rust." +#: src/error-handling/thiserror-and-anyhow.md:46 +msgid "`thiserror`" msgstr "" -#: src/testing/useful-crates.md +#: src/error-handling/thiserror-and-anyhow.md:48 msgid "" -"[rstest](https://docs.rs/rstest): Support for fixtures and parameterised " -"tests." +"The `Error` derive macro is provided by `thiserror`, and has lots of useful " +"attributes to help define error types in a compact way." msgstr "" -#: src/testing/googletest.md -msgid "" -"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " -"assertions using _matchers_:" +#: src/error-handling/thiserror-and-anyhow.md:50 +msgid "The `std::error::Error` trait is derived automatically." msgstr "" -#: src/testing/googletest.md -msgid "\"baz\"" +#: src/error-handling/thiserror-and-anyhow.md:51 +msgid "The message from `#[error]` is used to derive the `Display` trait." msgstr "" -#: src/testing/googletest.md -msgid "\"xyz\"" +#: src/error-handling/thiserror-and-anyhow.md:53 +msgid "`anyhow`" msgstr "" -#: src/testing/googletest.md +#: src/error-handling/thiserror-and-anyhow.md:55 msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" -#: src/testing/googletest.md -msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +#: src/error-handling/thiserror-and-anyhow.md:58 +msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" -#: src/testing/googletest.md +#: src/error-handling/thiserror-and-anyhow.md:59 msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." +"Actual error type inside of it can be extracted for examination if necessary." msgstr "" -#: src/testing/googletest.md -msgid "This just scratches the surface, there are many builtin matchers." +#: src/error-handling/thiserror-and-anyhow.md:60 +msgid "" +"Functionality provided by `anyhow::Result` may be familiar to Go " +"developers, as it provides similar usage patterns and ergonomics to `(T, " +"error)` from Go." msgstr "" -#: src/testing/googletest.md +#: src/error-handling/thiserror-and-anyhow.md:63 msgid "" -"A particularly nice feature is that mismatches in multi-line strings strings " -"are shown as a diff:" +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" -#: src/testing/googletest.md +#: src/error-handling/exercise.md:3 msgid "" -"\"Memory safety found,\\n\\\n" -" Rust's strong typing guides the way,\\n\\\n" -" Secure code you'll write.\"" +"The following implements a very simple parser for an expression language. " +"However, it handles errors by panicking. Rewrite it to instead use idiomatic " +"error handling and propagate errors to a return from `main`. Feel free to " +"use `thiserror` and `anyhow`." msgstr "" -#: src/testing/googletest.md +#: src/error-handling/exercise.md:8 msgid "" -"\"Memory safety found,\\n\\\n" -" Rust's silly humor guides the way,\\n\\\n" -" Secure code you'll write.\"" +"HINT: start by fixing error handling in the `parse` function. Once that is " +"working correctly, update `Tokenizer` to implement " +"`Iterator>` and handle that in the parser." msgstr "" -#: src/testing/googletest.md -msgid "shows a color-coded diff (colors not shown here):" +#: src/error-handling/exercise.md:15 src/error-handling/solution.md:9 +msgid "/// An arithmetic operator." msgstr "" -#: src/testing/googletest.md -msgid "" -"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" -"googletest/)." +#: src/error-handling/exercise.md:22 src/error-handling/solution.md:16 +msgid "/// A token in the expression language." msgstr "" -#: src/testing/googletest.md -msgid "GoogleTest is available for use in AOSP." +#: src/error-handling/exercise.md:30 src/error-handling/solution.md:24 +msgid "/// An expression in the expression language." msgstr "" -#: src/testing/mocking.md -msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" +#: src/error-handling/exercise.md:34 src/error-handling/solution.md:28 +msgid "/// A reference to a variable." msgstr "" -#: src/testing/mocking.md -msgid "" -"The advice here is for Android (AOSP) where Mockall is the recommended " -"mocking library. There are other [mocking libraries available on crates.io]" -"(https://crates.io/keywords/mock), in particular in the area of mocking HTTP " -"services. The other mocking libraries work in a similar fashion as Mockall, " -"meaning that they make it easy to get a mock implementation of a given trait." +#: src/error-handling/exercise.md:36 src/error-handling/solution.md:30 +msgid "/// A literal number." msgstr "" -#: src/testing/mocking.md -msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." +#: src/error-handling/exercise.md:38 src/error-handling/solution.md:32 +msgid "/// A binary operation." msgstr "" -#: src/testing/mocking.md -msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." +#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 +#: src/error-handling/solution.md:75 +msgid "'\\_'" msgstr "" -#: src/testing/mocking.md -msgid "" -"Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." +#: src/error-handling/exercise.md:76 src/error-handling/solution.md:76 +msgid "'+'" msgstr "" -#: src/testing/mocking.md -msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." +#: src/error-handling/exercise.md:77 src/error-handling/solution.md:77 +msgid "'-'" msgstr "" -#: src/testing/mocking.md -msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" +#: src/error-handling/exercise.md:78 +msgid "\"Unexpected character {c}\"" msgstr "" -#: src/testing/mocking.md -msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." +#: src/error-handling/exercise.md:88 src/error-handling/solution.md:87 +msgid "\"Unexpected end of input\"" msgstr "" -#: src/testing/lints.md -msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful " -"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " -"more lints, organized into groups that can be enabled per-project." +#: src/error-handling/exercise.md:92 +msgid "\"Invalid 32-bit integer'\"" msgstr "" -#: src/testing/lints.md -msgid "\"X probably fits in a u16, right? {}\"" +#: src/error-handling/exercise.md:96 src/error-handling/exercise.md:106 +msgid "\"Unexpected token {tok:?}\"" msgstr "" -#: src/testing/lints.md -msgid "" -"Run the code sample and examine the error message. There are also lints " -"visible here, but those will not be shown once the code compiles. Switch to " -"the Playground site to show those lints." +#: src/error-handling/exercise.md:98 src/error-handling/solution.md:110 +msgid "// Look ahead to parse a binary operation if present." msgstr "" -#: src/testing/lints.md -msgid "" -"After resolving the lints, run `clippy` on the playground site to show " -"clippy warnings. Clippy has extensive documentation of its lints, and adds " -"new lints (including default-deny lints) all the time." +#: src/error-handling/exercise.md:114 src/error-handling/solution.md:127 +msgid "\"10+foo+20-30\"" msgstr "" -#: src/testing/lints.md -msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " -"or via your editor." +#: src/error-handling/exercise.md:115 src/error-handling/solution.md:128 +msgid "\"{expr:?}\"" msgstr "" -#: src/testing/exercise.md -msgid "Luhn Algorithm" -msgstr "الگوریتم Luhn" - -#: src/testing/exercise.md -msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " -"to validate credit card numbers. The algorithm takes a string as input and " -"does the following to validate the credit card number:" +#: src/error-handling/solution.md:42 +msgid "\"Unexpected character '{0}' in input\"" msgstr "" -"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای " -"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " -"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " -"انجام می‌دهد:" -#: src/testing/exercise.md -msgid "Ignore all spaces. Reject number with less than two digits." -msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی با کمتر از دو رقم را رد کنید." - -#: src/testing/exercise.md -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`." +#: src/error-handling/solution.md:85 +msgid "\"Tokenizer error: {0}\"" msgstr "" -"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره " -"`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " -"می‌کنیم." -#: src/testing/exercise.md -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`." +#: src/error-handling/solution.md:89 +msgid "\"Unexpected token {0:?}\"" msgstr "" -"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. " -"بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." - -#: src/testing/exercise.md -msgid "Sum all the undoubled and doubled digits." -msgstr "تمام ارقام دو برابر نشده و دو برابر شده را جمع کنید." - -#: src/testing/exercise.md -msgid "The credit card number is valid if the sum ends with `0`." -msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت اعتباری معتبر است." -#: src/testing/exercise.md -msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, " -"along with two basic unit tests that confirm that most the algorithm is " -"implemented correctly." +#: src/error-handling/solution.md:91 +msgid "\"Invalid number\"" msgstr "" -#: src/testing/exercise.md -#, fuzzy -msgid "" -"Copy the code below to and write additional " -"tests to uncover bugs in the provided implementation, fixing any bugs you " -"find." +#: src/unsafe-rust.md +msgid "This segment should take about 1 hour and 5 minutes. It contains:" msgstr "" -"کد زیر را به کپی کنید و " -"تابع را پیاده‌سازی کنید." -#: src/testing/exercise.md src/testing/solution.md -msgid "\"4263 9826 4026 9299\"" +#: src/unsafe-rust/unsafe.md:3 +msgid "The Rust language has two parts:" msgstr "" -#: src/testing/exercise.md src/testing/solution.md -msgid "\"4539 3195 0343 6467\"" +#: src/unsafe-rust/unsafe.md:5 +msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -#: src/testing/exercise.md src/testing/solution.md -msgid "\"7992 7398 713\"" +#: src/unsafe-rust/unsafe.md:6 +msgid "" +"**Unsafe Rust:** can trigger undefined behavior if preconditions are " +"violated." msgstr "" -#: src/testing/exercise.md src/testing/solution.md -msgid "\"4223 9826 4026 9299\"" +#: src/unsafe-rust/unsafe.md:8 +msgid "" +"We saw mostly safe Rust in this course, but it's important to know what " +"Unsafe Rust is." msgstr "" -#: src/testing/exercise.md src/testing/solution.md -msgid "\"4539 3195 0343 6476\"" +#: src/unsafe-rust/unsafe.md:11 +msgid "" +"Unsafe code is usually small and isolated, and its correctness should be " +"carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" -#: src/testing/exercise.md src/testing/solution.md -msgid "\"8273 1232 7352 0569\"" +#: src/unsafe-rust/unsafe.md:14 +msgid "Unsafe Rust gives you access to five new capabilities:" msgstr "" -#: src/testing/solution.md -msgid "// This is the buggy version that appears in the problem.\n" +#: src/unsafe-rust/unsafe.md:16 +msgid "Dereference raw pointers." msgstr "" -#: src/testing/solution.md -msgid "// This is the solution and passes all of the tests below.\n" +#: src/unsafe-rust/unsafe.md:17 +msgid "Access or modify mutable static variables." msgstr "" -#: src/testing/solution.md -msgid "\"1234 5678 1234 5670\"" +#: src/unsafe-rust/unsafe.md:18 +msgid "Access `union` fields." msgstr "" -#: src/testing/solution.md -msgid "\"Is {cc_number} a valid credit card number? {}\"" +#: src/unsafe-rust/unsafe.md:19 +msgid "Call `unsafe` functions, including `extern` functions." msgstr "" -#: src/testing/solution.md -msgid "\"yes\"" +#: src/unsafe-rust/unsafe.md:20 +msgid "Implement `unsafe` traits." msgstr "" -#: src/testing/solution.md -msgid "\"no\"" +#: src/unsafe-rust/unsafe.md:22 +msgid "" +"We will briefly cover unsafe capabilities next. For full details, please see " +"Chapter 19.1 in the Rust Book and the Rustonomicon." msgstr "" -#: src/testing/solution.md -msgid "\"foo 0 0\"" +#: src/unsafe-rust/unsafe.md:29 +msgid "" +"Unsafe Rust does not mean the code is incorrect. It means that developers " +"have turned off some compiler safety features and have to write correct code " +"by themselves. It means the compiler no longer enforces Rust's memory-safety " +"rules." msgstr "" -#: src/testing/solution.md -msgid "\" \"" +#: src/unsafe-rust/dereferencing.md:3 +msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" msgstr "" -#: src/testing/solution.md -msgid "\" \"" +#: src/unsafe-rust/dereferencing.md:7 +msgid "\"careful!\"" msgstr "" -#: src/testing/solution.md -msgid "\" \"" +#: src/unsafe-rust/dereferencing.md:12 +msgid "" +"// SAFETY: r1 and r2 were obtained from references and so are guaranteed " +"to // be non-null and properly aligned, the objects underlying the " +"references // from which they were obtained are live throughout the whole " +"unsafe // block, and they are not accessed either through the references " +"or // concurrently through any other pointers." msgstr "" -#: src/testing/solution.md -msgid "\"0\"" +#: src/unsafe-rust/dereferencing.md:18 +msgid "\"r1 is: {}\"" msgstr "" -#: src/testing/solution.md -msgid "\" 0 0 \"" +#: src/unsafe-rust/dereferencing.md:19 +msgid "\"uhoh\"" msgstr "" -#: src/welcome-day-4-afternoon.md -msgid "[Error Handling](./error-handling.md) (45 minutes)" +#: src/unsafe-rust/dereferencing.md:20 +msgid "\"r2 is: {}\"" msgstr "" -#: src/welcome-day-4-afternoon.md -msgid "[Unsafe Rust](./unsafe-rust.md) (1 hour and 5 minutes)" +#: src/unsafe-rust/dereferencing.md:23 +msgid "" +"// NOT SAFE. DO NOT DO THIS. /\\* let r3: &String = unsafe { &\\*r1 }; " +"drop(s); println!(\"r3 is: {}\", \\*r3); \\*/" msgstr "" -#: src/welcome-day-4-afternoon.md -msgid "Including 10 minute breaks, this session should take about 2 hours" +#: src/unsafe-rust/dereferencing.md:35 +msgid "" +"It is good practice (and required by the Android Rust style guide) to write " +"a comment for each `unsafe` block explaining how the code inside it " +"satisfies the safety requirements of the unsafe operations it is doing." msgstr "" -#: src/error-handling.md -msgid "[Panics](./error-handling/panics.md) (3 minutes)" +#: src/unsafe-rust/dereferencing.md:39 +msgid "" +"In the case of pointer dereferences, this means that the pointers must be " +"_valid_, i.e.:" msgstr "" -#: src/error-handling.md -msgid "[Try Operator](./error-handling/try.md) (5 minutes)" +#: src/unsafe-rust/dereferencing.md:42 +msgid "The pointer must be non-null." msgstr "" -#: src/error-handling.md -msgid "[Try Conversions](./error-handling/try-conversions.md) (5 minutes)" +#: src/unsafe-rust/dereferencing.md:43 +msgid "" +"The pointer must be _dereferenceable_ (within the bounds of a single " +"allocated object)." msgstr "" -#: src/error-handling.md -msgid "[Error Trait](./error-handling/error.md) (5 minutes)" +#: src/unsafe-rust/dereferencing.md:45 +msgid "The object must not have been deallocated." msgstr "" -#: src/error-handling.md -msgid "" -"[thiserror and anyhow](./error-handling/thiserror-and-anyhow.md) (5 minutes)" +#: src/unsafe-rust/dereferencing.md:46 +msgid "There must not be concurrent accesses to the same location." msgstr "" -#: src/error-handling.md +#: src/unsafe-rust/dereferencing.md:47 msgid "" -"[Exercise: Rewriting with Result](./error-handling/exercise.md) (20 minutes)" +"If the pointer was obtained by casting a reference, the underlying object " +"must be live and no reference may be used to access the memory." msgstr "" -#: src/error-handling/panics.md -msgid "Rust handles fatal errors with a \"panic\"." +#: src/unsafe-rust/dereferencing.md:50 +msgid "In most cases the pointer must also be properly aligned." msgstr "" -#: src/error-handling/panics.md -msgid "Rust will trigger a panic if a fatal error happens at runtime:" +#: src/unsafe-rust/dereferencing.md:52 +msgid "" +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " +"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " +"outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" -#: src/error-handling/panics.md -msgid "\"v[100]: {}\"" +#: src/unsafe-rust/mutable-static.md:3 +msgid "It is safe to read an immutable static variable:" msgstr "" -#: src/error-handling/panics.md -msgid "Panics are for unrecoverable and unexpected errors." -msgstr "" +#: src/unsafe-rust/mutable-static.md:6 +#, fuzzy +msgid "\"Hello, world!\"" +msgstr "سلام دنیا" -#: src/error-handling/panics.md -msgid "Panics are symptoms of bugs in the program." +#: src/unsafe-rust/mutable-static.md:9 +msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" msgstr "" -#: src/error-handling/panics.md -msgid "Runtime failures like failed bounds checks can panic" +#: src/unsafe-rust/mutable-static.md:13 +msgid "" +"However, since data races can occur, it is unsafe to read and write mutable " +"static variables:" msgstr "" -#: src/error-handling/panics.md -msgid "Assertions (such as `assert!`) panic on failure" +#: src/unsafe-rust/mutable-static.md:20 src/unsafe-rust/mutable-static.md:29 +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`." msgstr "" -#: src/error-handling/panics.md -msgid "Purpose-specific panics can use the `panic!` macro." +#: src/unsafe-rust/mutable-static.md:31 +msgid "\"COUNTER: {COUNTER}\"" msgstr "" -#: src/error-handling/panics.md +#: src/unsafe-rust/mutable-static.md:39 msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions " -"had returned." +"The program here is safe because it is single-threaded. However, the Rust " +"compiler is conservative and will assume the worst. Try removing the " +"`unsafe` and see how the compiler explains that it is undefined behavior to " +"mutate a static from multiple threads." msgstr "" -#: src/error-handling/panics.md +#: src/unsafe-rust/mutable-static.md:44 msgid "" -"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +"Using a mutable static is generally a bad idea, but there are some cases " +"where it might make sense in low-level `no_std` code, such as implementing a " +"heap allocator or working with some C APIs." msgstr "" -#: src/error-handling/panics.md -msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be " -"caught:" +#: src/unsafe-rust/unions.md:3 +msgid "Unions are like enums, but you need to track the active field yourself:" msgstr "" -#: src/error-handling/panics.md -msgid "\"No problem here!\"" +#: src/unsafe-rust/unions.md:14 +msgid "\"int: {}\"" msgstr "" -#: src/error-handling/panics.md -msgid "\"{result:?}\"" +#: src/unsafe-rust/unions.md:15 +msgid "\"bool: {}\"" msgstr "" -#: src/error-handling/panics.md -msgid "\"oh no!\"" -msgstr "" +#: src/unsafe-rust/unions.md:15 +#, fuzzy +msgid "// Undefined behavior!" +msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" -#: src/error-handling/panics.md +#: src/unsafe-rust/unions.md:22 msgid "" -"Catching is unusual; do not attempt to implement exceptions with " -"`catch_unwind`!" +"Unions are very rarely needed in Rust as you can usually use an enum. They " +"are occasionally needed for interacting with C library APIs." msgstr "" -#: src/error-handling/panics.md +#: src/unsafe-rust/unions.md:25 msgid "" -"This can be useful in servers which should keep running even if a single " -"request crashes." +"If you just want to reinterpret bytes as a different type, you probably want " +"`std::mem::transmute` or a safe wrapper such as the `zerocopy` crate." msgstr "" -#: src/error-handling/panics.md -msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." -msgstr "" +#: src/unsafe-rust/unsafe-functions.md:3 src/unsafe-rust/unsafe-functions.md:76 +msgid "Calling Unsafe Functions" +msgstr "فراخوانی متدهای ناامن" -#: src/error-handling/try.md +#: src/unsafe-rust/unsafe-functions.md:5 msgid "" -"Runtime errors like connection-refused or file-not-found are handled with " -"the `Result` type, but matching this type on every call can be cumbersome. " -"The try-operator `?` is used to return errors to the caller. It lets you " -"turn the common" +"A function or method can be marked `unsafe` if it has extra preconditions " +"you must uphold to avoid undefined behaviour:" msgstr "" -#: src/error-handling/try.md -msgid "into the much simpler" +#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 +#: src/unsafe-rust/solution.md:41 src/android/interoperability/with-c.md:9 +#: src/android/interoperability/with-c/rust.md:15 +#: src/android/interoperability/with-c/rust.md:30 +#: src/android/interoperability/cpp/cpp-bridge.md:29 +#: src/android/interoperability/cpp/cpp-bridge.md:38 +#: src/exercises/chromium/build-rules.md:8 +#: src/exercises/chromium/build-rules.md:21 +#: src/bare-metal/aps/inline-assembly.md:19 +#: src/bare-metal/aps/better-uart/using.md:24 +#: src/bare-metal/aps/logging/using.md:23 +#: src/exercises/bare-metal/solutions-afternoon.md:43 +msgid "\"C\"" msgstr "" -#: src/error-handling/try.md -msgid "We can use this to simplify our error handling code:" +#: src/unsafe-rust/unsafe-functions.md:14 +msgid "\"🗻∈🌏\"" msgstr "" -#: src/error-handling/try.md -msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" +#: src/unsafe-rust/unsafe-functions.md:16 +msgid "" +"// SAFETY: The indices are in the correct order, within the bounds of the // " +"string slice, and lie on UTF-8 sequence boundaries." msgstr "" -#: src/error-handling/try.md src/error-handling/try-conversions.md -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"config.dat\"" +#: src/unsafe-rust/unsafe-functions.md:19 +#: src/unsafe-rust/unsafe-functions.md:20 +#: src/unsafe-rust/unsafe-functions.md:21 +msgid "\"emoji: {}\"" msgstr "" -#: src/error-handling/try.md src/error-handling/try-conversions.md -msgid "\"username or error: {username:?}\"" +#: src/unsafe-rust/unsafe-functions.md:24 +msgid "\"char count: {}\"" msgstr "" -#: src/error-handling/try.md -msgid "Simplify the `read_username` function to use `?`." +#: src/unsafe-rust/unsafe-functions.md:26 +msgid "" +"// SAFETY: `abs` doesn't deal with pointers and doesn't have any safety // " +"requirements." msgstr "" -#: src/error-handling/try.md -msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." +#: src/unsafe-rust/unsafe-functions.md:29 +msgid "\"Absolute value of -3 according to C: {}\"" msgstr "" -#: src/error-handling/try.md +#: src/unsafe-rust/unsafe-functions.md:32 msgid "" -"Use the `fs::write` call to test out the different scenarios: no file, empty " -"file, file with username." +"// Not upholding the UTF-8 encoding requirement breaks memory safety! // " +"println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) }); // println!" +"(\"char count: {}\", count_chars(unsafe { // emojis.get_unchecked(0..3) }));" msgstr "" -#: src/error-handling/try.md -msgid "" -"Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process:Termination`. In practice, this means that `E` implements `Debug`. " -"The executable will print the `Err` variant and return a nonzero exit status " -"on error." -msgstr "" +#: src/unsafe-rust/unsafe-functions.md:43 +#: src/unsafe-rust/unsafe-functions.md:88 +msgid "Writing Unsafe Functions" +msgstr "نوشتن متدهای ناامن" -#: src/error-handling/try-conversions.md +#: src/unsafe-rust/unsafe-functions.md:45 msgid "" -"The effective expansion of `?` is a little more complicated than previously " -"indicated:" +"You can mark your own functions as `unsafe` if they require particular " +"conditions to avoid undefined behaviour." msgstr "" -#: src/error-handling/try-conversions.md -msgid "works the same as" +#: src/unsafe-rust/unsafe-functions.md:49 +msgid "" +"/// Swaps the values pointed to by the given pointers. /// /// # " +"Safety /// /// The pointers must be valid and properly aligned." msgstr "" -#: src/error-handling/try-conversions.md -msgid "" -"The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function. This makes it easy to encapsulate errors into " -"higher-level errors." +#: src/unsafe-rust/unsafe-functions.md:64 +msgid "// SAFETY: ..." msgstr "" -#: src/error-handling/try-conversions.md -msgid "\"IO error: {e}\"" +#: src/unsafe-rust/unsafe-functions.md:69 +msgid "\"a = {}, b = {}\"" msgstr "" -#: src/error-handling/try-conversions.md -msgid "\"Found no username in {path}\"" +#: src/unsafe-rust/unsafe-functions.md:78 +msgid "" +"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " +"create UB if the range is incorrect. `abs` is incorrect for a different " +"reason: it is an external function (FFI). Calling external functions is " +"usually only a problem when those functions do things with pointers which " +"might violate Rust's memory model, but in general any C function might have " +"undefined behaviour under any arbitrary circumstances." msgstr "" -#: src/error-handling/try-conversions.md -#: src/error-handling/thiserror-and-anyhow.md -msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" +#: src/unsafe-rust/unsafe-functions.md:85 +msgid "The `\"C\"` in this example is the ABI; other ABIs are available too." msgstr "" -#: src/error-handling/try-conversions.md +#: src/unsafe-rust/unsafe-functions.md:90 msgid "" -"The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. " -"A function that returns `Result` can only use `?` on a value " -"of type `Result` if `ErrorOuter` and `ErrorInner` are the " -"same type or if `ErrorOuter` implements `From`." +"We wouldn't actually use pointers for a `swap` function - it can be done " +"safely with references." msgstr "" -#: src/error-handling/try-conversions.md +#: src/unsafe-rust/unsafe-functions.md:93 msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, " -"especially when the conversion only happens in one place." +"Note that unsafe code is allowed within an unsafe function without an " +"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " +"Try adding it and see what happens. This will likely change in a future Rust " +"edition." msgstr "" -#: src/error-handling/try-conversions.md +#: src/unsafe-rust/unsafe-traits.md:1 +msgid "Implementing Unsafe Traits" +msgstr "پیاده سازی صفات (Traits) ناامن" + +#: src/unsafe-rust/unsafe-traits.md:3 msgid "" -"There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and " -"`U` types." +"Like with functions, you can mark a trait as `unsafe` if the implementation " +"must guarantee particular conditions to avoid undefined behaviour." msgstr "" -#: src/error-handling/try-conversions.md +#: src/unsafe-rust/unsafe-traits.md:6 msgid "" -"A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " -"turns `Result` into `Option`." +"For example, the `zerocopy` crate has an unsafe trait that looks something " +"like this:" msgstr "" -#: src/error-handling/error.md -msgid "Dynamic Error Types" -msgstr "انواع خطاهای Dynamic" - -#: src/error-handling/error.md +#: src/unsafe-rust/unsafe-traits.md:12 msgid "" -"Sometimes we want to allow any type of error to be returned without writing " -"our own enum covering all the different possibilities. The `std::error::" -"Error` trait makes it easy to create a trait object that can contain any " -"error." +"/// ... /// # Safety /// The type must have a defined representation and no " +"padding." msgstr "" -#: src/error-handling/error.md -msgid "\"count.dat\"" +#: src/unsafe-rust/unsafe-traits.md:26 +msgid "// SAFETY: `u32` has a defined representation and no padding." msgstr "" -#: src/error-handling/error.md -msgid "\"1i3\"" +#: src/unsafe-rust/unsafe-traits.md:34 +msgid "" +"There should be a `# Safety` section on the Rustdoc for the trait explaining " +"the requirements for the trait to be safely implemented." msgstr "" -#: src/error-handling/error.md -msgid "\"Count: {count}\"" +#: src/unsafe-rust/unsafe-traits.md:37 +msgid "" +"The actual safety section for `AsBytes` is rather longer and more " +"complicated." msgstr "" -#: src/error-handling/error.md -msgid "\"Error: {err}\"" +#: src/unsafe-rust/unsafe-traits.md:39 +msgid "The built-in `Send` and `Sync` traits are unsafe." msgstr "" -#: src/error-handling/error.md +#: src/unsafe-rust/exercise.md:1 +msgid "Safe FFI Wrapper" +msgstr "امن بودن FFI Wrapper" + +#: src/unsafe-rust/exercise.md:3 msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) " -"or `std::num::ParseIntError` (from `String::parse`)." +"Rust has great support for calling functions through a _foreign function " +"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " +"functions you would use from C to read the names of files in a directory." msgstr "" -#: src/error-handling/error.md -msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle " -"different error cases differently in the program. As such it's generally not " -"a good idea to use `Box` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." +#: src/unsafe-rust/exercise.md:7 +msgid "You will want to consult the manual pages:" msgstr "" -#: src/error-handling/error.md -msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." +#: src/unsafe-rust/exercise.md:9 +msgid "`opendir(3)`" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" -"anyhow/) crates are widely used to simplify error handling." +#: src/unsafe-rust/exercise.md:10 +msgid "`readdir(3)`" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`thiserror` is often used in libraries to create custom error types that " -"implement `From`." +#: src/unsafe-rust/exercise.md:11 +msgid "`closedir(3)`" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/unsafe-rust/exercise.md:13 msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." +"You will also want to browse the `std::ffi` module. There you find a number " +"of string types which you need for the exercise:" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Found no username in {0}\"" +#: src/unsafe-rust/exercise.md:16 +msgid "Encoding" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to open {path}\"" +#: src/unsafe-rust/exercise.md:16 +msgid "Use" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to read\"" -msgstr "" +#: src/unsafe-rust/exercise.md:18 +#, fuzzy +msgid "`str` and `String`" +msgstr "`break` و `continue`" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Username: {username}\"" +#: src/unsafe-rust/exercise.md:18 +msgid "UTF-8" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Error: {err:?}\"" +#: src/unsafe-rust/exercise.md:18 +msgid "Text processing in Rust" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "`thiserror`" +#: src/unsafe-rust/exercise.md:19 +#, fuzzy +msgid "`CStr` and `CString`" +msgstr "`break` و `continue`" + +#: src/unsafe-rust/exercise.md:19 +msgid "NUL-terminated" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful " -"attributes to help define error types in a compact way." +#: src/unsafe-rust/exercise.md:19 +msgid "Communicating with C functions" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "The `std::error::Error` trait is derived automatically." +#: src/unsafe-rust/exercise.md:20 +#, fuzzy +msgid "`OsStr` and `OsString`" +msgstr "String" + +#: src/unsafe-rust/exercise.md:20 +msgid "OS-specific" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "The message from `#[error]` is used to derive the `Display` trait." +#: src/unsafe-rust/exercise.md:20 +msgid "Communicating with the OS" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "`anyhow`" +#: src/unsafe-rust/exercise.md:22 +msgid "You will convert between all these types:" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/unsafe-rust/exercise.md:24 msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." +"`&str` to `CString`: you need to allocate space for a trailing `\\0` " +"character," msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "`anyhow::Result` is a type alias for `Result`." +#: src/unsafe-rust/exercise.md:25 +msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/unsafe-rust/exercise.md:26 msgid "" -"Actual error type inside of it can be extracted for examination if necessary." +"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " +"character," msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/unsafe-rust/exercise.md:28 msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." +"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " +"unknown data\"," msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/unsafe-rust/exercise.md:30 msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use `OsStrExt` " +"to create it," msgstr "" -#: src/error-handling/exercise.md -msgid "Exercise: Rewriting with Result" +#: src/unsafe-rust/exercise.md:33 +msgid "" +"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " +"return it and call `readdir` again." msgstr "" -#: src/error-handling/exercise.md -msgid "" -"The following implements a very simple parser for an expression language. " -"However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +#: src/unsafe-rust/exercise.md:36 +msgid "The Nomicon also has a very useful chapter about FFI." msgstr "" -#: src/error-handling/exercise.md +#: src/unsafe-rust/exercise.md:47 +#, fuzzy msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." +"Copy the code below to https://play.rust-lang.org/ and fill in the missing " +"functions and methods:" msgstr "" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An arithmetic operator.\n" +#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 +#: src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 +#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 +#: src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 +#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +msgid "\"macos\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A token in the expression language.\n" +#: src/unsafe-rust/exercise.md:59 src/unsafe-rust/solution.md:9 +msgid "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An expression in the expression language.\n" +#: src/unsafe-rust/exercise.md:66 src/unsafe-rust/solution.md:16 +msgid "" +"// Layout according to the Linux man page for readdir(3), where ino_t and // " +"off_t are resolved according to the definitions in // /usr/include/x86_64-" +"linux-gnu/{sys/types.h, bits/typesizes.h}." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A reference to a variable.\n" +#: src/unsafe-rust/exercise.md:79 src/unsafe-rust/solution.md:29 +msgid "// Layout according to the macOS man page for dir(5)." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A literal number.\n" +#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 +#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +msgid "\"x86_64\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A binary operation.\n" +#: src/unsafe-rust/exercise.md:97 src/unsafe-rust/solution.md:47 +msgid "" +"// See https://github.com/rust-lang/libc/issues/414 and the section on // " +"\\_DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2). // // " +"\"Platforms that existed before these updates were available\" refers // to " +"macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'z'" +#: src/unsafe-rust/exercise.md:103 src/unsafe-rust/solution.md:53 +msgid "\"readdir$INODE64\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'_'" +#: src/unsafe-rust/exercise.md:121 src/unsafe-rust/solution.md:71 +msgid "" +"// Call opendir and return a Ok value if that worked, // otherwise return " +"Err with a message." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'+'" +#: src/unsafe-rust/exercise.md:130 +msgid "// Keep calling readdir until we get a NULL pointer back." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'-'" +#: src/unsafe-rust/exercise.md:137 src/unsafe-rust/solution.md:105 +msgid "// Call closedir as needed." msgstr "" -#: src/error-handling/exercise.md -msgid "\"Unexpected character {c}\"" +#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 +#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 +#: src/android/interoperability/with-c/rust.md:44 +msgid "\".\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"Unexpected end of input\"" +#: src/unsafe-rust/exercise.md:144 src/unsafe-rust/solution.md:117 +msgid "\"files: {:#?}\"" msgstr "" -#: src/error-handling/exercise.md -msgid "\"Invalid 32-bit integer'\"" +#: src/unsafe-rust/solution.md:74 +msgid "\"Invalid path: {err}\"" msgstr "" -#: src/error-handling/exercise.md -msgid "\"Unexpected token {tok:?}\"" +#: src/unsafe-rust/solution.md:75 +msgid "// SAFETY: path.as_ptr() cannot be NULL." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "// Look ahead to parse a binary operation if present.\n" +#: src/unsafe-rust/solution.md:78 +msgid "\"Could not open {:?}\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"10+foo+20-30\"" +#: src/unsafe-rust/solution.md:88 +msgid "" +"// Keep calling readdir until we get a NULL pointer back. // SAFETY: self." +"dir is never NULL." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"{expr:?}\"" +#: src/unsafe-rust/solution.md:92 +msgid "// We have reached the end of the directory." msgstr "" -#: src/error-handling/solution.md -msgid "\"Unexpected character '{0}' in input\"" +#: src/unsafe-rust/solution.md:95 +msgid "// SAFETY: dirent is not NULL and dirent.d_name is NUL // terminated." msgstr "" -#: src/error-handling/solution.md -msgid "\"Tokenizer error: {0}\"" +#: src/unsafe-rust/solution.md:107 +msgid "// SAFETY: self.dir is not NULL." msgstr "" -#: src/error-handling/solution.md -msgid "\"Unexpected token {0:?}\"" +#: src/unsafe-rust/solution.md:109 +msgid "\"Could not close {:?}\"" msgstr "" -#: src/error-handling/solution.md -msgid "\"Invalid number\"" +#: src/unsafe-rust/solution.md:128 +msgid "\"no-such-directory\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe](./unsafe-rust/unsafe.md) (5 minutes)" +#: src/unsafe-rust/solution.md:136 src/unsafe-rust/solution.md:151 +msgid "\"Non UTF-8 character in path\"" msgstr "" -#: src/unsafe-rust.md -msgid "" -"[Dereferencing Raw Pointers](./unsafe-rust/dereferencing.md) (10 minutes)" +#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 +msgid "\"..\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Mutable Static Variables](./unsafe-rust/mutable-static.md) (5 minutes)" +#: src/unsafe-rust/solution.md:147 src/unsafe-rust/solution.md:155 +msgid "\"foo.txt\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Unions](./unsafe-rust/unions.md) (5 minutes)" +#: src/unsafe-rust/solution.md:147 +msgid "\"The Foo Diaries\\n\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe Functions](./unsafe-rust/unsafe-functions.md) (5 minutes)" +#: src/unsafe-rust/solution.md:148 src/unsafe-rust/solution.md:155 +msgid "\"bar.png\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe Traits](./unsafe-rust/unsafe-traits.md) (5 minutes)" +#: src/unsafe-rust/solution.md:148 +msgid "\"\\\\n\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" +#: src/unsafe-rust/solution.md:149 src/unsafe-rust/solution.md:155 +msgid "\"crab.rs\"" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "The Rust language has two parts:" +#: src/unsafe-rust/solution.md:149 +msgid "\"//! Crab\\n\"" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "**Safe Rust:** memory safe, no undefined behavior possible." +#: src/android.md +msgid "Welcome to Rust in Android" msgstr "" -#: src/unsafe-rust/unsafe.md +#: src/android.md msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are " -"violated." +"Rust is supported for system software on Android. This means that you can " +"write new services, libraries, drivers or even firmware in Rust (or improve " +"existing code as needed)." msgstr "" -#: src/unsafe-rust/unsafe.md +#: src/android.md msgid "" -"We saw mostly safe Rust in this course, but it's important to know what " -"Unsafe Rust is." +"We will attempt to call Rust from one of your own projects today. So try to " +"find a little corner of your code base where we can move some lines of code " +"to Rust. The fewer dependencies and \"exotic\" types the better. Something " +"that parses some raw bytes would be ideal." msgstr "" -#: src/unsafe-rust/unsafe.md +#: src/android.md msgid "" -"Unsafe code is usually small and isolated, and its correctness should be " -"carefully documented. It is usually wrapped in a safe abstraction layer." +"The speaker may mention any of the following given the increased use of Rust " +"in Android:" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Unsafe Rust gives you access to five new capabilities:" +#: src/android.md +msgid "Service example: DNS over HTTP" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Dereference raw pointers." +#: src/android.md +msgid "Libraries: Rutabaga Virtual Graphics Interface" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Access or modify mutable static variables." +#: src/android.md +msgid "Kernel Drivers: Binder" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Access `union` fields." +#: src/android.md +msgid "Firmware: pKVM firmware" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Call `unsafe` functions, including `extern` functions." +#: src/android/setup.md +msgid "" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make " +"sure you have access to one or create a new one with:" msgstr "" -#: src/unsafe-rust/unsafe.md -msgid "Implement `unsafe` traits." +#: src/android/setup.md +msgid "Please see the Android Developer Codelab for details." msgstr "" -#: src/unsafe-rust/unsafe.md +#: src/android/setup.md msgid "" -"We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"Cuttlefish is a reference Android device designed to work on generic Linux " +"desktops. MacOS support is also planned." msgstr "" -#: src/unsafe-rust/unsafe.md +#: src/android/setup.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers " -"have turned off some compiler safety features and have to write correct code " -"by themselves. It means the compiler no longer enforces Rust's memory-safety " -"rules." +"The Cuttlefish system image maintains high fidelity to real devices, and is " +"the ideal emulator to run many Rust use cases." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" +#: src/android/build-rules.md +msgid "The Android build system (Soong) supports Rust via a number of modules:" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "\"careful!\"" +#: src/android/build-rules.md +msgid "Module Type" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "" -"// Safe because r1 and r2 were obtained from references and so are\n" -" // guaranteed to be non-null and properly aligned, the objects " -"underlying\n" -" // the references from which they were obtained are live throughout the\n" -" // whole unsafe block, and they are not accessed either through the\n" -" // references or concurrently through any other pointers.\n" +#: src/android/build-rules.md +msgid "Description" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "\"r1 is: {}\"" +#: src/android/build-rules.md +msgid "`rust_binary`" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "\"uhoh\"" +#: src/android/build-rules.md +msgid "Produces a Rust binary." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "\"r2 is: {}\"" +#: src/android/build-rules.md +msgid "`rust_library`" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "" -"// NOT SAFE. DO NOT DO THIS.\n" -" /*\n" -" let r3: &String = unsafe { &*r1 };\n" -" drop(s);\n" -" println!(\"r3 is: {}\", *r3);\n" -" */" +#: src/android/build-rules.md +msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "" -"It is good practice (and required by the Android Rust style guide) to write " -"a comment for each `unsafe` block explaining how the code inside it " -"satisfies the safety requirements of the unsafe operations it is doing." +#: src/android/build-rules.md +msgid "`rust_ffi`" msgstr "" -#: src/unsafe-rust/dereferencing.md +#: src/android/build-rules.md msgid "" -"In the case of pointer dereferences, this means that the pointers must be " -"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" +"Produces a Rust C library usable by `cc` modules, and provides both static " +"and shared variants." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "The pointer must be non-null." +#: src/android/build-rules.md +msgid "`rust_proc_macro`" msgstr "" -#: src/unsafe-rust/dereferencing.md +#: src/android/build-rules.md msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single " -"allocated object)." -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "The object must not have been deallocated." -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "There must not be concurrent accesses to the same location." +"Produces a `proc-macro` Rust library. These are analogous to compiler " +"plugins." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "" -"If the pointer was obtained by casting a reference, the underlying object " -"must be live and no reference may be used to access the memory." +#: src/android/build-rules.md +msgid "`rust_test`" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "In most cases the pointer must also be properly aligned." +#: src/android/build-rules.md +msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +#: src/android/build-rules.md +msgid "`rust_fuzz`" msgstr "" -#: src/unsafe-rust/mutable-static.md -msgid "It is safe to read an immutable static variable:" +#: src/android/build-rules.md +msgid "Produces a Rust fuzz binary leveraging `libfuzzer`." msgstr "" -#: src/unsafe-rust/mutable-static.md -#, fuzzy -msgid "\"Hello, world!\"" -msgstr "سلام دنیا" - -#: src/unsafe-rust/mutable-static.md -msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" +#: src/android/build-rules.md +msgid "`rust_protobuf`" msgstr "" -#: src/unsafe-rust/mutable-static.md +#: src/android/build-rules.md msgid "" -"However, since data races can occur, it is unsafe to read and write mutable " -"static variables:" -msgstr "" - -#: src/unsafe-rust/mutable-static.md -msgid "\"COUNTER: {COUNTER}\"" +"Generates source and produces a Rust library that provides an interface for " +"a particular protobuf." msgstr "" -#: src/unsafe-rust/mutable-static.md -msgid "" -"The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +#: src/android/build-rules.md +msgid "`rust_bindgen`" msgstr "" -#: src/unsafe-rust/mutable-static.md +#: src/android/build-rules.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." -msgstr "" - -#: src/unsafe-rust/unions.md -msgid "Unions are like enums, but you need to track the active field yourself:" +"Generates source and produces a Rust library containing Rust bindings to C " +"libraries." msgstr "" -#: src/unsafe-rust/unions.md -msgid "\"int: {}\"" +#: src/android/build-rules.md +msgid "We will look at `rust_binary` and `rust_library` next." msgstr "" -#: src/unsafe-rust/unions.md -msgid "\"bool: {}\"" +#: src/android/build-rules.md +msgid "Additional items speaker may mention:" msgstr "" -#: src/unsafe-rust/unions.md -#, fuzzy -msgid "// Undefined behavior!\n" -msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" - -#: src/unsafe-rust/unions.md +#: src/android/build-rules.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They " -"are occasionally needed for interacting with C library APIs." +"Cargo is not optimized for multi-language repos, and also downloads packages " +"from the internet." msgstr "" -#: src/unsafe-rust/unions.md +#: src/android/build-rules.md msgid "" -"If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." -"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" -"crates/zerocopy) crate." +"For compliance and performance, Android must have crates in-tree. It must " +"also interop with C/C++/Java code. Soong fills that gap." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "Calling Unsafe Functions" -msgstr "فراخوانی متدهای ناامن" - -#: src/unsafe-rust/unsafe-functions.md +#: src/android/build-rules.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md -#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md -#: src/android/interoperability/with-c/rust.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"C\"" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md -msgid "\"🗻∈🌏\"" +"Soong has many similarities to Bazel, which is the open-source variant of " +"Blaze (used in google3)." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"// Safe because the indices are in the correct order, within the bounds of\n" -" // the string slice, and lie on UTF-8 sequence boundaries.\n" +#: src/android/build-rules.md +msgid "There is a plan to transition Android, ChromeOS, and Fuchsia to Bazel." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"emoji: {}\"" +#: src/android/build-rules.md +msgid "Learning Bazel-like build rules is useful for all Rust OS developers." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"char count: {}\"" +#: src/android/build-rules.md +msgid "Fun fact: Data from Star Trek is a Soong-type Android." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -#, fuzzy -msgid "// Undefined behavior if abs misbehaves.\n" -msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" - -#: src/unsafe-rust/unsafe-functions.md -msgid "\"Absolute value of -3 according to C: {}\"" +#: src/android/build-rules/binary.md:1 +msgid "Rust Binaries" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/android/build-rules/binary.md:3 msgid "" -"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" -" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" -" // println!(\"char count: {}\", count_chars(unsafe {\n" -" // emojis.get_unchecked(0..3) }));\n" +"Let us start with a simple application. At the root of an AOSP checkout, " +"create the following files:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "Writing Unsafe Functions" -msgstr "نوشتن متدهای ناامن" +#: src/android/build-rules/binary.md:6 src/android/build-rules/library.md:13 +msgid "_hello_rust/Android.bp_:" +msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +#: src/android/build-rules/binary.md:10 src/android/build-rules/binary.md:11 +msgid "\"hello_rust\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"/// Swaps the values pointed to by the given pointers.\n" -"///\n" -"/// # Safety\n" -"///\n" -"/// The pointers must be valid and properly aligned.\n" +#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 +#: src/android/logging.md +msgid "\"src/main.rs\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "// Safe because ...\n" +#: src/android/build-rules/binary.md:16 src/android/build-rules/library.md:34 +msgid "_hello_rust/src/main.rs_:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"a = {}, b = {}\"" +#: src/android/build-rules/binary.md:19 src/android/build-rules/library.md:37 +msgid "//! Rust demo." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +#: src/android/build-rules/binary.md:20 src/android/build-rules/library.md:41 +msgid "/// Prints a greeting to standard output." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too]" -"(https://doc.rust-lang.org/reference/items/external-blocks.html)." +#: src/android/build-rules/binary.md:23 src/exercises/chromium/build-rules.md:9 +msgid "\"Hello from Rust!\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +#: src/android/build-rules/binary.md:27 +msgid "You can now build, push, and run the binary:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/android/build-rules/binary.md:29 msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"```shell\n" +"m hello_rust\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust\" /data/local/tmp\n" +"adb shell /data/local/tmp/hello_rust\n" +"```" msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "Implementing Unsafe Traits" -msgstr "پیاده سازی صفات (Traits) ناامن" - -#: src/unsafe-rust/unsafe-traits.md -msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation " -"must guarantee particular conditions to avoid undefined behaviour." +#: src/android/build-rules/library.md:1 +msgid "Rust Libraries" msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +#: src/android/build-rules/library.md:3 +msgid "You use `rust_library` to create a new Rust library for Android." msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "" -"/// ...\n" -"/// # Safety\n" -"/// The type must have a defined representation and no padding.\n" +#: src/android/build-rules/library.md:5 +msgid "Here we declare a dependency on two libraries:" msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "// Safe because u32 has a defined representation and no padding.\n" +#: src/android/build-rules/library.md:7 +msgid "`libgreeting`, which we define below," msgstr "" -#: src/unsafe-rust/unsafe-traits.md +#: src/android/build-rules/library.md:8 msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining " -"the requirements for the trait to be safely implemented." +"`libtextwrap`, which is a crate already vendored in `external/rust/crates/`." msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "" -"The actual safety section for `AsBytes` is rather longer and more " -"complicated." +#: src/android/build-rules/library.md:17 src/android/build-rules/library.md:18 +msgid "\"hello_rust_with_dep\"" msgstr "" -#: src/unsafe-rust/unsafe-traits.md -msgid "The built-in `Send` and `Sync` traits are unsafe." +#: src/android/build-rules/library.md:21 src/android/build-rules/library.md:28 +msgid "\"libgreetings\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Safe FFI Wrapper" -msgstr "امن بودن FFI Wrapper" +#: src/android/build-rules/library.md:22 +msgid "\"libtextwrap\"" +msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"Rust has great support for calling functions through a _foreign function " -"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " -"functions you would use from C to read the names of files in a directory." +#: src/android/build-rules/library.md:24 +msgid "// Need this to avoid dynamic link error." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "You will want to consult the manual pages:" +#: src/android/build-rules/library.md:29 +msgid "\"greetings\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" +#: src/android/build-rules/library.md:30 +#: src/android/aidl/example-service/service.md:28 src/android/testing.md +#: src/android/interoperability/java.md:39 +msgid "\"src/lib.rs\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" +#: src/android/build-rules/library.md:48 +msgid "_hello_rust/src/lib.rs_:" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" +#: src/android/build-rules/library.md:51 +msgid "//! Greeting library." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" -"ffi/) module. There you find a number of string types which you need for the " -"exercise:" +#: src/android/build-rules/library.md:52 +msgid "/// Greet `name`." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Encoding" +#: src/android/build-rules/library.md:55 +msgid "\"Hello {name}, it is very nice to meet you!\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Use" +#: src/android/build-rules/library.md:59 +msgid "You build, push, and run the binary like before:" msgstr "" -#: src/unsafe-rust/exercise.md +#: src/android/build-rules/library.md:61 msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"```shell\n" +"m hello_rust_with_dep\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/hello_rust_with_dep\n" +"```" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "UTF-8" +#: src/android/aidl.md +msgid "The Android Interface Definition Language (AIDL) is supported in Rust:" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Text processing in Rust" +#: src/android/aidl.md +msgid "Rust code can call existing AIDL servers," +msgstr "" + +#: src/android/aidl.md +msgid "You can create new AIDL servers in Rust." msgstr "" -#: src/unsafe-rust/exercise.md +#: src/android/aidl/birthday-service.md:3 msgid "" -"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" -"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" +"To illustrate how to use Rust with Binder, we're going to walk through the " +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "NUL-terminated" +#: src/android/aidl/example-service/interface.md:1 +msgid "AIDL Interfaces" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Communicating with C functions" +#: src/android/aidl/example-service/interface.md:3 +msgid "You declare the API of your service using an AIDL interface:" msgstr "" -#: src/unsafe-rust/exercise.md +#: src/android/aidl/example-service/interface.md:5 +#: src/android/aidl/example-service/service-bindings.md:6 msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " -"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "OS-specific" +#: src/android/aidl/example-service/interface.md:8 +#: src/android/aidl/example-service/service-bindings.md:9 +#: src/android/aidl/example-service/changing-definition.md:8 +msgid "/\\*\\* Birthday service interface. \\*/" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "Communicating with the OS" +#: src/android/aidl/example-service/interface.md:10 +#: src/android/aidl/example-service/service-bindings.md:11 +#: src/android/aidl/example-service/changing-definition.md:11 +msgid "/\\*\\* Generate a Happy Birthday message. \\*/" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "You will convert between all these types:" +#: src/android/aidl/example-service/interface.md:15 +msgid "_birthday_service/aidl/Android.bp_:" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` " -"character," +#: src/android/aidl/example-service/interface.md:19 +msgid "\"com.example.birthdayservice\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "`CString` to `*const i8`: you need a pointer to call C functions," +#: src/android/aidl/example-service/interface.md:20 +msgid "\"com/example/birthdayservice/\\*.aidl\"" msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " -"character," +#: src/android/aidl/example-service/interface.md:23 +msgid "// Rust is not enabled by default" msgstr "" -#: src/unsafe-rust/exercise.md +#: src/android/aidl/example-service/interface.md:32 msgid "" -"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " -"unknown data\"," +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." +"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," +#: src/android/aidl/example-service/service-bindings.md:1 +msgid "Generated Service API" msgstr "" -#: src/unsafe-rust/exercise.md +#: src/android/aidl/example-service/service-bindings.md:3 msgid "" -"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " -"return it and call `readdir` again." +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " -"useful chapter about FFI." -msgstr "" +#: src/android/aidl/example-service/service-bindings.md:16 +#, fuzzy +msgid "_Generated trait_:" +msgstr "Rust ناایمن" -#: src/unsafe-rust/exercise.md +#: src/android/aidl/example-service/service-bindings.md:24 msgid "" -"Copy the code below to and fill in the missing " -"functions and methods:" -msgstr "" - -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "\"macos\"" +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html.\n" +#: src/android/aidl/example-service/service-bindings.md:29 +msgid "" +"The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/android/aidl/example-service/service-bindings.md:31 msgid "" -"// Layout according to the Linux man page for readdir(3), where ino_t and\n" -" // off_t are resolved according to the definitions in\n" -" // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h}.\n" +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "// Layout according to the macOS man page for dir(5).\n" +#: src/android/aidl/example-service/service-bindings.md:33 +msgid "" +"`String` for an argument results in a different Rust type than `String` as a " +"return type." msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "\"x86_64\"" +#: src/android/aidl/example-service/service.md:1 +msgid "Service Implementation" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "" -"// See https://github.com/rust-lang/libc/issues/414 and the section on\n" -" // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" -" //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +#: src/android/aidl/example-service/service.md:3 +msgid "We can now implement the AIDL service:" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "\"readdir$INODE64\"" +#: src/android/aidl/example-service/service.md:5 +#: src/android/aidl/example-service/changing-implementation.md:5 +msgid "_birthday_service/src/lib.rs_:" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "" -"// Call opendir and return a Ok value if that worked,\n" -" // otherwise return Err with a message.\n" +#: src/android/aidl/example-service/service.md:10 +msgid "/// The `IBirthdayService` implementation." msgstr "" -#: src/unsafe-rust/exercise.md -msgid "// Keep calling readdir until we get a NULL pointer back.\n" +#: src/android/aidl/example-service/service.md:18 +#: src/android/aidl/example-service/changing-implementation.md:16 +#: src/android/aidl/types/file-descriptor.md:57 +msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "// Call closedir as needed.\n" +#: src/android/aidl/example-service/service.md:23 +#: src/android/aidl/example-service/server.md:28 +#: src/android/aidl/example-service/client.md:31 +msgid "_birthday_service/Android.bp_:" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -#: src/android/interoperability/with-c/rust.md -msgid "\".\"" +#: src/android/aidl/example-service/service.md:27 +#: src/android/aidl/example-service/server.md:38 +msgid "\"libbirthdayservice\"" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "\"files: {:#?}\"" +#: src/android/aidl/example-service/service.md:29 +#: src/android/aidl/example-service/server.md:13 +#: src/android/aidl/example-service/client.md:11 +msgid "\"birthdayservice\"" msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"Invalid path: {err}\"" +#: src/android/aidl/example-service/service.md:31 +#: src/android/aidl/example-service/server.md:36 +#: src/android/aidl/example-service/client.md:39 +msgid "\"com.example.birthdayservice-rust\"" msgstr "" -#: src/unsafe-rust/solution.md -msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" +#: src/android/aidl/example-service/service.md:32 +#: src/android/aidl/example-service/server.md:37 +#: src/android/aidl/example-service/client.md:40 +msgid "\"libbinder_rs\"" msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"Could not open {:?}\"" +#: src/android/aidl/example-service/service.md:39 +msgid "" +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." msgstr "" -#: src/unsafe-rust/solution.md +#: src/android/aidl/example-service/service.md:41 msgid "" -"// Keep calling readdir until we get a NULL pointer back.\n" -" // SAFETY: self.dir is never NULL.\n" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" msgstr "" -#: src/unsafe-rust/solution.md -msgid "// We have reached the end of the directory.\n" +#: src/android/aidl/example-service/server.md:1 +msgid "AIDL Server" msgstr "" -#: src/unsafe-rust/solution.md -msgid "" -"// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" -" // terminated.\n" +#: src/android/aidl/example-service/server.md:3 +msgid "Finally, we can create a server which exposes the service:" msgstr "" -#: src/unsafe-rust/solution.md -msgid "// SAFETY: self.dir is not NULL.\n" +#: src/android/aidl/example-service/server.md:5 +msgid "_birthday_service/src/server.rs_:" msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"Could not close {:?}\"" +#: src/android/aidl/example-service/server.md:8 +msgid "//! Birthday service." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"no-such-directory\"" +#: src/android/aidl/example-service/server.md:14 +msgid "/// Entry point for birthday service." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"Non UTF-8 character in path\"" +#: src/android/aidl/example-service/server.md:23 +msgid "\"Failed to register service\"" msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"..\"" +#: src/android/aidl/example-service/server.md:32 +#: src/android/aidl/example-service/server.md:33 +msgid "\"birthday_server\"" msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"foo.txt\"" +#: src/android/aidl/example-service/server.md:34 +#, fuzzy +msgid "\"src/server.rs\"" +msgstr "سرورها" + +#: src/android/aidl/example-service/server.md:40 +#: src/android/aidl/example-service/client.md:42 +msgid "// To avoid dynamic link error." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"The Foo Diaries\\n\"" +#: src/android/aidl/example-service/server.md:46 +msgid "" +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"bar.png\"" +#: src/android/aidl/example-service/server.md:52 +msgid "Create an instance of your service type (`BirthdayService`)." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"\\n\"" +#: src/android/aidl/example-service/server.md:53 +msgid "" +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " +"functionality that would be provided by the `BnBinder` base class in C++. We " +"don't have inheritance in Rust, so instead we use composition, putting our " +"`BirthdayService` within the generated `BnBinderService`." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"crab.rs\"" +#: src/android/aidl/example-service/server.md:58 +msgid "" +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." msgstr "" -#: src/unsafe-rust/solution.md -msgid "\"//! Crab\\n\"" +#: src/android/aidl/example-service/server.md:60 +msgid "" +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." msgstr "" -#: src/android.md -msgid "Welcome to Rust in Android" +#: src/android/aidl/example-service/deploy.md:3 +msgid "We can now build, push, and start the service:" msgstr "" -#: src/android.md +#: src/android/aidl/example-service/deploy.md:5 msgid "" -"Rust is supported for system software on Android. This means that you can " -"write new services, libraries, drivers or even firmware in Rust (or improve " -"existing code as needed)." +"```shell\n" +"m birthday_server\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" +"adb root\n" +"adb shell /data/local/tmp/birthday_server\n" +"```" msgstr "" -#: src/android.md -msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." +#: src/android/aidl/example-service/deploy.md:12 +msgid "In another terminal, check that the service runs:" msgstr "" -#: src/android.md -msgid "" -"The speaker may mention any of the following given the increased use of Rust " -"in Android:" +#: src/android/aidl/example-service/deploy.md:22 +msgid "You can also call the service with `service call`:" msgstr "" -#: src/android.md -msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +#: src/android/aidl/example-service/client.md:1 +msgid "AIDL Client" msgstr "" -#: src/android.md -msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +#: src/android/aidl/example-service/client.md:3 +msgid "Finally, we can create a Rust client for our new service." msgstr "" -#: src/android.md -msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +#: src/android/aidl/example-service/client.md:5 +#: src/android/aidl/example-service/changing-implementation.md:29 +msgid "_birthday_service/src/client.rs_:" msgstr "" -#: src/android.md -msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +#: src/android/aidl/example-service/client.md:12 +msgid "/// Call the birthday service." msgstr "" -#: src/android/setup.md -msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make " -"sure you have access to one or create a new one with:" +#: src/android/aidl/example-service/client.md:23 +#: src/android/aidl/types/objects.md:54 +#: src/android/aidl/types/parcelables.md:32 +#: src/android/aidl/types/file-descriptor.md:20 +msgid "\"Failed to connect to BirthdayService\"" msgstr "" -#: src/android/setup.md -msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/" -"setup/start) for details." +#: src/android/aidl/example-service/client.md:25 +msgid "// Call the service." msgstr "" -#: src/android/setup.md -msgid "" -"Cuttlefish is a reference Android device designed to work on generic Linux " -"desktops. MacOS support is also planned." +#: src/android/aidl/example-service/client.md:27 +msgid "\"{msg}\"" msgstr "" -#: src/android/setup.md -msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is " -"the ideal emulator to run many Rust use cases." +#: src/android/aidl/example-service/client.md:35 +#: src/android/aidl/example-service/client.md:36 +msgid "\"birthday_client\"" msgstr "" -#: src/android/build-rules.md -msgid "The Android build system (Soong) supports Rust via a number of modules:" +#: src/android/aidl/example-service/client.md:37 +msgid "\"src/client.rs\"" msgstr "" -#: src/android/build-rules.md -msgid "Module Type" +#: src/android/aidl/example-service/client.md:46 +msgid "Notice that the client does not depend on `libbirthdayservice`." msgstr "" -#: src/android/build-rules.md -msgid "Description" +#: src/android/aidl/example-service/client.md:48 +msgid "Build, push, and run the client on your device:" msgstr "" -#: src/android/build-rules.md -msgid "`rust_binary`" +#: src/android/aidl/example-service/client.md:50 +msgid "" +"```shell\n" +"m birthday_client\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/birthday_client Charlie 60\n" +"```" msgstr "" -#: src/android/build-rules.md -msgid "Produces a Rust binary." +#: src/android/aidl/example-service/client.md:62 +msgid "" +"`Strong` is the trait object representing the service " +"that the client has connected to." msgstr "" -#: src/android/build-rules.md -msgid "`rust_library`" +#: src/android/aidl/example-service/client.md:64 +msgid "" +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." msgstr "" -#: src/android/build-rules.md -msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." +#: src/android/aidl/example-service/client.md:67 +msgid "" +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." msgstr "" -#: src/android/build-rules.md -msgid "`rust_ffi`" +#: src/android/aidl/example-service/client.md:71 +msgid "" +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." msgstr "" -#: src/android/build-rules.md +#: src/android/aidl/example-service/changing-definition.md:3 msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants." +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md:16 +msgid "This results in an updated trait definition for `IBirthdayService`:" +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md:31 +msgid "" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" msgstr "" -#: src/android/build-rules.md -msgid "`rust_proc_macro`" +#: src/android/aidl/example-service/changing-definition.md:34 +msgid "`in` array arguments are translated to slices." msgstr "" -#: src/android/build-rules.md -msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins." +#: src/android/aidl/example-service/changing-definition.md:35 +msgid "`out` and `inout` args are translated to `&mut Vec`." msgstr "" -#: src/android/build-rules.md -msgid "`rust_test`" +#: src/android/aidl/example-service/changing-definition.md:36 +msgid "Return values are translated to returning a `Vec`." msgstr "" -#: src/android/build-rules.md -msgid "Produces a Rust test binary that uses the standard Rust test harness." +#: src/android/aidl/example-service/changing-implementation.md:1 +msgid "Updating Client and Service" msgstr "" -#: src/android/build-rules.md -msgid "`rust_fuzz`" +#: src/android/aidl/example-service/changing-implementation.md:3 +msgid "Update the client and server code to account for the new API." msgstr "" -#: src/android/build-rules.md -msgid "Produces a Rust fuzz binary leveraging `libfuzzer`." +#: src/android/aidl/example-service/changing-implementation.md:20 +msgid "'\\n'" msgstr "" -#: src/android/build-rules.md -msgid "`rust_protobuf`" +#: src/android/aidl/example-service/changing-implementation.md:36 +msgid "\"Habby birfday to yuuuuu\"" msgstr "" -#: src/android/build-rules.md +#: src/android/aidl/example-service/changing-implementation.md:37 +msgid "\"And also: many more\"" +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md:44 msgid "" -"Generates source and produces a Rust library that provides an interface for " -"a particular protobuf." +"TODO: Move code snippets into project files where they'll actually be built?" msgstr "" -#: src/android/build-rules.md -msgid "`rust_bindgen`" +#: src/android/aidl/types.md:1 +msgid "Working With AIDL Types" msgstr "" -#: src/android/build-rules.md -msgid "" -"Generates source and produces a Rust library containing Rust bindings to C " -"libraries." +#: src/android/aidl/types.md:3 +msgid "AIDL types translate into the appropriate idiomatic Rust type:" msgstr "" -#: src/android/build-rules.md -msgid "We will look at `rust_binary` and `rust_library` next." +#: src/android/aidl/types.md:5 +msgid "Primitive types map (mostly) to idiomatic Rust types." msgstr "" -#: src/android/build-rules.md -msgid "Additional items speaker may mention:" +#: src/android/aidl/types.md:6 +msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" -#: src/android/build-rules.md +#: src/android/aidl/types.md:7 msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages " -"from the internet." +"References to AIDL objects and file handles can be sent between clients and " +"services." msgstr "" -#: src/android/build-rules.md -msgid "" -"For compliance and performance, Android must have crates in-tree. It must " -"also interop with C/C++/Java code. Soong fills that gap." +#: src/android/aidl/types.md:9 +msgid "File handles and parcelables are fully supported." msgstr "" -#: src/android/build-rules.md -msgid "" -"Soong has many similarities to Bazel, which is the open-source variant of " -"Blaze (used in google3)." +#: src/android/aidl/types/primitives.md:3 +msgid "Primitive types map (mostly) idiomatically:" msgstr "" -#: src/android/build-rules.md -msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/" -"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) to Bazel." +#: src/android/aidl/types/primitives.md:5 +#, fuzzy +msgid "AIDL Type" +msgstr "AIDL" + +#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 +#: src/android/interoperability/cpp/type-mapping.md:3 +#, fuzzy +msgid "Rust Type" +msgstr "انواع داده‌های بازگشتی" + +#: src/android/aidl/types/primitives.md:5 +msgid "Note" msgstr "" -#: src/android/build-rules.md -msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +#: src/android/aidl/types/primitives.md:7 +#, fuzzy +msgid "`boolean`" +msgstr "بولین‌ها" + +#: src/android/aidl/types/primitives.md:8 +msgid "`byte`" msgstr "" -#: src/android/build-rules.md -msgid "Fun fact: Data from Star Trek is a Soong-type Android." +#: src/android/aidl/types/primitives.md:8 +msgid "`i8`" msgstr "" -#: src/android/build-rules/binary.md -msgid "Rust Binaries" +#: src/android/aidl/types/primitives.md:8 +msgid "Note that bytes are signed." msgstr "" -#: src/android/build-rules/binary.md -msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, " -"create the following files:" +#: src/android/aidl/types/primitives.md:9 +msgid "`u16`" msgstr "" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -msgid "_hello_rust/Android.bp_:" +#: src/android/aidl/types/primitives.md:9 +msgid "Note the usage of `u16`, NOT `u32`." msgstr "" -#: src/android/build-rules/binary.md -msgid "\"hello_rust\"" +#: src/android/aidl/types/primitives.md:10 +msgid "`int`" msgstr "" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -#: src/android/logging.md -msgid "\"src/main.rs\"" +#: src/android/aidl/types/primitives.md:10 +msgid "`i32`" msgstr "" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -msgid "_hello_rust/src/main.rs_:" +#: src/android/aidl/types/primitives.md:11 +msgid "`long`" msgstr "" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -msgid "//! Rust demo.\n" +#: src/android/aidl/types/primitives.md:11 +msgid "`i64`" msgstr "" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -msgid "/// Prints a greeting to standard output.\n" +#: src/android/aidl/types/primitives.md:12 +msgid "`float`" msgstr "" -#: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md -msgid "\"Hello from Rust!\"" +#: src/android/aidl/types/primitives.md:12 +msgid "`f32`" msgstr "" -#: src/android/build-rules/binary.md -msgid "You can now build, push, and run the binary:" +#: src/android/aidl/types/primitives.md:13 +msgid "`double`" +msgstr "" + +#: src/android/aidl/types/primitives.md:13 +msgid "`f64`" msgstr "" -#: src/android/build-rules/binary.md +#: src/android/aidl/types/arrays.md:3 msgid "" -"```shell\n" -"m hello_rust\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust\" /data/local/tmp\n" -"adb shell /data/local/tmp/hello_rust\n" -"```" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the " +"appropriate Rust array type depending on how they are used in the function " +"signature:" msgstr "" -#: src/android/build-rules/library.md -msgid "Rust Libraries" +#: src/android/aidl/types/arrays.md:7 +#, fuzzy +msgid "Position" +msgstr "راه حل‌ها" + +#: src/android/aidl/types/arrays.md:9 +msgid "`in` argument" msgstr "" -#: src/android/build-rules/library.md -msgid "You use `rust_library` to create a new Rust library for Android." +#: src/android/aidl/types/arrays.md:9 +#, fuzzy +msgid "`&[T]`" +msgstr "برش‌ها" + +#: src/android/aidl/types/arrays.md:10 +msgid "`out`/`inout` argument" msgstr "" -#: src/android/build-rules/library.md -msgid "Here we declare a dependency on two libraries:" +#: src/android/aidl/types/arrays.md:10 +msgid "`&mut Vec`" msgstr "" -#: src/android/build-rules/library.md -msgid "`libgreeting`, which we define below," +#: src/android/aidl/types/arrays.md:11 +msgid "Return" +msgstr "" + +#: src/android/aidl/types/arrays.md:11 +#: src/android/interoperability/cpp/type-mapping.md:11 +msgid "`Vec`" msgstr "" -#: src/android/build-rules/library.md +#: src/android/aidl/types/arrays.md:15 msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/)." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"int\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented " +"as array types." msgstr "" -#: src/android/build-rules/library.md -msgid "\"hello_rust_with_dep\"" +#: src/android/aidl/types/arrays.md:18 +msgid "Arrays in parcelable fields always get translated to `Vec`." msgstr "" -#: src/android/build-rules/library.md -msgid "\"libgreetings\"" +#: src/android/aidl/types/objects.md:3 +msgid "" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" msgstr "" -#: src/android/build-rules/library.md -msgid "\"libtextwrap\"" +#: src/android/aidl/types/objects.md:6 +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" msgstr "" -#: src/android/build-rules/library.md -msgid "// Need this to avoid dynamic link error.\n" +#: src/android/aidl/types/objects.md:17 +#: src/android/aidl/types/parcelables.md:16 +#: src/android/aidl/types/file-descriptor.md:6 +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" -#: src/android/build-rules/library.md -msgid "\"greetings\"" +#: src/android/aidl/types/objects.md:23 +msgid "/\\*\\* The same thing, but using a binder object. \\*/" msgstr "" -#: src/android/build-rules/library.md src/android/aidl/implementation.md -#: src/android/interoperability/java.md -msgid "\"src/lib.rs\"" +#: src/android/aidl/types/objects.md:26 +msgid "/\\*\\* The same thing, but using `IBinder`. \\*/" msgstr "" -#: src/android/build-rules/library.md -msgid "_hello_rust/src/lib.rs_:" +#: src/android/aidl/types/objects.md:31 +#: src/android/aidl/types/parcelables.md:27 +#: src/android/aidl/types/file-descriptor.md:15 +msgid "**birthday_service/src/client.rs**:" msgstr "" -#: src/android/build-rules/library.md -msgid "//! Greeting library.\n" +#: src/android/aidl/types/objects.md:34 +msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface." msgstr "" -#: src/android/build-rules/library.md -msgid "/// Greet `name`.\n" +#: src/android/aidl/types/objects.md:56 +msgid "// Create a binder object for the `IBirthdayInfoProvider` interface." msgstr "" -#: src/android/build-rules/library.md -msgid "\"Hello {name}, it is very nice to meet you!\"" +#: src/android/aidl/types/objects.md:62 +msgid "// Send the binder object to the service." msgstr "" -#: src/android/build-rules/library.md -msgid "You build, push, and run the binary like before:" +#: src/android/aidl/types/objects.md:65 +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`." msgstr "" -#: src/android/build-rules/library.md +#: src/android/aidl/types/objects.md:72 msgid "" -"```shell\n" -"m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" -"adb shell /data/local/tmp/hello_rust_with_dep\n" -"```" +"Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " +"`BnBirthdayService` that we saw previously." msgstr "" -#: src/android/aidl.md +#: src/android/aidl/types/parcelables.md:3 +msgid "Binder for Rust supports sending parcelables directly:" +msgstr "" + +#: src/android/aidl/types/parcelables.md:5 msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android." -"com/guide/components/aidl) is supported in Rust:" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" msgstr "" -#: src/android/aidl.md -msgid "Rust code can call existing AIDL servers," +#: src/android/aidl/types/parcelables.md:22 +msgid "/\\*\\* The same thing, but with a parcelable. \\*/" msgstr "" -#: src/android/aidl.md -msgid "You can create new AIDL servers in Rust." +#: src/android/aidl/types/file-descriptor.md:3 +msgid "" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" msgstr "" -#: src/android/aidl/interface.md -msgid "AIDL Interfaces" +#: src/android/aidl/types/file-descriptor.md:10 +msgid "/\\*\\* The same thing, but loads info from a file. \\*/" msgstr "" -#: src/android/aidl/interface.md -msgid "You declare the API of your service using an AIDL interface:" +#: src/android/aidl/types/file-descriptor.md:22 +msgid "// Open a file and put the birthday info in it." msgstr "" -#: src/android/aidl/interface.md -msgid "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +#: src/android/aidl/types/file-descriptor.md:23 +msgid "\"/data/local/tmp/birthday.info\"" msgstr "" -#: src/android/aidl/interface.md src/android/aidl/changing.md -msgid "/** Birthday service interface. */" +#: src/android/aidl/types/file-descriptor.md:24 +msgid "\"{name}\"" msgstr "" -#: src/android/aidl/interface.md src/android/aidl/changing.md -msgid "/** Generate a Happy Birthday message. */" +#: src/android/aidl/types/file-descriptor.md:25 +msgid "\"{years}\"" msgstr "" -#: src/android/aidl/interface.md -msgid "_birthday_service/aidl/Android.bp_:" +#: src/android/aidl/types/file-descriptor.md:27 +msgid "// Create a `ParcelFileDescriptor` from the file and send it." msgstr "" -#: src/android/aidl/interface.md -msgid "\"com.example.birthdayservice\"" +#: src/android/aidl/types/file-descriptor.md:33 +msgid "**birthday_service/src/lib.rs**:" msgstr "" -#: src/android/aidl/interface.md -msgid "\"com/example/birthdayservice/*.aidl\"" +#: src/android/aidl/types/file-descriptor.md:41 +msgid "" +"// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps // " +"an `OwnedFd`, which can be cloned and then used to create a `File` // object." msgstr "" -#: src/android/aidl/interface.md -msgid "// Rust is not enabled by default\n" +#: src/android/aidl/types/file-descriptor.md:48 +msgid "\"Invalid file handle\"" msgstr "" -#: src/android/aidl/interface.md +#: src/android/aidl/types/file-descriptor.md:64 msgid "" -"Add `vendor_available: true` if your AIDL file is used by a binary in the " -"vendor partition." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." msgstr "" -#: src/android/aidl/implementation.md -msgid "Service Implementation" +#: src/android/aidl/types/file-descriptor.md:67 +msgid "" +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" -#: src/android/aidl/implementation.md -msgid "We can now implement the AIDL service:" +#: src/android/testing.md +#, fuzzy +msgid "Testing in Android" +msgstr "Rust در اندروید" + +#: src/android/testing.md +msgid "" +"Building on Testing, we will now look at how unit tests work in AOSP. Use " +"the `rust_test` module for your unit tests:" msgstr "" -#: src/android/aidl/implementation.md -msgid "_birthday_service/src/lib.rs_:" +#: src/android/testing.md +#, fuzzy +msgid "_testing/Android.bp_:" +msgstr "Rust در اندروید" + +#: src/android/testing.md +msgid "\"libleftpad\"" msgstr "" -#: src/android/aidl/implementation.md -msgid "//! Implementation of the `IBirthdayService` AIDL interface.\n" +#: src/android/testing.md +msgid "\"leftpad\"" msgstr "" -#: src/android/aidl/implementation.md -msgid "/// The `IBirthdayService` implementation.\n" +#: src/android/testing.md +msgid "\"libleftpad_test\"" msgstr "" -#: src/android/aidl/implementation.md -msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" +#: src/android/testing.md +msgid "\"leftpad_test\"" msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "_birthday_service/Android.bp_:" +#: src/android/testing.md src/android/interoperability/with-c/bindgen.md:116 +msgid "\"general-tests\"" msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -msgid "\"libbirthdayservice\"" +#: src/android/testing.md +msgid "_testing/src/lib.rs_:" msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "\"birthdayservice\"" +#: src/android/testing.md +msgid "//! Left-padding library." msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "\"com.example.birthdayservice-rust\"" +#: src/android/testing.md +msgid "/// Left-pad `s` to `width`." msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "\"libbinder_rs\"" +#: src/android/testing.md +msgid "\"{s:>width$}\"" msgstr "" -#: src/android/aidl/server.md -msgid "AIDL Server" +#: src/android/testing.md +msgid "\" foo\"" msgstr "" -#: src/android/aidl/server.md -msgid "Finally, we can create a server which exposes the service:" +#: src/android/testing.md +msgid "\"foobar\"" msgstr "" -#: src/android/aidl/server.md -msgid "_birthday_service/src/server.rs_:" +#: src/android/testing.md +msgid "You can now run the test with" msgstr "" -#: src/android/aidl/server.md src/android/aidl/client.md -msgid "//! Birthday service.\n" +#: src/android/testing.md +msgid "The output looks like this:" msgstr "" -#: src/android/aidl/server.md -msgid "/// Entry point for birthday service.\n" +#: src/android/testing.md +msgid "" +"```text\n" +"INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" +"INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" +"INFO: Build completed successfully, 3 total actions\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" +" PASSED libleftpad_test.tests::long_string (0.0s)\n" +" PASSED libleftpad_test.tests::short_string (0.0s)\n" +"Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" +"```" msgstr "" -#: src/android/aidl/server.md -msgid "\"Failed to register service\"" +#: src/android/testing.md +msgid "" +"Notice how you only mention the root of the library crate. Tests are found " +"recursively in nested modules." msgstr "" -#: src/android/aidl/server.md -msgid "\"birthday_server\"" +#: src/android/testing/googletest.md:3 +msgid "" +"The GoogleTest crate allows for flexible test assertions using _matchers_:" msgstr "" -#: src/android/aidl/server.md -#, fuzzy -msgid "\"src/server.rs\"" -msgstr "سرورها" +#: src/android/testing/googletest.md:11 +msgid "\"baz\"" +msgstr "" -#: src/android/aidl/server.md src/android/aidl/client.md -msgid "// To avoid dynamic link error.\n" +#: src/android/testing/googletest.md:12 +msgid "\"xyz\"" msgstr "" -#: src/android/aidl/deploy.md -msgid "We can now build, push, and start the service:" +#: src/android/testing/googletest.md:16 +msgid "" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" msgstr "" -#: src/android/aidl/deploy.md +#: src/android/testing/googletest.md:37 msgid "" -"```shell\n" -"m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" -"adb root\n" -"adb shell /data/local/tmp/birthday_server\n" -"```" +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" -#: src/android/aidl/deploy.md -msgid "In another terminal, check that the service runs:" +#: src/android/testing/googletest.md:41 +msgid "" +"The `use googletest::prelude::*;` line imports a number of commonly used " +"macros and types." msgstr "" -#: src/android/aidl/deploy.md -msgid "You can also call the service with `service call`:" +#: src/android/testing/googletest.md:44 +msgid "" +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of \"Advanced testing for Rust " +"applications\", a self-guided Rust course: it provides a guided introduction " +"to the library, with exercises to help you get comfortable with `googletest` " +"macros, its matchers and its overall philosophy." msgstr "" -#: src/android/aidl/client.md -msgid "AIDL Client" +#: src/android/testing/googletest.md:51 +msgid "" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" msgstr "" -#: src/android/aidl/client.md -msgid "Finally, we can create a Rust client for our new service." +#: src/android/testing/googletest.md:57 +msgid "" +"\"Memory safety found,\\n \n" +"Rust's strong typing guides the way,\\n \n" +"Secure code you'll write.\"" msgstr "" -#: src/android/aidl/client.md -msgid "_birthday_service/src/client.rs_:" +#: src/android/testing/googletest.md:62 +msgid "" +"\"Memory safety found,\\n \n" +"Rust's silly humor guides the way,\\n \n" +"Secure code you'll write.\"" msgstr "" -#: src/android/aidl/client.md -msgid "/// Connect to the BirthdayService.\n" +#: src/android/testing/googletest.md:69 +msgid "shows a color-coded diff (colors not shown here):" msgstr "" -#: src/android/aidl/client.md -msgid "/// Call the birthday service.\n" +#: src/android/testing/googletest.md:86 +msgid "The crate is a Rust port of GoogleTest for C++." msgstr "" -#: src/android/aidl/client.md -msgid "\"Failed to connect to BirthdayService\"" +#: src/android/testing/mocking.md:3 +msgid "" +"For mocking, Mockall is a widely used library. You need to refactor your " +"code to use traits, which you can then quickly mock:" msgstr "" -#: src/android/aidl/client.md -msgid "\"{msg}\"" +#: src/android/testing/mocking.md:27 +msgid "" +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other mocking libraries available on crates.io, in particular in the area of " +"mocking HTTP services. The other mocking libraries work in a similar fashion " +"as Mockall, meaning that they make it easy to get a mock implementation of a " +"given trait." msgstr "" -#: src/android/aidl/client.md -msgid "\"birthday_client\"" +#: src/android/testing/mocking.md:33 +msgid "" +"Note that mocking is somewhat _controversial_: mocks allow you to completely " +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." msgstr "" -#: src/android/aidl/client.md -msgid "\"src/client.rs\"" +#: src/android/testing/mocking.md:38 +msgid "" +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." msgstr "" -#: src/android/aidl/client.md -msgid "Notice that the client does not depend on `libbirthdayservice`." +#: src/android/testing/mocking.md:43 +msgid "" +"Similarly, many web frameworks allow you to start an in-process server which " +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." msgstr "" -#: src/android/aidl/client.md -msgid "Build, push, and run the client on your device:" +#: src/android/testing/mocking.md:47 +msgid "" +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." msgstr "" -#: src/android/aidl/client.md +#: src/android/testing/mocking.md:51 msgid "" -"```shell\n" -"m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" -"adb shell /data/local/tmp/birthday_client Charlie 60\n" -"```" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -#: src/android/aidl/changing.md +#: src/android/testing/mocking.md:69 msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" #: src/android/logging.md @@ -11950,11 +12004,11 @@ msgid "_hello_rust_logs/src/main.rs_:" msgstr "" #: src/android/logging.md -msgid "//! Rust logging demo.\n" +msgid "//! Rust logging demo." msgstr "" #: src/android/logging.md -msgid "/// Logs a greeting.\n" +msgid "/// Logs a greeting." msgstr "" #: src/android/logging.md @@ -11973,8 +12027,8 @@ msgstr "" msgid "\"Something went wrong!\"" msgstr "" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md -#: src/android/interoperability/with-c/rust.md +#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 +#: src/android/interoperability/with-c/rust.md:72 msgid "Build, push, and run the binary on your device:" msgstr "" @@ -12012,153 +12066,164 @@ msgid "" "_foreign function interface_, also known as FFI." msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:1 msgid "Interoperability with C" msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:3 msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:6 msgid "You can do it by hand if you want:" msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:15 +msgid "// SAFETY: `abs` doesn't have any safety requirements." +msgstr "" + +#: src/android/interoperability/with-c.md:17 msgid "\"{x}, {abs_x}\"" msgstr "" -#: src/android/interoperability/with-c.md -msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../exercises/day-3/" -"safe-ffi-wrapper.md)." +#: src/android/interoperability/with-c.md:21 +msgid "We already saw this in the Safe FFI Wrapper exercise." msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:24 msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." msgstr "" -#: src/android/interoperability/with-c.md +#: src/android/interoperability/with-c.md:27 msgid "We will look at better options next." msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:1 msgid "Using Bindgen" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +#: src/android/interoperability/with-c/bindgen.md:3 +msgid "The bindgen tool can auto-generate bindings from a C header file." msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:6 msgid "First create a small C library:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:8 msgid "_interoperability/bindgen/libbirthday.h_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:19 msgid "_interoperability/bindgen/libbirthday.c_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "" +#: src/android/interoperability/with-c/bindgen.md:22 +msgid "\\" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:23 +#: src/android/interoperability/with-c/bindgen.md:50 msgid "\"libbirthday.h\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:26 +#: src/android/interoperability/with-c/bindgen.md:29 msgid "\"+--------------\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:27 msgid "\"| Happy Birthday %s!\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:28 msgid "\"| Congratulations with the %i years!\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:33 msgid "Add this to your `Android.bp` file:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:35 +#: src/android/interoperability/with-c/bindgen.md:55 +#: src/android/interoperability/with-c/bindgen.md:69 +#: src/android/interoperability/with-c/bindgen.md:109 msgid "_interoperability/bindgen/Android.bp_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:39 +#: src/android/interoperability/with-c/bindgen.md:63 msgid "\"libbirthday\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:40 msgid "\"libbirthday.c\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:44 msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:47 msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:53 msgid "You can now auto-generate the bindings:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:59 +#: src/android/interoperability/with-c/bindgen.md:75 msgid "\"libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:60 msgid "\"birthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:61 msgid "\"libbirthday_wrapper.h\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:62 msgid "\"bindings\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:67 msgid "Finally, we can use the bindings in our Rust program:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:73 msgid "\"print_birthday_card\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:74 msgid "\"main.rs\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:79 msgid "_interoperability/bindgen/main.rs_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "//! Bindgen demo.\n" +#: src/android/interoperability/with-c/bindgen.md:82 +msgid "//! Bindgen demo." msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "// SAFETY: `print_card` is safe to call with a valid `card` pointer.\n" +#: src/android/interoperability/with-c/bindgen.md:89 +msgid "" +"// SAFETY: The pointer we pass is valid because it came from a Rust // " +"reference, and the `name` it contains refers to `name` above which also // " +"remains valid. `print_card` doesn't store either pointer to use later // " +"after it returns." msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:101 msgid "" "```shell\n" "m print_birthday_card\n" @@ -12168,103 +12233,102 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:107 msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:113 +#: src/android/interoperability/with-c/bindgen.md:115 msgid "\"libbirthday_bindgen_test\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:114 msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "\"general-tests\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/bindgen.md:118 +#: src/android/interoperability/with-c/bindgen.md:119 msgid "\"none\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "// Generated file, skip linting\n" +#: src/android/interoperability/with-c/bindgen.md:118 +msgid "// Generated file, skip linting" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:1 msgid "Calling Rust" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:3 msgid "Exporting Rust functions and types to C is easy:" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:5 msgid "_interoperability/rust/libanalyze/analyze.rs_" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "//! Rust FFI demo.\n" +#: src/android/interoperability/with-c/rust.md:8 +msgid "//! Rust FFI demo." msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "/// Analyze the numbers.\n" +#: src/android/interoperability/with-c/rust.md:12 +msgid "/// Analyze the numbers." msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:17 msgid "\"x ({x}) is smallest!\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:19 msgid "\"y ({y}) is probably larger than x ({x})\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:24 msgid "_interoperability/rust/libanalyze/analyze.h_" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:37 msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:41 +#: src/android/interoperability/with-c/rust.md:68 msgid "\"libanalyze_ffi\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:42 msgid "\"analyze_ffi\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:43 msgid "\"analyze.rs\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:48 msgid "We can now call this from a C binary:" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:50 msgid "_interoperability/rust/analyze/main.c_" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:53 msgid "\"analyze.h\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:62 msgid "_interoperability/rust/analyze/Android.bp_" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:66 msgid "\"analyze_numbers\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:67 msgid "\"main.c\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:74 msgid "" "```shell\n" "m analyze_numbers\n" @@ -12274,118 +12338,117 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust.md:82 msgid "" "`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " "will just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -#: src/android/interoperability/cpp.md +#: src/android/interoperability/cpp.md:3 msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe " -"interoperability between Rust and C++." +"The CXX crate makes it possible to do safe interoperability between Rust and " +"C++." msgstr "" -#: src/android/interoperability/cpp.md +#: src/android/interoperability/cpp.md:6 msgid "The overall approach looks like this:" msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:3 msgid "" "CXX relies on a description of the function signatures that will be exposed " "from each language to the other. You provide this description using extern " "blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:9 msgid "\"org::blobstore\"" msgstr "" -#: src/android/interoperability/cpp/bridge.md -msgid "// Shared structs with fields visible to both languages.\n" +#: src/android/interoperability/cpp/bridge.md:11 +msgid "// Shared structs with fields visible to both languages." msgstr "" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/generated-cpp.md -msgid "// Rust types and signatures exposed to C++.\n" +#: src/android/interoperability/cpp/bridge.md:17 +#: src/android/interoperability/cpp/generated-cpp.md:6 +msgid "// Rust types and signatures exposed to C++." msgstr "" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/rust-bridge.md -#: src/android/interoperability/cpp/generated-cpp.md -#: src/android/interoperability/cpp/rust-result.md -#: src/chromium/interoperability-with-cpp/example-bindings.md -#: src/chromium/interoperability-with-cpp/error-handling-qr.md -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/android/interoperability/cpp/bridge.md:18 +#: src/android/interoperability/cpp/rust-bridge.md:6 +#: src/android/interoperability/cpp/generated-cpp.md:7 +#: src/android/interoperability/cpp/rust-result.md:6 +#: src/chromium/interoperability-with-cpp/example-bindings.md:9 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:10 +#: src/chromium/interoperability-with-cpp/error-handling-png.md:9 #, fuzzy msgid "\"Rust\"" msgstr "Rustdoc" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md -msgid "// C++ types and signatures exposed to Rust.\n" +#: src/android/interoperability/cpp/bridge.md:24 +#: src/android/interoperability/cpp/cpp-bridge.md:6 +msgid "// C++ types and signatures exposed to Rust." msgstr "" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/android/interoperability/cpp/cpp-exception.md -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/android/interoperability/cpp/bridge.md:25 +#: src/android/interoperability/cpp/cpp-bridge.md:7 +#: src/android/interoperability/cpp/cpp-exception.md:6 +#: src/chromium/interoperability-with-cpp/example-bindings.md:15 msgid "\"C++\"" msgstr "" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md:26 +#: src/android/interoperability/cpp/cpp-bridge.md:8 msgid "\"include/blobstore.h\"" msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:40 msgid "The bridge is generally declared in an `ffi` module within your crate." msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:41 msgid "" "From the declarations made in the bridge module, CXX will generate matching " "Rust and C++ type/function definitions in order to expose those items to " "both languages." msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:44 msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/" -"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " -"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " -"(though this doesn't apply for Android projects)." +"To view the generated Rust code, use cargo-expand to view the expanded proc " +"macro. For most of the examples you would use `cargo expand ::ffi` to expand " +"just the `ffi` module (though this doesn't apply for Android projects)." msgstr "" -#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/bridge.md:47 msgid "To view the generated C++ code, look in `target/cxxbridge`." msgstr "" -#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/rust-bridge.md:1 msgid "Rust Bridge Declarations" msgstr "" -#: src/android/interoperability/cpp/rust-bridge.md -msgid "// Opaque type\n" +#: src/android/interoperability/cpp/rust-bridge.md:7 +msgid "// Opaque type" msgstr "" -#: src/android/interoperability/cpp/rust-bridge.md -msgid "// Method on `MyType`\n" +#: src/android/interoperability/cpp/rust-bridge.md:8 +msgid "// Method on `MyType`" msgstr "" -#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/rust-bridge.md:9 #, fuzzy -msgid "// Free function\n" +msgid "// Free function" msgstr "توابع" -#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/rust-bridge.md:28 msgid "" "Items declared in the `extern \"Rust\"` reference items that are in scope in " "the parent module." msgstr "" -#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/rust-bridge.md:30 msgid "" "The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" "+ header file containing the corresponding C++ declarations. The generated " @@ -12393,48 +12456,48 @@ msgid "" "except with a .rs.h file extension." msgstr "" -#: src/android/interoperability/cpp/generated-cpp.md +#: src/android/interoperability/cpp/generated-cpp.md:15 msgid "Results in (roughly) the following C++:" msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:1 msgid "C++ Bridge Declarations" msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:20 msgid "Results in (roughly) the following Rust:" msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:30 msgid "\"org$blobstore$cxxbridge1$new_blobstore_client\"" msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:39 msgid "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:56 msgid "" "The programmer does not need to promise that the signatures they have typed " "in are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md:59 msgid "" "`unsafe extern` blocks allow you to declare C++ functions that are safe to " "call from Rust." msgstr "" -#: src/android/interoperability/cpp/shared-types.md -msgid "// A=1, J=11, Q=12, K=13\n" +#: src/android/interoperability/cpp/shared-types.md:9 +msgid "// A=1, J=11, Q=12, K=13" msgstr "" -#: src/android/interoperability/cpp/shared-types.md +#: src/android/interoperability/cpp/shared-types.md:23 msgid "Only C-like (unit) enums are supported." msgstr "" -#: src/android/interoperability/cpp/shared-types.md +#: src/android/interoperability/cpp/shared-types.md:24 msgid "" "A limited number of traits are supported for `#[derive()]` on shared types. " "Corresponding functionality is also generated for the C++ code, e.g. if you " @@ -12442,16 +12505,16 @@ msgid "" "corresponding C++ type." msgstr "" -#: src/android/interoperability/cpp/shared-enums.md +#: src/android/interoperability/cpp/shared-enums.md:15 #, fuzzy msgid "Generated Rust:" msgstr "Rust ناایمن" -#: src/android/interoperability/cpp/shared-enums.md +#: src/android/interoperability/cpp/shared-enums.md:33 msgid "Generated C++:" msgstr "" -#: src/android/interoperability/cpp/shared-enums.md +#: src/android/interoperability/cpp/shared-enums.md:46 msgid "" "On the Rust side, the code generated for shared enums is actually a struct " "wrapping a numeric value. This is because it is not UB in C++ for an enum " @@ -12459,48 +12522,48 @@ msgid "" "Rust representation needs to have the same behavior." msgstr "" -#: src/android/interoperability/cpp/rust-result.md +#: src/android/interoperability/cpp/rust-result.md:13 msgid "\"fallible1 requires depth > 0\"" msgstr "" -#: src/android/interoperability/cpp/rust-result.md +#: src/android/interoperability/cpp/rust-result.md:16 msgid "\"Success!\"" msgstr "" -#: src/android/interoperability/cpp/rust-result.md +#: src/android/interoperability/cpp/rust-result.md:22 msgid "" "Rust functions that return `Result` are translated to exceptions on the C++ " "side." msgstr "" -#: src/android/interoperability/cpp/rust-result.md +#: src/android/interoperability/cpp/rust-result.md:24 msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " "exposes a way to get the error message string. The error message will come " "from the error type's `Display` impl." msgstr "" -#: src/android/interoperability/cpp/rust-result.md +#: src/android/interoperability/cpp/rust-result.md:27 msgid "" "A panic unwinding from Rust to C++ will always cause the process to " "immediately terminate." msgstr "" -#: src/android/interoperability/cpp/cpp-exception.md +#: src/android/interoperability/cpp/cpp-exception.md:7 msgid "\"example/include/example.h\"" msgstr "" -#: src/android/interoperability/cpp/cpp-exception.md +#: src/android/interoperability/cpp/cpp-exception.md:14 msgid "\"Error: {}\"" msgstr "" -#: src/android/interoperability/cpp/cpp-exception.md +#: src/android/interoperability/cpp/cpp-exception.md:22 msgid "" "C++ functions declared to return a `Result` will catch any thrown exception " "on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -#: src/android/interoperability/cpp/cpp-exception.md +#: src/android/interoperability/cpp/cpp-exception.md:24 msgid "" "If an exception is thrown from an extern \"C++\" function that is not " "declared by the CXX bridge to return `Result`, the program calls C++'s `std::" @@ -12508,303 +12571,296 @@ msgid "" "through a `noexcept` C++ function." msgstr "" -#: src/android/interoperability/cpp/type-mapping.md -#, fuzzy -msgid "Rust Type" -msgstr "انواع داده‌های بازگشتی" - -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:3 #, fuzzy msgid "C++ Type" msgstr "مثالی در C++" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:5 #, fuzzy msgid "`rust::String`" msgstr "String" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:6 msgid "`&str`" msgstr "&str" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:6 msgid "`rust::Str`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:7 #, fuzzy msgid "`CxxString`" msgstr "String" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:7 #, fuzzy msgid "`std::string`" msgstr "String" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:8 msgid "`&[T]`/`&mut [T]`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:8 msgid "`rust::Slice`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:9 msgid "`rust::Box`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:10 msgid "`UniquePtr`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:10 msgid "`std::unique_ptr`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md -msgid "`Vec`" -msgstr "" - -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:11 msgid "`rust::Vec`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:12 msgid "`CxxVector`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:12 msgid "`std::vector`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:16 msgid "" "These types can be used in the fields of shared structs and the arguments " "and returns of extern functions." msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:18 msgid "" "Note that Rust's `String` does not map directly to `std::string`. There are " "a few reasons for this:" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:20 msgid "" "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:21 msgid "" "The two types have different layouts in memory and so can't be passed " "directly between languages." msgstr "" -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/interoperability/cpp/type-mapping.md:23 msgid "" "`std::string` requires move constructors that don't match Rust's move " "semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-cpp-genrules.md -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-build-cpp.md:1 +#: src/android/interoperability/cpp/android-cpp-genrules.md:1 +#: src/android/interoperability/cpp/android-build-rust.md:1 #, fuzzy msgid "Building in Android" msgstr "Rust در اندروید" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:3 msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-build-cpp.md:8 +#: src/android/interoperability/cpp/android-build-rust.md:10 msgid "\"libcxx_test_cpp\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:9 msgid "\"cxx_test.cpp\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:11 msgid "\"cxx-bridge-header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md:12 +#: src/android/interoperability/cpp/android-cpp-genrules.md:10 msgid "\"libcxx_test_bridge_header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md:14 +#: src/android/interoperability/cpp/android-cpp-genrules.md:19 msgid "\"libcxx_test_bridge_code\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:20 msgid "" "Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " "the dependencies for the CXX-generated C++ bindings. We'll show how these " "are setup on the next slide." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:23 msgid "" "Note that you also need to depend on the `cxx-bridge-header` library in " "order to pull in common CXX definitions." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-cpp.md:25 msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +"Full docs for using CXX in Android can be found in the Android docs. You may " +"want to share that link with the class so that students know where they can " +"find these instructions again in the future." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:3 msgid "" "Create two genrules: One to generate the CXX header, and one to generate the " "CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:7 msgid "" -"// Generate a C++ header containing the C++ bindings\n" -"// to the Rust exported functions in lib.rs.\n" +"// Generate a C++ header containing the C++ bindings // to the Rust exported " +"functions in lib.rs." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:11 +#: src/android/interoperability/cpp/android-cpp-genrules.md:20 msgid "\"cxxbridge\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:12 msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:13 +#: src/android/interoperability/cpp/android-cpp-genrules.md:22 +#: src/android/interoperability/cpp/android-build-rust.md:8 msgid "\"lib.rs\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:14 msgid "\"lib.rs.h\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "// Generate the C++ code that Rust calls into.\n" +#: src/android/interoperability/cpp/android-cpp-genrules.md:16 +msgid "// Generate the C++ code that Rust calls into." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:21 msgid "\"$(location cxxbridge) $(in) > $(out)\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:23 msgid "\"lib.rs.cc\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:29 msgid "" "The `cxxbridge` tool is a standalone tool that generates the C++ side of the " "bridge module. It is included in Android and available as a Soong tool." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-cpp-genrules.md:31 msgid "" "By convention, if your Rust source file is `lib.rs` your header file will be " "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-build-rust.md:3 msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-build-rust.md:7 msgid "\"cxx_test\"" msgstr "" -#: src/android/interoperability/cpp/android-build-rust.md +#: src/android/interoperability/cpp/android-build-rust.md:9 msgid "\"libcxx\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:1 msgid "Interoperability with Java" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:3 msgid "" -"Java can load shared objects via [Java Native Interface (JNI)](https://en." -"wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" -"jni/) allows you to create a compatible library." +"Java can load shared objects via Java Native Interface (JNI). The `jni` " +"crate allows you to create a compatible library." msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:8 msgid "First, we create a Rust function to export to Java:" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:10 msgid "_interoperability/java/src/lib.rs_:" msgstr "" -#: src/android/interoperability/java.md -msgid "//! Rust <-> Java FFI demo.\n" +#: src/android/interoperability/java.md:13 +msgid "//! Rust \\<\\-> Java FFI demo." msgstr "" -#: src/android/interoperability/java.md -msgid "/// HelloWorld::hello method implementation.\n" +#: src/android/interoperability/java.md:18 +msgid "/// HelloWorld::hello method implementation." msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:21 msgid "\"system\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:27 msgid "\"Hello, {input}!\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:33 +#: src/android/interoperability/java.md:63 msgid "_interoperability/java/Android.bp_:" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:37 +#: src/android/interoperability/java.md:70 msgid "\"libhello_jni\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:38 +#: src/android/interoperability/java.md:53 msgid "\"hello_jni\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:40 msgid "\"libjni\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:44 msgid "We then call this function from Java:" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:46 msgid "_interoperability/java/HelloWorld.java_:" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:67 msgid "\"helloworld_jni\"" msgstr "" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:68 #, fuzzy msgid "\"HelloWorld.java\"" msgstr "سلام دنیا" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:69 #, fuzzy msgid "\"HelloWorld\"" msgstr "سلام دنیا" -#: src/android/interoperability/java.md +#: src/android/interoperability/java.md:74 msgid "Finally, you can build, sync, and run the binary:" msgstr "" @@ -12861,9 +12917,8 @@ msgstr "" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" -"the-code/) if you aren't already at that point. Be warned: setting up to " -"build Chromium takes time." +"See How to build Chromium if you aren't already at that point. Be warned: " +"setting up to build Chromium takes time." msgstr "" #: src/chromium/setup.md @@ -12884,9 +12939,8 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Rust community typically uses `cargo` and libraries from [crates.io](https://" -"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " -"dependencies." +"The Rust community typically uses `cargo` and libraries from crates.io. " +"Chromium is built using `gn` and `ninja` and a curated set of dependencies." msgstr "" #: src/chromium/cargo.md @@ -12902,15 +12956,12 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " -"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Using-cargo)" +"Use `cargo`, but restrict yourself to Chromium's audited toolchain and crates" msgstr "" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " -"downloaded from the internet](https://crates.io/)" +"Use `cargo`, trusting a toolchain and/or crates downloaded from the internet" msgstr "" #: src/chromium/cargo.md @@ -13040,13 +13091,13 @@ msgstr "" msgid "" "Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " "when building and bootstrapping Rust standard library when building Rust " -"toolchain.)" +"toolchain." msgstr "" #: src/chromium/cargo.md msgid "" "`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " -"third-party libraries downloaded from the internet, by `run_gnrt.py` asks " +"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" @@ -13100,17 +13151,14 @@ msgstr "" #: src/chromium/policy.md msgid "" "Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"approved by Chromium's Area Tech Leads." msgstr "" #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"Chromium's policy on third party libraries is outlined here - Rust is " +"allowed for third party libraries under various circumstances, including if " +"they're the best option for performance or for security." msgstr "" #: src/chromium/policy.md @@ -13226,17 +13274,16 @@ msgstr "" #: src/chromium/build-rules.md msgid "" "Students might be wondering why we need a gn template, rather than using " -"[gn's built-in support for Rust static libraries](https://gn.googlesource." -"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " -"this template provides support for CXX interop, Rust features, and unit " -"tests, some of which we'll use later." +"gn's built-in support for Rust static libraries. The answer is that this " +"template provides support for CXX interop, Rust features, and unit tests, " +"some of which we'll use later." msgstr "" -#: src/chromium/build-rules/unsafe.md +#: src/chromium/build-rules/unsafe.md:1 msgid "Including `unsafe` Rust Code" msgstr "" -#: src/chromium/build-rules/unsafe.md +#: src/chromium/build-rules/unsafe.md:3 msgid "" "Unsafe Rust code is forbidden in `rust_static_library` by default --- it " "won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " @@ -13244,7 +13291,7 @@ msgid "" "necessary.)" msgstr "" -#: src/chromium/build-rules/unsafe.md +#: src/chromium/build-rules/unsafe.md:7 msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" @@ -13260,11 +13307,11 @@ msgid "" "```" msgstr "" -#: src/chromium/build-rules/depending.md +#: src/chromium/build-rules/depending.md:3 msgid "Simply add the above target to the `deps` of some Chromium C++ target." msgstr "" -#: src/chromium/build-rules/depending.md +#: src/chromium/build-rules/depending.md:5 msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" @@ -13281,108 +13328,108 @@ msgid "" "```" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:3 msgid "" "Types are elided in Rust code, which makes a good IDE even more useful than " "for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:6 msgid "" "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " "Rust support" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:8 msgid "" "`gn gen out/Debug --export-rust-project` (or equivalent for your output " "directory)" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:10 msgid "`ln -s out/Debug/rust-project.json rust-project.json`" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:16 msgid "" "A demo of some of the code annotation and exploration features of rust-" "analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:19 msgid "" "The following steps may help with the demo (but feel free to instead use a " "piece of Chromium-related Rust that you are most familiar with):" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:22 msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:23 msgid "" "Place the cursor over the `QrCode::new` call (around line 26) in " "\\`qr_code_generator_ffi_glue.rs" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:25 msgid "" "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:27 msgid "" "Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " "(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:29 msgid "" "Demo **outline** and navigate to the `QrCode::with_bits` method (around line " "164; the outline is in the file explorer pane in vscode; typical vim/CoC " "bindings = space o)" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:32 msgid "" "Demo **type annotations** (there are quote a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" -#: src/chromium/build-rules/vscode.md +#: src/chromium/build-rules/vscode.md:35 msgid "" "It may be worth pointing out that `gn gen ... --export-rust-project` will " "need to be rerun after editing `BUILD.gn` files (which we will do a few " "times throughout the exercises in this session)." msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:1 #, fuzzy msgid "Build rules exercise" msgstr "قوانین ساخت" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:3 msgid "" "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " "containing:" msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:13 msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to to allow unsafe code in your `gn` " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " "target." msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:16 msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " "function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " "see how this can be automated by bindings generation tools):" msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:24 msgid "" "Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " "we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " @@ -13390,50 +13437,39 @@ msgid "" "times." msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:28 msgid "" "If you use VSCode, now set up Rust to work well in VSCode. It will be useful " "in subsequent exercises. If you've succeeded, you will be able to use right-" "click \"Go to definition\" on `println!`." msgstr "" -#: src/exercises/chromium/build-rules.md -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/build-rules.md:32 +#: src/exercises/chromium/interoperability-with-cpp.md:48 msgid "Where to find help" msgstr "" -#: src/exercises/chromium/build-rules.md -msgid "" -"The options available to the [`rust_static_library` gn template](https://" -"source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_static_library.gni;l=16)" +#: src/exercises/chromium/build-rules.md:34 +msgid "The options available to the `rust_static_library` gn template" msgstr "" -#: src/exercises/chromium/build-rules.md -msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +#: src/exercises/chromium/build-rules.md:35 +msgid "Information about `#[no_mangle]`" msgstr "" -#: src/exercises/chromium/build-rules.md -msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." -"extern.html)" +#: src/exercises/chromium/build-rules.md:36 +msgid "Information about `extern \"C\"`" msgstr "" -#: src/exercises/chromium/build-rules.md -msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) switch" +#: src/exercises/chromium/build-rules.md:37 +msgid "Information about gn's `--export-rust-project` switch" msgstr "" -#: src/exercises/chromium/build-rules.md -msgid "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" -"languages/rust)" +#: src/exercises/chromium/build-rules.md:38 +msgid "How to install rust-analyzer in VSCode" msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:44 msgid "" "This example is unusual because it boils down to the lowest-common-" "denominator interop language, C. Both C++ and Rust can natively declare and " @@ -13441,14 +13477,14 @@ msgid "" "Rust." msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:48 msgid "" "`allow_unsafe = true` is required here because `#[no_mangle]` might allow " "Rust to generate two functions with the same name, and Rust can no longer " "guarantee that the right one is called." msgstr "" -#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/build-rules.md:52 msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." @@ -13457,8 +13493,8 @@ msgstr "" #: src/chromium/testing.md msgid "" "Rust community typically authors unit tests in a module placed in the same " -"source file as the code being tested. This was covered [earlier](../testing." -"md) in the course and looks like this:" +"source file as the code being tested. This was covered earlier in the course " +"and looks like this:" msgstr "" #: src/chromium/testing.md @@ -13523,36 +13559,34 @@ msgid "" "functionality may benefit from separate tests authored in Rust." msgstr "" -#: src/chromium/testing/rust-gtest-interop.md -msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) library provides a way to:" +#: src/chromium/testing/rust-gtest-interop.md:3 +msgid "The `rust_gtest_interop` library provides a way to:" msgstr "" -#: src/chromium/testing/rust-gtest-interop.md +#: src/chromium/testing/rust-gtest-interop.md:5 msgid "" "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " "attribute)" msgstr "" -#: src/chromium/testing/rust-gtest-interop.md +#: src/chromium/testing/rust-gtest-interop.md:7 msgid "" "Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " "panicking and not terminating the test when the assertion fails)." msgstr "" -#: src/chromium/testing/rust-gtest-interop.md +#: src/chromium/testing/rust-gtest-interop.md:10 #, fuzzy msgid "Example:" msgstr "مثال" -#: src/chromium/testing/build-gn.md +#: src/chromium/testing/build-gn.md:3 msgid "" "The simplest way to build Rust `gtest` tests is to add them to an existing " "test binary that already contains tests authored in C++. For example:" msgstr "" -#: src/chromium/testing/build-gn.md +#: src/chromium/testing/build-gn.md:6 msgid "" "```gn\n" "test(\"ui_base_unittests\") {\n" @@ -13563,13 +13597,13 @@ msgid "" "```" msgstr "" -#: src/chromium/testing/build-gn.md +#: src/chromium/testing/build-gn.md:14 msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" -#: src/chromium/testing/build-gn.md +#: src/chromium/testing/build-gn.md:17 msgid "" "```gn\n" "rust_static_library(\"my_rust_lib_unittests\") {\n" @@ -13590,7 +13624,7 @@ msgid "" "```" msgstr "" -#: src/chromium/testing/chromium-import-macro.md +#: src/chromium/testing/chromium-import-macro.md:3 msgid "" "After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " "import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " @@ -13600,23 +13634,21 @@ msgid "" "from the automatically-imported `chromium` crate:" msgstr "" -#: src/chromium/testing/chromium-import-macro.md +#: src/chromium/testing/chromium-import-macro.md:12 msgid "\"//ui/base:my_rust_lib\"" msgstr "" -#: src/chromium/testing/chromium-import-macro.md +#: src/chromium/testing/chromium-import-macro.md:18 msgid "Under the covers the macro expands to something similar to:" msgstr "" -#: src/chromium/testing/chromium-import-macro.md +#: src/chromium/testing/chromium-import-macro.md:26 msgid "" -"More information can be found in [the doc comment](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" -"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" -"third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." +"More information can be found in the doc comment of the `chromium::import` " +"macro." msgstr "" -#: src/chromium/testing/chromium-import-macro.md +#: src/chromium/testing/chromium-import-macro.md:31 msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " "property, but doing this is discouraged. And it is discouraged because the " @@ -13625,35 +13657,35 @@ msgid "" "covered in a later section) use short crate names." msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:1 #, fuzzy msgid "Testing exercise" msgstr "تمرین‌ها" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:3 msgid "Time for another exercise!" msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:5 msgid "In your Chromium build:" msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:7 msgid "" "Add a testable function next to `hello_from_rust`. Some suggestions: adding " "two integers received as arguments, computing the nth Fibonacci number, " "summing integers in a slice, etc." msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:10 msgid "Add a separate `..._unittest.rs` file with a test for the new function." msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:11 msgid "Add the new tests to `BUILD.gn`." msgstr "" -#: src/exercises/chromium/testing.md +#: src/exercises/chromium/testing.md:12 msgid "Build the tests, run them, and verify that the new test works." msgstr "" @@ -13672,9 +13704,7 @@ msgid "" msgstr "" #: src/chromium/interoperability-with-cpp.md -msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " -"using this." +msgid "See the CXX tutorial for a full example of using this." msgstr "" #: src/chromium/interoperability-with-cpp.md @@ -13729,25 +13759,25 @@ msgid "" "terminate a string)." msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:3 msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:16 msgid "\"example/include/blobstore.h\"" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md -msgid "// Definitions of Rust types and functions go here\n" +#: src/chromium/interoperability-with-cpp/example-bindings.md:24 +msgid "// Definitions of Rust types and functions go here" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:30 msgid "Point out:" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:32 msgid "" "Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " "procedural macro does complex things to it. The generated code is quite a " @@ -13755,24 +13785,24 @@ msgid "" "`ffi` in your code." msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:36 msgid "Native support for C++'s `std::unique_ptr` in Rust" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:37 #, fuzzy msgid "Native support for Rust slices in C++" msgstr "پشتیبانی درون-ساختی از تست نویسی" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:38 msgid "Calls from C++ to Rust, and Rust types (in the top part)" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:39 msgid "Calls from Rust to C++, and C++ types (in the bottom part)" msgstr "" -#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/example-bindings.md:41 msgid "" "**Common misconception**: It _looks_ like a C++ header is being parsed by " "Rust, but this is misleading. This header is never interpreted by Rust, but " @@ -13780,35 +13810,33 @@ msgid "" "compilers." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"By far the most useful page when using CXX is the [type reference](https://" -"cxx.rs/bindings.html)." +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:3 +msgid "By far the most useful page when using CXX is the type reference." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:5 msgid "CXX fundamentally suits cases where:" msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:7 msgid "" "Your Rust-C++ interface is sufficiently simple that you can declare all of " "it." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:8 msgid "" "You're using only the types natively supported by CXX already, for example " "`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:11 msgid "" "It has many limitations --- for example lack of support for Rust's `Option` " "type." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:14 msgid "" "These limitations constrain us to using Rust in Chromium only for well " "isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " @@ -13817,89 +13845,87 @@ msgid "" "enough." msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:26 msgid "" "You should also discuss some of the other sticky points with CXX, for " "example:" msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:28 msgid "" "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:29 msgid "Function pointers are awkward to use." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:3 msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " -"on C++ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's support for `Result` relies on C++ exceptions, so we can't use " +"that in Chromium. Alternatives:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:6 msgid "The `T` part of `Result` can be:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:7 msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " "be passed across the FFI boundary - for example `T` has to be:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:9 msgid "A primitive type (like `u32` or `usize`)" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:10 msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:12 msgid "" "Retained on the Rust side, and exposed via reference. This may be needed " "when `T` is a Rust type, which cannot be passed across the FFI boundary, and " "cannot be stored in `UniquePtr`." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:16 msgid "The `E` part of `Result` can be:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:17 msgid "" "Returned as a boolean (e.g. `true` representing success, and `false` " "representing failure)" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling.md +#: src/chromium/interoperability-with-cpp/error-handling.md:19 msgid "" "Preserving error details is in theory possible, but so far hasn't been " "needed in practice." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:1 #, fuzzy msgid "CXX Error Handling: QR Example" msgstr "مدیریت خطا (Error Handling)" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:3 msgid "" -"The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." -"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " -"used to communicate success vs failure, and where the successful result can " -"be passed across the FFI boundary:" +"The QR code generator is an example where a boolean is used to communicate " +"success vs failure, and where the successful result can be passed across the " +"FFI boundary:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:8 msgid "\"qr_code_generator\"" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:23 msgid "" "Students may be curious about the semantics of the `out_qr_size` output. " "This is not the size of the vector, but the size of the QR code (and " @@ -13907,7 +13933,7 @@ msgid "" "the vector)." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:27 msgid "" "It may be worth pointing out the importance of initializing `out_qr_size` " "before calling into the Rust function. Creation of a Rust reference that " @@ -13915,43 +13941,43 @@ msgid "" "when only the act of dereferencing such memory results in UB)." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:32 msgid "" "If students ask about `Pin`, then explain why CXX needs it for mutable " "references to C++ data: the answer is that C++ data can’t be moved around " "like Rust data, because it may contain self-referential pointers." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:1 #, fuzzy msgid "CXX Error Handling: PNG Example" msgstr "مدیریت خطا (Error Handling)" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:3 msgid "" "A prototype of a PNG decoder illustrates what can be done when the " "successful result cannot be passed across the FFI boundary:" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:7 msgid "\"gfx::rust_bindings\"" msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:10 msgid "" -"/// This returns an FFI-friendly equivalent of `Result,\n" -" /// ()>`.\n" +"/// This returns an FFI-friendly equivalent of " +"`Result, /// ()>`." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md -msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" +#: src/chromium/interoperability-with-cpp/error-handling-png.md:14 +msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md -msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" +#: src/chromium/interoperability-with-cpp/error-handling-png.md:21 +msgid "/// C++ bindings for the `crate::png::PngReader` type." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:32 msgid "" "`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " "types cannot cross the FFI boundary without indirection of a `Box`. We " @@ -13959,7 +13985,7 @@ msgid "" "to store Rust objects by value." msgstr "" -#: src/chromium/interoperability-with-cpp/error-handling-png.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md:37 msgid "" "This example illustrates that even though CXX doesn't support arbitrary " "generics nor templates, we can still pass them across the FFI boundary by " @@ -13969,18 +13995,18 @@ msgid "" "`as_mut`)." msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:1 msgid "Using cxx in Chromium" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:3 msgid "" "In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" "node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:7 msgid "" "```gn\n" "cxx_bindings = [ \"my_rust_file.rs\" ]\n" @@ -13989,198 +14015,192 @@ msgid "" "```" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:13 msgid "" "to your existing `rust_static_library` target alongside `crate_root` and " "`sources`." msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:16 msgid "C++ headers will be generated at a sensible location, so you can just" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:19 msgid "\"ui/base/my_rust_file.rs.h\"" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:22 msgid "" "You will find some utility functions in `//base` to convert to/from Chromium " -"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" -"l=21)." +"C++ types to CXX Rust types --- for example `SpanToRustSlice`." msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:27 msgid "Students may ask --- why do we still need `allow_unsafe = true`?" msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:29 msgid "" "The broad answer is that no C/C++ code is \"safe\" by the normal Rust " "standards. Calling back and forth to C/C++ from Rust may do arbitrary things " "to memory, and compromise the safety of Rust's own data layouts. Presence of " "_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " -"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " -"binary can cause unexpected behavior from Rust's perspective." +"ratio of such a keyword, and is controversial, but strictly, bringing any " +"foreign code into a Rust binary can cause unexpected behavior from Rust's " +"perspective." msgstr "" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:36 msgid "" -"The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " -"`unsafe` and `extern \"C\"` functions just like we did manually in the " -"previous section." +"The narrow answer lies in the diagram at the top of this page --- behind the " +"scenes, CXX generates Rust `unsafe` and `extern \"C\"` functions just like " +"we did manually in the previous section." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:1 #, fuzzy msgid "Exercise: Interoperability with C++" msgstr "قابلیت همکاری" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:3 msgid "Part one" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:5 msgid "" "In the Rust file you previously created, add a `#[cxx::bridge]` which " "specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:8 msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " "`#[no_mangle]`. This is now just a standard Rust function." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:10 msgid "Modify your `gn` target to build these bindings." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:11 msgid "" "In your C++ code, remove the forward-declaration of `hello_from_rust`. " "Instead, include the generated header file." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:13 msgid "Build and run!" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:15 msgid "Part two" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:17 msgid "" "It's a good idea to play with CXX a little. It helps you think about how " "flexible Rust in Chromium actually is." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:20 #, fuzzy msgid "Some things to try:" msgstr "نکته:" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:22 msgid "Call back into C++ from Rust. You will need:" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:23 msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:25 msgid "" "An `unsafe` block to call such a function, or alternatively specify the " -"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" -"extern-c++.html#functions-and-member-functions)." +"`unsafe` keyword in your `#[cxx::bridge]` as described here." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." "h\"`" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:29 msgid "Pass a C++ string from C++ into Rust." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:30 msgid "Pass a reference to a C++ object into Rust." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:31 msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:33 msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:35 msgid "" "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " "own some C++ object." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:37 msgid "" "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " "need a `Box`)." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:39 msgid "Declare some methods on a C++ type. Call them from Rust." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:40 msgid "Declare some methods on a Rust type. Call them from C++." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:42 msgid "Part three" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:44 msgid "" "Now you understand the strengths and limitations of CXX interop, think of a " "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md -msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" +#: src/exercises/chromium/interoperability-with-cpp.md:50 +msgid "The `cxx` binding reference" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md -msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +#: src/exercises/chromium/interoperability-with-cpp.md:51 +msgid "The `rust_static_library` gn template" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:57 msgid "Some of the questions you may encounter:" msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:59 msgid "" "I'm seeing a problem initializing a variable of type X with type Y, where X " "and Y are both function types. This is because your C++ function doesn't " "quite match the declaration in your `cxx::bridge`." msgstr "" -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/interoperability-with-cpp.md:62 msgid "" "I seem to be able to freely convert C++ references into Rust references. " "Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" @@ -14190,11 +14210,14 @@ msgstr "" #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" +"Rust libraries are called \"crates\" and are found at crates.io. It's _very " +"easy_ for Rust crates to depend upon one another. So they do!" msgstr "" +#: src/chromium/adding-third-party-crates.md +msgid "Property" +msgstr "ویژگی" + #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "C++ library" @@ -14203,12 +14226,12 @@ msgstr "کتابخانه" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Rust crate" -msgstr "اکوسیستم Rsut" +msgstr "اکوسیستم Rust" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Build system" -msgstr "اکوسیستم Rsut" +msgstr "اکوسیستم Rust" #: src/chromium/adding-third-party-crates.md msgid "Lots" @@ -14270,19 +14293,17 @@ msgstr "" msgid "How to audit its source code for sufficient safety." msgstr "" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:1 msgid "Configuring the `Cargo.toml` file to add crates" msgstr "" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 msgid "" "Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" +"These are managed through a single `Cargo.toml`:" msgstr "" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 msgid "" "```toml\n" "[dependencies]\n" @@ -14293,141 +14314,136 @@ msgid "" "```" msgstr "" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." +"As with any other `Cargo.toml`, you can specify more details about the " +"dependencies --- most commonly, you'll want to specify the `features` that " +"you wish to enable in the crate." msgstr "" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 msgid "" "When adding a crate to Chromium, you'll often need to provide some extra " "information in an additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml). This contains Chromium-specific extensions to crate handling." +"Alongside `Cargo.toml` is `gnrt_config.toml`. This contains Chromium-" +"specific extensions to crate handling." msgstr "" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 msgid "" "If you add a new crate, you should specify at least the `group`. This is one " "of:" msgstr "" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:15 msgid "For instance," msgstr "" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 msgid "" "Depending on the crate source code layout, you may also need to use this " "file to specify where its `LICENSE` file(s) can be found." msgstr "" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 msgid "" "Later, we'll see some other things you will need to configure in this file " "to resolve problems." msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:3 msgid "" "A tool called `gnrt` knows how to download crates and how to generate `BUILD." "gn` rules." msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:6 msgid "To start, download the crate you want like this:" msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:13 msgid "" "Although the `gnrt` tool is part of the Chromium source code, by running " "this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." +"`crates.io`. See the earlier section discussing this security decision." msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:17 msgid "This `vendor` command may download:" msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:19 #, fuzzy msgid "Your crate" msgstr "جعبه‌های (crates) کاربردی" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:20 msgid "Direct and transitive dependencies" msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:21 msgid "" "New versions of other crates, as required by `cargo` to resolve the complete " "set of crates required by Chromium." msgstr "" -#: src/chromium/adding-third-party-crates/downloading-crates.md +#: src/chromium/adding-third-party-crates/downloading-crates.md:24 msgid "" "Chromium maintains patches for some crates, kept in `//third_party/rust/" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 msgid "" "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 msgid "Now run `git status`. You should find:" msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 msgid "" "At least one new crate source code in `third_party/rust/chromium_crates_io/" "vendor`" msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 msgid "" "At least one new `BUILD.gn` in `third_party/rust//v`" msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 msgid "An appropriate `README.chromium`" msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 #, fuzzy -msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." +msgid "The \"major semver version\" is a Rust \"semver\" version number." msgstr "" "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " "مراجعه کنید." -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 msgid "" "Take a close look, especially at the things generated in `third_party/rust`." msgstr "" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 msgid "" "Talk a little about semver --- and specifically the way that in Chromium " "it's to allow multiple incompatible versions of a crate, which is " "discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:3 msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " "arbitrary things at build time. This is fundamentally at odds with the " @@ -14435,78 +14451,90 @@ msgid "" "to maximize parallelism and repeatability of builds." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:8 msgid "" "Some `build.rs` actions are automatically supported; others require action:" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 msgid "build script effect" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 msgid "Supported by our gn templates" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 msgid "Work required by you" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 msgid "Checking rustc version to configure features on and off" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +msgid "Yes" +msgstr "بلی" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 msgid "None" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 msgid "Checking platform or CPU to configure features on and off" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 #, fuzzy msgid "Generating code" msgstr "جنریک‌ها" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 msgid "Yes - specify in `gnrt_config.toml`" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 msgid "Building C/C++" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +msgid "No" +msgstr "خیر" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +#: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Patch around it" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Arbitrary other actions" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md +#: src/chromium/adding-third-party-crates/resolving-problems.md:18 msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:3 msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:6 msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " -"add `build-script-outputs` to the crate. If this is a transitive dependency, " -"that is, one on which Chromium code should not directly depend, also add " -"`allow-first-party-usage=false`. There are several examples already in that " -"file:" +"If so, modify `gnrt_config.toml` to add `build-script-outputs` to the crate. " +"If this is a transitive dependency, that is, one on which Chromium code " +"should not directly depend, also add `allow-first-party-usage=false`. There " +"are several examples already in that file:" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:11 msgid "" "```toml\n" "[crate.unicode-linebreak]\n" @@ -14515,55 +14543,51 @@ msgid "" "```" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:17 msgid "" -"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input " -"to subsequent build steps." +"Now rerun `gnrt.py -- gen` to regenerate `BUILD.gn` files to inform ninja " +"that this particular output file is input to subsequent build steps." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:3 msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " -"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" -"crates.io/crates/bindgen) within their build scripts. These actions can't be " -"supported in a Chromium context --- our gn, ninja and LLVM build system is " -"very specific in expressing relationships between build actions." +"Some crates use the `cc` crate to build and link C/C++ libraries. Other " +"crates parse C/C++ using `bindgen` within their build scripts. These actions " +"can't be supported in a Chromium context --- our gn, ninja and LLVM build " +"system is very specific in expressing relationships between build actions." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:8 msgid "So, your options are:" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:10 msgid "Avoid these crates" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:11 msgid "Apply a patch to the crate." msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:13 msgid "" "Patches should be kept in `third_party/rust/chromium_crates_io/patches/" -"` - see for example the [patches against the `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - and will be applied automatically by " -"`gnrt` each time it upgrades the crate." +"` - see for example the patches against the `cxx` crate - and will be " +"applied automatically by `gnrt` each time it upgrades the crate." msgstr "" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:3 msgid "" "Once you've added a third-party crate and generated build rules, depending " "on a crate is simple. Find your `rust_static_library` target, and add a " "`dep` on the `:lib` target within your crate." msgstr "" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:7 msgid "Specifically," msgstr "" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:9 msgid "" "```bob\n" " +------------+ +----------------------+\n" @@ -14573,7 +14597,7 @@ msgid "" "```" msgstr "" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:17 msgid "" "```gn\n" "rust_static_library(\"my_rust_lib\") {\n" @@ -14584,32 +14608,29 @@ msgid "" "```" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:1 msgid "Auditing Third Party Crates" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:3 msgid "" -"Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Third_party-review), but of course also subject to security review. As " -"you may be bringing in not just a single crate but also transitive " -"dependencies, there may be a lot of code to review. On the other hand, safe " -"Rust code can have limited negative side effects. How should you review it?" +"Adding new libraries is subject to Chromium's standard policies, but of " +"course also subject to security review. As you may be bringing in not just a " +"single crate but also transitive dependencies, there may be a lot of code to " +"review. On the other hand, safe Rust code can have limited negative side " +"effects. How should you review it?" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "" -"Over time Chromium aims to move to a process based around [cargo vet]" -"(https://mozilla.github.io/cargo-vet/)." +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:9 +msgid "Over time Chromium aims to move to a process based around cargo vet." msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:11 msgid "" "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:13 msgid "" "Understand why each crate is used. What's the relationship between crates? " "If the build system for each crate contains a `build.rs` or procedural " @@ -14617,77 +14638,73 @@ msgid "" "is normally built?" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:17 msgid "Check each crate seems to be reasonably well maintained" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:18 msgid "" "Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " "vulnerabilities (first you'll need to `cargo install cargo-audit`, which " -"ironically involves downloading lots of dependencies from the internet[2](../" -"cargo.md))" +"ironically involves downloading lots of dependencies from the internet2)" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." -"md#unsafe-code-in-safe-languages)" +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:21 +msgid "Ensure any `unsafe` code is good enough for the Rule of Two" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:22 msgid "Check for any use of `fs` or `net` APIs" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:23 msgid "" "Read all the code at a sufficient level to look for anything out of place " "that might have been maliciously inserted. (You can't realistically aim for " "100% perfection here: there's often just too much code.)" msgstr "" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md +#: src/chromium/adding-third-party-crates/reviews-and-audits.md:27 msgid "" "These are just guidelines --- work with reviewers from `security@chromium." "org` to work out the right way to become confident of the crate." msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:1 msgid "Checking Crates into Chromium Source Code" msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:3 msgid "`git status` should reveal:" msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:5 msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:6 msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:9 msgid "Please also add an `OWNERS` file in the latter location." msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:11 msgid "" "You should land all this, along with your `Cargo.toml` and `gnrt_config." "toml` changes, into the Chromium repo." msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:14 msgid "" "**Important**: you need to use `git add -f` because otherwise `.gitignore` " "files may result in some files being skipped." msgstr "" -#: src/chromium/adding-third-party-crates/checking-in.md +#: src/chromium/adding-third-party-crates/checking-in.md:17 msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " "language. This is because Rust crate data tends to include names of git " @@ -14695,80 +14712,76 @@ msgid "" "you may need to run:" msgstr "" -#: src/chromium/adding-third-party-crates/keeping-up-to-date.md +#: src/chromium/adding-third-party-crates/keeping-up-to-date.md:3 msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to " -"keep it up to date with any security fixes](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " -"hoped that we will soon automate this for Rust crates, but for now, it's " -"still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are expected to " +"keep it up to date with any security fixes. It is hoped that we will soon " +"automate this for Rust crates, but for now, it's still your responsibility " +"just as it is for any other third party dependency." msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:3 msgid "" -"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/" -"features.html#the-default-feature). Assume that the crate will be used in " -"shipping Chromium, but won't be used to handle untrustworthy input." +"Add uwuify to Chromium, turning off the crate's default features. Assume " +"that the crate will be used in shipping Chromium, but won't be used to " +"handle untrustworthy input." msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:7 msgid "" "(In the next exercise we'll use uwuify from Chromium, but feel free to skip " "ahead and do that now if you like. Or, you could create a new " -"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"`rust_executable` target which uses `uwuify`)." msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:13 msgid "Students will need to download lots of transitive dependencies." msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:15 msgid "The total crates needed are:" msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:17 msgid "`instant`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:18 msgid "`lock_api`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:19 msgid "`parking_lot`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:20 msgid "`parking_lot_core`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:21 msgid "`redox_syscall`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:22 msgid "`scopeguard`," msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:23 msgid "`smallvec`, and" msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:24 msgid "`uwuify`." msgstr "" -#: src/exercises/chromium/third-party.md +#: src/exercises/chromium/third-party.md:26 msgid "" "If students are downloading even more than that, they probably forgot to " "turn off the default features." msgstr "" -#: src/exercises/chromium/third-party.md -msgid "" -"Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" +#: src/exercises/chromium/third-party.md:29 +msgid "Thanks to Daniel Liu for this crate!" msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14806,9 +14819,7 @@ msgid "" msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"In fact, you already [imported that crate in the previous exercise](https://" -"crates.io/crates/uwuify)." +msgid "In fact, you already imported that crate in the previous exercise." msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14844,10 +14855,8 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " -"consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which " -"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" -"slice.html)." +"consider `String::from_utf16`, consider error handling, and consider which " +"CXX supported types can transfer a lot of u16s." msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14855,10 +14864,10 @@ msgid "" "Students may design the C++/Rust boundary in several different ways, e.g. " "taking and returning strings by value, or taking a mutable reference to a " "string. If a mutable reference is used, CXX will likely tell the student " -"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " -"need to explain what `Pin` does, and then explain why CXX needs it for " -"mutable references to C++ data: the answer is that C++ data can't be moved " -"around like Rust data, because it may contain self-referential pointers." +"that they need to use `Pin`. You may need to explain what `Pin` does, and " +"then explain why CXX needs it for mutable references to C++ data: the answer " +"is that C++ data can't be moved around like Rust data, because it may " +"contain self-referential pointers." msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14875,9 +14884,7 @@ msgid "" msgstr "" #: src/exercises/chromium/solutions.md -msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs]" -"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." +msgid "Solutions to the Chromium exercises can be found in this series of CLs." msgstr "" #: src/bare-metal.md @@ -14916,11 +14923,10 @@ msgstr "" #: src/bare-metal.md msgid "" -"For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF51822 microcontroller " -"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " -"an on-board SWD debugger." +"For the microcontroller part of the course we will use the BBC micro:bit v2 " +"as an example. It's a development board based on the Nordic nRF52833 " +"microcontroller with some LEDs and buttons, an I2C-connected accelerometer " +"and compass, and an on-board SWD debugger." msgstr "" #: src/bare-metal.md @@ -14933,7 +14939,7 @@ msgid "" "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" -#: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md:33 msgid "On MacOS:" msgstr "" @@ -15037,86 +15043,83 @@ msgstr "" msgid "`std` re-exports the contents of both `core` and `alloc`." msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:1 msgid "A minimal `no_std` program" msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:19 msgid "This will compile to an empty binary." msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:20 msgid "`std` provides a panic handler; without it we must provide our own." msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:21 msgid "It can also be provided by another crate, such as `panic-halt`." msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:22 msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -#: src/bare-metal/minimal.md +#: src/bare-metal/minimal.md:24 msgid "" "Note that there is no `main` or any other entry point; it's up to you to " "define your own entry point. This will typically involve a linker script and " "some assembly code to set things up ready for Rust code to run." msgstr "" -#: src/bare-metal/alloc.md -msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc." -"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +#: src/bare-metal/alloc.md:3 +msgid "To use `alloc` you must implement a global (heap) allocator." msgstr "" -#: src/bare-metal/alloc.md -msgid "" -"// Safe because `HEAP` is only used here and `entry` is only called once.\n" +#: src/bare-metal/alloc.md:23 +msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once." msgstr "" -#: src/bare-metal/alloc.md -msgid "// Give the allocator some memory to allocate.\n" +#: src/bare-metal/alloc.md:25 +msgid "// Give the allocator some memory to allocate." msgstr "" -#: src/bare-metal/alloc.md -msgid "// Now we can do things that require heap allocation.\n" +#: src/bare-metal/alloc.md:29 +msgid "// Now we can do things that require heap allocation." msgstr "" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:31 #, fuzzy msgid "\"A string\"" msgstr "String" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:37 msgid "" "`buddy_system_allocator` is a third-party crate implementing a basic buddy " "system allocator. Other crates are available, or you can write your own or " "hook into your existing allocator." msgstr "" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:40 msgid "" "The const parameter of `LockedHeap` is the max order of the allocator; i.e. " "in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:42 msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " "exactly one global allocator defined in your binary. Usually this is done in " "the top-level binary crate." msgstr "" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:45 msgid "" "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " "crate is linked in so we get its panic handler." msgstr "" -#: src/bare-metal/alloc.md +#: src/bare-metal/alloc.md:47 msgid "This example will build but not run, as it doesn't have an entry point." msgstr "" @@ -15142,173 +15145,171 @@ msgstr "" msgid "Run the example with `cargo embed --bin minimal`" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/mmio.md:3 msgid "" "Most microcontrollers access peripherals via memory-mapped IO. Let's try " "turning on an LED on our micro:bit:" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -msgid "/// GPIO port 0 peripheral address\n" +#: src/bare-metal/microcontrollers/mmio.md:16 +msgid "/// GPIO port 0 peripheral address" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -msgid "// GPIO peripheral offsets\n" +#: src/bare-metal/microcontrollers/mmio.md:19 +msgid "// GPIO peripheral offsets" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -msgid "// PIN_CNF fields\n" +#: src/bare-metal/microcontrollers/mmio.md:24 +msgid "// PIN_CNF fields" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md -#: src/bare-metal/microcontrollers/hals.md -msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" +#: src/bare-metal/microcontrollers/mmio.md:34 +#: src/bare-metal/microcontrollers/pacs.md:21 +#: src/bare-metal/microcontrollers/hals.md:26 +msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/mmio.md:37 +#: src/bare-metal/microcontrollers/mmio.md:59 msgid "" -"// Safe because the pointers are to valid peripheral control registers, and\n" -" // no aliases exist.\n" +"// SAFETY: The pointers are to valid peripheral control registers, and no // " +"aliases exist." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md -#: src/bare-metal/microcontrollers/hals.md -msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" +#: src/bare-metal/microcontrollers/mmio.md:56 +#: src/bare-metal/microcontrollers/pacs.md:39 +#: src/bare-metal/microcontrollers/hals.md:30 +msgid "// Set pin 28 low and pin 21 high to turn the LED on." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/mmio.md:72 msgid "" "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " "to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md -#: src/bare-metal/microcontrollers/hals.md -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/mmio.md:75 +#: src/bare-metal/microcontrollers/pacs.md:61 +#: src/bare-metal/microcontrollers/hals.md:44 +#: src/bare-metal/microcontrollers/board-support.md:37 msgid "Run the example with:" msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:1 msgid "Peripheral Access Crates" msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:3 msgid "" -"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" -"pack/doc/CMSIS/SVD/html/index.html) files." +"`svd2rust` generates mostly-safe Rust wrappers for memory-mapped peripherals " +"from CMSIS-SVD files." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:49 msgid "" "SVD (System View Description) files are XML files typically provided by " "silicon vendors which describe the memory map of the device." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:51 msgid "" "They are organised by peripheral, register, field and value, with names, " "descriptions, addresses and so on." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:53 msgid "" "SVD files are often buggy and incomplete, so there are various projects " "which patch the mistakes, add missing details, and publish the generated " "crates." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:56 msgid "`cortex-m-rt` provides the vector table, among other things." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/pacs.md:57 msgid "" "If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " "pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" -#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/hals.md:1 msgid "HAL crates" msgstr "" -#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/hals.md:3 msgid "" -"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around " -"various peripherals. These generally implement traits from [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal)." +"HAL crates for many microcontrollers provide wrappers around various " +"peripherals. These generally implement traits from `embedded-hal`." msgstr "" -#: src/bare-metal/microcontrollers/hals.md -msgid "// Create HAL wrapper for GPIO port 0.\n" +#: src/bare-metal/microcontrollers/hals.md:23 +msgid "// Create HAL wrapper for GPIO port 0." msgstr "" -#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/hals.md:40 msgid "" "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" -#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/hals.md:41 msgid "" "HAL crates exist for many Cortex-M and RISC-V devices, including various " "STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/board-support.md:1 msgid "Board support crates" msgstr "" -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/board-support.md:3 msgid "" "Board support crates provide a further level of wrapping for a specific " "board for convenience." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/board-support.md:31 msgid "" "In this case the board support crate is just providing more useful names, " "and a bit of initialisation." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/board-support.md:33 msgid "" "The crate may also include drivers for some on-board devices outside of the " "microcontroller itself." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/board-support.md:35 msgid "`microbit-v2` includes a simple driver for the LED matrix." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:1 msgid "The type state pattern" msgstr "" -#: src/bare-metal/microcontrollers/type-state.md -msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" +#: src/bare-metal/microcontrollers/type-state.md:11 +msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md -msgid "// pin_input.is_high(); // Error, moved.\n" +#: src/bare-metal/microcontrollers/type-state.md:19 +msgid "// pin_input.is_high(); // Error, moved." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:33 msgid "" "Pins don't implement `Copy` or `Clone`, so only one instance of each can " "exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:35 msgid "" "Changing the configuration of a pin consumes the old pin instance, so you " "can’t keep use the old instance afterwards." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:37 msgid "" "The type of a value indicates the state that it is in: e.g. in this case, " "the configuration state of a GPIO pin. This encodes the state machine into " @@ -15317,234 +15318,239 @@ msgid "" "caught at compile time." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:42 msgid "" "You can call `is_high` on an input pin and `set_high` on an output pin, but " "not vice-versa." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md +#: src/bare-metal/microcontrollers/type-state.md:44 msgid "Many HAL crates follow this pattern." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md +#: src/bare-metal/microcontrollers/embedded-hal.md:3 msgid "" -"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " -"number of traits covering common microcontroller peripherals." +"The `embedded-hal` crate provides a number of traits covering common " +"microcontroller peripherals:" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md +#: src/bare-metal/microcontrollers/embedded-hal.md:6 msgid "GPIO" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "ADC" +#: src/bare-metal/microcontrollers/embedded-hal.md:7 +msgid "PWM" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "I2C, SPI, UART, CAN" +#: src/bare-metal/microcontrollers/embedded-hal.md:8 +msgid "Delay timers" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "RNG" +#: src/bare-metal/microcontrollers/embedded-hal.md:9 +msgid "I2C and SPI buses and devices" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Timers" +#: src/bare-metal/microcontrollers/embedded-hal.md:11 +msgid "" +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into `embedded-io`, `embedded-can` and `rand_core` respectively." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Watchdogs" +#: src/bare-metal/microcontrollers/embedded-hal.md:14 +msgid "" +"Other crates then implement drivers in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md +#: src/bare-metal/microcontrollers/embedded-hal.md:19 msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI bus implementation." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md +#: src/bare-metal/microcontrollers/embedded-hal.md:21 msgid "" "There are implementations for many microcontrollers, as well as other " "platforms such as Linux on Raspberry Pi." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md +#: src/bare-metal/microcontrollers/embedded-hal.md:23 +msgid "`embedded-hal-async` provides async versions of the traits." +msgstr "" + +#: src/bare-metal/microcontrollers/embedded-hal.md:24 msgid "" -"There is work in progress on an `async` version of `embedded-hal`, but it " -"isn't stable yet." +"`embedded-hal-nb` provides another approach to non-blocking I/O, based on " +"the `nb` crate." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:3 msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " -"like OpenOCD but better integrated." +"probe-rs is a handy toolset for embedded debugging, like OpenOCD but better " +"integrated." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:6 msgid "" "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:7 msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:8 msgid "Cargo integration" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:10 msgid "" "`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " "(Real Time Transfers) output and connect GDB. It's configured by an `Embed." "toml` file in your project directory." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:16 msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " -"an Arm standard protocol over USB for an in-circuit debugger to access the " -"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " -"on-board debugger on the BBC micro:bit uses." +"CMSIS-DAP is an Arm standard protocol over USB for an in-circuit debugger to " +"access the CoreSight Debug Access Port of various Arm Cortex processors. " +"It's what the on-board debugger on the BBC micro:bit uses." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:20 msgid "" "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " "is a range from SEGGER." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:22 msgid "" "The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " "Serial Wire Debug." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:24 msgid "" "probe-rs is a library which you can integrate into your own tools if you " "want to." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:26 msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" -"adapter-protocol/) lets VSCode and other IDEs debug code running on any " -"supported microcontroller." +"The Microsoft Debug Adapter Protocol lets VSCode and other IDEs debug code " +"running on any supported microcontroller." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:30 msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md +#: src/bare-metal/microcontrollers/probe-rs.md:31 msgid "" "RTT (Real Time Transfers) is a mechanism to transfer data between the debug " "host and the target through a number of ringbuffers." msgstr "" -#: src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal/microcontrollers/debugging.md:3 msgid "_Embed.toml_:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal/microcontrollers/debugging.md:15 msgid "In one terminal under `src/bare-metal/microcontrollers/examples/`:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal/microcontrollers/debugging.md:23 msgid "In another terminal in the same directory:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal/microcontrollers/debugging.md:25 msgid "On gLinux or Debian:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md +#: src/bare-metal/microcontrollers/debugging.md:43 msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:1 +#: src/bare-metal/aps/other-projects.md:1 msgid "Other projects" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "[RTIC](https://rtic.rs/)" +#: src/bare-metal/microcontrollers/other-projects.md:3 +msgid "RTIC" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:4 msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:5 msgid "" "Shared resource management, message passing, task scheduling, timer queue" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "[Embassy](https://embassy.dev/)" -msgstr "" +#: src/bare-metal/microcontrollers/other-projects.md:6 +#, fuzzy +msgid "Embassy" +msgstr "vmbase" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:7 msgid "`async` executors with priorities, timers, networking, USB" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" +#: src/bare-metal/microcontrollers/other-projects.md:8 +msgid "TockOS" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:9 msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "[Hubris](https://hubris.oxide.computer/)" +#: src/bare-metal/microcontrollers/other-projects.md:11 +msgid "Hubris" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:12 msgid "" "Microkernel RTOS from Oxide Computer Company with memory protection, " "unprivileged drivers, IPC" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" +#: src/bare-metal/microcontrollers/other-projects.md:14 +msgid "Bindings for FreeRTOS" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." -"github.io/book/overview/using-the-standard-library.html)." +#: src/bare-metal/microcontrollers/other-projects.md:15 +msgid "Some platforms have `std` implementations, e.g. esp-idf." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:20 msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:21 msgid "It doesn't include any HALs." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:22 msgid "" "It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " "scheduling rather than a proper kernel." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:24 msgid "Cortex-M only." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:25 msgid "" "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md:26 msgid "" "FreeRTOS is mostly written in C, but there are Rust bindings for writing " "applications." @@ -15556,158 +15562,139 @@ msgid "" "serial port." msgstr "" -#: src/exercises/bare-metal/morning.md src/exercises/concurrency/morning.md -msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"morning.md) provided." +#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md +#, fuzzy +msgid "After looking at the exercises, you can look at the solutions provided." msgstr "" "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " "نگاه کنید." -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:3 msgid "" "We will read the direction from an I2C compass, and log the readings to a " "serial port. If you have time, try displaying it on the LEDs somehow too, or " "use the buttons somehow." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:7 msgid "Hints:" msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:9 msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" -"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" -"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." -"org/hardware/)." +"Check the documentation for the `lsm303agr` and `microbit-v2` crates, as " +"well as the micro:bit hardware." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:13 msgid "" "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:14 msgid "" "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:15 msgid "" "The LSM303AGR driver needs something implementing the `embedded_hal::" -"blocking::i2c::WriteRead` trait. The [`microbit::hal::Twim`](https://docs.rs/" -"microbit-v2/latest/microbit/hal/struct.Twim.html) struct implements this." +"blocking::i2c::WriteRead` trait. The `microbit::hal::Twim` struct implements " +"this." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:19 msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) struct with fields for the various pins and peripherals." +"You have a `microbit::Board` struct with fields for the various pins and " +"peripherals." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:22 msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " -"this exercise." +"You can also look at the nRF52833 datasheet if you want, but it shouldn't be " +"necessary for this exercise." msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:26 msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `compass` directory for the following files." +"Download the exercise template and look in the `compass` directory for the " +"following files." msgstr "" -#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/compass.md:29 src/exercises/bare-metal/rtc.md:22 msgid "_src/main.rs_:" msgstr "" -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Configure serial port.\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Use the system timer as a delay provider.\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -msgid "" -"// Set up the I2C controller and Inertial Measurement Unit.\n" -" // TODO\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "\"Ready.\"" -msgstr "" - -#: src/exercises/bare-metal/compass.md -msgid "" -"// Read compass data and log it to the serial port.\n" -" // TODO\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/compass.md:71 src/exercises/bare-metal/rtc.md:393 msgid "_Cargo.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:93 msgid "_Embed.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/compass.md:109 src/exercises/bare-metal/rtc.md:1000 msgid "_.cargo/config.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:122 msgid "See the serial output on Linux with:" msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:130 msgid "" "Or on Mac OS something like (the device name may be slightly different):" msgstr "" -#: src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/compass.md:138 msgid "Use Ctrl+A Ctrl+Q to quit picocom." msgstr "" -#: src/exercises/bare-metal/solutions-morning.md +#: src/exercises/bare-metal/solutions-morning.md:1 msgid "Bare Metal Rust Morning Exercise" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md -msgid "([back to exercise](compass.md))" +#: src/exercises/bare-metal/solutions-morning.md:5 +#: src/exercises/bare-metal/solutions-afternoon.md:5 +msgid "(back to exercise)" +msgstr "" + +#: src/exercises/bare-metal/solutions-morning.md:34 +msgid "// Configure serial port." +msgstr "" + +#: src/exercises/bare-metal/solutions-morning.md:42 +msgid "// Use the system timer as a delay provider." msgstr "" -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Set up the I2C controller and Inertial Measurement Unit.\n" +#: src/exercises/bare-metal/solutions-morning.md:45 +msgid "// Set up the I2C controller and Inertial Measurement Unit." msgstr "" -#: src/exercises/bare-metal/solutions-morning.md +#: src/exercises/bare-metal/solutions-morning.md:46 msgid "\"Setting up IMU...\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Set up display and timer.\n" +#: src/exercises/bare-metal/solutions-morning.md:64 +msgid "// Set up display and timer." +msgstr "" + +#: src/exercises/bare-metal/solutions-morning.md:71 +msgid "\"Ready.\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Read compass data and log it to the serial port.\n" +#: src/exercises/bare-metal/solutions-morning.md:74 +msgid "// Read compass data and log it to the serial port." msgstr "" -#: src/exercises/bare-metal/solutions-morning.md +#: src/exercises/bare-metal/solutions-morning.md:82 msgid "\"{},{},{}\\t{},{},{}\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md +#: src/exercises/bare-metal/solutions-morning.md:120 msgid "" "// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" -" // on.\n" +"LEDs // on." msgstr "" #: src/bare-metal/aps.md @@ -15718,8 +15705,7 @@ msgstr "" msgid "" "So far we've talked about microcontrollers, such as the Arm Cortex-M series. " "Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"with QEMU's aarch64 'virt' board." msgstr "" #: src/bare-metal/aps.md @@ -15736,12 +15722,12 @@ msgid "" "hardware, but is designed purely for virtual machines." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:3 msgid "" "Before we can start running Rust code, we need to do some initialisation." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:5 msgid "" "```armasm\n" ".section .init.entry, \"ax\"\n" @@ -15817,13 +15803,13 @@ msgid "" "```" msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:77 msgid "" "This is the same as it would be for C: initialising the processor state, " "zeroing the BSS, and setting up the stack pointer." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:79 msgid "" "The BSS (block starting symbol, for historical reasons) is the part of the " "object file which containing statically allocated variables which are " @@ -15832,19 +15818,19 @@ msgid "" "them." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:84 msgid "" "The BSS may already be zeroed, depending on how memory is initialised and " "the image is loaded, but we zero it to be sure." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:86 msgid "" "We need to enable the MMU and cache before reading or writing any memory. If " "we don't:" msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:88 msgid "" "Unaligned accesses will fault. We build the Rust code for the `aarch64-" "unknown-none` target which sets `+strict-align` to prevent the compiler " @@ -15852,7 +15838,7 @@ msgid "" "is not necessarily the case in general." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:92 msgid "" "If it were running in a VM, this can lead to cache coherency issues. The " "problem is that the VM is accessing memory directly with the cache disabled, " @@ -15863,7 +15849,7 @@ msgid "" "not VA or IPA.)" msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:99 msgid "" "For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " "identity maps the first 1 GiB of address space for devices, the next 1 GiB " @@ -15871,86 +15857,86 @@ msgid "" "memory layout that QEMU uses." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:103 msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" -#: src/bare-metal/aps/entry-point.md +#: src/bare-metal/aps/entry-point.md:105 msgid "" "All examples this afternoon assume we will be running at exception level 1 " "(EL1). If you need to run at a different exception level you'll need to " "modify `entry.S` accordingly." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:1 msgid "Inline assembly" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:3 msgid "" "Sometimes we need to use assembly to do things that aren't possible with " "Rust code. For example, to make an HVC (hypervisor call) to tell the " "firmware to power off the system:" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:20 msgid "" -"// Safe because this only uses the declared registers and doesn't do\n" -" // anything with memory.\n" +"// SAFETY: this only uses the declared registers and doesn't do anything // " +"with memory." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:23 msgid "\"hvc #0\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:24 msgid "\"w0\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:25 msgid "\"w1\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:26 msgid "\"w2\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:27 msgid "\"w3\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:28 msgid "\"w4\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:29 msgid "\"w5\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:30 msgid "\"w6\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:31 msgid "\"w7\"" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:40 msgid "" -"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" -"smccc) crate which has wrappers for all these functions.)" +"(If you actually want to do this, use the `smccc` crate which has wrappers " +"for all these functions.)" msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:45 msgid "" "PSCI is the Arm Power State Coordination Interface, a standard set of " "functions to manage system and CPU power states, among other things. It is " "implemented by EL3 firmware and hypervisors on many systems." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:48 msgid "" "The `0 => _` syntax means initialise the register to 0 before running the " "inline assembly code, and ignore its contents afterwards. We need to use " @@ -15958,13 +15944,13 @@ msgid "" "contents of the registers." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:52 msgid "" "This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " "it is called from our entry point in `entry.S`." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:54 msgid "" "`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " "used by the bootloader to pass things like a pointer to the device tree. " @@ -15974,111 +15960,101 @@ msgid "" "special except make sure it doesn't change these registers." msgstr "" -#: src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/inline-assembly.md:60 msgid "" "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" "examples`." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:1 msgid "Volatile memory access for MMIO" msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:3 msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:4 msgid "Never hold a reference." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:5 msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:10 msgid "" "Volatile access: read or write operations may have side-effects, so prevent " "the compiler or hardware from reordering, duplicating or eliding them." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:12 msgid "" "Usually if you write and then read, e.g. via a mutable reference, the " "compiler may assume that the value read is the same as the value just " "written, and not bother actually reading memory." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:15 msgid "" "Some existing crates for volatile access to hardware do hold references, but " "this is unsound. Whenever a reference exist, the compiler may choose to " "dereference it." msgstr "" -#: src/bare-metal/aps/mmio.md +#: src/bare-metal/aps/mmio.md:18 msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:1 msgid "Let's write a UART driver" msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:3 msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" -"documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a PL011 UART, so let's write a driver for that." msgstr "" -#: src/bare-metal/aps/uart.md -msgid "/// Minimal driver for a PL011 UART.\n" +#: src/bare-metal/aps/uart.md:9 +msgid "/// Minimal driver for a PL011 UART." msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/uart.md:17 src/bare-metal/aps/better-uart/driver.md:13 msgid "" -"/// Constructs a new instance of the UART driver for a PL011 device at the\n" -" /// given base address.\n" -" ///\n" -" /// # Safety\n" -" ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" +"/// Constructs a new instance of the UART driver for a PL011 device at " +"the /// given base address. /// /// # Safety /// /// The given base address " +"must point to the 8 MMIO control registers of a /// PL011 device, which must " +"be mapped into the address space of the process /// as device memory and not " +"have any other aliases." msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md -msgid "/// Writes a single byte to the UART.\n" +#: src/bare-metal/aps/uart.md:29 src/bare-metal/aps/better-uart/driver.md:25 +msgid "/// Writes a single byte to the UART." msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md -msgid "// Wait until there is room in the TX buffer.\n" +#: src/bare-metal/aps/uart.md:31 src/bare-metal/aps/better-uart/driver.md:27 +msgid "// Wait until there is room in the TX buffer." msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:34 src/bare-metal/aps/uart.md:46 msgid "" -"// Safe because we know that the base address points to the control\n" -" // registers of a PL011 device which is appropriately mapped.\n" +"// SAFETY: We know that the base address points to the control // registers " +"of a PL011 device which is appropriately mapped." msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md -msgid "// Write to the TX buffer.\n" +#: src/bare-metal/aps/uart.md:37 src/bare-metal/aps/better-uart/driver.md:33 +msgid "// Write to the TX buffer." msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md -msgid "// Wait until the UART is no longer busy.\n" +#: src/bare-metal/aps/uart.md:41 src/bare-metal/aps/better-uart/driver.md:37 +msgid "// Wait until the UART is no longer busy." msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:55 msgid "" "Note that `Uart::new` is unsafe while the other methods are safe. This is " "because as long as the caller of `Uart::new` guarantees that its safety " @@ -16088,403 +16064,423 @@ msgid "" "necessary preconditions." msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:61 msgid "" "We could have done it the other way around (making `new` safe but " "`write_byte` unsafe), but that would be much less convenient to use as every " "place that calls `write_byte` would need to reason about the safety" msgstr "" -#: src/bare-metal/aps/uart.md +#: src/bare-metal/aps/uart.md:64 msgid "" "This is a common pattern for writing safe wrappers of unsafe code: moving " "the burden of proof for soundness from a large number of places to a smaller " "number of places." msgstr "" -#: src/bare-metal/aps/uart/traits.md +#: src/bare-metal/aps/uart/traits.md:1 msgid "More traits" msgstr "" -#: src/bare-metal/aps/uart/traits.md +#: src/bare-metal/aps/uart/traits.md:3 msgid "" "We derived the `Debug` trait. It would be useful to implement a few more " "traits too." msgstr "" -#: src/bare-metal/aps/uart/traits.md src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/uart/traits.md:17 msgid "" -"// Safe because it just contains a pointer to device memory, which can be\n" -"// accessed from any context.\n" +"// SAFETY: `Uart` just contains a pointer to device memory, which can be // " +"accessed from any context." msgstr "" -#: src/bare-metal/aps/uart/traits.md +#: src/bare-metal/aps/uart/traits.md:25 msgid "" "Implementing `Write` lets us use the `write!` and `writeln!` macros with our " "`Uart` type." msgstr "" -#: src/bare-metal/aps/uart/traits.md +#: src/bare-metal/aps/uart/traits.md:27 msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:1 msgid "A better UART driver" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:3 msgid "" -"The PL011 actually has [a bunch more registers](https://developer.arm.com/" -"documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to " -"read. Plus, some of them are bit fields which would be nice to access in a " -"structured way." +"The PL011 actually has a bunch more registers, and adding offsets to " +"construct pointers to access them is error-prone and hard to read. Plus, " +"some of them are bit fields which would be nice to access in a structured " +"way." msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:7 msgid "Offset" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:7 msgid "Register name" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:7 msgid "Width" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:9 msgid "0x00" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:9 msgid "DR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:9 msgid "12" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:10 msgid "0x04" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:10 msgid "RSR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:10 +msgid "4" +msgstr "" + +#: src/bare-metal/aps/better-uart.md:11 msgid "0x18" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:11 msgid "FR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:11 msgid "9" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:12 msgid "0x20" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:12 msgid "ILPR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:12 src/bare-metal/aps/better-uart.md:15 +msgid "8" +msgstr "" + +#: src/bare-metal/aps/better-uart.md:13 msgid "0x24" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:13 msgid "IBRD" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:13 src/bare-metal/aps/better-uart.md:16 msgid "16" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:14 msgid "0x28" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:14 msgid "FBRD" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:14 src/bare-metal/aps/better-uart.md:17 +msgid "6" +msgstr "" + +#: src/bare-metal/aps/better-uart.md:15 msgid "0x2c" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:15 msgid "LCR_H" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:16 msgid "0x30" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:16 msgid "CR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:17 msgid "0x34" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:17 msgid "IFLS" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:18 msgid "0x38" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:18 msgid "IMSC" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 +#: src/bare-metal/aps/better-uart.md:20 src/bare-metal/aps/better-uart.md:21 msgid "11" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:19 msgid "0x3c" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:19 msgid "RIS" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:20 msgid "0x40" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:20 msgid "MIS" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:21 msgid "0x44" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:21 msgid "ICR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:22 msgid "0x48" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:22 msgid "DMACR" msgstr "" -#: src/bare-metal/aps/better-uart.md +#: src/bare-metal/aps/better-uart.md:22 +msgid "3" +msgstr "" + +#: src/bare-metal/aps/better-uart.md:26 msgid "There are also some ID registers which have been omitted for brevity." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md -msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " -"working with bitflags." +#: src/bare-metal/aps/better-uart/bitflags.md:3 +msgid "The `bitflags` crate is useful for working with bitflags." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Flags from the UART flag register.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:10 +msgid "/// Flags from the UART flag register." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Clear to send.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:14 +msgid "/// Clear to send." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Data set ready.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:16 +msgid "/// Data set ready." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Data carrier detect.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:18 +msgid "/// Data carrier detect." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// UART busy transmitting data.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:20 +msgid "/// UART busy transmitting data." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Receive FIFO is empty.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:22 +msgid "/// Receive FIFO is empty." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Transmit FIFO is full.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:24 +msgid "/// Transmit FIFO is full." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Receive FIFO is full.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:26 +msgid "/// Receive FIFO is full." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Transmit FIFO is empty.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:28 +msgid "/// Transmit FIFO is empty." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md -msgid "/// Ring indicator.\n" +#: src/bare-metal/aps/better-uart/bitflags.md:30 +msgid "/// Ring indicator." msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md +#: src/bare-metal/aps/better-uart/bitflags.md:38 msgid "" "The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " "with a bunch of method implementations to get and set flags." msgstr "" -#: src/bare-metal/aps/better-uart/registers.md +#: src/bare-metal/aps/better-uart/registers.md:1 msgid "Multiple registers" msgstr "" -#: src/bare-metal/aps/better-uart/registers.md +#: src/bare-metal/aps/better-uart/registers.md:3 msgid "" "We can use a struct to represent the memory layout of the UART's registers." msgstr "" -#: src/bare-metal/aps/better-uart/registers.md +#: src/bare-metal/aps/better-uart/registers.md:43 msgid "" -"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) tells the compiler to lay the struct fields out in order, " +"`#[repr(C)]` tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " "predictable layout, as default Rust representation allows the compiler to " "(among other things) reorder fields however it sees fit." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/better-uart/driver.md:3 msgid "Now let's use the new `Registers` struct in our driver." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md -msgid "/// Driver for a PL011 UART.\n" +#: src/bare-metal/aps/better-uart/driver.md:6 +msgid "/// Driver for a PL011 UART." +msgstr "" + +#: src/bare-metal/aps/better-uart/driver.md:30 +#: src/bare-metal/aps/better-uart/driver.md:56 +msgid "" +"// SAFETY: We know that self.registers points to the control registers // of " +"a PL011 device which is appropriately mapped." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/driver.md:41 msgid "" -"// Safe because we know that self.registers points to the control\n" -" // registers of a PL011 device which is appropriately mapped.\n" +"/// Reads and returns a pending byte, or `None` if nothing has been /// " +"received." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/driver.md:47 msgid "" -"/// Reads and returns a pending byte, or `None` if nothing has been\n" -" /// received.\n" +"// SAFETY: We know that self.registers points to the control // registers of " +"a PL011 device which is appropriately mapped." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md -msgid "// TODO: Check for error conditions in bits 8-11.\n" +#: src/bare-metal/aps/better-uart/driver.md:50 +msgid "// TODO: Check for error conditions in bits 8-11." msgstr "" -#: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/better-uart/driver.md:65 msgid "" "Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/bare-metal/aps/better-uart/using.md:1 +#: src/bare-metal/aps/logging/using.md:1 msgid "Using it" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:3 msgid "" "Let's write a small program using our driver to write to the serial console, " "and echo incoming bytes." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base address of the primary PL011 UART.\n" +#: src/bare-metal/aps/better-uart/using.md:19 +#: src/bare-metal/aps/logging/using.md:18 +#: src/exercises/bare-metal/solutions-afternoon.md:33 +msgid "/// Base address of the primary PL011 UART." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/better-uart/using.md:25 +#: src/bare-metal/aps/logging/using.md:24 +#: src/exercises/bare-metal/solutions-afternoon.md:44 msgid "" -"// Safe because `PL011_BASE_ADDRESS` is the base address of a PL011 device,\n" -" // and nothing else accesses that address range.\n" +"// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, " +"and // nothing else accesses that address range." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/bare-metal/aps/better-uart/using.md:29 +#: src/bare-metal/aps/logging/using.md:29 msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:35 msgid "b'\\r'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/async/pitfalls/cancellation.md +#: src/bare-metal/aps/better-uart/using.md:36 +#: src/concurrency/async-pitfalls/cancellation.md:27 msgid "b'\\n'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:38 msgid "b'q'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:44 msgid "\"Bye!\"" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:51 msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"As in the inline assembly example, this `main` function is called from our " +"entry point code in `entry.S`. See the speaker notes there for details." msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/better-uart/using.md:54 msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" -#: src/bare-metal/aps/logging.md +#: src/bare-metal/aps/logging.md:3 msgid "" -"It would be nice to be able to use the logging macros from the [`log`]" -"(https://crates.io/crates/log) crate. We can do this by implementing the " -"`Log` trait." +"It would be nice to be able to use the logging macros from the `log` crate. " +"We can do this by implementing the `Log` trait." msgstr "" -#: src/bare-metal/aps/logging.md src/exercises/bare-metal/rtc.md -msgid "\"[{}] {}\"" +#: src/bare-metal/aps/logging.md:26 +msgid "\"\\[{}\\] {}\"" msgstr "" -#: src/bare-metal/aps/logging.md src/exercises/bare-metal/rtc.md -msgid "/// Initialises UART logger.\n" +#: src/bare-metal/aps/logging.md:35 +msgid "/// Initialises UART logger." msgstr "" -#: src/bare-metal/aps/logging.md +#: src/bare-metal/aps/logging.md:48 msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" -#: src/bare-metal/aps/logging/using.md +#: src/bare-metal/aps/logging/using.md:3 msgid "We need to initialise the logger before we use it." msgstr "" -#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/logging/using.md:38 +#: src/exercises/bare-metal/solutions-afternoon.md:115 msgid "\"{info}\"" msgstr "" -#: src/bare-metal/aps/logging/using.md +#: src/bare-metal/aps/logging/using.md:46 msgid "Note that our panic handler can now log details of panics." msgstr "" -#: src/bare-metal/aps/logging/using.md +#: src/bare-metal/aps/logging/using.md:47 msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" -#: src/bare-metal/aps/exceptions.md +#: src/bare-metal/aps/exceptions.md:3 msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " "exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " @@ -16493,81 +16489,79 @@ msgid "" "calling into Rust code:" msgstr "" -#: src/bare-metal/aps/exceptions.md +#: src/bare-metal/aps/exceptions.md:67 msgid "EL is exception level; all our examples this afternoon run in EL1." msgstr "" -#: src/bare-metal/aps/exceptions.md +#: src/bare-metal/aps/exceptions.md:68 msgid "" "For simplicity we aren't distinguishing between SP0 and SPx for the current " "EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -#: src/bare-metal/aps/exceptions.md +#: src/bare-metal/aps/exceptions.md:70 msgid "" "For this example we just log the exception and power down, as we don't " "expect any of them to actually happen." msgstr "" -#: src/bare-metal/aps/exceptions.md +#: src/bare-metal/aps/exceptions.md:72 msgid "" "We can think of exception handlers and our main execution context more or " -"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." -"md) will control what we can share between them, just like with threads. For " -"example, if we want to share some value between exception handlers and the " -"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " -"it in something like a `Mutex` and put it in a static." +"less like different threads. `Send` and `Sync` will control what we can " +"share between them, just like with threads. For example, if we want to share " +"some value between exception handlers and the rest of the program, and it's " +"`Send` but not `Sync`, then we'll need to wrap it in something like a " +"`Mutex` and put it in a static." msgstr "" -#: src/bare-metal/aps/other-projects.md -msgid "[oreboot](https://github.com/oreboot/oreboot)" +#: src/bare-metal/aps/other-projects.md:3 +msgid "oreboot" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:4 msgid "\"coreboot without the C\"" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:5 msgid "Supports x86, aarch64 and RISC-V." msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:6 msgid "Relies on LinuxBoot rather than having many drivers itself." msgstr "" -#: src/bare-metal/aps/other-projects.md -msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +#: src/bare-metal/aps/other-projects.md:7 +msgid "Rust RaspberryPi OS tutorial" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:8 msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " "exception handling, page tables" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:10 msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" -#: src/bare-metal/aps/other-projects.md -msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" +#: src/bare-metal/aps/other-projects.md:12 +msgid "`cargo-call-stack`" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:13 msgid "Static analysis to determine maximum stack usage." msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:17 msgid "" "The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " "enabled. This will read and write memory (e.g. the stack). However:" msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:19 msgid "" "Without the MMU and cache, unaligned accesses will fault. It builds with " "`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " @@ -16575,7 +16569,7 @@ msgid "" "necessarily the case in general." msgstr "" -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/aps/other-projects.md:23 msgid "" "If it were running in a VM, this can lead to cache coherency issues. The " "problem is that the VM is accessing memory directly with the cache disabled, " @@ -16596,157 +16590,148 @@ msgid "" "programming." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:3 msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " -"traits and macros for safely converting between byte sequences and other " -"types." +"The `zerocopy` crate (from Fuchsia) provides traits and macros for safely " +"converting between byte sequences and other types." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:42 msgid "" "This is not suitable for MMIO (as it doesn't use volatile reads and writes), " "but can be useful for working with structures shared with hardware e.g. by " "DMA, or sent over some external interface." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:48 msgid "" "`FromBytes` can be implemented for types for which any byte pattern is " "valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:50 msgid "" "Attempting to derive `FromBytes` for these types would fail, because " "`RequestType` doesn't use all possible u32 values as discriminants, so not " "all byte patterns are valid." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:53 msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" -#: src/bare-metal/useful-crates/zerocopy.md +#: src/bare-metal/useful-crates/zerocopy.md:54 msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "zerocopy-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md +#: src/bare-metal/useful-crates/aarch64-paging.md:3 msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " -"you create page tables according to the AArch64 Virtual Memory System " -"Architecture." +"The `aarch64-paging` crate lets you create page tables according to the " +"AArch64 Virtual Memory System Architecture." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Create a new page table with identity mapping.\n" +#: src/bare-metal/useful-crates/aarch64-paging.md:14 +msgid "// Create a new page table with identity mapping." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Map a 2 MiB region of memory as read-only.\n" +#: src/bare-metal/useful-crates/aarch64-paging.md:16 +msgid "// Map a 2 MiB region of memory as read-only." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Set `TTBR0_EL1` to activate the page table.\n" +#: src/bare-metal/useful-crates/aarch64-paging.md:21 +msgid "// Set `TTBR0_EL1` to activate the page table." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md +#: src/bare-metal/useful-crates/aarch64-paging.md:28 msgid "" "For now it only supports EL1, but support for other exception levels should " "be straightforward to add." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +#: src/bare-metal/useful-crates/aarch64-paging.md:30 +msgid "This is used in Android for the Protected VM Firmware." msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md +#: src/bare-metal/useful-crates/aarch64-paging.md:31 msgid "" "There's no easy way to run this example, as it needs to run on real hardware " "or under QEMU." msgstr "" -#: src/bare-metal/useful-crates/buddy_system_allocator.md +#: src/bare-metal/useful-crates/buddy_system_allocator.md:3 msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" +"`buddy_system_allocator` is a third-party crate implementing a basic buddy " +"system allocator. It can be used both for `LockedHeap` implementing " +"`GlobalAlloc` so you can use the standard `alloc` crate (as we saw before), " +"or for allocating other address space. For example, we might want to " +"allocate MMIO space for PCI BARs:" msgstr "" -#: src/bare-metal/useful-crates/buddy_system_allocator.md +#: src/bare-metal/useful-crates/buddy_system_allocator.md:29 msgid "PCI BARs always have alignment equal to their size." msgstr "" -#: src/bare-metal/useful-crates/buddy_system_allocator.md +#: src/bare-metal/useful-crates/buddy_system_allocator.md:30 msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "allocator-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" -#: src/bare-metal/useful-crates/tinyvec.md +#: src/bare-metal/useful-crates/tinyvec.md:3 msgid "" "Sometimes you want something which can be resized like a `Vec`, but without " -"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " -"this: a vector backed by an array or slice, which could be statically " -"allocated or on the stack, which keeps track of how many elements are used " -"and panics if you try to use more than are allocated." +"heap allocation. `tinyvec` provides this: a vector backed by an array or " +"slice, which could be statically allocated or on the stack, which keeps " +"track of how many elements are used and panics if you try to use more than " +"are allocated." msgstr "" -#: src/bare-metal/useful-crates/tinyvec.md +#: src/bare-metal/useful-crates/tinyvec.md:25 msgid "" "`tinyvec` requires that the element type implement `Default` for " "initialisation." msgstr "" -#: src/bare-metal/useful-crates/tinyvec.md +#: src/bare-metal/useful-crates/tinyvec.md:27 msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:3 msgid "" "`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " "are not available in `core` or `alloc`. How can we manage synchronisation or " "interior mutability, such as for sharing state between different CPUs?" msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:7 msgid "" -"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " -"equivalents of many of these primitives." +"The `spin` crate provides spinlock-based equivalents of many of these " +"primitives." msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:26 msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:27 msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:29 msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " -"useful types for late initialisation with a slightly different approach to " -"`spin::once::Once`." +"The `once_cell` crate also has some useful types for late initialisation " +"with a slightly different approach to `spin::once::Once`." msgstr "" -#: src/bare-metal/useful-crates/spin.md +#: src/bare-metal/useful-crates/spin.md:31 msgid "" "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" @@ -16759,25 +16744,24 @@ msgid "" "to convert the ELF to a raw binary ready to be run." msgstr "" -#: src/bare-metal/android/vmbase.md +#: src/bare-metal/android/vmbase.md:1 msgid "vmbase" msgstr "vmbase" -#: src/bare-metal/android/vmbase.md +#: src/bare-metal/android/vmbase.md:3 msgid "" -"For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" -"master/vmbase/) library provides a linker script and useful defaults for the " -"build rules, along with an entry point, UART console logging and more." +"For VMs running under crosvm on aarch64, the vmbase library provides a " +"linker script and useful defaults for the build rules, along with an entry " +"point, UART console logging and more." msgstr "" -#: src/bare-metal/android/vmbase.md +#: src/bare-metal/android/vmbase.md:24 msgid "" "The `main!` macro marks your main function, to be called from the `vmbase` " "entry point." msgstr "" -#: src/bare-metal/android/vmbase.md +#: src/bare-metal/android/vmbase.md:26 msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." @@ -16787,1201 +16771,623 @@ msgstr "" msgid "We will write a driver for the PL031 real-time clock device." msgstr "" -#: src/exercises/bare-metal/afternoon.md src/exercises/concurrency/afternoon.md -msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"afternoon.md) provided." -msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " -"شده نگاهی بیندازید." - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md:1 +#: src/exercises/bare-metal/solutions-afternoon.md:3 msgid "RTC driver" msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:3 msgid "" -"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " -"you should write a driver for it." +"The QEMU aarch64 virt machine has a PL031 real-time clock at 0x9010000. For " +"this exercise, you should write a driver for it." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:6 msgid "" "Use it to print the current time to the serial console. You can use the " -"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." +"`chrono` crate for date/time formatting." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:8 msgid "" "Use the match register and raw interrupt status to busy-wait until a given " -"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" -"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"time, e.g. 3 seconds in the future. (Call `core::hint::spin_loop` inside the " +"loop.)" msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:11 msgid "" "_Extension if you have time:_ Enable and handle the interrupt generated by " -"the RTC match. You can use the driver provided in the [`arm-gic`](https://" -"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"the RTC match. You can use the driver provided in the `arm-gic` crate to " +"configure the Arm Generic Interrupt Controller." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:14 msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:15 msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `rtc` directory for the following files." -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base addresses of the GICv3.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md:19 msgid "" -"// Safe because `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" -" // addresses of a GICv3 distributor and redistributor respectively, and\n" -" // nothing else accesses those address ranges.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// TODO: Create instance of RTC driver and print current time.\n" +"Download the exercise template and look in the `rtc` directory for the " +"following files." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// TODO: Wait for 3 seconds.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/rtc.md:79 msgid "" "_src/exceptions.rs_ (you should only need to change this for the 3rd part of " "the exercise):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "" -"// Copyright 2023 Google LLC\n" -"//\n" -"// Licensed under the Apache License, Version 2.0 (the \"License\");\n" -"// you may not use this file except in compliance with the License.\n" -"// You may obtain a copy of the License at\n" -"//\n" -"// http://www.apache.org/licenses/LICENSE-2.0\n" -"//\n" -"// Unless required by applicable law or agreed to in writing, software\n" -"// distributed under the License is distributed on an \"AS IS\" BASIS,\n" -"// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -"// See the License for the specific language governing permissions and\n" -"// limitations under the License.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"sync_exception_current\"" +#: src/exercises/bare-metal/rtc.md:156 +msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"irq_current\"" +#: src/exercises/bare-metal/rtc.md:216 +msgid "_src/pl011.rs_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"No pending interrupt\"" +#: src/exercises/bare-metal/rtc.md:419 +msgid "_build.rs_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"IRQ {intid:?}\"" +#: src/exercises/bare-metal/rtc.md:456 +msgid "_entry.S_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"fiq_current\"" +#: src/exercises/bare-metal/rtc.md:606 +msgid "_exceptions.S_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"serr_current\"" +#: src/exercises/bare-metal/rtc.md:792 +msgid "_idmap.S_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"sync_lower\"" +#: src/exercises/bare-metal/rtc.md:842 +msgid "_image.ld_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"irq_lower\"" +#: src/exercises/bare-metal/rtc.md:954 +msgid "_Makefile_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"fiq_lower\"" +#: src/exercises/bare-metal/rtc.md:1011 +msgid "Run the code in QEMU with `make qemu`." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"serr_lower\"" -msgstr "" +#: src/exercises/bare-metal/solutions-afternoon.md:1 +msgid "Bare Metal Rust Afternoon" +msgstr "عصرانه با Bare Metal Rust" -#: src/exercises/bare-metal/rtc.md -msgid "_src/logger.rs_ (you shouldn't need to change this):" +#: src/exercises/bare-metal/solutions-afternoon.md:7 +msgid "_main.rs_:" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: main\n" +#: src/exercises/bare-metal/solutions-afternoon.md:29 +msgid "/// Base addresses of the GICv3." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_src/pl011.rs_ (you shouldn't need to change this):" +#: src/exercises/bare-metal/solutions-afternoon.md:36 +msgid "/// Base address of the PL031 RTC." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: Flags\n" +#: src/exercises/bare-metal/solutions-afternoon.md:38 +msgid "/// The IRQ used by the PL031 RTC." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Flags\n" +#: src/exercises/bare-metal/solutions-afternoon.md:49 +msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md:51 msgid "" -"/// Flags from the UART Receive Status Register / Error Clear Register.\n" +"// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base // " +"addresses of a GICv3 distributor and redistributor respectively, and // " +"nothing else accesses those address ranges." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "/// Framing error.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:57 +msgid "" +"// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, " +"and // nothing else accesses that address range." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "/// Parity error.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:62 +msgid "\"RTC: {time}\"" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "/// Break error.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:70 +msgid "// Wait for 3 seconds, without interrupts." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "/// Overrun error.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:73 +#: src/exercises/bare-metal/solutions-afternoon.md:91 +msgid "\"Waiting for {}\"" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: Registers\n" +#: src/exercises/bare-metal/solutions-afternoon.md:75 +#: src/exercises/bare-metal/solutions-afternoon.md:83 +#: src/exercises/bare-metal/solutions-afternoon.md:96 +#: src/exercises/bare-metal/solutions-afternoon.md:104 +msgid "\"matched={}, interrupt_pending={}\"" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Registers\n" +#: src/exercises/bare-metal/solutions-afternoon.md:87 +#: src/exercises/bare-metal/solutions-afternoon.md:108 +msgid "\"Finished waiting\"" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "" -"// ANCHOR: Uart\n" -"/// Driver for a PL011 UART.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:89 +msgid "// Wait another 3 seconds for an interrupt." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "" -"/// Constructs a new instance of the UART driver for a PL011 device at the\n" -" /// given base address.\n" -" ///\n" -" /// # Safety\n" -" ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" +#: src/exercises/bare-metal/solutions-afternoon.md:121 +msgid "_pl031.rs_:" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Uart\n" +#: src/exercises/bare-metal/solutions-afternoon.md:128 +msgid "/// Data register" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_build.rs_ (you shouldn't need to change this):" +#: src/exercises/bare-metal/solutions-afternoon.md:130 +msgid "/// Match register" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"linux\"" +#: src/exercises/bare-metal/solutions-afternoon.md:132 +msgid "/// Load register" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"CROSS_COMPILE\"" +#: src/exercises/bare-metal/solutions-afternoon.md:134 +msgid "/// Control register" msgstr "" -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "\"aarch64-linux-gnu\"" -msgstr "aarch64-paging" - -#: src/exercises/bare-metal/rtc.md -msgid "\"aarch64-none-elf\"" +#: src/exercises/bare-metal/solutions-afternoon.md:137 +msgid "/// Interrupt Mask Set or Clear register" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"entry.S\"" +#: src/exercises/bare-metal/solutions-afternoon.md:140 +msgid "/// Raw Interrupt Status" msgstr "" -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "\"exceptions.S\"" -msgstr "استثناها" - -#: src/exercises/bare-metal/rtc.md -msgid "\"idmap.S\"" +#: src/exercises/bare-metal/solutions-afternoon.md:143 +msgid "/// Masked Interrupt Status" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "\"empty\"" +#: src/exercises/bare-metal/solutions-afternoon.md:146 +msgid "/// Interrupt Clear Register" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_entry.S_ (you shouldn't need to change this):" +#: src/exercises/bare-metal/solutions-afternoon.md:150 +msgid "/// Driver for a PL031 real-time clock." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md:158 msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -".macro adr_l, reg:req, sym:req\n" -"\tadrp \\reg, \\sym\n" -"\tadd \\reg, \\reg, :lo12:\\sym\n" -".endm\n" -"\n" -".macro mov_i, reg:req, imm:req\n" -"\tmovz \\reg, :abs_g3:\\imm\n" -"\tmovk \\reg, :abs_g2_nc:\\imm\n" -"\tmovk \\reg, :abs_g1_nc:\\imm\n" -"\tmovk \\reg, :abs_g0_nc:\\imm\n" -".endm\n" -"\n" -".set .L_MAIR_DEV_nGnRE,\t0x04\n" -".set .L_MAIR_MEM_WBWA,\t0xff\n" -".set .Lmairval, .L_MAIR_DEV_nGnRE | (.L_MAIR_MEM_WBWA << 8)\n" -"\n" -"/* 4 KiB granule size for TTBR0_EL1. */\n" -".set .L_TCR_TG0_4KB, 0x0 << 14\n" -"/* 4 KiB granule size for TTBR1_EL1. */\n" -".set .L_TCR_TG1_4KB, 0x2 << 30\n" -"/* Disable translation table walk for TTBR1_EL1, generating a translation " -"fault instead. */\n" -".set .L_TCR_EPD1, 0x1 << 23\n" -"/* Translation table walks for TTBR0_EL1 are inner sharable. */\n" -".set .L_TCR_SH_INNER, 0x3 << 12\n" -"/*\n" -" * Translation table walks for TTBR0_EL1 are outer write-back read-allocate " -"write-allocate\n" -" * cacheable.\n" -" */\n" -".set .L_TCR_RGN_OWB, 0x1 << 10\n" -"/*\n" -" * Translation table walks for TTBR0_EL1 are inner write-back read-allocate " -"write-allocate\n" -" * cacheable.\n" -" */\n" -".set .L_TCR_RGN_IWB, 0x1 << 8\n" -"/* Size offset for TTBR0_EL1 is 2**39 bytes (512 GiB). */\n" -".set .L_TCR_T0SZ_512, 64 - 39\n" -".set .Ltcrval, .L_TCR_TG0_4KB | .L_TCR_TG1_4KB | .L_TCR_EPD1 | ." -"L_TCR_RGN_OWB\n" -".set .Ltcrval, .Ltcrval | .L_TCR_RGN_IWB | .L_TCR_SH_INNER | ." -"L_TCR_T0SZ_512\n" -"\n" -"/* Stage 1 instruction access cacheability is unaffected. */\n" -".set .L_SCTLR_ELx_I, 0x1 << 12\n" -"/* SP alignment fault if SP is not aligned to a 16 byte boundary. */\n" -".set .L_SCTLR_ELx_SA, 0x1 << 3\n" -"/* Stage 1 data access cacheability is unaffected. */\n" -".set .L_SCTLR_ELx_C, 0x1 << 2\n" -"/* EL0 and EL1 stage 1 MMU enabled. */\n" -".set .L_SCTLR_ELx_M, 0x1 << 0\n" -"/* Privileged Access Never is unchanged on taking an exception to EL1. */\n" -".set .L_SCTLR_EL1_SPAN, 0x1 << 23\n" -"/* SETEND instruction disabled at EL0 in aarch32 mode. */\n" -".set .L_SCTLR_EL1_SED, 0x1 << 8\n" -"/* Various IT instructions are disabled at EL0 in aarch32 mode. */\n" -".set .L_SCTLR_EL1_ITD, 0x1 << 7\n" -".set .L_SCTLR_EL1_RES1, (0x1 << 11) | (0x1 << 20) | (0x1 << 22) | (0x1 << " -"28) | (0x1 << 29)\n" -".set .Lsctlrval, .L_SCTLR_ELx_M | .L_SCTLR_ELx_C | .L_SCTLR_ELx_SA | ." -"L_SCTLR_EL1_ITD | .L_SCTLR_EL1_SED\n" -".set .Lsctlrval, .Lsctlrval | .L_SCTLR_ELx_I | .L_SCTLR_EL1_SPAN | ." -"L_SCTLR_EL1_RES1\n" -"\n" -"/**\n" -" * This is a generic entry point for an image. It carries out the operations " -"required to prepare the\n" -" * loaded image to be run. Specifically, it zeroes the bss section using " -"registers x25 and above,\n" -" * prepares the stack, enables floating point, and sets up the exception " -"vector. It preserves x0-x3\n" -" * for the Rust entry point, as these may contain boot parameters.\n" -" */\n" -".section .init.entry, \"ax\"\n" -".global entry\n" -"entry:\n" -"\t/* Load and apply the memory management configuration, ready to enable MMU " -"and caches. */\n" -"\tadrp x30, idmap\n" -"\tmsr ttbr0_el1, x30\n" -"\n" -"\tmov_i x30, .Lmairval\n" -"\tmsr mair_el1, x30\n" -"\n" -"\tmov_i x30, .Ltcrval\n" -"\t/* Copy the supported PA range into TCR_EL1.IPS. */\n" -"\tmrs x29, id_aa64mmfr0_el1\n" -"\tbfi x30, x29, #32, #4\n" -"\n" -"\tmsr tcr_el1, x30\n" -"\n" -"\tmov_i x30, .Lsctlrval\n" -"\n" -"\t/*\n" -"\t * Ensure everything before this point has completed, then invalidate any " -"potentially stale\n" -"\t * local TLB entries before they start being used.\n" -"\t */\n" -"\tisb\n" -"\ttlbi vmalle1\n" -"\tic iallu\n" -"\tdsb nsh\n" -"\tisb\n" -"\n" -"\t/*\n" -"\t * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this has completed.\n" -"\t */\n" -"\tmsr sctlr_el1, x30\n" -"\tisb\n" -"\n" -"\t/* Disable trapping floating point access in EL1. */\n" -"\tmrs x30, cpacr_el1\n" -"\torr x30, x30, #(0x3 << 20)\n" -"\tmsr cpacr_el1, x30\n" -"\tisb\n" -"\n" -"\t/* Zero out the bss section. */\n" -"\tadr_l x29, bss_begin\n" -"\tadr_l x30, bss_end\n" -"0:\tcmp x29, x30\n" -"\tb.hs 1f\n" -"\tstp xzr, xzr, [x29], #16\n" -"\tb 0b\n" -"\n" -"1:\t/* Prepare the stack. */\n" -"\tadr_l x30, boot_stack_end\n" -"\tmov sp, x30\n" -"\n" -"\t/* Set up exception vector. */\n" -"\tadr x30, vector_table_el1\n" -"\tmsr vbar_el1, x30\n" -"\n" -"\t/* Call into Rust code. */\n" -"\tbl main\n" -"\n" -"\t/* Loop forever waiting for interrupts. */\n" -"2:\twfi\n" -"\tb 2b\n" -"```" +"/// Constructs a new instance of the RTC driver for a PL031 device at " +"the /// given base address. /// /// # Safety /// /// The given base address " +"must point to the MMIO control registers of a /// PL031 device, which must " +"be mapped into the address space of the process /// as device memory and not " +"have any other aliases." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_exceptions.S_ (you shouldn't need to change this):" +#: src/exercises/bare-metal/solutions-afternoon.md:170 +msgid "/// Reads the current RTC value." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md:172 +#: src/exercises/bare-metal/solutions-afternoon.md:180 +#: src/exercises/bare-metal/solutions-afternoon.md:188 +#: src/exercises/bare-metal/solutions-afternoon.md:199 +#: src/exercises/bare-metal/solutions-afternoon.md:211 +#: src/exercises/bare-metal/solutions-afternoon.md:218 msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -"/**\n" -" * Saves the volatile registers onto the stack. This currently takes 14\n" -" * instructions, so it can be used in exception handlers with 18 " -"instructions\n" -" * left.\n" -" *\n" -" * On return, x0 and x1 are initialised to elr_el2 and spsr_el2 " -"respectively,\n" -" * which can be used as the first and second arguments of a subsequent " -"call.\n" -" */\n" -".macro save_volatile_to_stack\n" -"\t/* Reserve stack space and save registers x0-x18, x29 & x30. */\n" -"\tstp x0, x1, [sp, #-(8 * 24)]!\n" -"\tstp x2, x3, [sp, #8 * 2]\n" -"\tstp x4, x5, [sp, #8 * 4]\n" -"\tstp x6, x7, [sp, #8 * 6]\n" -"\tstp x8, x9, [sp, #8 * 8]\n" -"\tstp x10, x11, [sp, #8 * 10]\n" -"\tstp x12, x13, [sp, #8 * 12]\n" -"\tstp x14, x15, [sp, #8 * 14]\n" -"\tstp x16, x17, [sp, #8 * 16]\n" -"\tstr x18, [sp, #8 * 18]\n" -"\tstp x29, x30, [sp, #8 * 20]\n" -"\n" -"\t/*\n" -"\t * Save elr_el1 & spsr_el1. This such that we can take nested exception\n" -"\t * and still be able to unwind.\n" -"\t */\n" -"\tmrs x0, elr_el1\n" -"\tmrs x1, spsr_el1\n" -"\tstp x0, x1, [sp, #8 * 22]\n" -".endm\n" -"\n" -"/**\n" -" * Restores the volatile registers from the stack. This currently takes 14\n" -" * instructions, so it can be used in exception handlers while still leaving " -"18\n" -" * instructions left; if paired with save_volatile_to_stack, there are 4\n" -" * instructions to spare.\n" -" */\n" -".macro restore_volatile_from_stack\n" -"\t/* Restore registers x2-x18, x29 & x30. */\n" -"\tldp x2, x3, [sp, #8 * 2]\n" -"\tldp x4, x5, [sp, #8 * 4]\n" -"\tldp x6, x7, [sp, #8 * 6]\n" -"\tldp x8, x9, [sp, #8 * 8]\n" -"\tldp x10, x11, [sp, #8 * 10]\n" -"\tldp x12, x13, [sp, #8 * 12]\n" -"\tldp x14, x15, [sp, #8 * 14]\n" -"\tldp x16, x17, [sp, #8 * 16]\n" -"\tldr x18, [sp, #8 * 18]\n" -"\tldp x29, x30, [sp, #8 * 20]\n" -"\n" -"\t/* Restore registers elr_el1 & spsr_el1, using x0 & x1 as scratch. */\n" -"\tldp x0, x1, [sp, #8 * 22]\n" -"\tmsr elr_el1, x0\n" -"\tmsr spsr_el1, x1\n" -"\n" -"\t/* Restore x0 & x1, and release stack space. */\n" -"\tldp x0, x1, [sp], #8 * 24\n" -".endm\n" -"\n" -"/**\n" -" * This is a generic handler for exceptions taken at the current EL while " -"using\n" -" * SP0. It behaves similarly to the SPx case by first switching to SPx, " -"doing\n" -" * the work, then switching back to SP0 before returning.\n" -" *\n" -" * Switching to SPx and calling the Rust handler takes 16 instructions. To\n" -" * restore and return we need an additional 16 instructions, so we can " -"implement\n" -" * the whole handler within the allotted 32 instructions.\n" -" */\n" -".macro current_exception_sp0 handler:req\n" -"\tmsr spsel, #1\n" -"\tsave_volatile_to_stack\n" -"\tbl \\handler\n" -"\trestore_volatile_from_stack\n" -"\tmsr spsel, #0\n" -"\teret\n" -".endm\n" -"\n" -"/**\n" -" * This is a generic handler for exceptions taken at the current EL while " -"using\n" -" * SPx. It saves volatile registers, calls the Rust handler, restores " -"volatile\n" -" * registers, then returns.\n" -" *\n" -" * This also works for exceptions taken from EL0, if we don't care about\n" -" * non-volatile registers.\n" -" *\n" -" * Saving state and jumping to the Rust handler takes 15 instructions, and\n" -" * restoring and returning also takes 15 instructions, so we can fit the " -"whole\n" -" * handler in 30 instructions, under the limit of 32.\n" -" */\n" -".macro current_exception_spx handler:req\n" -"\tsave_volatile_to_stack\n" -"\tbl \\handler\n" -"\trestore_volatile_from_stack\n" -"\teret\n" -".endm\n" -"\n" -".section .text.vector_table_el1, \"ax\"\n" -".global vector_table_el1\n" -".balign 0x800\n" -"vector_table_el1:\n" -"sync_cur_sp0:\n" -"\tcurrent_exception_sp0 sync_exception_current\n" -"\n" -".balign 0x80\n" -"irq_cur_sp0:\n" -"\tcurrent_exception_sp0 irq_current\n" -"\n" -".balign 0x80\n" -"fiq_cur_sp0:\n" -"\tcurrent_exception_sp0 fiq_current\n" -"\n" -".balign 0x80\n" -"serr_cur_sp0:\n" -"\tcurrent_exception_sp0 serr_current\n" -"\n" -".balign 0x80\n" -"sync_cur_spx:\n" -"\tcurrent_exception_spx sync_exception_current\n" -"\n" -".balign 0x80\n" -"irq_cur_spx:\n" -"\tcurrent_exception_spx irq_current\n" -"\n" -".balign 0x80\n" -"fiq_cur_spx:\n" -"\tcurrent_exception_spx fiq_current\n" -"\n" -".balign 0x80\n" -"serr_cur_spx:\n" -"\tcurrent_exception_spx serr_current\n" -"\n" -".balign 0x80\n" -"sync_lower_64:\n" -"\tcurrent_exception_spx sync_lower\n" -"\n" -".balign 0x80\n" -"irq_lower_64:\n" -"\tcurrent_exception_spx irq_lower\n" -"\n" -".balign 0x80\n" -"fiq_lower_64:\n" -"\tcurrent_exception_spx fiq_lower\n" -"\n" -".balign 0x80\n" -"serr_lower_64:\n" -"\tcurrent_exception_spx serr_lower\n" -"\n" -".balign 0x80\n" -"sync_lower_32:\n" -"\tcurrent_exception_spx sync_lower\n" -"\n" -".balign 0x80\n" -"irq_lower_32:\n" -"\tcurrent_exception_spx irq_lower\n" -"\n" -".balign 0x80\n" -"fiq_lower_32:\n" -"\tcurrent_exception_spx fiq_lower\n" -"\n" -".balign 0x80\n" -"serr_lower_32:\n" -"\tcurrent_exception_spx serr_lower\n" -"```" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_idmap.S_ (you shouldn't need to change this):" +"// SAFETY: We know that self.registers points to the control registers // of " +"a PL031 device which is appropriately mapped." msgstr "" -#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md:177 msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -".set .L_TT_TYPE_BLOCK, 0x1\n" -".set .L_TT_TYPE_PAGE, 0x3\n" -".set .L_TT_TYPE_TABLE, 0x3\n" -"\n" -"/* Access flag. */\n" -".set .L_TT_AF, 0x1 << 10\n" -"/* Not global. */\n" -".set .L_TT_NG, 0x1 << 11\n" -".set .L_TT_XN, 0x3 << 53\n" -"\n" -".set .L_TT_MT_DEV, 0x0 << 2\t\t\t// MAIR #0 (DEV_nGnRE)\n" -".set .L_TT_MT_MEM, (0x1 << 2) | (0x3 << 8)\t// MAIR #1 (MEM_WBWA), inner " -"shareable\n" -"\n" -".set .L_BLOCK_DEV, .L_TT_TYPE_BLOCK | .L_TT_MT_DEV | .L_TT_AF | .L_TT_XN\n" -".set .L_BLOCK_MEM, .L_TT_TYPE_BLOCK | .L_TT_MT_MEM | .L_TT_AF | .L_TT_NG\n" -"\n" -".section \".rodata.idmap\", \"a\", %progbits\n" -".global idmap\n" -".align 12\n" -"idmap:\n" -"\t/* level 1 */\n" -"\t.quad\t\t.L_BLOCK_DEV | 0x0\t\t // 1 GiB of device mappings\n" -"\t.quad\t\t.L_BLOCK_MEM | 0x40000000\t// 1 GiB of DRAM\n" -"\t.fill\t\t254, 8, 0x0\t\t\t// 254 GiB of unmapped VA space\n" -"\t.quad\t\t.L_BLOCK_DEV | 0x4000000000 // 1 GiB of device mappings\n" -"\t.fill\t\t255, 8, 0x0\t\t\t// 255 GiB of remaining VA space\n" -"```" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_image.ld_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "" -"```ld\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -"/*\n" -" * Code will start running at this symbol which is placed at the start of " -"the\n" -" * image.\n" -" */\n" -"ENTRY(entry)\n" -"\n" -"MEMORY\n" -"{\n" -"\timage : ORIGIN = 0x40080000, LENGTH = 2M\n" -"}\n" -"\n" -"SECTIONS\n" -"{\n" -"\t/*\n" -"\t * Collect together the code.\n" -"\t */\n" -"\t.init : ALIGN(4096) {\n" -"\t\ttext_begin = .;\n" -"\t\t*(.init.entry)\n" -"\t\t*(.init.*)\n" -"\t} >image\n" -"\t.text : {\n" -"\t\t*(.text.*)\n" -"\t} >image\n" -"\ttext_end = .;\n" -"\n" -"\t/*\n" -"\t * Collect together read-only data.\n" -"\t */\n" -"\t.rodata : ALIGN(4096) {\n" -"\t\trodata_begin = .;\n" -"\t\t*(.rodata.*)\n" -"\t} >image\n" -"\t.got : {\n" -"\t\t*(.got)\n" -"\t} >image\n" -"\trodata_end = .;\n" -"\n" -"\t/*\n" -"\t * Collect together the read-write data including .bss at the end which\n" -"\t * will be zero'd by the entry code.\n" -"\t */\n" -"\t.data : ALIGN(4096) {\n" -"\t\tdata_begin = .;\n" -"\t\t*(.data.*)\n" -"\t\t/*\n" -"\t\t * The entry point code assumes that .data is a multiple of 32\n" -"\t\t * bytes long.\n" -"\t\t */\n" -"\t\t. = ALIGN(32);\n" -"\t\tdata_end = .;\n" -"\t} >image\n" -"\n" -"\t/* Everything beyond this point will not be included in the binary. */\n" -"\tbin_end = .;\n" -"\n" -"\t/* The entry point code assumes that .bss is 16-byte aligned. */\n" -"\t.bss : ALIGN(16) {\n" -"\t\tbss_begin = .;\n" -"\t\t*(.bss.*)\n" -"\t\t*(COMMON)\n" -"\t\t. = ALIGN(16);\n" -"\t\tbss_end = .;\n" -"\t} >image\n" -"\n" -"\t.stack (NOLOAD) : ALIGN(4096) {\n" -"\t\tboot_stack_begin = .;\n" -"\t\t. += 40 * 4096;\n" -"\t\t. = ALIGN(4096);\n" -"\t\tboot_stack_end = .;\n" -"\t} >image\n" -"\n" -"\t. = ALIGN(4K);\n" -"\tPROVIDE(dma_region = .);\n" -"\n" -"\t/*\n" -"\t * Remove unused sections from the image.\n" -"\t */\n" -"\t/DISCARD/ : {\n" -"\t\t/* The image loads itself so doesn't need these sections. */\n" -"\t\t*(.gnu.hash)\n" -"\t\t*(.hash)\n" -"\t\t*(.interp)\n" -"\t\t*(.eh_frame_hdr)\n" -"\t\t*(.eh_frame)\n" -"\t\t*(.note.gnu.build-id)\n" -"\t}\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_Makefile_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "# Copyright 2023 Google LLC" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "$(shell uname -s)" +"/// Writes a match value. When the RTC value matches this then an " +"interrupt /// will be generated (if it is enabled)." msgstr "" -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "aarch64-linux-gnu" -msgstr "aarch64-paging" - -#: src/exercises/bare-metal/rtc.md -msgid "stdio -display none -kernel $< -s" +#: src/exercises/bare-metal/solutions-afternoon.md:185 +msgid "" +"/// Returns whether the match register matches the RTC value, whether or " +"not /// the interrupt is enabled." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "cargo clean" +#: src/exercises/bare-metal/solutions-afternoon.md:194 +msgid "" +"/// Returns whether there is currently an interrupt pending. /// /// This " +"should be true if and only if `matched` returns true and the /// interrupt " +"is masked." msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "Run the code in QEMU with `make qemu`." +#: src/exercises/bare-metal/solutions-afternoon.md:205 +msgid "" +"/// Sets or clears the interrupt mask. /// /// When the mask is true the " +"interrupt is enabled; when it is false the /// interrupt is disabled." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "Bare Metal Rust Afternoon" -msgstr "عصرانه با Bare Metal Rust" - -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "([back to exercise](rtc.md))" +#: src/exercises/bare-metal/solutions-afternoon.md:216 +msgid "/// Clears a pending interrupt, if any." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "_main.rs_:" +#: src/exercises/bare-metal/solutions-afternoon.md:223 +msgid "" +"// SAFETY: `Rtc` just contains a pointer to device memory, which can be // " +"accessed from any context." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base address of the PL031 RTC.\n" +#: src/concurrency/welcome.md +msgid "Welcome to Concurrency in Rust" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// The IRQ used by the PL031 RTC.\n" +#: src/concurrency/welcome.md +msgid "" +"Rust has full support for concurrency using OS threads with mutexes and " +"channels." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/concurrency/welcome.md msgid "" -"// Safe because `PL031_BASE_ADDRESS` is the base address of a PL031 device,\n" -" // and nothing else accesses that address range.\n" +"The Rust type system plays an important role in making many concurrency bugs " +"compile time bugs. This is often referred to as _fearless concurrency_ since " +"you can rely on the compiler to ensure correctness at runtime." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"RTC: {time}\"" +#: src/concurrency/welcome.md src/concurrency/welcome-async.md +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 20 " +"minutes. It contains:" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "// Wait for 3 seconds, without interrupts.\n" +#: src/concurrency/welcome.md +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"Waiting for {}\"" +#: src/concurrency/welcome.md +msgid "" +"The type system gives us safety for concurrency without any special features." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"matched={}, interrupt_pending={}\"" +#: src/concurrency/welcome.md +msgid "" +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"Finished waiting\"" +#: src/concurrency/threads.md src/concurrency/shared-state.md +#: src/concurrency/async.md +msgid "This segment should take about 30 minutes. It contains:" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "// Wait another 3 seconds for an interrupt.\n" +#: src/concurrency/threads/plain.md:3 +msgid "Rust threads work similarly to threads in other languages:" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "_pl031.rs_:" +#: src/concurrency/threads/plain.md:12 +msgid "\"Count in thread: {i}!\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Data register\n" +#: src/concurrency/threads/plain.md:18 +msgid "\"Main thread: {i}\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Match register\n" +#: src/concurrency/threads/plain.md:24 +msgid "Threads are all daemon threads, the main thread does not wait for them." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Load register\n" +#: src/concurrency/threads/plain.md:25 +msgid "Thread panics are independent of each other." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Control register\n" +#: src/concurrency/threads/plain.md:26 +msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Interrupt Mask Set or Clear register\n" +#: src/concurrency/threads/plain.md:31 +msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Raw Interrupt Status\n" +#: src/concurrency/threads/plain.md:33 +msgid "Run the example." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Masked Interrupt Status\n" +#: src/concurrency/threads/plain.md:34 +msgid "" +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Interrupt Clear Register\n" +#: src/concurrency/threads/plain.md:36 +msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Driver for a PL031 real-time clock.\n" +#: src/concurrency/threads/plain.md:37 +msgid "" +"This is because main ends the program and spawned threads do not make it " +"persist." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"/// Constructs a new instance of the RTC driver for a PL031 device at the\n" -" /// given base address.\n" -" ///\n" -" /// # Safety\n" -" ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" +#: src/concurrency/threads/plain.md:39 +msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Reads the current RTC value.\n" +#: src/concurrency/threads/plain.md:41 +msgid "How do we wait around for the spawned thread to complete?" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"// Safe because we know that self.registers points to the control\n" -" // registers of a PL031 device which is appropriately mapped.\n" +#: src/concurrency/threads/plain.md:42 +msgid "`thread::spawn` returns a `JoinHandle`. Look at the docs." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"/// Writes a match value. When the RTC value matches this then an interrupt\n" -" /// will be generated (if it is enabled).\n" +#: src/concurrency/threads/plain.md:43 +msgid "`JoinHandle` has a `.join()` method that blocks." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/concurrency/threads/plain.md:45 msgid "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" -" /// the interrupt is enabled.\n" +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " +"the thread to finish and have the program count all the way to 10." msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"/// Returns whether there is currently an interrupt pending.\n" -" ///\n" -" /// This should be true if and only if `matched` returns true and the\n" -" /// interrupt is masked.\n" +#: src/concurrency/threads/plain.md:48 +msgid "Now what if we want to return a value?" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"/// Sets or clears the interrupt mask.\n" -" ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" -" /// interrupt is disabled.\n" +#: src/concurrency/threads/plain.md:49 +msgid "Look at docs again:" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Clears a pending interrupt, if any.\n" +#: src/concurrency/threads/plain.md:50 +msgid "`thread::spawn`'s closure returns `T`" msgstr "" -#: src/concurrency.md -msgid "Welcome to Concurrency in Rust" +#: src/concurrency/threads/plain.md:51 +msgid "`JoinHandle` `.join()` returns `thread::Result`" msgstr "" -#: src/concurrency.md +#: src/concurrency/threads/plain.md:53 msgid "" -"Rust has full support for concurrency using OS threads with mutexes and " -"channels." +"Use the `Result` return value from `handle.join()` to get access to the " +"returned value." msgstr "" -#: src/concurrency.md -msgid "" -"The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since " -"you can rely on the compiler to ensure correctness at runtime." +#: src/concurrency/threads/plain.md:56 +msgid "Ok, what about the other case?" msgstr "" -#: src/concurrency/threads.md -msgid "Rust threads work similarly to threads in other languages:" +#: src/concurrency/threads/plain.md:57 +msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" -#: src/concurrency/threads.md -msgid "\"Count in thread: {i}!\"" +#: src/concurrency/threads/plain.md:58 +msgid "Access the panic payload. This is a good time to talk about `Any`." msgstr "" -#: src/concurrency/threads.md -msgid "\"Main thread: {i}\"" +#: src/concurrency/threads/plain.md:60 +msgid "Now we can return values from threads! What about taking inputs?" msgstr "" -#: src/concurrency/threads.md -msgid "Threads are all daemon threads, the main thread does not wait for them." +#: src/concurrency/threads/plain.md:61 +msgid "Capture something by reference in the thread closure." msgstr "" -#: src/concurrency/threads.md -msgid "Thread panics are independent of each other." +#: src/concurrency/threads/plain.md:62 +msgid "An error message indicates we must move it." msgstr "" -#: src/concurrency/threads.md -msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." +#: src/concurrency/threads/plain.md:63 +msgid "Move it in, see we can compute and then return a derived value." msgstr "" -#: src/concurrency/threads.md -msgid "" -"Notice that the thread is stopped before it reaches 10 --- the main thread " -"is not waiting." +#: src/concurrency/threads/plain.md:65 +msgid "If we want to borrow?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md:66 msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish." +"Main kills child threads when it returns, but another function would just " +"return and leave them running." msgstr "" -#: src/concurrency/threads.md -msgid "Trigger a panic in the thread, notice how this doesn't affect `main`." +#: src/concurrency/threads/plain.md:68 +msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -#: src/concurrency/threads.md -msgid "" -"Use the `Result` return value from `handle.join()` to get access to the " -"panic payload. This is a good time to talk about [`Any`](https://doc.rust-" -"lang.org/std/any/index.html)." +#: src/concurrency/threads/plain.md:69 +msgid "How do we avoid this? see next slide." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md:3 msgid "Normal threads cannot borrow from their environment:" msgstr "" -#: src/concurrency/scoped-threads.md -msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" -"fn.scope.html) for this:" +#: src/concurrency/threads/scoped.md:20 +msgid "However, you can use a scoped thread for this:" msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md:41 msgid "" "The reason for that is that when the `thread::scope` function completes, all " "the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md:43 msgid "" "Normal Rust borrowing rules apply: you can either borrow mutably by one " "thread, or immutably by any number of threads." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels.md src/concurrency/async-control-flow.md +msgid "This segment should take about 20 minutes. It contains:" +msgstr "" + +#: src/concurrency/channels/senders-receivers.md:3 msgid "" "Rust channels have two parts: a `Sender` and a `Receiver`. The two " "parts are connected via the channel, but you only see the end-points." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md:15 +#: src/concurrency/channels/senders-receivers.md:16 +#: src/concurrency/channels/senders-receivers.md:20 msgid "\"Received: {:?}\"" msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md:27 msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " "implement `Clone` (so you can make multiple producers) but `Receiver` does " "not." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md:30 msgid "" "`send()` and `recv()` return `Result`. If they return `Err`, it means the " "counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" -#: src/concurrency/channels/unbounded.md +#: src/concurrency/channels/unbounded.md:3 msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" msgstr "" -#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md +#: src/concurrency/channels/unbounded.md:16 +#: src/concurrency/channels/bounded.md:16 msgid "\"Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md +#: src/concurrency/channels/unbounded.md:17 +#: src/concurrency/channels/bounded.md:17 msgid "\"{thread_id:?}: sent Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md +#: src/concurrency/channels/unbounded.md:19 +#: src/concurrency/channels/bounded.md:19 msgid "\"{thread_id:?}: done\"" msgstr "" -#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md +#: src/concurrency/channels/unbounded.md:24 +#: src/concurrency/channels/bounded.md:24 msgid "\"Main: got {msg}\"" msgstr "" -#: src/concurrency/channels/bounded.md +#: src/concurrency/channels/bounded.md:3 msgid "" "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" -#: src/concurrency/channels/bounded.md +#: src/concurrency/channels/bounded.md:32 msgid "" "Calling `send` will block the current thread until there is space in the " "channel for the new message. The thread can be blocked indefinitely if there " "is nobody who reads from the channel." msgstr "" -#: src/concurrency/channels/bounded.md +#: src/concurrency/channels/bounded.md:35 msgid "" "A call to `send` will abort with an error (that is why it returns `Result`) " "if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" -#: src/concurrency/channels/bounded.md +#: src/concurrency/channels/bounded.md:37 msgid "" "A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `read`." +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md +msgid "Send" +msgstr "ارسال" + +#: src/concurrency/send-sync.md +msgid "Sync" +msgstr "همگام سازی" + +#: src/concurrency/send-sync/marker-traits.md:3 msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:6 msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " -"is `Send` if it is safe to move a `T` across a thread boundary." +"`Send`: a type `T` is `Send` if it is safe to move a `T` across a thread " +"boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:8 msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " -"is `Sync` if it is safe to move a `&T` across a thread boundary." +"`Sync`: a type `T` is `Sync` if it is safe to move a `&T` across a thread " +"boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:11 msgid "" -"`Send` and `Sync` are [unsafe traits](../unsafe/unsafe-traits.md). The " -"compiler will automatically derive them for your types as long as they only " -"contain `Send` and `Sync` types. You can also implement them manually when " -"you know it is valid." +"`Send` and `Sync` are unsafe traits. The compiler will automatically derive " +"them for your types as long as they only contain `Send` and `Sync` types. " +"You can also implement them manually when you know it is valid." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:22 msgid "" "One can think of these traits as markers that the type has certain thread-" "safety properties." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md:24 msgid "They can be used in the generic constraints as normal traits." msgstr "" -#: src/concurrency/send-sync/send.md +#: src/concurrency/send-sync/send.md:3 msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " -"if it is safe to move a `T` value to another thread." +"A type `T` is `Send` if it is safe to move a `T` value to another thread." msgstr "" -#: src/concurrency/send-sync/send.md +#: src/concurrency/send-sync/send.md:5 msgid "" "The effect of moving ownership to another thread is that _destructors_ will " "run in that thread. So the question is when you can allocate a value in one " "thread and deallocate it in another." msgstr "" -#: src/concurrency/send-sync/send.md +#: src/concurrency/send-sync/send.md:14 msgid "" "As an example, a connection to the SQLite library must only be accessed from " "a single thread." msgstr "" -#: src/concurrency/send-sync/sync.md +#: src/concurrency/send-sync/sync.md:3 msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " -"if it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is `Sync` if it is safe to access a `T` value from multiple " +"threads at the same time." msgstr "" -#: src/concurrency/send-sync/sync.md +#: src/concurrency/send-sync/sync.md:6 msgid "More precisely, the definition is:" msgstr "" -#: src/concurrency/send-sync/sync.md +#: src/concurrency/send-sync/sync.md:8 msgid "`T` is `Sync` if and only if `&T` is `Send`" msgstr "" -#: src/concurrency/send-sync/sync.md +#: src/concurrency/send-sync/sync.md:15 msgid "" "This statement is essentially a shorthand way of saying that if a type is " "thread-safe for shared use, it is also thread-safe to pass references of it " "across threads." msgstr "" -#: src/concurrency/send-sync/sync.md +#: src/concurrency/send-sync/sync.md:19 msgid "" "This is because if a type is Sync it means that it can be shared across " "multiple threads without the risk of data races or other synchronization " @@ -17990,285 +17396,262 @@ msgid "" "be accessed from any thread safely." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:3 msgid "`Send + Sync`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:5 msgid "Most types you come across are `Send + Sync`:" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:7 msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:8 msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:9 msgid "`String`, `Option`, `Vec`, `Box`, ..." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:10 msgid "`Arc`: Explicitly thread-safe via atomic reference count." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:11 msgid "`Mutex`: Explicitly thread-safe via internal locking." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:12 +msgid "`mpsc::Sender`: As of 1.72.0." +msgstr "" + +#: src/concurrency/send-sync/examples.md:13 msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:15 msgid "" "The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:18 msgid "`Send + !Sync`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:20 msgid "" "These types can be moved to other threads, but they're not thread-safe. " "Typically because of interior mutability:" msgstr "" -#: src/concurrency/send-sync/examples.md -msgid "`mpsc::Sender`" -msgstr "" - -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:23 msgid "`mpsc::Receiver`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:24 msgid "`Cell`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:25 msgid "`RefCell`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:27 msgid "`!Send + Sync`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:29 msgid "" "These types are thread-safe, but they cannot be moved to another thread:" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:31 msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " "the thread which created them." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:34 msgid "`!Send + !Sync`" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:36 msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:38 msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" -#: src/concurrency/send-sync/examples.md +#: src/concurrency/send-sync/examples.md:40 msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" -#: src/concurrency/shared_state.md -msgid "" -"Rust uses the type system to enforce synchronization of shared data. This is " -"primarily done via two types:" -msgstr "" - -#: src/concurrency/shared_state.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html), atomic " -"reference counted `T`: handles sharing between threads and takes care to " -"deallocate `T` when the last reference is dropped," -msgstr "" +#: src/concurrency/shared-state.md +msgid "Arc" +msgstr "Shared State" -#: src/concurrency/shared_state.md -msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): ensures " -"mutually exclusive access to the `T` value." -msgstr "" +#: src/concurrency/shared-state.md +msgid "Mutex" +msgstr "Mutex" -#: src/concurrency/shared_state/arc.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +#: src/concurrency/shared-state/arc.md:3 +msgid "`Arc` allows shared read-only access via `Arc::clone`:" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:16 msgid "\"{thread_id:?}: {v:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/arc.md:21 +#: src/concurrency/shared-state/example.md:17 +#: src/concurrency/shared-state/example.md:46 msgid "\"v: {v:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:30 msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:32 msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:34 msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:36 msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md:38 msgid "`std::sync::Weak` can help." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:3 msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " -"mutual exclusion _and_ allows mutable access to `T` behind a read-only " -"interface (another form of [interior mutability](../../borrowing/interior-" -"mutability)):" +"`Mutex` ensures mutual exclusion _and_ allows mutable access to `T` " +"behind a read-only interface (another form of interior mutability):" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:12 +#: src/concurrency/shared-state/mutex.md:19 msgid "\"v: {:?}\"" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:23 msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " +"Notice how we have a `impl Sync for Mutex` blanket " "implementation." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:33 msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:35 msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:37 msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:39 msgid "" "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " "implements `Send`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:41 msgid "A read-write lock counterpart: `RwLock`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:42 msgid "Why does `lock()` return a `Result`?" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md:43 msgid "" "If the thread that held the `Mutex` panicked, the `Mutex` becomes " "\"poisoned\" to signal that the data it protected might be in an " "inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"`PoisonError`. You can call `into_inner()` on the error to recover the data " +"regardless." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:3 msgid "Let us see `Arc` and `Mutex` in action:" msgstr "" -#: src/concurrency/shared_state/example.md -msgid "// use std::sync::{Arc, Mutex};\n" +#: src/concurrency/shared-state/example.md:6 +msgid "// use std::sync::{Arc, Mutex};" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:24 msgid "Possible solution:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:50 msgid "Notable parts:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:52 msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:54 msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:56 msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md:58 msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "" -#: src/exercises/concurrency/morning.md -msgid "Let us practice our new concurrency skills with" -msgstr "" - -#: src/exercises/concurrency/morning.md -msgid "Dining philosophers: a classic problem in concurrency." -msgstr "" - -#: src/exercises/concurrency/morning.md -msgid "" -"Multi-threaded link checker: a larger project where you'll use Cargo to " -"download dependencies and then check links in parallel." +#: src/concurrency/sync-exercises.md src/concurrency/async-exercises.md +msgid "This segment should take about 1 hour and 10 minutes. It contains:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md:3 msgid "The dining philosophers problem is a classic problem in concurrency:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md:5 msgid "" "Five philosophers dine together at the same table. Each philosopher has " "their own place at the table. There is a fork between each plate. The dish " @@ -18280,103 +17663,99 @@ msgid "" "down both forks." msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md:13 msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) " -"for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local Cargo installation for this exercise. Copy the code " +"below to a file called `src/main.rs`, fill out the blanks, and test that " +"`cargo run` does not deadlock:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -msgid "" -"// left_fork: ...\n" -" // right_fork: ...\n" -" // thoughts: ...\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:28 +#: src/concurrency/async-exercises/dining-philosophers.md:23 +msgid "// left_fork: ... // right_fork: ... // thoughts: ..." msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:36 +#: src/concurrency/sync-exercises/solutions.md:22 +#: src/concurrency/async-exercises/dining-philosophers.md:31 +#: src/concurrency/async-exercises/solutions.md:23 msgid "\"Eureka! {} has a new idea!\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Pick up forks...\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:41 +#: src/concurrency/async-exercises/solutions.md:31 +msgid "// Pick up forks..." msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:42 +#: src/concurrency/sync-exercises/solutions.md:31 +#: src/concurrency/async-exercises/dining-philosophers.md:38 +#: src/concurrency/async-exercises/solutions.md:51 msgid "\"{} is eating...\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Socrates\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Hypatia\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Plato\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Aristotle\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Pythagoras\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create forks\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:51 +#: src/concurrency/async-exercises/dining-philosophers.md:48 +#: src/concurrency/async-exercises/solutions.md:63 +msgid "// Create forks" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create philosophers\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:53 +#: src/concurrency/async-exercises/dining-philosophers.md:50 +#: src/concurrency/async-exercises/solutions.md:67 +msgid "// Create philosophers" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -msgid "// Make each of them think and eat 100 times\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:55 +msgid "// Make each of them think and eat 100 times" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Output their thoughts\n" +#: src/concurrency/sync-exercises/dining-philosophers.md:57 +#: src/concurrency/async-exercises/dining-philosophers.md:54 +#: src/concurrency/async-exercises/solutions.md:95 +msgid "// Output their thoughts" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md:61 msgid "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md:65 msgid "" "```toml\n" "[package]\n" @@ -18386,7 +17765,7 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:3 msgid "" "Let us use our new knowledge to create a multi-threaded link checker. It " "should start at a webpage and check that links on the page are valid. It " @@ -18394,36 +17773,29 @@ msgid "" "until all pages have been validated." msgstr "" -#: src/exercises/concurrency/link-checker.md -msgid "" -"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). Create a new Cargo project and `reqwest` it as a dependency with:" -msgstr "" - -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:8 msgid "" -"If `cargo add` fails with `error: no such subcommand`, then please edit the " -"`Cargo.toml` file by hand. Add the dependencies listed below." +"For this, you will need an HTTP client such as `reqwest`. You will also need " +"a way to find links, we can use `scraper`. Finally, we'll need some way of " +"handling errors, we will use `thiserror`." msgstr "" -#: src/exercises/concurrency/link-checker.md -msgid "" -"You will also need a way to find links. We can use [`scraper`](https://docs." -"rs/scraper/) for that:" +#: src/concurrency/sync-exercises/link-checker.md:12 +msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:22 msgid "" -"Finally, we'll need some way of handling errors. We use [`thiserror`]" -"(https://docs.rs/thiserror/) for that:" +"If `cargo add` fails with `error: no such subcommand`, then please edit the " +"`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:25 msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:29 msgid "" "```toml\n" "[package]\n" @@ -18440,130 +17812,112 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:42 msgid "" "You can now download the start page. Try with a small site such as `https://" "www.google.org/`." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:45 msgid "Your `src/main.rs` file should look something like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:57 +#: src/concurrency/sync-exercises/solutions.md:93 msgid "\"request error: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:59 +#: src/concurrency/sync-exercises/solutions.md:95 msgid "\"bad http response: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:70 +#: src/concurrency/sync-exercises/solutions.md:106 msgid "\"Checking {:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:88 +#: src/concurrency/sync-exercises/solutions.md:124 msgid "\"href\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:95 +#: src/concurrency/sync-exercises/solutions.md:131 msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md:104 +#: src/concurrency/sync-exercises/solutions.md:241 msgid "\"https://www.google.org\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:107 msgid "\"Links: {links:#?}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:108 msgid "\"Could not extract links: {err:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:113 msgid "Run the code in `src/main.rs` with" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:121 msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md:123 msgid "" "Extend this to recursively extract links from all pages on the `www.google." "org` domain. Put an upper limit of 100 pages or so so that you don't end up " "being blocked by the site." msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "Concurrency Morning Exercise" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](dining-philosophers.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:27 msgid "\"{} is trying to eat\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:51 msgid "" -"// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" -" // either of them.\n" +"// To avoid a deadlock, we have to break the symmetry // somewhere. This " +"will swap the forks without deinitializing // either of them." msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:75 msgid "\"{thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:80 msgid "Link Checker" msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](link-checker.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md -msgid "" -"/// Determine whether links within the given page should be extracted.\n" +#: src/concurrency/sync-exercises/solutions.md:150 +msgid "/// Determine whether links within the given page should be extracted." msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:158 msgid "" -"/// Mark the given page as visited, returning false if it had already\n" -" /// been visited.\n" +"/// Mark the given page as visited, returning false if it had already /// " +"been visited." msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "// The sender got dropped. No more commands coming in.\n" +#: src/concurrency/sync-exercises/solutions.md:184 +msgid "// The sender got dropped. No more commands coming in." msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:225 msgid "\"Got crawling error: {:#}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md:243 msgid "\"Bad URLs: {:#?}\"" msgstr "" -#: src/async.md -msgid "Async Rust" -msgstr "" - -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "\"Async\" is a concurrency model where multiple tasks are executed " "concurrently by executing each task until it would block, then switching to " @@ -18573,96 +17927,98 @@ msgid "" "primitives for efficiently identifying I/O that is able to proceed." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Rust's asynchronous operation is based on \"futures\", which represent work " "that may be completed in the future. Futures are \"polled\" until they " "signal that they are complete." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " "callback-based, and not polled. Async Python programs require a \"loop\", " "similar to a runtime in Rust." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "JavaScript's `Promise` is similar, but again callback-based. The language " "runtime implements the event loop, so many of the details of Promise " "resolution are hidden." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async.md +msgid "async/await" +msgstr "async/await" + +#: src/concurrency/async/async-await.md:3 msgid "" "At a high level, async Rust code looks very much like \"normal\" sequential " "code:" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:10 msgid "\"Count is: {i}!\"" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:28 msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:31 msgid "What is the return type of an async call?" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:32 msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:34 msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:37 msgid "" "You cannot make `main` async, without additional instructions to the " "compiler on how to use the returned future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:40 msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:43 msgid "" "`.await` asynchronously waits for the completion of another operation. " "Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md:46 msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:3 msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " -"trait, implemented by objects that represent an operation that may not be " -"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html)." +"`Future` is a trait, implemented by objects that represent an operation that " +"may not be complete yet. A future can be polled, and `poll` returns a `Poll`." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:23 msgid "" "An async function returns an `impl Future`. It's also possible (but " "uncommon) to implement `Future` for your own types. For example, the " @@ -18670,76 +18026,74 @@ msgid "" "joining to it." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:27 msgid "" "The `.await` keyword, applied to a Future, causes the current async function " "to pause until that Future is ready, and then evaluates to its output." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:33 msgid "" "The `Future` and `Poll` types are implemented exactly as shown; click the " "links to show the implementations in the docs." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:36 msgid "" "We will not get to `Pin` and `Context`, as we will focus on writing async " "code, rather than building new async primitives. Briefly:" msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:39 msgid "" "`Context` allows a Future to schedule itself to be polled again when an " "event occurs." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md:42 msgid "" "`Pin` ensures that the Future isn't moved in memory, so that pointers into " "that future remain valid. This is required to allow references to remain " "valid after an `.await`." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:3 msgid "" "A _runtime_ provides support for performing operations asynchronously (a " "_reactor_) and is responsible for executing futures (an _executor_). Rust " "does not have a \"built-in\" runtime, but several options are available:" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:7 msgid "" -"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" -"github.com/hyperium/tonic) for gRPC." +"Tokio: performant, with a well-developed ecosystem of functionality like " +"Hyper for HTTP or Tonic for gRPC." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:10 msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." +"async-std: aims to be a \"std for async\", and includes a basic runtime in " +"`async::task`." msgstr "" -#: src/async/runtimes.md -msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" +#: src/concurrency/async/runtimes.md:12 +msgid "smol: simple and lightweight" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:14 msgid "" -"Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" -"async/src/lib.rs) already has one." +"Several larger applications have their own runtimes. For example, Fuchsia " +"already has one." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:21 msgid "" "Note that of the listed runtimes, only Tokio is supported in the Rust " "playground. The playground also does not permit any I/O, so most interesting " "async things can't run in the playground." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md:25 msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " @@ -18747,66 +18101,66 @@ msgid "" "used." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:3 msgid "Tokio provides:" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:5 msgid "A multi-threaded runtime for executing asynchronous code." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:6 msgid "An asynchronous version of the standard library." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:7 msgid "A large ecosystem of libraries." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:14 msgid "\"Count in task: {i}!\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:24 msgid "\"Main task: {i}\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:32 msgid "With the `tokio::main` macro we can now make `main` async." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:34 msgid "The `spawn` function creates a new, concurrent \"task\"." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:36 msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:38 msgid "**Further exploration:**" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:40 msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " "cancellation. `tokio::spawn` returns a handle which can be awaited to wait " "until it finishes." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:44 msgid "Try `count_to(10).await` instead of spawning." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md:46 msgid "Try awaiting the task returned from `tokio::spawn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:3 msgid "Rust has a task system, which is a form of lightweight threading." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:5 msgid "" "A task has a single top-level future which the executor polls to make " "progress. That future may have one or more nested futures that its `poll` " @@ -18815,170 +18169,150 @@ msgid "" "and an I/O operation." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:16 msgid "\"127.0.0.1:0\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:17 msgid "\"listening on port {}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:22 msgid "\"connection from {addr:?}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:25 msgid "b\"Who are you?\\n\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 +#: src/concurrency/async/tasks.md:31 msgid "\"socket error\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:30 msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "" -#: src/async/tasks.md src/async/control-flow/join.md +#: src/concurrency/async/tasks.md:40 +#: src/concurrency/async-control-flow/join.md:37 msgid "" "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -#: src/async/tasks.md -msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix." -"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" -"telnet/)." +#: src/concurrency/async/tasks.md:42 +msgid "Try connecting to it with a TCP connection tool like nc or telnet." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:46 msgid "" "Ask students to visualize what the state of the example server would be with " "a few connected clients. What tasks exist? What are their Futures?" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:49 msgid "" "This is the first time we've seen an `async` block. This is similar to a " "closure, but does not take any arguments. Its return value is a Future, " "similar to an `async fn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md:53 msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:3 msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:13 msgid "\"Received {count} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:16 msgid "\"ping_handler complete\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:24 msgid "\"Failed to send ping.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:25 msgid "\"Sent {} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:29 msgid "\"Something went wrong in ping handler task.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:36 msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:38 msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](concurrency/channels.md)." +"morning class." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:41 msgid "Try removing the `std::mem::drop` call. What happens? Why?" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:43 msgid "" -"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient " -"for complex applications with both IO and heavy CPU processing tasks." +"The Flume crate has channels that implement both `sync` and `async` `send` " +"and `recv`. This can be convenient for complex applications with both IO and " +"heavy CPU processing tasks." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md:47 msgid "" "What makes working with `async` channels preferable is the ability to " "combine them with other `future`s to combine them and create complex control " "flow." msgstr "" -#: src/async/control-flow.md -msgid "Futures Control Flow" -msgstr "" - -#: src/async/control-flow.md -msgid "" -"Futures can be combined together to produce concurrent compute flow graphs. " -"We have already seen tasks, that function as independent threads of " -"execution." -msgstr "" - -#: src/async/control-flow.md -msgid "[Join](control-flow/join.md)" -msgstr "" - -#: src/async/control-flow.md -msgid "[Select](control-flow/select.md)" -msgstr "" - -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:3 msgid "" "A join operation waits until all of a set of futures are ready, and returns " "a collection of their results. This is similar to `Promise.all` in " "JavaScript or `asyncio.gather` in Python." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:21 msgid "\"https://google.com\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:22 msgid "\"https://httpbin.org/ip\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:23 msgid "\"https://play.rust-lang.org/\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:24 msgid "\"BAD_URL\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:39 msgid "" "For multiple futures of disjoint types, you can use `std::future::join!` but " "you must know how many futures you will have at compile time. This is " "currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:43 msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md:46 msgid "" "You can also combine `join_all` with `join!` for instance to join all " "requests to an http service as well as a database query. Try adding a " @@ -18987,7 +18321,7 @@ msgid "" "demonstrates `join!`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:3 msgid "" "A select operation waits until any of a set of futures is ready, and " "responds to that future's result. In JavaScript, this is similar to `Promise." @@ -18995,7 +18329,7 @@ msgid "" "FIRST_COMPLETED)`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:8 msgid "" "Similar to a match statement, the body of `select!` has a number of arms, " "each of the form `pattern = future => statement`. When a `future` is ready, " @@ -19004,31 +18338,27 @@ msgid "" "of the `select!` macro." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:40 msgid "\"Felix\"" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:40 msgid "\"Failed to send cat.\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Rex\"" -msgstr "" - -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:44 msgid "\"Failed to send dog.\"" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:49 msgid "\"Failed to receive winner\"" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:51 msgid "\"Winner is {winner:?}\"" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:58 msgid "" "In this example, we have a race between a cat and a dog. " "`first_animal_to_finish_race` listens to both channels and will pick " @@ -19036,63 +18366,47 @@ msgid "" "that take 500ms." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:63 msgid "" "You can use `oneshot` channels in this example as the channels are supposed " "to receive only one `send`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:66 msgid "" "Try adding a deadline to the race, demonstrating selecting different sorts " "of futures." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:69 msgid "" "Note that `select!` drops unmatched branches, which cancels their futures. " "It is easiest to use when every execution of `select!` creates new futures." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md:72 msgid "" "An alternative is to pass `&mut future` instead of the future itself, but " "this can lead to issues, further discussed in the pinning slide." msgstr "" -#: src/async/pitfalls.md -msgid "Pitfalls of async/await" -msgstr "" - -#: src/async/pitfalls.md +#: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " "asynchronous programming. However, the async/await model in Rust also comes " "with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter:" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Blocking the Executor](pitfalls/blocking-executor.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Pin](pitfalls/pin.md)" +"chapter." msgstr "" -#: src/async/pitfalls.md -msgid "[Async Traits](pitfalls/async-traits.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Cancellation](pitfalls/cancellation.md)" -msgstr "" +#: src/concurrency/async-pitfalls.md +msgid "Pin" +msgstr "Pin" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:1 msgid "Blocking the executor" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:3 msgid "" "Most async runtimes only allow IO tasks to run concurrently. This means that " "CPU blocking tasks will block the executor and prevent other tasks from " @@ -19100,39 +18414,39 @@ msgid "" "possible." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:14 msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:19 msgid "\"current_thread\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:30 msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:33 msgid "" "The `\"current_thread\"` flavor puts all tasks on a single thread. This " "makes the effect more obvious, but the bug is still present in the multi-" "threaded flavor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:37 msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:39 msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:42 msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " @@ -19142,27 +18456,27 @@ msgid "" "situations." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md:48 msgid "" "Use sync mutexes with care. Holding a mutex over an `.await` may cause " "another task to block, and that task may be running on the same thread." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:3 msgid "" "Async blocks and functions return types implementing the `Future` trait. The " "type returned is the result of a compiler transformation which turns local " "variables into data stored inside the future." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:7 msgid "" "Some of those variables can hold pointers to other local variables. Because " "of that, the future should never be moved to a different memory location, as " "it would invalidate those pointers." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:11 msgid "" "To prevent moving the future type in memory, it can only be polled through a " "pinned pointer. `Pin` is a wrapper around a reference that disallows all " @@ -19170,95 +18484,95 @@ msgid "" "location." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:20 msgid "" -"// A work item. In this case, just sleep for the given time and respond\n" -"// with a message on the `respond_on` channel.\n" +"// A work item. In this case, just sleep for the given time and respond // " +"with a message on the `respond_on` channel." msgstr "" -#: src/async/pitfalls/pin.md -msgid "// A worker which listens for work on a queue and performs it.\n" +#: src/concurrency/async-pitfalls/pin.md:28 +msgid "// A worker which listens for work on a queue and performs it." msgstr "" -#: src/async/pitfalls/pin.md -msgid "// Pretend to work.\n" +#: src/concurrency/async-pitfalls/pin.md:35 +msgid "// Pretend to work." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:38 msgid "\"failed to send response\"" msgstr "" -#: src/async/pitfalls/pin.md -msgid "// TODO: report number of iterations every 100ms\n" +#: src/concurrency/async-pitfalls/pin.md:41 +msgid "// TODO: report number of iterations every 100ms" msgstr "" -#: src/async/pitfalls/pin.md -msgid "// A requester which requests work and waits for it to complete.\n" +#: src/concurrency/async-pitfalls/pin.md:45 +msgid "// A requester which requests work and waits for it to complete." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:52 msgid "\"failed to send on work queue\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:53 msgid "\"failed waiting for response\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:62 msgid "\"work result for iteration {i}: {resp}\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:70 msgid "" "You may recognize this as an example of the actor pattern. Actors typically " "call `select!` in a loop." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:73 msgid "" "This serves as a summation of a few of the previous lessons, so take your " "time with it." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:76 msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:79 msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:90 msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " "`timeout_fut` in the `select!` to work around the move, then using `Box::" "pin`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:104 msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " "iteration (a fused future would help with this). Update to reset " "`timeout_fut` every time it expires." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:108 msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " "stabilized, with older code often using `tokio::pin!`) is also an option, " "but that is difficult to use for a future that is reassigned." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:112 msgid "" "Another alternative is to not use `pin` at all but spawn another task that " "will send to a `oneshot` channel every 100ms." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:115 msgid "" "Data that contains pointers to itself is called self-referential. Normally, " "the Rust borrow checker would prevent self-referential data from being " @@ -19267,64 +18581,80 @@ msgid "" "borrow checker." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:121 msgid "" "`Pin` is a wrapper around a reference. An object cannot be moved from its " "place using a pinned pointer. However, it can still be moved through an " "unpinned pointer." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md:125 msgid "" "The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " "`&mut Self` to refer to the instance. That's why it can only be called on a " "pinned pointer." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:3 +msgid "" +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md:7 +msgid "" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md:10 +msgid "" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md:13 msgid "" -"Async methods in traits are not yet supported in the stable channel ([An " -"experimental feature exists in nightly and should be stabilized in the mid " -"term.](https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-" -"nightly.html))" +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:16 msgid "" -"The crate [async_trait](https://docs.rs/async-trait/latest/async_trait/) " -"provides a workaround through a macro:" +"If we do need `dyn` support, the crate async_trait provides a workaround " +"through a macro, with some caveats:" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:46 msgid "\"running all sleepers..\"" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:50 msgid "\"slept for {}ms\"" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:68 msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:71 msgid "" "The challenges in language support for `async trait` are deep Rust and " "probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"explaining them in this post if you are interested in digging deeper." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md:77 msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " "time and adding it to the Vec." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:3 msgid "" "Dropping a future implies it can never be polled again. This is called " "_cancellation_ and it can occur at any `await` point. Care is needed to " @@ -19332,119 +18662,102 @@ msgid "" "example, it shouldn't deadlock or lose data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:35 msgid "\"not UTF-8\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:51 msgid "\"hi\\nthere\\n\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:57 msgid "\"tick!\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:73 msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:76 msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:79 msgid "The example loses parts of the string." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:81 msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:84 msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "" -#: src/async/pitfalls/cancellation.md -msgid "// prefix buf and bytes with self.\n" +#: src/concurrency/async-pitfalls/cancellation.md:98 +msgid "// prefix buf and bytes with self." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:107 msgid "" -"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a " +"`Interval::tick` is cancellation-safe because it keeps track of whether a " "tick has been 'delivered'." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:111 msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) is cancellation-safe because it either " -"returns or doesn't read data." +"`AsyncReadExt::read` is cancellation-safe because it either returns or " +"doesn't read data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md:114 msgid "" -"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " +"`AsyncBufReadExt::read_line` is similar to the example and _isn't_ " "cancellation-safe. See its documentation for details and alternatives." msgstr "" -#: src/exercises/concurrency/afternoon.md -msgid "" -"To practice your Async Rust skills, we have again two exercises for you:" -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"Dining philosophers: we already saw this problem in the morning. This time " -"you are going to implement it with Async Rust." -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"A Broadcast Chat Application: this is a larger project that allows you " -"experiment with more advanced Async Rust features." -msgstr "" - -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/dining-philosophers.md:1 +#: src/concurrency/async-exercises/solutions.md:3 #, fuzzy msgid "Dining Philosophers --- Async" msgstr "فلسفه Dining" -#: src/exercises/concurrency/dining-philosophers-async.md -msgid "" -"See [dining philosophers](dining-philosophers.md) for a description of the " -"problem." +#: src/concurrency/async-exercises/dining-philosophers.md:3 +msgid "See dining philosophers for a description of the problem." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md:6 msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-" -"locally.md) for this exercise. Copy the code below to a file called `src/" -"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local Cargo installation for this exercise. Copy " +"the code below to a file called `src/main.rs`, fill out the blanks, and test " +"that `cargo run` does not deadlock:" +msgstr "" + +#: src/concurrency/async-exercises/dining-philosophers.md:37 +#: src/concurrency/async-exercises/solutions.md:29 +msgid "// Keep trying until we have both forks" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Make them think and eat\n" +#: src/concurrency/async-exercises/dining-philosophers.md:52 +#: src/concurrency/async-exercises/solutions.md:85 +msgid "// Make them think and eat" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md:58 msgid "" "Since this time you are using Async Rust, you'll need a `tokio` dependency. " "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md:63 msgid "" "```toml\n" "[package]\n" @@ -19458,17 +18771,17 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md:73 msgid "" "Also note that this time you have to use the `Mutex` and the `mpsc` module " "from the `tokio` crate." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md:79 msgid "Can you make your implementation single-threaded?" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:3 msgid "" "In this exercise, we want to use our new knowledge to implement a broadcast " "chat application. We have a chat server that the clients connect to and " @@ -19477,23 +18790,21 @@ msgid "" "that it receives to all the clients." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:9 msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/) for the communication between the client " -"and the server." +"For this, we use a broadcast channel on the server, and `tokio_websockets` " +"for the communication between the client and the server." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:12 msgid "Create a new Cargo project and add the following dependencies:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:14 msgid "_Cargo.toml_:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:18 msgid "" "```toml\n" "[package]\n" @@ -19503,140 +18814,134 @@ msgid "" "\n" "[dependencies]\n" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" -"http = \"1.0.0\"\n" -"tokio = { version = \"1.28.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.5.1\", features = [\"client\", " +"http = \"1.1.0\"\n" +"tokio = { version = \"1.38.0\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:31 msgid "The required APIs" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:33 msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " -"to familiarize yourself with the API." +"`tokio_websockets`. Spend a few minutes to familiarize yourself with the API." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:37 msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " -"asynchronously reading messages from a Websocket Stream." +"StreamExt::next() implemented by `WebSocketStream`: for asynchronously " +"reading messages from a Websocket Stream." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:39 msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " -"asynchronously sending messages on a Websocket Stream." +"SinkExt::send() implemented by `WebSocketStream`: for asynchronously sending " +"messages on a Websocket Stream." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:41 msgid "" -"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): for asynchronously reading user messages from the " +"Lines::next_line(): for asynchronously reading user messages from the " "standard input." msgstr "" -#: src/exercises/concurrency/chat-app.md -msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." +#: src/concurrency/async-exercises/chat-app.md:43 +msgid "Sender::subscribe(): for subscribing to a broadcast channel." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:45 msgid "Two binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:47 msgid "" "Normally in a Cargo project, you can have only one binary, and one `src/main." "rs` file. In this project, we need two binaries. One for the client, and one " "for the server. You could potentially make them two separate Cargo projects, " "but we are going to put them in a single Cargo project with two binaries. " "For this to work, the client and the server code should go under `src/bin` " -"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" -"targets.html#binaries))." +"(see the documentation)." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:54 msgid "" "Copy the following server and client code into `src/bin/server.rs` and `src/" "bin/client.rs`, respectively. Your task is to complete these files as " "described below." msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:58 +#: src/concurrency/async-exercises/solutions.md:104 msgid "_src/bin/server.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md -msgid "// TODO: For a hint, see the description of the task below.\n" +#: src/concurrency/async-exercises/chat-app.md:77 +#: src/concurrency/async-exercises/chat-app.md:124 +msgid "// TODO: For a hint, see the description of the task below." msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:85 +#: src/concurrency/async-exercises/solutions.md:154 msgid "\"127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:86 +#: src/concurrency/async-exercises/solutions.md:155 msgid "\"listening on port 2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:90 +#: src/concurrency/async-exercises/solutions.md:159 msgid "\"New connection from {addr:?}\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Wrap the raw TCP stream into a websocket.\n" +#: src/concurrency/async-exercises/chat-app.md:93 +#: src/concurrency/async-exercises/solutions.md:162 +msgid "// Wrap the raw TCP stream into a websocket." msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:102 +#: src/concurrency/async-exercises/solutions.md:171 msgid "_src/bin/client.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md:116 +#: src/concurrency/async-exercises/solutions.md:183 msgid "\"ws://127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:129 msgid "Running the binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:131 msgid "Run the server with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:137 msgid "and the client with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:145 msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:146 msgid "" "Hint: Use `tokio::select!` for concurrently performing two tasks in a " "continuous loop. One task receives messages from the client and broadcasts " "them. The other sends messages received by the server to the client." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:149 msgid "Complete the main function in `src/bin/client.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:150 msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " "performing two tasks: (1) reading user messages from standard input and " @@ -19644,69 +18949,56 @@ msgid "" "displaying them for the user." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md:154 msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "Concurrency Afternoon Exercise" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](dining-philosophers-async.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:35 msgid "" -"// Add a delay before picking the second fork to allow the execution\n" -" // to transfer to another task\n" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// The locks are dropped here\n" +"// If we didn't get the left fork, drop the right fork if we // have it and " +"let other tasks make progress." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:42 msgid "" -"// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" -" // either of them.\n" +"// If we didn't get the right fork, drop the left fork and let // other " +"tasks make progress." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" +#: src/concurrency/async-exercises/solutions.md:54 +msgid "// The locks are dropped here" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "\"Here is a thought: {thought}\"" +#: src/concurrency/async-exercises/solutions.md:82 +msgid "// tx is dropped here, so we don't need to explicitly drop it later" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](chat-app.md))" +#: src/concurrency/async-exercises/solutions.md:97 +msgid "\"Here is a thought: {thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:122 msgid "\"Welcome to chat! Type a message\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:126 msgid "" -"// A continuous loop for concurrently performing two tasks: (1) receiving\n" -" // messages from `ws_stream` and broadcasting them, and (2) receiving\n" -" // messages on `bcast_rx` and sending them to the client.\n" +"// A continuous loop for concurrently performing two tasks: (1) receiving // " +"messages from `ws_stream` and broadcasting them, and (2) receiving // " +"messages on `bcast_rx` and sending them to the client." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:135 msgid "\"From client {addr:?} {text:?}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Continuous loop for concurrently sending and receiving messages.\n" +#: src/concurrency/async-exercises/solutions.md:190 +msgid "// Continuous loop for concurrently sending and receiving messages." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md:197 msgid "\"From server: {}\"" msgstr "" @@ -19720,8 +19012,7 @@ msgstr "" msgid "" "We've had a lot of fun putting the course together. The course is not " "perfect, so if you spotted any mistakes or have ideas for improvements, " -"please get in [contact with us on GitHub](https://github.com/google/" -"comprehensive-rust/discussions). We would love to hear from you." +"please get in contact with us on GitHub. We would love to hear from you." msgstr "" #: src/glossary.md @@ -19731,10 +19022,11 @@ msgid "" "the English original." msgstr "" +#. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md msgid "" "allocate: \n" -"Dynamic memory allocation on [the heap](memory-management/stack-vs-heap.md)." +"Dynamic memory allocation on the heap." msgstr "" #: src/glossary.md @@ -19747,19 +19039,19 @@ msgstr "" msgid "" "Bare-metal Rust: \n" "Low-level Rust development, often deployed to a system without an operating " -"system. See [Bare-metal Rust](bare-metal.md)." +"system. See Bare-metal Rust." msgstr "" #: src/glossary.md msgid "" "block: \n" -"See [Blocks](control-flow/blocks.md) and _scope_." +"See Blocks and _scope_." msgstr "" #: src/glossary.md msgid "" "borrow: \n" -"See [Borrowing](ownership/borrowing.md)." +"See Borrowing." msgstr "" #: src/glossary.md @@ -19790,7 +19082,7 @@ msgstr "" #: src/glossary.md msgid "" "channel: \n" -"Used to safely pass messages [between threads](concurrency/channels.md)." +"Used to safely pass messages between threads." msgstr "" #: src/glossary.md @@ -19808,7 +19100,7 @@ msgstr "" #: src/glossary.md msgid "" "Concurrency in Rust: \n" -"See [Concurrency in Rust](concurrency.md)." +"See Concurrency in Rust." msgstr "" #: src/glossary.md @@ -20032,19 +19324,19 @@ msgstr "" #: src/glossary.md msgid "" "Rust Fundamentals: \n" -"Days 1 to 3 of this course." +"Days 1 to 4 of this course." msgstr "" #: src/glossary.md msgid "" "Rust in Android: \n" -"See [Rust in Android](android.md)." +"See Rust in Android." msgstr "" #: src/glossary.md msgid "" "Rust in Chromium: \n" -"See [Rust in Chromium](chromium.md)." +"See Rust in Chromium." msgstr "" #: src/glossary.md @@ -20076,8 +19368,7 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [`String` vs `str`](basic-syntax/" -"string-slices.html) for more." +"A data type storing textual data. See Strings for more." msgstr "" #: src/glossary.md @@ -20159,7 +19450,7 @@ msgstr "" msgid "" "unit test: \n" "Rust comes with built-in support for running small unit tests and larger " -"integration tests. See [Unit Tests](testing/unit-tests.html)." +"integration tests. See Unit Tests." msgstr "" #: src/glossary.md @@ -20172,7 +19463,7 @@ msgstr "" msgid "" "unsafe: \n" "The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe.html)." +"Unsafe Rust." msgstr "" #: src/glossary.md @@ -20201,29 +19492,26 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " -"canonical free book about Rust. Covers the language in detail and includes a " -"few projects for people to build." +"The Rust Programming Language: the canonical free book about Rust. Covers " +"the language in detail and includes a few projects for people to build." msgstr "" #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " -"Rust syntax via a series of examples which showcase different constructs. " -"Sometimes includes small exercises where you are asked to expand on the code " -"in the examples." +"Rust By Example: covers the Rust syntax via a series of examples which " +"showcase different constructs. Sometimes includes small exercises where you " +"are asked to expand on the code in the examples." msgstr "" #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " -"of the standard library for Rust." +"Rust Standard Library: full documentation of the standard library for Rust." msgstr "" #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " -"book which describes the Rust grammar and memory model." +"The Rust Reference: an incomplete book which describes the Rust grammar and " +"memory model." msgstr "" #: src/other-resources.md @@ -20232,23 +19520,20 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages " -"(FFI)." +"The Rustonomicon: covers unsafe Rust, including working with raw pointers " +"and interfacing with other languages (FFI)." msgstr "" #: src/other-resources.md msgid "" -"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the " -"Rust Book was written." +"Asynchronous Programming in Rust: covers the new asynchronous programming " +"model which was introduced after the Rust Book was written." msgstr "" #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"an introduction to using Rust on embedded devices without an operating " -"system." +"The Embedded Rust Book: an introduction to using Rust on embedded devices " +"without an operating system." msgstr "" #: src/other-resources.md @@ -20261,72 +19546,70 @@ msgstr "" #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " -"from the perspective of low-level C programmers." +"Learn Rust the Dangerous Way: covers Rust from the perspective of low-level " +"C programmers." msgstr "" #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://docs.opentitan.org/doc/ug/" -"rust_for_c/): covers Rust from the perspective of developers who write " -"firmware in C." +"Rust for Embedded C Programmers: covers Rust from the perspective of " +"developers who write firmware in C." msgstr "" #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): " -"covers the syntax of Rust using side-by-side comparisons with other " -"languages such as C, C++, Java, JavaScript, and Python." +"Rust for professionals: covers the syntax of Rust using side-by-side " +"comparisons with other languages such as C, C++, Java, JavaScript, and " +"Python." msgstr "" #: src/other-resources.md -msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " -"you learn Rust." +msgid "Rust on Exercism: 100+ exercises to help you learn Rust." msgstr "" #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): a series of small presentations covering both basic " -"and advanced part of the Rust language. Other topics such as WebAssembly, " -"and async/await are also covered." +"Ferrous Teaching Material: a series of small presentations covering both " +"basic and advanced part of the Rust language. Other topics such as " +"WebAssembly, and async/await are also covered." msgstr "" #: src/other-resources.md msgid "" -"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs." -"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " -"new developers. The first is a set of 35 videos and the second is a set of " -"11 modules which covers Rust syntax and basic constructs." +"Advanced testing for Rust applications: a self-paced workshop that goes " +"beyond Rust's built-in testing framework. It covers `googletest`, snapshot " +"testing, mocking as well as how to write your own custom test harness." msgstr "" #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." -"github.io/too-many-lists/): in-depth exploration of Rust's memory management " -"rules, through implementing a few different types of list structures." +"Beginner's Series to Rust and Take your first steps with Rust: two Rust " +"guides aimed at new developers. The first is a set of 35 videos and the " +"second is a set of 11 modules which covers Rust syntax and basic constructs." msgstr "" #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " -"for even more Rust books." +"Learn Rust With Entirely Too Many Linked Lists: in-depth exploration of " +"Rust's memory management rules, through implementing a few different types " +"of list structures." +msgstr "" + +#: src/other-resources.md +msgid "Please see the Little Book of Rust Books for even more Rust books." msgstr "" #: src/credits.md msgid "" "The material here builds on top of the many great sources of Rust " -"documentation. See the page on [other resources](other-resources.md) for a " -"full list of useful resources." +"documentation. See the page on other resources for a full list of useful " +"resources." msgstr "" #: src/credits.md msgid "" "The material of Comprehensive Rust is licensed under the terms of the Apache " -"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" -"rust/blob/main/LICENSE) for details." +"2.0 license, please see `LICENSE` for details." msgstr "" #: src/credits.md @@ -20335,10 +19618,9 @@ msgstr "" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by " -"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " -"`third_party/rust-by-example/` directory for details, including the license " -"terms." +"Some examples and exercises have been copied and adapted from Rust by " +"Example. Please see the `third_party/rust-by-example/` directory for " +"details, including the license terms." msgstr "" #: src/credits.md @@ -20347,9 +19629,9 @@ msgstr "" #: src/credits.md msgid "" -"Some exercises have been copied and adapted from [Rust on Exercism](https://" -"exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " -"directory for details, including the license terms." +"Some exercises have been copied and adapted from Rust on Exercism. Please " +"see the `third_party/rust-on-exercism/` directory for details, including the " +"license terms." msgstr "" #: src/credits.md @@ -20358,11 +19640,352 @@ msgstr "" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section " -"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " -"directory for details, including the license terms." +"The Interoperability with C++ section uses an image from CXX. Please see the " +"`third_party/cxx/` directory for details, including the license terms." msgstr "" +#, fuzzy +#~ msgid "Static and Const" +#~ msgstr "نمادهای ایستا و ثابت" + +#, fuzzy +#~ msgid "Slices and Lifetimes" +#~ msgstr "چرخه حیات" + +#, fuzzy +#~ msgid "String References" +#~ msgstr "ارجاعات تعلیق شده" + +#~ msgid "Control Flow" +#~ msgstr "کنترل جریان" + +#, fuzzy +#~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" +#~ msgstr "" +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." + +#~ msgid "Arrow-Left" +#~ msgstr "Arrow-Left" + +#~ msgid "Arrow-Right" +#~ msgstr "Arrow-Right" + +#~ msgid "Ctrl + Enter" +#~ msgstr "Ctrl + Enter" + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "" +#~ "[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-" +#~ "BR/) by [@rastringer](https://github.com/rastringer), [@hugojacob]" +#~ "(https://github.com/hugojacob), [@joaovicmendes](https://github.com/" +#~ "joaovicmendes), and [@henrif75](https://github.com/henrif75)." +#~ msgstr "" +#~ "[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " +#~ "[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +#~ "com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " +#~ "[@henrif75](https://github.com/henrif75)." + +#~ msgid "" +#~ "[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-" +#~ "CN/) by [@suetfei](https://github.com/suetfei), [@wnghl](https://github." +#~ "com/wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github." +#~ "com/kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd]" +#~ "(https://github.com/superwhd), [@SketchK](https://github.com/SketchK), " +#~ "and [@nodmp](https://github.com/nodmp)." +#~ msgstr "" +#~ "[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " +#~ "[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" +#~ "wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" +#~ "kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" +#~ "github.com/superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp]" +#~ "(https://github.com/nodmp)." + +#~ msgid "" +#~ "[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-" +#~ "TW/) by [@hueich](https://github.com/hueich), [@victorhsieh](https://" +#~ "github.com/victorhsieh), [@mingyc](https://github.com/mingyc), " +#~ "[@kuanhungchen](https://github.com/kuanhungchen), and [@johnathan79717]" +#~ "(https://github.com/johnathan79717)." +#~ msgstr "" +#~ "[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +#~ "[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +#~ "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen]" +#~ "(https://github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +#~ "johnathan79717)." + +#~ msgid "" +#~ "[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" +#~ "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " +#~ "and [@jooyunghan](https://github.com/jooyunghan)." +#~ msgstr "" +#~ "[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" +#~ "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " +#~ "[@jooyunghan](https://github.com/jooyunghan)." + +#~ msgid "" +#~ "[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" +#~ "(https://github.com/deavid)." +#~ msgstr "" +#~ "[Spanish](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" +#~ "(https://github.com/deavid)." + +#~ msgid "" +#~ "[Bengali](https://google.github.io/comprehensive-rust/bn/) by " +#~ "[@raselmandol](https://github.com/raselmandol)." +#~ msgstr "" +#~ "[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط " +#~ "[@raselmandol](https://github.com/raselmandol)." + +#~ msgid "" +#~ "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" +#~ "(https://github.com/KookaS) and [@vcaen](https://github.com/vcaen)." +#~ msgstr "" +#~ "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" +#~ "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." + +#~ msgid "" +#~ "[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" +#~ "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +#~ msgstr "" +#~ "[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" +#~ "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." + +#~ msgid "" +#~ "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-" +#~ "JPN](https://github.com/CoinEZ) and [@momotaro1105](https://github.com/" +#~ "momotaro1105)." +#~ msgstr "" +#~ "[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-" +#~ "JPN](https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" +#~ "momotaro1105)." + +#~ msgid "" +#~ "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +#~ msgstr "" +#~ "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" + +#~ msgid "" +#~ "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +#~ "html)" +#~ msgstr "" +#~ "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +#~ "html)" + +#~ msgid "" +#~ "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-" +#~ "install.html)" +#~ msgstr "" +#~ "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-" +#~ "install.html)" + +#~ msgid "You can use " +#~ msgstr "همان طور که مشاهده می‌کنید" + +#~ msgid "" +#~ "Rust supports many [platforms and architectures](https://doc.rust-lang." +#~ "org/nightly/rustc/platform-support.html):" +#~ msgstr "" +#~ " راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" +#~ "rustc/platform-support.html) پشتیبانی می کند :" + +#~ msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" +#~ msgstr "بسیاری از دستور زبان Rust مشابه زبان‌های C، C++ یا Java خواهد بود:" + +#, fuzzy +#~ msgid "Blocks are delimited by curly braces." +#~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." + +#~ msgid "" +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." +#~ msgstr "" +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " +#~ "مشخص می‌شوند." + +#~ msgid "Keywords like `if` and `while` work the same." +#~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." + +#~ msgid "Variable assignment is done with `=`, comparison is done with `==`." +#~ msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." + +#~ msgid "" +#~ "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "" +#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." + +#~ msgid "`[T; N]`" +#~ msgstr "[T; N]" + +#~ msgid "`[20, 30, 40]`, `[0; 3]`" +#~ msgstr "" +#~ "[20, 30, 40], [0; " +#~ "3]" + +#~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." +#~ msgstr "" +#~ "(), (T,), " +#~ "(T1, T2), …" + +#~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." +#~ msgstr "" +#~ "(), ('x',), " +#~ "('x', 1.2), …" + +#~ msgid "Array assignment and access:" +#~ msgstr "انتساب و دسترسی به آرایه:" + +#~ msgid "Tuple assignment and access:" +#~ msgstr "انتساب و دسترسی به تاپل:" + +#~ msgid "Arrays:" +#~ msgstr "آرایه‌ها:" + +#~ msgid "Tuples:" +#~ msgstr ":تاپل‌ها" + +#, fuzzy +#~ msgid "" +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its 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 "" +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " +#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " +#~ "که در اسلاید بعدی خواهیم دید. " + +#, fuzzy +#~ msgid "" +#~ "You can think of it as `void` that can be familiar to you from other " +#~ "programming languages." +#~ msgstr "" +#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " +#~ "برنامه‌نویسی برایتان آشنا باشد." + +#, fuzzy +#~ msgid "You can destructure tuples and arrays by matching on their elements:" +#~ msgstr "" +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " +#~ "کنید." + +#, fuzzy +#~ msgid "Create a new array pattern using `_` to represent an element." +#~ msgstr "یک الگوی جدید با استفاده از `_` برای نمایش یک عنصر ایجاد کنید." + +#~ msgid "Add more values to the array." +#~ msgstr "مقادیر بیشتری را به آرایه اضافه کنید." + +#~ msgid "" +#~ "Point out that how `..` will expand to account for different number of " +#~ "elements." +#~ msgstr "" +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +#~ "یافت." + +#~ msgid "" +#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgstr "" +#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " +#~ "`[a@..,b]` را نشان دهید." + +#~ msgid "Hard-code both functions to operate on 3 × 3 matrices." +#~ msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." + +#, fuzzy +#~ msgid "" +#~ "Static and constant variables are two different ways to create globally-" +#~ "scoped values that cannot be moved or reallocated during the execution of " +#~ "the program." +#~ msgstr "" +#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " +#~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " +#~ "دوباره تعریف شوند." + +#~ msgid "Properties table:" +#~ msgstr "جدول خاصیت‌ها:" + +#~ msgid "Has an address in memory" +#~ msgstr "دارای یک آدرس واقعی در حافظه" + +#~ msgid "No (inlined)" +#~ msgstr "خیر (به صورت درون خطی)" + +#~ msgid "Lives for the entire duration of the program" +#~ msgstr "در طول‌عمر کل برنامه زنده می‌ماند؟" + +#~ msgid "Can be mutable" +#~ msgstr "میتوان قابل تغییر اش کرد" + +#~ msgid "Yes (unsafe)" +#~ msgstr "بلی (unsafe)" + +#~ msgid "Evaluated at compile time" +#~ msgstr "ارزیابی در زمان کامپایل" + +#~ msgid "Yes (initialised at compile time)" +#~ msgstr "بلی (در زمان کامپایل ساخته می‌شود)" + +#~ msgid "Inlined wherever it is used" +#~ msgstr "به صورت درون‌خطی هر جا که استفاده میشود قرار میگیرد" + +#, fuzzy +#~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" +#~ msgstr "" +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." + +#~ msgid "`match` expressions" +#~ msgstr "عبارت `match`" + +#, fuzzy +#~ msgid "" +#~ "All of the details about [loops](https://doc.rust-lang.org/stable/" +#~ "reference/expressions/loop-expr.html)." +#~ msgstr "" +#~ "اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-" +#~ "lang.org/reference/expressions/loop-expr.html#break-expressions) استفاده " +#~ "کنید," + +#~ msgid "Rust terminology:" +#~ msgstr "اصطلاحات راست:" + +#~ msgid "`&str` an immutable reference to a string slice." +#~ msgstr "" +#~ "&str یک مرجع غیرقابل " +#~ "تغییر به یک برش از رشته‌ است." + +#~ msgid "`String` a mutable string buffer." +#~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." + +#, fuzzy +#~ msgid "// Undefined behavior if abs misbehaves.\n" +#~ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" + +#~ msgid "" +#~ "After looking at the exercises, you can look at the [solutions](solutions-" +#~ "afternoon.md) provided." +#~ msgstr "" +#~ "پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +#~ "شده نگاهی بیندازید." + +#, fuzzy +#~ msgid "\"aarch64-linux-gnu\"" +#~ msgstr "aarch64-paging" + +#, fuzzy +#~ msgid "\"exceptions.S\"" +#~ msgstr "استثناها" + +#, fuzzy +#~ msgid "aarch64-linux-gnu" +#~ msgstr "aarch64-paging" + #~ msgid "Small Example" #~ msgstr "یک مثال ساده" @@ -20396,9 +20019,6 @@ msgstr "" #~ msgid "Arrays and for Loops" #~ msgstr "آرایه ها و حلقه های for" -#~ msgid "if expressions" -#~ msgstr "عبارت if" - #~ msgid "for expressions" #~ msgstr "عبارت for" @@ -20417,9 +20037,6 @@ msgstr "" #~ msgid "Enum Sizes" #~ msgstr "اندازه ی Enum ها" -#~ msgid "Novel Control Flow" -#~ msgstr "کنترل جریان پیشرفته" - #~ msgid "if let expressions" #~ msgstr "عبارت if let" @@ -20429,9 +20046,6 @@ msgstr "" #~ msgid "match expressions" #~ msgstr "عبارت تطبیق" -#~ msgid "Destructuring Structs" -#~ msgstr "تخریب ساختارها" - #~ msgid "Destructuring Arrays" #~ msgstr "تخریب آرایه‌ها" @@ -20474,27 +20088,15 @@ msgstr "" #~ msgid "Field Shorthand Syntax" #~ msgstr "نحو اختصاری فیلد" -#~ msgid "Method Receiver" -#~ msgstr "متد دریافتی" - #~ msgid "Storing Books" #~ msgstr "ذخیره سازی کتاب" #~ msgid "Option and Result" #~ msgstr "Option و Result" -#~ msgid "Vec" -#~ msgstr "Vec" - -#~ msgid "HashMap" -#~ msgstr "HashMap" - #~ msgid "Box" #~ msgstr "Box" -#~ msgid "Rc" -#~ msgstr "Rc" - #~ msgid "Iterators and Ownership" #~ msgstr "تکرار کننده ها و مالکیت" @@ -20510,15 +20112,9 @@ msgstr "" #~ msgid "Default Methods" #~ msgstr "متدهای پیشفرض" -#~ msgid "impl Trait" -#~ msgstr "صفات impl (impl Trait)" - #~ msgid "Important Traits" #~ msgstr "صفات مهم" -#~ msgid "From and Into" -#~ msgstr "From و Into" - #~ msgid "Default" #~ msgstr "پیش‌فرض" @@ -20573,27 +20169,6 @@ msgstr "" #~ msgid "spin" #~ msgstr "چرخش" -#~ msgid "Send and Sync" -#~ msgstr "ارسال و همگام سازی" - -#~ msgid "Send" -#~ msgstr "ارسال" - -#~ msgid "Sync" -#~ msgstr "همگام سازی" - -#~ msgid "Arc" -#~ msgstr "Shared State" - -#~ msgid "Mutex" -#~ msgstr "Mutex" - -#~ msgid "async/await" -#~ msgstr "async/await" - -#~ msgid "Pin" -#~ msgstr "Pin" - #~ msgid "Day 1 Morning" #~ msgstr "روز ۱ صبح" @@ -21158,9 +20733,6 @@ msgstr "" #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " -#~ msgid "We can now understand the two string types in Rust:" -#~ msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" - #~ msgid "" #~ "You can borrow `&str` slices from `String` via `&` and optionally range " #~ "selection." @@ -21314,9 +20886,6 @@ msgstr "" #~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " #~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." -#~ msgid "Alternatively, use the Rust Playground." -#~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." - #~ msgid "" #~ "The code snippets are not editable on purpose: the inline code snippets " #~ "lose their state if you navigate away from the page." @@ -22060,10 +21629,6 @@ msgstr "" #~ msgid "control flow:" #~ msgstr "کنترل جریان" -#, fuzzy -#~ msgid "enumeration:" -#~ msgstr "پیاده سازی" - #, fuzzy #~ msgid "error handling:" #~ msgstr "مدیریت خطا (Error Handling)" From 5e87e5a74c86a11798738c09a76b9f59b08685b6 Mon Sep 17 00:00:00 2001 From: javad-jafari Date: Fri, 19 Jul 2024 18:06:14 -0400 Subject: [PATCH 02/92] fix(fa.po): src/running-the-course/course-structure.md segment --- po/fa.po | 106 +++++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/po/fa.po b/po/fa.po index 85906b7f1a0..17e9b938582 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1566,8 +1566,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and C" +"++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. Rust یک زبان استاتیک تایپ ." "است \n" @@ -1627,8 +1627,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker Notes" +"\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -1799,7 +1799,7 @@ msgstr "پیاده سازی" #: src/iterators.md src/modules.md src/testing.md src/error-handling.md #: src/unsafe-rust.md src/concurrency/shared-state.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md -msgid "5 minutes" +msgid "۵ minutes" msgstr "۵ دقیقه" #: src/running-the-course/course-structure.md:16 @@ -1889,7 +1889,7 @@ msgstr "صبح روز ۳ (۲ ساعت و ۲۰ دقیقه، شامل وقت اس #: src/running-the-course/course-structure.md:57 msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" -msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" +msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" #: src/running-the-course/course-structure.md:65 msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" @@ -2046,7 +2046,7 @@ msgstr "۳۰ دقیقه" #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md msgid "20 minutes" -msgstr "۲۰ دقیقه"" +msgstr "۲۰ دقیقه" #: src/running-the-course/course-structure.md:153 src/concurrency/welcome.md msgid "Send and Sync" @@ -4018,8 +4018,8 @@ msgstr "" #, fuzzy msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" +"++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4207,8 +4207,8 @@ msgstr "" #, fuzzy msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals (`\"Hello" +"\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4279,9 +4279,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" +"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " +"`#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4548,9 +4548,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche optimization" +"\"). For example, `Option<&u8>` stores either a pointer to an integer or " +"`NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5073,8 +5073,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍" +"`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 @@ -8093,8 +8093,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:" -"\"Dog\"| :\n" +": : | : | data:\"Dog" +"\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8116,16 +8116,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk" +"\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk" +"\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -8441,8 +8441,8 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor" +"\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 @@ -9045,9 +9045,8 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments" +"\". These document the item that contains them -- in this case, a module." msgstr "" #: src/modules/filesystem.md:22 @@ -9485,9 +9484,9 @@ msgstr "" #: src/testing/other.md:26 msgid "" "/// Shortens a string to the given length. /// /// `/// # use playground::" -"shorten_string; /// assert_eq!(shorten_string(\"Hello World\", 5), " -"\"Hello\"); /// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello " -"World\"); ///`" +"shorten_string; /// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello" +"\"); /// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World" +"\"); ///`" msgstr "" #: src/testing/other.md:38 @@ -11626,9 +11625,9 @@ msgstr "" #: src/android/aidl/types/arrays.md:15 msgid "" "In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"int\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented " -"as array types." +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. int" +"\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" #: src/android/aidl/types/arrays.md:18 @@ -11884,9 +11883,9 @@ msgstr "" #: src/android/testing/googletest.md:44 msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of \"Advanced testing for Rust " -"applications\", a self-guided Rust course: it provides a guided introduction " -"to the library, with exercises to help you get comfortable with `googletest` " +"going through the first chapter of \"Advanced testing for Rust applications" +"\", a self-guided Rust course: it provides a guided introduction to the " +"library, with exercises to help you get comfortable with `googletest` " "macros, its matchers and its overall philosophy." msgstr "" @@ -14126,8 +14125,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" +"\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -14591,8 +14590,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" +"\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -17596,11 +17595,10 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"`PoisonError`. You can call `into_inner()` on the error to recover the data " -"regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" +"\" to signal that the data it protected might be in an inconsistent state. " +"Calling `lock()` on a poisoned mutex fails with a `PoisonError`. You can " +"call `into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -17805,8 +17803,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" +"\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -18816,8 +18814,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" +"\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -19004,8 +19002,8 @@ msgstr "" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " +"it was useful." msgstr "" #: src/thanks.md From 29bf2a9938597691ffff4c1aa8ead5a777d4d22c Mon Sep 17 00:00:00 2001 From: javad-jafari Date: Fri, 19 Jul 2024 19:08:54 -0400 Subject: [PATCH 03/92] fix(fa.po): src/running-the-course/course-structure.md --- po/fa.po | 104 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/po/fa.po b/po/fa.po index 17e9b938582..805acb61bb4 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1566,8 +1566,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and C" -"++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. Rust یک زبان استاتیک تایپ ." "است \n" @@ -1627,8 +1627,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker Notes" -"\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -1799,7 +1799,7 @@ msgstr "پیاده سازی" #: src/iterators.md src/modules.md src/testing.md src/error-handling.md #: src/unsafe-rust.md src/concurrency/shared-state.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md -msgid "۵ minutes" +msgid "5 minutes" msgstr "۵ دقیقه" #: src/running-the-course/course-structure.md:16 @@ -1889,7 +1889,7 @@ msgstr "صبح روز ۳ (۲ ساعت و ۲۰ دقیقه، شامل وقت اس #: src/running-the-course/course-structure.md:57 msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" -msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" +msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" #: src/running-the-course/course-structure.md:65 msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" @@ -4018,8 +4018,8 @@ msgstr "" #, fuzzy msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" -"++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4207,8 +4207,8 @@ msgstr "" #, fuzzy msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello" -"\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals " +"(`\"Hello\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4279,9 +4279,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" -"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " -"`#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4548,9 +4548,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche optimization" -"\"). For example, `Option<&u8>` stores either a pointer to an integer or " -"`NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5073,8 +5073,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 @@ -8093,8 +8093,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:\"Dog" -"\"| :\n" +": : | : | data:" +"\"Dog\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8116,16 +8116,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk" -"\" | :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk" -"\" | :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -8441,8 +8441,8 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor" -"\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 @@ -9045,8 +9045,9 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments" -"\". These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md:22 @@ -9484,9 +9485,9 @@ msgstr "" #: src/testing/other.md:26 msgid "" "/// Shortens a string to the given length. /// /// `/// # use playground::" -"shorten_string; /// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello" -"\"); /// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World" -"\"); ///`" +"shorten_string; /// assert_eq!(shorten_string(\"Hello World\", 5), " +"\"Hello\"); /// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello " +"World\"); ///`" msgstr "" #: src/testing/other.md:38 @@ -11625,9 +11626,9 @@ msgstr "" #: src/android/aidl/types/arrays.md:15 msgid "" "In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. int" -"\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented as " -"array types." +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"int\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented " +"as array types." msgstr "" #: src/android/aidl/types/arrays.md:18 @@ -11883,9 +11884,9 @@ msgstr "" #: src/android/testing/googletest.md:44 msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of \"Advanced testing for Rust applications" -"\", a self-guided Rust course: it provides a guided introduction to the " -"library, with exercises to help you get comfortable with `googletest` " +"going through the first chapter of \"Advanced testing for Rust " +"applications\", a self-guided Rust course: it provides a guided introduction " +"to the library, with exercises to help you get comfortable with `googletest` " "macros, its matchers and its overall philosophy." msgstr "" @@ -14125,8 +14126,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" -"\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -14590,8 +14591,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" -"\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -17595,10 +17596,11 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" -"\" to signal that the data it protected might be in an inconsistent state. " -"Calling `lock()` on a poisoned mutex fails with a `PoisonError`. You can " -"call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"`PoisonError`. You can call `into_inner()` on the error to recover the data " +"regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -17803,8 +17805,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" -"\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -18814,8 +18816,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" -"\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -19002,8 +19004,8 @@ msgstr "" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " -"it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" #: src/thanks.md From 49e97d078893624ee83d87e4d6216cbc8feaf5ed Mon Sep 17 00:00:00 2001 From: javad-jafari Date: Fri, 19 Jul 2024 19:21:48 -0400 Subject: [PATCH 04/92] fix(fa.po): src/running-the-course/course-structure.md --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 805acb61bb4..f9848f47765 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1889,7 +1889,7 @@ msgstr "صبح روز ۳ (۲ ساعت و ۲۰ دقیقه، شامل وقت اس #: src/running-the-course/course-structure.md:57 msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" -msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" +msgstr "بعدازظهر روز ۳ (۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" #: src/running-the-course/course-structure.md:65 msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" From 909edffa93ae65db929c3170875e92218bd4ce36 Mon Sep 17 00:00:00 2001 From: javad-jafari Date: Sat, 20 Jul 2024 08:12:04 -0400 Subject: [PATCH 05/92] fix(fa.po) --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index f9848f47765..4c4ff11e1e7 100644 --- a/po/fa.po +++ b/po/fa.po @@ -21699,4 +21699,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" +#~ msgstr "تطبیق الگو" \ No newline at end of file From df1385dfce2763b1cc4e35506ccc90214f4a5d2c Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:28:59 +0000 Subject: [PATCH 06/92] fix(fa.po): number to fa --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 4c4ff11e1e7..f2e319659dd 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2713,7 +2713,7 @@ msgstr "اسلاید" #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" -msgstr "10 دقیقه" +msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md #: src/memory-management.md src/concurrency/channels.md From 3c2b211fec0ae5c53188c007443d6da62fe4e413 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Sat, 20 Jul 2024 17:21:19 +0000 Subject: [PATCH 07/92] fix(fa.po):number to fa and fix line enter --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index f2e319659dd..08fda0b111b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -21699,4 +21699,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" \ No newline at end of file +#~ msgstr "تطبیق الگو" From 478029bf56532e11ffe9124551c417b630236f86 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:46:07 +0000 Subject: [PATCH 08/92] fix(po/fa): src/hello-world/what-is-rust --- po/fa.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index a237a045d8f..63f96b425f6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -77,7 +77,7 @@ msgstr "مزیت‌های زبان Rust" #: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md:1 msgid "Playground" -msgstr "" +msgstr "Playground" #: src/SUMMARY.md src/running-the-course/course-structure.md:17 #: src/welcome-day-1.md src/types-and-values.md @@ -2635,7 +2635,7 @@ msgstr "" #: src/welcome-day-1.md msgid "Types and type inference." -msgstr "" +msgstr "Types and type inference." #: src/welcome-day-1.md msgid "Control flow constructs: loops, conditionals, and so on." @@ -2764,13 +2764,15 @@ msgstr "۱۰ دقیقه" #: src/memory-management.md src/concurrency/channels.md #: src/concurrency/send-sync.md msgid "2 minutes" -msgstr "2 دقیقه" +msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md:3 msgid "" "Rust is a new programming language which had its [1.0 release in 2015]" "(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md:5 msgid "Rust is a statically compiled language in a similar role as C++" From 074065ad9c70dce4f2a251bc2273ab0666504e55 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:08:11 +0000 Subject: [PATCH 09/92] feat:Day 1: morning --- po/fa.po | 105 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/po/fa.po b/po/fa.po index 63f96b425f6..a4cca7498a0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -132,11 +132,11 @@ msgstr "حلقه‌ها" #: src/SUMMARY.md src/control-flow-basics/loops/for.md:1 msgid "`for`" -msgstr "" +msgstr "`for`" #: src/SUMMARY.md src/control-flow-basics/loops/loop.md:1 msgid "`loop`" -msgstr "" +msgstr "`loop`" #: src/SUMMARY.md src/control-flow-basics/break-continue.md:1 msgid "`break` and `continue`" @@ -3041,7 +3041,7 @@ msgstr "" #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" -msgstr "این بخش باید حدود 40 دقیقه طول بکشد. آن شامل:" +msgstr "این بخش باید حدود ۴۰ دقیقه طول بکشد. آن شامل:" #: src/types-and-values/hello-world.md:3 msgid "" @@ -3053,7 +3053,7 @@ msgstr "" #: src/types-and-values/hello-world.md:8 msgid "\"Hello 🌍!\"" -msgstr "" +msgstr "\"Hello 🌍!\"" #: src/types-and-values/hello-world.md:12 msgid "What you see:" @@ -3153,13 +3153,15 @@ msgstr "" #: src/types-and-values/variables.md:9 src/control-flow-basics/loops/for.md:9 #: src/control-flow-basics/blocks-and-scopes.md:17 msgid "\"x: {x}\"" -msgstr "" +msgstr "\"x: {x}\"" #: src/types-and-values/variables.md:10 msgid "" "// x = 20;\n" " // println!(\"x: {x}\");\n" msgstr "" +"// x = 20;\n" +" // println!(\"x: {x}\");\n" #: src/types-and-values/variables.md:18 msgid "" @@ -3229,7 +3231,7 @@ msgstr "اعداد با ممیز شناور" #: src/types-and-values/values.md:10 msgid "`f32`, `f64`" -msgstr "" +msgstr "`f32`, `f64`" #: src/types-and-values/values.md:10 msgid "`3.14`, `-10.0e20`, `2_f32`" @@ -3243,11 +3245,11 @@ msgstr "مقادیر عددی یونیکد" #: src/types-and-values/values.md:11 src/android/aidl/types/primitives.md:9 msgid "`char`" -msgstr "" +msgstr "`char`" #: src/types-and-values/values.md:11 msgid "`'a'`, `'α'`, `'∞'`" -msgstr "" +msgstr "`'a'`, `'α'`, `'∞'`" #: src/types-and-values/values.md:12 msgid "Booleans" @@ -3255,11 +3257,11 @@ msgstr "بولین‌ها" #: src/types-and-values/values.md:12 src/android/aidl/types/primitives.md:7 msgid "`bool`" -msgstr "" +msgstr "`bool`" #: src/types-and-values/values.md:12 msgid "`true`, `false`" -msgstr "" +msgstr "`true`, `false`" #: src/types-and-values/values.md:14 msgid "The types have widths as follows:" @@ -3298,7 +3300,7 @@ msgstr "" #: src/types-and-values/arithmetic.md:9 msgid "\"result: {}\"" -msgstr "" +msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md:16 msgid "" @@ -3384,7 +3386,7 @@ msgstr "" #: src/types-and-values/inference.md:46 msgid "// ERROR: no implementation for `{float} == {integer}`\n" -msgstr "" +msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md:3 msgid "" @@ -3405,7 +3407,7 @@ msgstr "" #: src/types-and-values/exercise.md:12 msgid "// The base case.\n" -msgstr "" +msgstr "//حالت پایه\n" #: src/types-and-values/exercise.md:13 src/types-and-values/exercise.md:16 #: src/control-flow-basics/exercise.md:27 @@ -3416,11 +3418,11 @@ msgstr "پیاده سازی" #: src/types-and-values/exercise.md:15 msgid "// The recursive case.\n" -msgstr "" +msgstr "// حالت بازگشتی\n" #: src/types-and-values/exercise.md:22 src/types-and-values/solution.md:14 msgid "\"fib({n}) = {}\"" -msgstr "" +msgstr "\"fib({n}) = {}\"" #: src/control-flow-basics.md msgid "if Expressions" @@ -3429,7 +3431,7 @@ msgstr "عبارت if" #: src/control-flow-basics.md src/pattern-matching.md src/concurrency/async.md #: src/concurrency/async-control-flow.md msgid "4 minutes" -msgstr "" +msgstr "۴ دقیقه" #: src/control-flow-basics.md msgid "break and continue" @@ -3449,15 +3451,15 @@ msgstr "" #: src/control-flow-basics/if.md:11 msgid "\"zero!\"" -msgstr "" +msgstr "\"zero!\"" #: src/control-flow-basics/if.md:13 msgid "\"biggish\"" -msgstr "" +msgstr "\"biggish\"" #: src/control-flow-basics/if.md:15 msgid "\"huge\"" -msgstr "" +msgstr "\"huge\"" #: src/control-flow-basics/if.md:20 msgid "" @@ -3469,15 +3471,15 @@ msgstr "" #: src/control-flow-basics/if.md:26 msgid "\"small\"" -msgstr "" +msgstr "\"کوچک\"" #: src/control-flow-basics/if.md:26 msgid "\"large\"" -msgstr "" +msgstr "\"بزرگ\"" #: src/control-flow-basics/if.md:27 msgid "\"number size: {}\"" -msgstr "" +msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md:34 msgid "" @@ -3519,7 +3521,7 @@ msgstr "" #: src/control-flow-basics/loops.md:18 msgid "\"Final x: {x}\"" -msgstr "" +msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md:3 msgid "" @@ -3531,7 +3533,7 @@ msgstr "" #: src/control-flow-basics/loops/for.md:13 msgid "\"elem: {elem}\"" -msgstr "" +msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md:20 msgid "" @@ -3562,7 +3564,7 @@ msgstr "" #: src/control-flow-basics/loops/loop.md:11 msgid "\"{i}\"" -msgstr "" +msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md:3 msgid "" @@ -3591,7 +3593,7 @@ msgstr "" #: src/android/interoperability/cpp/rust-bridge.md:17 #: src/concurrency/async-pitfalls/cancellation.md:59 msgid "\"{}\"" -msgstr "" +msgstr "\"{}\"" #: src/control-flow-basics/break-continue/labels.md:3 msgid "" @@ -3603,7 +3605,7 @@ msgstr "" #: src/control-flow-basics/break-continue/labels.md:19 msgid "\"elements searched: {elements_searched}\"" -msgstr "" +msgstr "\"elements searched: {elements_searched}\"" #: src/control-flow-basics/break-continue/labels.md:25 msgid "" @@ -3630,7 +3632,7 @@ msgstr "" #: src/control-flow-basics/blocks-and-scopes.md:14 msgid "\"y: {y}\"" -msgstr "" +msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md:21 msgid "" @@ -3649,7 +3651,7 @@ msgstr "" #: src/control-flow-basics/blocks-and-scopes/scopes.md:3 msgid "A variable's scope is limited to the enclosing block." -msgstr "" +msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محاصره‌کننده آن است." #: src/control-flow-basics/blocks-and-scopes/scopes.md:5 msgid "" @@ -3661,25 +3663,25 @@ msgstr "" #: src/control-flow-basics/blocks-and-scopes/scopes.md:11 msgid "\"before: {a}\"" -msgstr "" +msgstr "\"before: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md:13 #: src/generics/exercise.md:18 src/generics/solution.md:20 #: src/std-traits/from-and-into.md:7 src/std-traits/from-and-into.md:19 msgid "\"hello\"" -msgstr "" +msgstr "\"hello\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md:14 msgid "\"inner scope: {a}\"" -msgstr "" +msgstr "\"inner scope: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md:17 msgid "\"shadowed in inner scope: {a}\"" -msgstr "" +msgstr "\"shadowed in inner scope: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md:20 msgid "\"after: {a}\"" -msgstr "" +msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md:26 msgid "" @@ -3742,7 +3744,7 @@ msgstr "" #: src/control-flow-basics/functions.md:30 msgid "" "Overloading is not supported -- each function has a single implementation." -msgstr "هر تابع فقط یک پیاده سازی دارد:" +msgstr "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md:31 msgid "" @@ -3807,7 +3809,7 @@ msgstr "" #: src/control-flow-basics/macros.md:32 msgid "\"{n}! = {}\"" -msgstr "" +msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md:39 msgid "" @@ -3833,68 +3835,67 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"[دنباله Collatz](https://en.wikipedia.org/wiki/Collatz_conjecture) برای یک n " -"دلخواه به صورت زیر تعریف می شود" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md:6 msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." -msgstr "" +msgstr "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." #: src/control-flow-basics/exercise.md:7 msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "" +msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md:8 msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." -msgstr "" +msgstr "اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." #: src/control-flow-basics/exercise.md:10 msgid "For example, beginning with _n1_ = 3:" -msgstr "" +msgstr "به عنوان مثال، با شروع از _ni_ = ۳:" #: src/control-flow-basics/exercise.md:12 msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" -msgstr "" +msgstr "۳ فرد است، پس _n2_ = ۳ * ۳ + ۱ = 10;" #: src/control-flow-basics/exercise.md:13 msgid "10 is even, so _n3_ = 10 / 2 = 5;" -msgstr "" +msgstr "۱۰ زوج است، پس _n3_ = ۱۰ / ۲ = ۵;" #: src/control-flow-basics/exercise.md:14 msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" -msgstr "" +msgstr "۵ فرد است، پس _n4_ = ۳ * ۵ + ۱ = 16;" #: src/control-flow-basics/exercise.md:15 msgid "16 is even, so _n5_ = 16 / 2 = 8;" -msgstr "" +msgstr "۱۶ زوج است، پس _n5_ = ۱۶ / ۲ = 8;" #: src/control-flow-basics/exercise.md:16 msgid "8 is even, so _n6_ = 8 / 2 = 4;" -msgstr "" +msgstr "۸ زوج است، پس _n6_ = ۸ / ۲ = 4;" #: src/control-flow-basics/exercise.md:17 msgid "4 is even, so _n7_ = 4 / 2 = 2;" -msgstr "" +msgstr "۴ زوج است، پس _n7_ = ۴ / ۲ = ۲;" #: src/control-flow-basics/exercise.md:18 msgid "2 is even, so _n8_ = 1; and" -msgstr "" +msgstr "۲ زوج است، پس _n۸_ = ۱; و" #: src/control-flow-basics/exercise.md:19 msgid "the sequence terminates." -msgstr "" +msgstr "دنباله به پایان می‌رسد." #: src/control-flow-basics/exercise.md:21 msgid "" "Write a function to calculate the length of the collatz sequence for a given " "initial `n`." -msgstr "" +msgstr "یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." #: src/control-flow-basics/exercise.md:25 src/control-flow-basics/solution.md:4 msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" -msgstr "" +msgstr "/// Determine the length of the collatz sequence beginning at `n`.\n" #: src/control-flow-basics/solution.md:20 src/concurrency/threads/scoped.md:11 #: src/concurrency/threads/scoped.md:30 From 31aebaccf6d015e3f2f446bd67bcc0de7d195d87 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:28:15 +0000 Subject: [PATCH 10/92] feat(fa.po):Day 1: morning --- po/fa.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index a4cca7498a0..f8be690a5a0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3891,7 +3891,8 @@ msgstr "دنباله به پایان می‌رسد." msgid "" "Write a function to calculate the length of the collatz sequence for a given " "initial `n`." -msgstr "یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." +msgstr "" +"یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." #: src/control-flow-basics/exercise.md:25 src/control-flow-basics/solution.md:4 msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" From 95fac257663e26bfb22736d74121ce183a8fc7ed Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:30:09 +0000 Subject: [PATCH 11/92] fix(fa.po):Day 1: morning --- po/fa.po | 116 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/po/fa.po b/po/fa.po index f8be690a5a0..2d4da925e02 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1511,8 +1511,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and C" +"++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1571,8 +1571,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker Notes" +"\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -3744,7 +3744,8 @@ msgstr "" #: src/control-flow-basics/functions.md:30 msgid "" "Overloading is not supported -- each function has a single implementation." -msgstr "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." +msgstr "" +"بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md:31 msgid "" @@ -3835,21 +3836,27 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " +"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md:6 msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." -msgstr "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." +msgstr "" +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " +"می‌یابد." #: src/control-flow-basics/exercise.md:7 msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "" +"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md:8 msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." -msgstr "اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." +msgstr "" +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " +"+ ۱." #: src/control-flow-basics/exercise.md:10 msgid "For example, beginning with _n1_ = 3:" @@ -4194,8 +4201,8 @@ msgstr "" #: src/references/shared.md:51 msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" +"++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4395,8 +4402,8 @@ msgstr "" #: src/references/strings.md:33 msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals (`\"Hello" +"\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4466,9 +4473,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" +"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " +"`#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4738,9 +4745,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche optimization" +"\"). For example, `Option<&u8>` stores either a pointer to an integer or " +"`NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5269,8 +5276,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍" +"`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 @@ -6793,9 +6800,9 @@ msgstr "" #: src/std-types/hashmap.md:55 msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" +"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " +"easily initialize a hash map from a literal array:" msgstr "" #: src/std-types/hashmap.md:65 @@ -8357,8 +8364,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:" -"\"Dog\"| :\n" +": : | : | data:\"Dog" +"\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8380,16 +8387,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk" +"\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk" +"\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -8717,8 +8724,8 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor" +"\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 @@ -9356,9 +9363,8 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments" +"\". These document the item that contains them -- in this case, a module." msgstr "" #: src/modules/filesystem.md:22 @@ -12331,11 +12337,11 @@ msgstr "" #: src/android/testing/googletest.md:44 msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://github.com/mainmatter/rust-advanced-testing-" -"workshop), a self-guided Rust course: it provides a guided introduction to " -"the library, with exercises to help you get comfortable with `googletest` " -"macros, its matchers and its overall philosophy." +"going through the first chapter of [\"Advanced testing for Rust applications" +"\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-" +"guided Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" #: src/android/testing/googletest.md:51 @@ -14619,8 +14625,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" +"\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -15099,8 +15105,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" +"\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -18207,11 +18213,11 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" +"\" to signal that the data it protected might be in an inconsistent state. " +"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" +"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " +"`into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -18416,8 +18422,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" +"\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -19447,8 +19453,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" +"\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -19642,8 +19648,8 @@ msgstr "" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " +"it was useful." msgstr "" #: src/thanks.md From b6b9dd63c8286121b1d8e43e9c41cdd00045a74d Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 20:03:22 +0000 Subject: [PATCH 12/92] fix(fa.po):Day1:Morning --- po/fa.po | 103 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/po/fa.po b/po/fa.po index 2d4da925e02..145de90b9ac 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1511,8 +1511,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and C" -"++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1571,8 +1571,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker Notes" -"\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -3843,6 +3843,7 @@ msgstr "" msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " "می‌یابد." @@ -3855,8 +3856,7 @@ msgstr "" msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " -"+ ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." #: src/control-flow-basics/exercise.md:10 msgid "For example, beginning with _n1_ = 3:" @@ -4201,8 +4201,8 @@ msgstr "" #: src/references/shared.md:51 msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" -"++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4402,8 +4402,8 @@ msgstr "" #: src/references/strings.md:33 msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello" -"\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals " +"(`\"Hello\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4473,9 +4473,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" -"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " -"`#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4745,9 +4745,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche optimization" -"\"). For example, `Option<&u8>` stores either a pointer to an integer or " -"`NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5276,8 +5276,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 @@ -6800,9 +6800,9 @@ msgstr "" #: src/std-types/hashmap.md:55 msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" -"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " -"easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" #: src/std-types/hashmap.md:65 @@ -8364,8 +8364,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:\"Dog" -"\"| :\n" +": : | : | data:" +"\"Dog\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8387,16 +8387,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk" -"\" | :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk" -"\" | :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -8724,8 +8724,8 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor" -"\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 @@ -9363,8 +9363,9 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments" -"\". These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md:22 @@ -12337,11 +12338,11 @@ msgstr "" #: src/android/testing/googletest.md:44 msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust applications" -"\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-" -"guided Rust course: it provides a guided introduction to the library, with " -"exercises to help you get comfortable with `googletest` macros, its matchers " -"and its overall philosophy." +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://github.com/mainmatter/rust-advanced-testing-" +"workshop), a self-guided Rust course: it provides a guided introduction to " +"the library, with exercises to help you get comfortable with `googletest` " +"macros, its matchers and its overall philosophy." msgstr "" #: src/android/testing/googletest.md:51 @@ -14625,8 +14626,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" -"\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -15105,8 +15106,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" -"\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -18213,11 +18214,11 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" -"\" to signal that the data it protected might be in an inconsistent state. " -"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" -"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " -"`into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -18422,8 +18423,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" -"\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -19453,8 +19454,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" -"\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -19648,8 +19649,8 @@ msgstr "" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " -"it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" #: src/thanks.md From a8208f6e93416b0e6dedab3206bb38b3eccb3477 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 2 Aug 2024 20:22:09 +0000 Subject: [PATCH 13/92] fix(fa.po):Day1:Morning --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 145de90b9ac..1d50b9f92b6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -3843,7 +3843,6 @@ msgstr "" msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " "می‌یابد." @@ -3856,7 +3855,8 @@ msgstr "" msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " +"+ ۱." #: src/control-flow-basics/exercise.md:10 msgid "For example, beginning with _n1_ = 3:" From a2169a4c22837e88b588fc17f41a16321fbf3330 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Sun, 11 Aug 2024 21:41:16 +0000 Subject: [PATCH 14/92] concurrency part 1 Farsi --- po/fa.po | 6159 +++++++++++++++++++----------------------------------- 1 file changed, 2103 insertions(+), 4056 deletions(-) diff --git a/po/fa.po b/po/fa.po index 9730163e826..9897a8849b0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" -"PO-Revision-Date: 2024-08-07 22:37+0330\n" +"PO-Revision-Date: 2024-08-11 22:49+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.0.1\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🦀" @@ -1213,15 +1213,15 @@ msgstr "" #: src/concurrency/send-sync/marker-traits.md:1 #, fuzzy msgid "Marker Traits" -msgstr "صفت‌های بیشتر" +msgstr "Marker هایTraits" #: src/SUMMARY.md src/concurrency/send-sync/send.md:1 msgid "`Send`" -msgstr "" +msgstr "`Send`" #: src/SUMMARY.md src/concurrency/send-sync/sync.md:1 msgid "`Sync`" -msgstr "" +msgstr "`Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/examples.md:1 @@ -1235,11 +1235,11 @@ msgstr "ناحیه‌های مشترک" #: src/SUMMARY.md src/concurrency/shared-state/arc.md:1 msgid "`Arc`" -msgstr "" +msgstr "`Arc`" #: src/SUMMARY.md src/concurrency/shared-state/mutex.md:1 msgid "`Mutex`" -msgstr "" +msgstr "`Mutex`" #: src/SUMMARY.md src/memory-management/review.md:16 #: src/error-handling/try-conversions.md:23 src/concurrency/shared-state.md @@ -1252,12 +1252,12 @@ msgstr "مثال" #: src/concurrency/sync-exercises/solutions.md:3 #: src/concurrency/async-exercises.md msgid "Dining Philosophers" -msgstr "فلسفه Dining" +msgstr "Dining فلسفه" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/link-checker.md:1 msgid "Multi-threaded Link Checker" -msgstr "جستجوگر پیوند چند تِردی" +msgstr "بررسی‌کننده لینک چند تِردی" #: src/SUMMARY.md msgid "Concurrency: Afternoon" @@ -1266,11 +1266,11 @@ msgstr "همزمانی: عصر" #: src/SUMMARY.md src/running-the-course/course-structure.md:162 #: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" -msgstr "مبانی Async" +msgstr "Async مبانی" #: src/SUMMARY.md src/concurrency/async/async-await.md:1 msgid "`async`/`await`" -msgstr "" +msgstr "`async`/`await`" #: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md:1 msgid "Futures" @@ -1299,7 +1299,7 @@ msgstr "کنترل جریان پیشرفته" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/channels.md:1 msgid "Async Channels" -msgstr "کانال‌های Async" +msgstr "Async کانال‌های" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/join.md:1 @@ -1314,20 +1314,20 @@ msgstr "Select" #: src/SUMMARY.md src/running-the-course/course-structure.md:164 #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" -msgstr "مشکل‌ها" +msgstr "هاPitfall" #: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" -msgstr "مسدود کردن Executor" +msgstr "Executor مسدود کردن" #: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md:1 msgid "`Pin`" -msgstr "" +msgstr "`Pin`" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/async-traits.md:1 msgid "Async Traits" -msgstr "صفات Async" +msgstr "Async هایTrait" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/cancellation.md:1 @@ -1338,7 +1338,7 @@ msgstr "لغو" #: src/concurrency/async-exercises/chat-app.md:1 #: src/concurrency/async-exercises/solutions.md:102 msgid "Broadcast Chat Application" -msgstr "پخش برنامه چت" +msgstr "پخش‌کننده برنامه چت" #: src/SUMMARY.md msgid "Final Words" @@ -1346,7 +1346,7 @@ msgstr "کلمات آخر" #: src/SUMMARY.md src/thanks.md msgid "Thanks!" -msgstr "سپاس!" +msgstr "!سپاس" #. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md @@ -1475,10 +1475,10 @@ msgid "" "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"[Concurrency](concurrency.md): یک کلاس تمام روز درباره همزمانی در Rust. ما " -"هر همزمانی کلاسیک (برنامه ریزی پیشگیرانه با استفاده از موضوعات و mutexes) و " -"async / await concurrency (چند وظیفه ای تعاونی با استفاده از اینده) را پوشش " -"می دهیم." +"‏[Concurrency](concurrency.md): ما تمام روز را به بررسی در زبان Rust " +"می‌پردازیم ما هر دو مبحث concurrency کلاسیک (زمان‌بندی پیشگیرانه با استفاده " +"از threadها و mutexeها) و ‏async / await در concurrency (چند وظیفه‌ای مشترک " +"با استفاده از futures) را پوشش می‌دهیم می دهیم." #: src/index.md msgid "Non-Goals" @@ -1509,8 +1509,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and C" +"++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1569,8 +1569,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker Notes" +"\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -1821,27 +1821,27 @@ msgstr "۴۵ دقیقه" #: src/welcome-day-2-afternoon.md src/concurrency/welcome.md #: src/concurrency/welcome-async.md msgid "1 hour and 10 minutes" -msgstr "۱ ساعت و ۱۰ دقیفه" +msgstr "‏۱ ساعت و ۱۰ دقیقه" #: src/running-the-course/course-structure.md:48 msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" -msgstr "روز ۳ صبح (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" +msgstr "روز سوم - صبح (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:57 msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" -msgstr "روز ۳ بعدازظهر(۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" +msgstr "روز سوم - بعدازظهر(۱ ساعت و ۵۵ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:65 msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" -msgstr "روز ۴ صبح (۲ ساعت و ۴۰ دقیقه، شامل وقت استراحت)" +msgstr "روز چهارم - صبح (۲ ساعت و ۴۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:75 msgid "Day 4 Afternoon (2 hours and 15 minutes, including breaks)" -msgstr "روز ۴ بعدازظهر (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" +msgstr "روز چهارم - بعدازظهر (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:80 src/welcome-day-4-afternoon.md msgid "1 hour and 5 minutes" -msgstr "ساعت و ۵ دقیقه" +msgstr "‏۱ ساعت و ۵ دقیقه" #: src/running-the-course/course-structure.md:85 msgid "Deep Dives" @@ -1956,8 +1956,8 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی " -"کلاسیک و همچنین همزمانی `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " +"شامل همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md:135 msgid "" @@ -2651,7 +2651,7 @@ msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرای #: src/welcome-day-4.md src/concurrency/welcome.md #: src/concurrency/welcome-async.md msgid "Schedule" -msgstr "برنامه زمانی" +msgstr "زمان‌بند (Schedule)" #: src/welcome-day-1.md msgid "" @@ -3796,7 +3796,7 @@ msgid "" "panic." msgstr "" "`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " -"panic می کند." +"panic می کند. " #: src/control-flow-basics/macros.md:14 msgid "" @@ -4133,7 +4133,7 @@ msgstr "" #: src/references.md src/smart-pointers.md src/borrowing.md #: src/concurrency/async-pitfalls.md msgid "This segment should take about 55 minutes. It contains:" -msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن شامل:" +msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. که شامل:" #: src/references.md msgid "Slices: &\\[T\\]" @@ -4199,8 +4199,8 @@ msgstr "" #: src/references/shared.md:51 msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" +"++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4400,8 +4400,8 @@ msgstr "" #: src/references/strings.md:33 msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals (`\"Hello" +"\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4471,9 +4471,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" +"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " +"`#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4627,7 +4627,7 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:99 #: src/concurrency/async-pitfalls/cancellation.md:103 msgid "// ...\n" -msgstr "" +msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md:41 msgid "" @@ -4743,9 +4743,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche optimization" +"\"). For example, `Option<&u8>` stores either a pointer to an integer or " +"`NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5277,8 +5277,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍" +"`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 @@ -5856,7 +5856,7 @@ msgstr "" #: src/methods-and-traits/traits/supertraits.md:30 #: src/concurrency/async-control-flow/select.md:44 msgid "\"Rex\"" -msgstr "" +msgstr "\"Rex\"" #: src/methods-and-traits/traits/supertraits.md:31 msgid "\"{} has {} legs\"" @@ -5882,7 +5882,7 @@ msgstr "" #: src/methods-and-traits/traits/associated-types.md:25 #: src/concurrency/async-control-flow/join.md:30 msgid "\"{:?}\"" -msgstr "" +msgstr "\"{:?}\"" #: src/methods-and-traits/traits/associated-types.md:31 msgid "" @@ -6766,7 +6766,7 @@ msgstr "" #: src/testing/unit-tests.md:32 src/testing/unit-tests.md:37 #: src/concurrency/threads/scoped.md:9 src/concurrency/threads/scoped.md:26 msgid "\"Hello\"" -msgstr "" +msgstr "\"Hello\"" #: src/std-types/string.md:9 msgid "\"s1: len = {}, capacity = {}\"" @@ -6822,10 +6822,9 @@ msgid "" "unicode_segmentation/struct.Graphemes.html)." msgstr "" "`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " -"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." -"html)." +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر" +"\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/" +"unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." #: src/std-types/string.md:37 msgid "" @@ -7067,9 +7066,9 @@ msgstr "برخلاف `!vec`، متأسفانه ماکروی استاندارد ` #: src/std-types/hashmap.md:55 msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" +"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " +"easily initialize a hash map from a literal array:" msgstr "" "از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" "(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" @@ -8354,7 +8353,7 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:85 #: src/concurrency/sync-exercises/solutions.md:121 msgid "\"a\"" -msgstr "" +msgstr "\"a\"" #: src/memory-management/drop.md:20 src/android/testing/googletest.md:12 msgid "\"b\"" @@ -8702,6 +8701,9 @@ msgid "" "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " "context." msgstr "" +"اگر شما علاقه‌مند به موضوع multi-thread هستید بهتر است\n" +" مباحث [`Arc`](../concurrency/shared-state/arc.md) و [`Mutex`](https://" +"doc.rust-lang.org/std/sync/struct.Mutex.html) را ببینید." #: src/smart-pointers/rc.md:19 msgid "" @@ -8772,8 +8774,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:" -"\"Dog\"| :\n" +": : | : | data:\"Dog" +"\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8795,16 +8797,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk" +"\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk" +"\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -9132,186 +9134,26 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor" +"\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 #: src/borrowing/exercise.md:60 src/borrowing/solution.md:52 -#: src/borrowing/solution.md:58 src/borrowing/solution.md:62 -#: src/android/build-rules/library.md:44 -#: src/android/aidl/example-service/client.md:15 -msgid "\"Bob\"" -msgstr "" - -#: src/borrowing/exercise.md:51 src/borrowing/solution.md:53 -msgid "\"I'm {} and my age is {}\"" -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:3 -msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers " -"to. This is verified by the borrow checker." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:6 -msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes " -"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " -"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " -"`Point` which is valid for at least the lifetime `a`\"." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:11 -msgid "" -"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " -"yourself. Explicit lifetime annotations create constraints where there is " -"ambiguity; the compiler verifies that there is a valid solution." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:15 -msgid "" -"Lifetimes become more complicated when considering passing values to and " -"returning values from functions." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:36 -msgid "// What is the lifetime of p3?\n" -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:37 -msgid "\"p3: {p3:?}\"" -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:44 -msgid "" -"In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that " -"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " -"requires explicit annotations of lifetimes on function arguments and return " -"values." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:50 -msgid "Add `'a` appropriately to `left_most`:" -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:56 -msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." -msgstr "" - -#: src/lifetimes/lifetime-annotations.md:59 -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:1 -msgid "Lifetimes in Function Calls" -msgstr "طول عمر در فراخوانی‌ توابع" - -#: src/lifetimes/lifetime-elision.md:3 -msgid "" -"Lifetimes for function arguments and return values must be fully specified, " -"but Rust allows lifetimes to be elided in most cases with [a few simple " -"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " -"inference -- it is just a syntactic shorthand." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:8 -msgid "Each argument which does not have a lifetime annotation is given one." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:9 -msgid "" -"If there is only one argument lifetime, it is given to all un-annotated " -"return values." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:11 -msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, " -"that lifetime is given to all un-annotated return values." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:53 -msgid "In this example, `cab_distance` is trivially elided." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:55 -msgid "" -"The `nearest` function provides another example of a function with multiple " -"references in its arguments that requires explicit annotation." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:58 -msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" -msgstr "" - -#: src/lifetimes/lifetime-elision.md:64 +#: src/mes.md:26 msgid "" -"This won't compile, demonstrating that the annotations are checked for " -"validity by the compiler. Note that this is not the case for raw pointers " -"(unsafe), and this is a common source of errors with unsafe Rust." -msgstr "" - -#: src/lifetimes/lifetime-elision.md:68 -msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have " -"lifetimes. Most of the time, elision and type inference mean these don't " -"need to be written out. In more complicated cases, lifetime annotations can " -"help resolve ambiguity. Often, especially when prototyping, it's easier to " -"just work with owned data by cloning values where necessary." -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:1 -msgid "Lifetimes in Data Structures" -msgstr "طول عمر در ساختمان داده" - -#: src/lifetimes/struct-lifetimes.md:3 -msgid "" -"If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:10 -msgid "\"Bye {text}!\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:14 -msgid "\"The quick brown fox jumps over the lazy dog.\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:17 -msgid "// erase(text);\n" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:18 -msgid "\"{fox:?}\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:19 -msgid "\"{dog:?}\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md:26 -msgid "" -"In the above example, the annotation on `Highlight` enforces that the data " -"underlying the contained `&str` lives at least as long as any instance of " -"`Highlight` that uses that data." +"In the above example, the annotation on `Highlight` enforces that the data underlying the contained `&str` lives at least as long as " +"any instance of `Highlight` that uses that data." msgstr "" #: src/lifetimes/struct-lifetimes.md:29 -msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +msgid "If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker throws an error." msgstr "" #: src/lifetimes/struct-lifetimes.md:31 msgid "" -"Types with borrowed data force users to hold on to the original data. This " -"can be useful for creating lightweight views, but it generally makes them " -"somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This can be useful for creating lightweight views, but it " +"generally makes them somewhat harder to use." msgstr "" #: src/lifetimes/struct-lifetimes.md:34 @@ -9320,26 +9162,23 @@ msgstr "" #: src/lifetimes/struct-lifetimes.md:35 msgid "" -"Some structs with multiple references inside can have more than one lifetime " -"annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime " -"of the struct itself. Those are very advanced use cases." +"Some structs with multiple references inside can have more than one lifetime annotation. This can be necessary if there is a need to " +"describe lifetime relationships between the references themselves, in addition to the lifetime of the struct itself. Those are very " +"advanced use cases." msgstr "" #: src/lifetimes/exercise.md:3 msgid "" -"In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " -"simpler than it seems! This illustrates a common parsing pattern, passing " -"slices of data. The underlying data itself is never copied." +"In this exercise, you will build a parser for the [protobuf binary encoding](https://protobuf.dev/programming-guides/encoding/). " +"Don't worry, it's simpler than it seems! This illustrates a common parsing pattern, passing slices of data. The underlying data " +"itself is never copied." msgstr "" #: src/lifetimes/exercise.md:8 msgid "" -"Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` " -"file. In this exercise, we'll encode that information into `match` " -"statements in functions that get called for each field." +"Fully parsing a protobuf message requires knowing the types of the fields, indexed by their field numbers. That is typically " +"provided in a `proto` file. In this exercise, we'll encode that information into `match` statements in functions that get called for " +"each field." msgstr "" #: src/lifetimes/exercise.md:13 @@ -9348,24 +9187,20 @@ msgstr "" #: src/lifetimes/exercise.md:28 msgid "" -"A proto message is encoded as a series of fields, one after the next. Each " -"is implemented as a \"tag\" followed by the value. The tag contains a field " -"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each is implemented as a \"tag\" followed by the value. The " +"tag contains a field number (e.g., `2` for the `id` field of a `Person` message) and a wire type defining how the payload should be " +"determined from the byte stream." msgstr "" #: src/lifetimes/exercise.md:33 msgid "" -"Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +"Integers, including the tag, are represented with a variable-length encoding called VARINT. Luckily, `parse_varint` is defined for " +"you below. The given code also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse a message into a series " +"of calls to those callbacks." msgstr "" #: src/lifetimes/exercise.md:38 -msgid "" -"What remains for you is to implement the `parse_field` function and the " -"`ProtoMessage` trait for `Person` and `PhoneNumber`." +msgid "What remains for you is to implement the `parse_field` function and the `ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" #: src/lifetimes/exercise.md:44 src/lifetimes/solution.md:4 @@ -9379,8 +9214,7 @@ msgstr "" #: src/lifetimes/exercise.md:48 src/lifetimes/solution.md:8 msgid "" "//I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" @@ -9432,8 +9266,7 @@ msgid "\"Expected `i32` to be an `I32` field\"" msgstr "" #: src/lifetimes/exercise.md:119 src/lifetimes/solution.md:79 -msgid "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" #: src/lifetimes/exercise.md:124 src/lifetimes/solution.md:84 @@ -9463,9 +9296,7 @@ msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" #: src/lifetimes/exercise.md:154 -msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as " -"necessary.\"" +msgid "\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" msgstr "" #: src/lifetimes/exercise.md:156 @@ -9474,8 +9305,7 @@ msgstr "" #: src/lifetimes/exercise.md:158 src/lifetimes/solution.md:138 msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -9487,11 +9317,9 @@ msgstr "" #: src/lifetimes/exercise.md:204 msgid "" -"In this exercise there are various cases where protobuf parsing might fail, " -"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " -"the data buffer. In normal Rust code we'd handle this with the `Result` " -"enum, but for simplicity in this exercise we panic if any errors are " -"encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, e.g. if you try to parse an `i32` when there are fewer " +"than 4 bytes left in the data buffer. In normal Rust code we'd handle this with the `Result` enum, but for simplicity in this " +"exercise we panic if any errors are encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" #: src/lifetimes/solution.md:119 @@ -9516,8 +9344,7 @@ msgid "Welcome to Day 4" msgstr "به روز ۱ خوش آمدید" #: src/welcome-day-4.md -msgid "" -"Today we will cover topics relating to building large-scale software in Rust:" +msgid "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" #: src/welcome-day-4.md @@ -9538,14 +9365,11 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "" #: src/welcome-day-4.md -msgid "" -"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 40 " -"minutes. It contains:" +msgid "Including 10 minute breaks, this session should take about 2 hours and 40 minutes. It contains:" msgstr "" #: src/iterators.md @@ -9564,10 +9388,9 @@ msgstr "FromIterator" #: src/iterators/iterator.md:3 msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait supports iterating over values in a collection. It " +"requires a `next` method and provides lots of methods. Many standard library types implement `Iterator`, and you can implement it " +"yourself, too:" msgstr "" #: src/iterators/iterator.md:27 @@ -9576,27 +9399,23 @@ msgstr "" #: src/iterators/iterator.md:35 msgid "" -"The `Iterator` trait implements many common functional programming " -"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"The `Iterator` trait implements many common functional programming operations over collections (e.g. `map`, `filter`, `reduce`, " +"etc). This is the trait where you can find all the documentation about them. In Rust these functions should produce the code as " +"efficient as equivalent imperative implementations." msgstr "" #: src/iterators/iterator.md:40 msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"`IntoIterator` is the trait that makes for loops work. It is implemented by collection types such as `Vec` and references to them " +"such as `&Vec` and `&[T]`. Ranges also implement it. This is why you can iterate over a vector with `for i in some_vec { .. }` " +"but `some_vec.next()` doesn't exist." msgstr "" #: src/iterators/intoiterator.md:3 msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " -"It is used automatically by the `for` loop." +"The `Iterator` trait tells you how to _iterate_ once you have created an iterator. The related trait [`IntoIterator`](https://doc." +"rust-lang.org/std/iter/trait.IntoIterator.html) defines how to create an iterator for a type. It is used automatically by the `for` " +"loop." msgstr "" #: src/iterators/intoiterator.md:49 @@ -9604,9 +9423,7 @@ msgid "\"point = {x}, {y}\"" msgstr "" #: src/iterators/intoiterator.md:57 -msgid "" -"Click through to the docs for `IntoIterator`. Every implementation of " -"`IntoIterator` must declare two types:" +msgid "Click through to the docs for `IntoIterator`. Every implementation of `IntoIterator` must declare two types:" msgstr "" #: src/iterators/intoiterator.md:60 @@ -9619,8 +9436,7 @@ msgstr "" #: src/iterators/intoiterator.md:63 msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same " -"`Item` type, which means that it returns `Option`" +"Note that `IntoIter` and `Item` are linked: the iterator must have the same `Item` type, which means that it returns `Option`" msgstr "" #: src/iterators/intoiterator.md:66 @@ -9628,30 +9444,23 @@ msgid "The example iterates over all combinations of x and y coordinates." msgstr "" #: src/iterators/intoiterator.md:68 -msgid "" -"Try iterating over the grid twice in `main`. Why does this fail? Note that " -"`IntoIterator::into_iter` takes ownership of `self`." +msgid "Try iterating over the grid twice in `main`. Why does this fail? Note that `IntoIterator::into_iter` takes ownership of `self`." msgstr "" #: src/iterators/intoiterator.md:71 -msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +msgid "Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md:74 msgid "" -"The same problem can occur for standard library types: `for e in " -"some_vector` will take ownership of `some_vector` and iterate over owned " -"elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in some_vector` will take ownership of `some_vector` and iterate over " +"owned elements from that vector. Use `for e in &some_vector` instead, to iterate over references to elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md:3 msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets you build a collection from an [`Iterator`]" +"(https://doc.rust-lang.org/std/iter/trait.Iterator.html)." msgstr "" #: src/iterators/fromiterator.md:9 @@ -9668,42 +9477,35 @@ msgstr "" #: src/iterators/fromiterator.md:27 msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." +"With the \"turbofish\": `some_iterator.collect::()`, as shown. The `_` shorthand used here lets Rust infer the type " +"of the `Vec` elements." msgstr "" #: src/iterators/fromiterator.md:29 -msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"Rewrite the example to use this form." +msgid "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. Rewrite the example to use this form." msgstr "" #: src/iterators/fromiterator.md:32 msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. There are also more specialized implementations which " +"let you do cool things like convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md:3 msgid "" -"In this exercise, you will need to find and use some of the provided methods " -"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait to implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods in the [`Iterator`](https://doc.rust-lang.org/std/iter/" +"trait.Iterator.html) trait to implement a complex calculation." msgstr "" #: src/iterators/exercise.md:6 msgid "" -"Copy the following code to and make the tests " -"pass. Use an iterator expression and `collect` the result to construct the " -"return value." +"Copy the following code to and make the tests pass. Use an iterator expression and `collect` the " +"result to construct the return value." msgstr "" #: src/iterators/exercise.md:11 src/iterators/solution.md:4 msgid "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -9730,15 +9532,11 @@ msgid "\"In the bar module\"" msgstr "" #: src/modules/modules.md:29 -msgid "" -"Packages provide functionality and include a `Cargo.toml` file that " -"describes how to build a bundle of 1+ crates." +msgid "Packages provide functionality and include a `Cargo.toml` file that describes how to build a bundle of 1+ crates." msgstr "" #: src/modules/modules.md:31 -msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and " -"a library crate compiles to a library." +msgid "Crates are a tree of modules, where a binary crate creates an executable and a library crate compiles to a library." msgstr "" #: src/modules/modules.md:33 @@ -9746,15 +9544,13 @@ msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md:3 -msgid "" -"Omitting the module content will tell Rust to look for it in another file:" +msgid "Omitting the module content will tell Rust to look for it in another file:" msgstr "" #: src/modules/filesystem.md:9 msgid "" -"This tells rust that the `garden` module content is found at `src/garden." -"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" -"vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden.rs`. Similarly, a `garden::vegetables` module can be found " +"at `src/garden/vegetables.rs`." msgstr "" #: src/modules/filesystem.md:13 @@ -9771,15 +9567,13 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments\". These document the item that contains them -- in this " +"case, a module." msgstr "" #: src/modules/filesystem.md:22 msgid "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" msgstr "" @@ -9797,14 +9591,14 @@ msgstr "" #: src/modules/filesystem.md:43 msgid "" -"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " -"`module.rs`, and this is still a working alternative for editions after 2018." +"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of `module.rs`, and this is still a working alternative " +"for editions after 2018." msgstr "" #: src/modules/filesystem.md:46 msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod." -"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` was because many files named `mod.rs` can be hard to " +"distinguish in IDEs." msgstr "" #: src/modules/filesystem.md:49 @@ -9812,9 +9606,7 @@ msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" #: src/modules/filesystem.md:59 -msgid "" -"The place rust will look for modules can be changed with a compiler " -"directive:" +msgid "The place rust will look for modules can be changed with a compiler directive:" msgstr "" #: src/modules/filesystem.md:62 @@ -9823,8 +9615,8 @@ msgstr "" #: src/modules/filesystem.md:66 msgid "" -"This is useful, for example, if you would like to place tests for a module " -"in a file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module in a file named `some_module_test.rs`, similar to the " +"convention in Go." msgstr "" #: src/modules/visibility.md:3 @@ -9840,9 +9632,7 @@ msgid "Parent and sibling items are always visible." msgstr "" #: src/modules/visibility.md:7 -msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all " -"the descendants of `foo`." +msgid "In other words, if an item is visible in module `foo`, it's visible in all the descendants of `foo`." msgstr "" #: src/modules/visibility.md:13 @@ -9866,15 +9656,12 @@ msgid "Use the `pub` keyword to make modules public." msgstr "" #: src/modules/visibility.md:42 -msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " -"of public visibility." +msgid "Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public visibility." msgstr "" #: src/modules/visibility.md:45 msgid "" -"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" -"privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." +"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" #: src/modules/visibility.md:47 @@ -9886,15 +9673,13 @@ msgid "Less commonly, you can give visibility to a specific path." msgstr "" #: src/modules/visibility.md:49 -msgid "" -"In any case, visibility must be granted to an ancestor module (and all of " -"its descendants)." +msgid "In any case, visibility must be granted to an ancestor module (and all of its descendants)." msgstr "" #: src/modules/paths.md:3 msgid "" -"A module can bring symbols from another module into scope with `use`. You " -"will typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You will typically see something like this at the top of each " +"module:" msgstr "" #: src/modules/paths.md:11 @@ -9930,44 +9715,35 @@ msgid "`bar::foo` refers to `foo` in the `bar` crate." msgstr "" #: src/modules/paths.md:26 -msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the " -"top-level `lib.rs` in a crate might have" +msgid "It is common to \"re-export\" symbols at a shorter path. For example, the top-level `lib.rs` in a crate might have" msgstr "" #: src/modules/paths.md:36 -msgid "" -"making `DiskStorage` and `NetworkStorage` available to other crates with a " -"convenient, short path." +msgid "making `DiskStorage` and `NetworkStorage` available to other crates with a convenient, short path." msgstr "" #: src/modules/paths.md:39 msgid "" -"For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if " -"a type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to " -"`use std::io::Read`." +"For the most part, only items that appear in a module need to be `use`'d. However, a trait must be in scope to call any methods on " +"that trait, even if a type implementing that trait is already in scope. For example, to use the `read_to_string` method on a type " +"implementing the `Read` trait, you need to `use std::io::Read`." msgstr "" #: src/modules/paths.md:45 msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is " -"discouraged because it is not clear which items are imported, and those " -"might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged because it is not clear which items are imported, and " +"those might change over time." msgstr "" #: src/modules/exercise.md:3 msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. " -"This library defines a `Widget` trait and a few implementations of that " -"trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. This library defines a `Widget` trait and a few " +"implementations of that trait, as well as a `main` function." msgstr "" #: src/modules/exercise.md:7 msgid "" -"It is typical to put each type or set of closely-related types into its own " -"module, so each widget type should get its own module." +"It is typical to put each type or set of closely-related types into its own module, so each widget type should get its own module." msgstr "" #: src/modules/exercise.md:10 @@ -9976,15 +9752,11 @@ msgid "Cargo Setup" msgstr "تنظیم" #: src/modules/exercise.md:12 -msgid "" -"The Rust playground only supports one file, so you will need to make a Cargo " -"project on your local filesystem:" +msgid "The Rust playground only supports one file, so you will need to make a Cargo project on your local filesystem:" msgstr "" #: src/modules/exercise.md:21 -msgid "" -"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " -"files in the `src` directory." +msgid "Edit the resulting `src/main.rs` to add `mod` statements, and add additional files in the `src` directory." msgstr "" #: src/modules/exercise.md:24 @@ -10017,22 +9789,17 @@ msgstr "" #: src/modules/exercise.md:100 msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -#: src/modules/exercise.md:102 src/modules/exercise.md:108 -#: src/modules/solution.md:165 src/modules/solution.md:171 +#: src/modules/exercise.md:102 src/modules/exercise.md:108 src/modules/solution.md:165 src/modules/solution.md:171 msgid "\"+-{:-`1 + 4 = 5` تبدیل می‌شود." +"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." #: src/testing/exercise.md:17 msgid "Sum all the undoubled and doubled digits." @@ -10323,20 +10073,16 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md:21 msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, " -"along with two basic unit tests that confirm that most of the algorithm is " -"implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, along with two basic unit tests that confirm that most of " +"the algorithm is implemented correctly." msgstr "" #: src/testing/exercise.md:25 #, fuzzy msgid "" -"Copy the code below to and write additional " -"tests to uncover bugs in the provided implementation, fixing any bugs you " -"find." -msgstr "" -"کد زیر را به کپی کنید و " -"تابع را پیاده‌سازی کنید." +"Copy the code below to and write additional tests to uncover bugs in the provided implementation, " +"fixing any bugs you find." +msgstr "کد زیر را به کپی کنید و تابع را پیاده‌سازی کنید." #: src/testing/exercise.md:57 src/testing/solution.md:69 msgid "\"4263 9826 4026 9299\"" @@ -10412,12 +10158,8 @@ msgstr "" #: src/welcome-day-4-afternoon.md #, fuzzy -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 15 " -"minutes. It contains:" -msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +msgid "Including 10 minute breaks, this session should take about 2 hours and 15 minutes. It contains:" +msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/error-handling.md #, fuzzy @@ -10465,20 +10207,15 @@ msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" #: src/error-handling/panics.md:19 -msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions " -"had returned." +msgid "A panic will \"unwind\" the stack, dropping values just as if the functions had returned." msgstr "" #: src/error-handling/panics.md:21 -msgid "" -"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" #: src/error-handling/panics.md:26 -msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be " -"caught:" +msgid "By default, a panic will cause the stack to unwind. The unwinding can be caught:" msgstr "" #: src/error-handling/panics.md:32 @@ -10494,15 +10231,11 @@ msgid "\"oh no!\"" msgstr "" #: src/error-handling/panics.md:42 -msgid "" -"Catching is unusual; do not attempt to implement exceptions with " -"`catch_unwind`!" +msgid "Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" msgstr "" #: src/error-handling/panics.md:44 -msgid "" -"This can be useful in servers which should keep running even if a single " -"request crashes." +msgid "This can be useful in servers which should keep running even if a single request crashes." msgstr "" #: src/error-handling/panics.md:46 @@ -10511,38 +10244,32 @@ msgstr "" #: src/error-handling/result.md:3 msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://" -"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " -"saw when discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://doc.rust-lang.org/stable/std/result/enum.Result.html) " +"enum, which we briefly saw when discussing standard library types." msgstr "" #: src/error-handling/result.md:33 -msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` " -"which contains an error value of some kind." +msgid "`Result` has two variants: `Ok` which contains the success value, and `Err` which contains an error value of some kind." msgstr "" #: src/error-handling/result.md:36 msgid "" -"Whether or not a function can produce an error is encoded in the function's " -"type signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's type signature by having the function return a `Result` " +"value." msgstr "" #: src/error-handling/result.md:39 msgid "" -"Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern " -"matching on the `Result` to check which variant you have. Methods like " -"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " -"error handling, but means that you can always see in your source code where " -"proper error handling is being skipped." +"Like with `Option`, there is no way to forget to handle an error: You cannot access either the success value or the error value " +"without first pattern matching on the `Result` to check which variant you have. Methods like `unwrap` make it easier to write quick-" +"and-dirty code that doesn't do robust error handling, but means that you can always see in your source code where proper error " +"handling is being skipped." msgstr "" #: src/error-handling/result.md:48 msgid "" -"It may be helpful to compare error handling in Rust to error handling " -"conventions that students may be familiar with from other programming " -"languages." +"It may be helpful to compare error handling in Rust to error handling conventions that students may be familiar with from other " +"programming languages." msgstr "" #: src/error-handling/result.md:53 @@ -10551,17 +10278,14 @@ msgstr "" #: src/error-handling/result.md:55 msgid "" -"In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means " -"that you can't tell when calling a function if it may throw an exception or " -"not." +"In most languages with exceptions, whether or not a function can throw an exception is not visible as part of its type signature. " +"This generally means that you can't tell when calling a function if it may throw an exception or not." msgstr "" #: src/error-handling/result.md:60 msgid "" -"Exceptions generally unwind the call stack, propagating upward until a `try` " -"block is reached. An error originating deep in the call stack may impact an " -"unrelated function further up." +"Exceptions generally unwind the call stack, propagating upward until a `try` block is reached. An error originating deep in the call " +"stack may impact an unrelated function further up." msgstr "" #: src/error-handling/result.md:64 @@ -10570,24 +10294,20 @@ msgstr "" #: src/error-handling/result.md:66 msgid "" -"Some languages have functions return an error number (or some other error " -"value) separately from the successful return value of the function. Examples " -"include C and Go." +"Some languages have functions return an error number (or some other error value) separately from the successful return value of the " +"function. Examples include C and Go." msgstr "" #: src/error-handling/result.md:70 msgid "" -"Depending on the language it may be possible to forget to check the error " -"value, in which case you may be accessing an uninitialized or otherwise " -"invalid success value." +"Depending on the language it may be possible to forget to check the error value, in which case you may be accessing an uninitialized " +"or otherwise invalid success value." msgstr "" #: src/error-handling/try.md:3 msgid "" -"Runtime errors like connection-refused or file-not-found are handled with " -"the `Result` type, but matching this type on every call can be cumbersome. " -"The try-operator `?` is used to return errors to the caller. It lets you " -"turn the common" +"Runtime errors like connection-refused or file-not-found are handled with the `Result` type, but matching this type on every call " +"can be cumbersome. The try-operator `?` is used to return errors to the caller. It lets you turn the common" msgstr "" #: src/error-handling/try.md:15 @@ -10602,8 +10322,7 @@ msgstr "" msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" msgstr "" -#: src/error-handling/try.md:43 src/error-handling/try-conversions.md:65 -#: src/error-handling/thiserror-and-anyhow.md:36 +#: src/error-handling/try.md:43 src/error-handling/try-conversions.md:65 src/error-handling/thiserror-and-anyhow.md:36 msgid "\"config.dat\"" msgstr "" @@ -10620,23 +10339,17 @@ msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." msgstr "" #: src/error-handling/try.md:56 -msgid "" -"Use the `fs::write` call to test out the different scenarios: no file, empty " -"file, file with username." +msgid "Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username." msgstr "" #: src/error-handling/try.md:58 msgid "" -"Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. " -"The executable will print the `Err` variant and return a nonzero exit status " -"on error." +"Note that `main` can return a `Result<(), E>` as long as it implements `std::process::Termination`. In practice, this means that `E` " +"implements `Debug`. The executable will print the `Err` variant and return a nonzero exit status on error." msgstr "" #: src/error-handling/try-conversions.md:3 -msgid "" -"The effective expansion of `?` is a little more complicated than previously " -"indicated:" +msgid "The effective expansion of `?` is a little more complicated than previously indicated:" msgstr "" #: src/error-handling/try-conversions.md:10 @@ -10645,9 +10358,8 @@ msgstr "" #: src/error-handling/try-conversions.md:19 msgid "" -"The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function. This makes it easy to encapsulate errors into " -"higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the type returned by the function. This makes it easy to " +"encapsulate errors into higher-level errors." msgstr "" #: src/error-handling/try-conversions.md:42 @@ -10664,31 +10376,25 @@ msgstr "" #: src/error-handling/try-conversions.md:73 msgid "" -"The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. " -"A function that returns `Result` can only use `?` on a value " -"of type `Result` if `ErrorOuter` and `ErrorInner` are the " -"same type or if `ErrorOuter` implements `From`." +"The `?` operator must return a value compatible with the return type of the function. For `Result`, it means that the error types " +"have to be compatible. A function that returns `Result` can only use `?` on a value of type `Result` " +"if `ErrorOuter` and `ErrorInner` are the same type or if `ErrorOuter` implements `From`." msgstr "" #: src/error-handling/try-conversions.md:79 -msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, " -"especially when the conversion only happens in one place." +msgid "A common alternative to a `From` implementation is `Result::map_err`, especially when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md:82 msgid "" -"There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and " -"`U` types." +"There is no compatibility requirement for `Option`. A function returning `Option` can use the `?` operator on `Option` for " +"arbitrary `T` and `U` types." msgstr "" #: src/error-handling/try-conversions.md:86 msgid "" -"A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " -"turns `Result` into `Option`." +"A function that returns `Result` cannot use `?` on `Option` and vice versa. However, `Option::ok_or` converts `Option` to `Result` " +"whereas `Result::ok` turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md:1 @@ -10697,10 +10403,8 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md:3 msgid "" -"Sometimes we want to allow any type of error to be returned without writing " -"our own enum covering all the different possibilities. The `std::error::" -"Error` trait makes it easy to create a trait object that can contain any " -"error." +"Sometimes we want to allow any type of error to be returned without writing our own enum covering all the different possibilities. " +"The `std::error::Error` trait makes it easy to create a trait object that can contain any error." msgstr "" #: src/error-handling/error.md:20 src/error-handling/error.md:21 @@ -10721,44 +10425,37 @@ msgstr "" #: src/error-handling/error.md:31 msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) " -"or `std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) or `std::num::ParseIntError` (from `String::parse`)." msgstr "" #: src/error-handling/error.md:34 msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle " -"different error cases differently in the program. As such it's generally not " -"a good idea to use `Box` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle different error cases differently in the program. As such " +"it's generally not a good idea to use `Box` in the public API of a library, but it can be a good option in a program " +"where you just want to display the error message somewhere." msgstr "" #: src/error-handling/error.md:40 msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom error type so it can be boxed. But if you need to " +"support the `no_std` attribute, keep in mind that the `std::error::Error` trait is currently compatible with `no_std` in [nightly]" +"(https://github.com/rust-lang/rust/issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:3 msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" -"anyhow/) crates are widely used to simplify error handling." +"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/anyhow/) crates are widely used to simplify error " +"handling." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:7 -msgid "" -"`thiserror` is often used in libraries to create custom error types that " -"implement `From`." +msgid "`thiserror` is often used in libraries to create custom error types that implement `From`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:9 msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in functions, including adding contextual information to your " +"errors." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:19 @@ -10791,8 +10488,7 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md:48 msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful " -"attributes to help define error types in a compact way." +"The `Error` derive macro is provided by `thiserror`, and has lots of useful attributes to help define error types in a compact way." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:50 @@ -10809,9 +10505,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md:55 msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally not a good choice for the public API " +"of a library, but is widely used in applications." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:58 @@ -10819,36 +10514,30 @@ msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:59 -msgid "" -"Actual error type inside of it can be extracted for examination if necessary." +msgid "Actual error type inside of it can be extracted for examination if necessary." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:60 msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides similar usage patterns and ergonomics " +"to `(T, error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:63 msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` types. `use anyhow::Context` is necessary to enable " +"`.context()` and `.with_context()` on those types." msgstr "" #: src/error-handling/exercise.md:3 msgid "" -"The following implements a very simple parser for an expression language. " -"However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"The following implements a very simple parser for an expression language. However, it handles errors by panicking. Rewrite it to " +"instead use idiomatic error handling and propagate errors to a return from `main`. Feel free to use `thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md:8 msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " +"HINT: start by fixing error handling in the `parse` function. Once that is working correctly, update `Tokenizer` to implement " "`Iterator>` and handle that in the parser." msgstr "" @@ -10876,8 +10565,7 @@ msgstr "" msgid "/// A binary operation.\n" msgstr "" -#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 -#: src/error-handling/solution.md:75 +#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 src/error-handling/solution.md:75 msgid "'_'" msgstr "" @@ -10946,21 +10634,17 @@ msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" #: src/unsafe-rust/unsafe.md:6 -msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are " -"violated." +msgid "**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." msgstr "" #: src/unsafe-rust/unsafe.md:8 -msgid "" -"We saw mostly safe Rust in this course, but it's important to know what " -"Unsafe Rust is." +msgid "We saw mostly safe Rust in this course, but it's important to know what Unsafe Rust is." msgstr "" #: src/unsafe-rust/unsafe.md:11 msgid "" -"Unsafe code is usually small and isolated, and its correctness should be " -"carefully documented. It is usually wrapped in a safe abstraction layer." +"Unsafe code is usually small and isolated, and its correctness should be carefully documented. It is usually wrapped in a safe " +"abstraction layer." msgstr "" #: src/unsafe-rust/unsafe.md:14 @@ -10989,17 +10673,14 @@ msgstr "" #: src/unsafe-rust/unsafe.md:22 msgid "" -"We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"We will briefly cover unsafe capabilities next. For full details, please see [Chapter 19.1 in the Rust Book](https://doc.rust-lang." +"org/book/ch19-01-unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" #: src/unsafe-rust/unsafe.md:29 msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers " -"have turned off some compiler safety features and have to write correct code " -"by themselves. It means the compiler no longer enforces Rust's memory-safety " -"rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers have turned off some compiler safety features and have to " +"write correct code by themselves. It means the compiler no longer enforces Rust's memory-safety rules." msgstr "" #: src/unsafe-rust/dereferencing.md:3 @@ -11013,8 +10694,7 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:12 msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11044,15 +10724,14 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:35 msgid "" -"It is good practice (and required by the Android Rust style guide) to write " -"a comment for each `unsafe` block explaining how the code inside it " -"satisfies the safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write a comment for each `unsafe` block explaining how the " +"code inside it satisfies the safety requirements of the unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md:39 msgid "" -"In the case of pointer dereferences, this means that the pointers must be " -"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" +"In the case of pointer dereferences, this means that the pointers must be [_valid_](https://doc.rust-lang.org/std/ptr/index." +"html#safety), i.e.:" msgstr "" #: src/unsafe-rust/dereferencing.md:42 @@ -11060,9 +10739,7 @@ msgid "The pointer must be non-null." msgstr "" #: src/unsafe-rust/dereferencing.md:43 -msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single " -"allocated object)." +msgid "The pointer must be _dereferenceable_ (within the bounds of a single allocated object)." msgstr "" #: src/unsafe-rust/dereferencing.md:45 @@ -11075,8 +10752,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:47 msgid "" -"If the pointer was obtained by casting a reference, the underlying object " -"must be live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object must be live and no reference may be used to access the " +"memory." msgstr "" #: src/unsafe-rust/dereferencing.md:50 @@ -11085,9 +10762,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:52 msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has the `'static` lifetime, so `r3` has type `&'static " +"String`, and thus outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md:3 @@ -11104,14 +10780,11 @@ msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" msgstr "" #: src/unsafe-rust/mutable-static.md:13 -msgid "" -"However, since data races can occur, it is unsafe to read and write mutable " -"static variables:" +msgid "However, since data races can occur, it is unsafe to read and write mutable static variables:" msgstr "" #: src/unsafe-rust/mutable-static.md:20 src/unsafe-rust/mutable-static.md:29 -msgid "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" #: src/unsafe-rust/mutable-static.md:31 @@ -11120,17 +10793,14 @@ msgstr "" #: src/unsafe-rust/mutable-static.md:39 msgid "" -"The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"The program here is safe because it is single-threaded. However, the Rust compiler is conservative and will assume the worst. Try " +"removing the `unsafe` and see how the compiler explains that it is undefined behavior to mutate a static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md:44 msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases where it might make sense in low-level `no_std` code, such " +"as implementing a heap allocator or working with some C APIs." msgstr "" #: src/unsafe-rust/unions.md:3 @@ -11152,16 +10822,14 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md:22 msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They " -"are occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally needed for interacting with C library " +"APIs." msgstr "" #: src/unsafe-rust/unions.md:25 msgid "" -"If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." -"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" -"crates/zerocopy) crate." +"If you just want to reinterpret bytes as a different type, you probably want [`std::mem::transmute`](https://doc.rust-lang.org/" +"stable/std/mem/fn.transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md:3 src/unsafe-rust/unsafe-functions.md:76 @@ -11169,22 +10837,14 @@ msgid "Calling Unsafe Functions" msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md:5 -msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 -#: src/unsafe-rust/solution.md:41 src/android/interoperability/with-c.md:9 -#: src/android/interoperability/with-c/rust.md:15 -#: src/android/interoperability/with-c/rust.md:30 -#: src/android/interoperability/cpp/cpp-bridge.md:29 -#: src/android/interoperability/cpp/cpp-bridge.md:38 -#: src/exercises/chromium/build-rules.md:8 -#: src/exercises/chromium/build-rules.md:21 -#: src/bare-metal/aps/inline-assembly.md:19 -#: src/bare-metal/aps/better-uart/using.md:24 -#: src/bare-metal/aps/logging/using.md:23 +msgid "A function or method can be marked `unsafe` if it has extra preconditions you must uphold to avoid undefined behaviour:" +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 src/unsafe-rust/solution.md:41 +#: src/android/interoperability/with-c.md:9 src/android/interoperability/with-c/rust.md:15 +#: src/android/interoperability/with-c/rust.md:30 src/android/interoperability/cpp/cpp-bridge.md:29 +#: src/android/interoperability/cpp/cpp-bridge.md:38 src/exercises/chromium/build-rules.md:8 src/exercises/chromium/build-rules.md:21 +#: src/bare-metal/aps/inline-assembly.md:19 src/bare-metal/aps/better-uart/using.md:24 src/bare-metal/aps/logging/using.md:23 #: src/exercises/bare-metal/solutions-afternoon.md:43 msgid "\"C\"" msgstr "" @@ -11199,9 +10859,7 @@ msgid "" " // string slice, and lie on UTF-8 sequence boundaries.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:19 -#: src/unsafe-rust/unsafe-functions.md:20 -#: src/unsafe-rust/unsafe-functions.md:21 +#: src/unsafe-rust/unsafe-functions.md:19 src/unsafe-rust/unsafe-functions.md:20 src/unsafe-rust/unsafe-functions.md:21 msgid "\"emoji: {}\"" msgstr "" @@ -11227,15 +10885,12 @@ msgid "" " // emojis.get_unchecked(0..3) }));\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:43 -#: src/unsafe-rust/unsafe-functions.md:88 +#: src/unsafe-rust/unsafe-functions.md:43 src/unsafe-rust/unsafe-functions.md:88 msgid "Writing Unsafe Functions" msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md:45 -msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +msgid "You can mark your own functions as `unsafe` if they require particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-functions.md:49 @@ -11257,32 +10912,26 @@ msgstr "" #: src/unsafe-rust/unsafe-functions.md:78 msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can create UB if the range is incorrect. `abs` is incorrect " +"for a different reason: it is an external function (FFI). Calling external functions is usually only a problem when those functions " +"do things with pointers which might violate Rust's memory model, but in general any C function might have undefined behaviour under " +"any arbitrary circumstances." msgstr "" #: src/unsafe-rust/unsafe-functions.md:85 msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too]" -"(https://doc.rust-lang.org/reference/items/external-blocks.html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://doc.rust-lang.org/reference/items/external-blocks." +"html)." msgstr "" #: src/unsafe-rust/unsafe-functions.md:90 -msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +msgid "We wouldn't actually use pointers for a `swap` function - it can be done safely with references." msgstr "" #: src/unsafe-rust/unsafe-functions.md:93 msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"Note that unsafe code is allowed within an unsafe function without an `unsafe` block. We can prohibit this with " +"`#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it and see what happens. This will likely change in a future Rust edition." msgstr "" #: src/unsafe-rust/unsafe-traits.md:1 @@ -11291,14 +10940,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md:3 msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation " -"must guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation must guarantee particular conditions to avoid undefined " +"behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md:6 msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something like this](https://docs.rs/zerocopy/latest/zerocopy/" +"trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md:12 @@ -11314,14 +10963,11 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md:34 msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining " -"the requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining the requirements for the trait to be safely implemented." msgstr "" #: src/unsafe-rust/unsafe-traits.md:37 -msgid "" -"The actual safety section for `AsBytes` is rather longer and more " -"complicated." +msgid "The actual safety section for `AsBytes` is rather longer and more complicated." msgstr "" #: src/unsafe-rust/unsafe-traits.md:39 @@ -11334,9 +10980,8 @@ msgstr "امن بودن FFI Wrapper" #: src/unsafe-rust/exercise.md:3 msgid "" -"Rust has great support for calling functions through a _foreign function " -"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " -"functions you would use from C to read the names of files in a directory." +"Rust has great support for calling functions through a _foreign function interface_ (FFI). We will use this to build a safe wrapper " +"for the `libc` functions you would use from C to read the names of files in a directory." msgstr "" #: src/unsafe-rust/exercise.md:7 @@ -11357,9 +11002,8 @@ msgstr "" #: src/unsafe-rust/exercise.md:13 msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" -"ffi/) module. There you find a number of string types which you need for the " -"exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) module. There you find a number of string types " +"which you need for the exercise:" msgstr "" #: src/unsafe-rust/exercise.md:16 @@ -11372,8 +11016,7 @@ msgstr "" #: src/unsafe-rust/exercise.md:18 msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" #: src/unsafe-rust/exercise.md:18 @@ -11386,8 +11029,7 @@ msgstr "" #: src/unsafe-rust/exercise.md:19 msgid "" -"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" -"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" +"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`](https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" #: src/unsafe-rust/exercise.md:19 @@ -11400,8 +11042,8 @@ msgstr "" #: src/unsafe-rust/exercise.md:20 msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " -"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString." +"html)" msgstr "" #: src/unsafe-rust/exercise.md:20 @@ -11417,9 +11059,7 @@ msgid "You will convert between all these types:" msgstr "" #: src/unsafe-rust/exercise.md:24 -msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` " -"character," +msgid "`&str` to `CString`: you need to allocate space for a trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md:25 @@ -11427,45 +11067,33 @@ msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" #: src/unsafe-rust/exercise.md:26 -msgid "" -"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " -"character," +msgid "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md:28 -msgid "" -"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " -"unknown data\"," +msgid "`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some unknown data\"," msgstr "" #: src/unsafe-rust/exercise.md:30 msgid "" -"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," +"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`](https://doc.rust-lang.org/std/os/unix/ffi/trait." +"OsStrExt.html) to create it," msgstr "" #: src/unsafe-rust/exercise.md:33 -msgid "" -"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " -"return it and call `readdir` again." +msgid "`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to return it and call `readdir` again." msgstr "" #: src/unsafe-rust/exercise.md:36 -msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " -"useful chapter about FFI." +msgid "The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful chapter about FFI." msgstr "" #: src/unsafe-rust/exercise.md:47 -msgid "" -"Copy the code below to and fill in the missing " -"functions and methods:" +msgid "Copy the code below to and fill in the missing functions and methods:" msgstr "" -#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 -#: src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 -#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 -#: src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 +#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 +#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 #: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 msgid "\"macos\"" msgstr "" @@ -11485,8 +11113,7 @@ msgstr "" msgid "// Layout according to the macOS man page for dir(5).\n" msgstr "" -#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 -#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 msgid "\"x86_64\"" msgstr "" @@ -11495,10 +11122,8 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" msgstr "" #: src/unsafe-rust/exercise.md:103 src/unsafe-rust/solution.md:53 @@ -11519,8 +11144,7 @@ msgstr "" msgid "// Call closedir as needed.\n" msgstr "" -#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 -#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 #: src/android/interoperability/with-c/rust.md:44 msgid "\".\"" msgstr "" @@ -11607,71 +11231,52 @@ msgstr "" #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can " -"write new services, libraries, drivers or even firmware in Rust (or improve " -"existing code as needed)." +"Rust is supported for system software on Android. This means that you can write new services, libraries, drivers or even firmware in " +"Rust (or improve existing code as needed)." msgstr "" #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to find a little corner of your code base where we can move " +"some lines of code to Rust. The fewer dependencies and \"exotic\" types the better. Something that parses some raw bytes would be " +"ideal." msgstr "" #: src/android.md -msgid "" -"The speaker may mention any of the following given the increased use of Rust " -"in Android:" +msgid "The speaker may mention any of the following given the increased use of Rust in Android:" msgstr "" #: src/android.md -msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +msgid "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-android.html)" msgstr "" #: src/android.md -msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +msgid "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/rutabaga_gfx.html)" msgstr "" #: src/android.md -msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +msgid "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" #: src/android.md -msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +msgid "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android.html)" msgstr "" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make " -"sure you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure you have access to one or create a new one with:" msgstr "" #: src/android/setup.md -msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/" -"setup/start) for details." +msgid "Please see the [Android Developer Codelab](https://source.android.com/docs/setup/start) for details." msgstr "" #: src/android/setup.md -msgid "" -"Cuttlefish is a reference Android device designed to work on generic Linux " -"desktops. MacOS support is also planned." +msgid "Cuttlefish is a reference Android device designed to work on generic Linux desktops. MacOS support is also planned." msgstr "" #: src/android/setup.md -msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is " -"the ideal emulator to run many Rust use cases." +msgid "The Cuttlefish system image maintains high fidelity to real devices, and is the ideal emulator to run many Rust use cases." msgstr "" #: src/android/build-rules.md @@ -11707,9 +11312,7 @@ msgid "`rust_ffi`" msgstr "" #: src/android/build-rules.md -msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants." +msgid "Produces a Rust C library usable by `cc` modules, and provides both static and shared variants." msgstr "" #: src/android/build-rules.md @@ -11717,9 +11320,7 @@ msgid "`rust_proc_macro`" msgstr "" #: src/android/build-rules.md -msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins." +msgid "Produces a `proc-macro` Rust library. These are analogous to compiler plugins." msgstr "" #: src/android/build-rules.md @@ -11743,9 +11344,7 @@ msgid "`rust_protobuf`" msgstr "" #: src/android/build-rules.md -msgid "" -"Generates source and produces a Rust library that provides an interface for " -"a particular protobuf." +msgid "Generates source and produces a Rust library that provides an interface for a particular protobuf." msgstr "" #: src/android/build-rules.md @@ -11753,9 +11352,7 @@ msgid "`rust_bindgen`" msgstr "" #: src/android/build-rules.md -msgid "" -"Generates source and produces a Rust library containing Rust bindings to C " -"libraries." +msgid "Generates source and produces a Rust library containing Rust bindings to C libraries." msgstr "" #: src/android/build-rules.md @@ -11767,29 +11364,22 @@ msgid "Additional items speaker may mention:" msgstr "" #: src/android/build-rules.md -msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages " -"from the internet." +msgid "Cargo is not optimized for multi-language repos, and also downloads packages from the internet." msgstr "" #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must " -"also interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must also interop with C/C++/Java code. Soong fills that gap." msgstr "" #: src/android/build-rules.md -msgid "" -"Soong has many similarities to Bazel, which is the open-source variant of " -"Blaze (used in google3)." +msgid "Soong has many similarities to Bazel, which is the open-source variant of Blaze (used in google3)." msgstr "" #: src/android/build-rules.md msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/" -"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) to Bazel." +"There is a plan to transition [Android](https://source.android.com/docs/setup/build/bazel/introduction), [ChromeOS](https://chromium." +"googlesource.com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) to Bazel." msgstr "" #: src/android/build-rules.md @@ -11805,9 +11395,7 @@ msgid "Rust Binaries" msgstr "" #: src/android/build-rules/binary.md:3 -msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, " -"create the following files:" +msgid "Let us start with a simple application. At the root of an AOSP checkout, create the following files:" msgstr "" #: src/android/build-rules/binary.md:6 src/android/build-rules/library.md:13 @@ -11818,8 +11406,7 @@ msgstr "" msgid "\"hello_rust\"" msgstr "" -#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 -#: src/android/logging.md +#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 src/android/logging.md msgid "\"src/main.rs\"" msgstr "" @@ -11870,9 +11457,8 @@ msgstr "" #: src/android/build-rules/library.md:8 msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`](https://cs.android.com/android/platform/superproject/+/" +"master:external/rust/crates/)." msgstr "" #: src/android/build-rules/library.md:17 src/android/build-rules/library.md:18 @@ -11895,8 +11481,7 @@ msgstr "" msgid "\"greetings\"" msgstr "" -#: src/android/build-rules/library.md:30 -#: src/android/aidl/example-service/service.md:28 src/android/testing.md +#: src/android/build-rules/library.md:30 src/android/aidl/example-service/service.md:28 src/android/testing.md #: src/android/interoperability/java.md:39 msgid "\"src/lib.rs\"" msgstr "" @@ -11925,16 +11510,13 @@ msgstr "" msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" #: src/android/aidl.md -msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android." -"com/guide/components/aidl) is supported in Rust:" +msgid "The [Android Interface Definition Language (AIDL)](https://developer.android.com/guide/components/aidl) is supported in Rust:" msgstr "" #: src/android/aidl.md @@ -11947,9 +11529,8 @@ msgstr "" #: src/android/aidl/birthday-service.md:3 msgid "" -"To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement " -"the described service and write client code that talks to that service." +"To illustrate how to use Rust with Binder, we're going to walk through the process of creating a Binder interface. We're then going " +"to both implement the described service and write client code that talks to that service." msgstr "" #: src/android/aidl/example-service/interface.md:1 @@ -11960,20 +11541,16 @@ msgstr "" msgid "You declare the API of your service using an AIDL interface:" msgstr "" -#: src/android/aidl/example-service/interface.md:5 -#: src/android/aidl/example-service/service-bindings.md:6 -msgid "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +#: src/android/aidl/example-service/interface.md:5 src/android/aidl/example-service/service-bindings.md:6 +msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" -#: src/android/aidl/example-service/interface.md:8 -#: src/android/aidl/example-service/service-bindings.md:9 +#: src/android/aidl/example-service/interface.md:8 src/android/aidl/example-service/service-bindings.md:9 #: src/android/aidl/example-service/changing-definition.md:8 msgid "/** Birthday service interface. */" msgstr "" -#: src/android/aidl/example-service/interface.md:10 -#: src/android/aidl/example-service/service-bindings.md:11 +#: src/android/aidl/example-service/interface.md:10 src/android/aidl/example-service/service-bindings.md:11 #: src/android/aidl/example-service/changing-definition.md:11 msgid "/** Generate a Happy Birthday message. */" msgstr "" @@ -11996,9 +11573,8 @@ msgstr "" #: src/android/aidl/example-service/interface.md:32 msgid "" -"Note that the directory structure under the `aidl/` directory needs to match " -"the package name used in the AIDL file, i.e. the package is `com.example." -"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." +"Note that the directory structure under the `aidl/` directory needs to match the package name used in the AIDL file, i.e. the " +"package is `com.example.birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" #: src/android/aidl/example-service/service-bindings.md:1 @@ -12006,9 +11582,7 @@ msgid "Generated Service API" msgstr "" #: src/android/aidl/example-service/service-bindings.md:3 -msgid "" -"Binder generates a trait corresponding to the interface definition. trait to " -"talk to the service." +msgid "Binder generates a trait corresponding to the interface definition. trait to talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md:16 @@ -12017,27 +11591,20 @@ msgid "_Generated trait_:" msgstr "Rust ناایمن" #: src/android/aidl/example-service/service-bindings.md:24 -msgid "" -"Your service will need to implement this trait, and your client will use " -"this trait to talk to the service." +msgid "Your service will need to implement this trait, and your client will use this trait to talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md:29 -msgid "" -"The generated bindings can be found at `out/soong/.intermediates//`." +msgid "The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" #: src/android/aidl/example-service/service-bindings.md:31 msgid "" -"Point out how the generated function signature, specifically the argument " -"and return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument and return types, correspond the interface definition." msgstr "" #: src/android/aidl/example-service/service-bindings.md:33 -msgid "" -"`String` for an argument results in a different Rust type than `String` as a " -"return type." +msgid "`String` for an argument results in a different Rust type than `String` as a return type." msgstr "" #: src/android/aidl/example-service/service.md:1 @@ -12048,8 +11615,7 @@ msgstr "" msgid "We can now implement the AIDL service:" msgstr "" -#: src/android/aidl/example-service/service.md:5 -#: src/android/aidl/example-service/changing-implementation.md:5 +#: src/android/aidl/example-service/service.md:5 src/android/aidl/example-service/changing-implementation.md:5 msgid "_birthday_service/src/lib.rs_:" msgstr "" @@ -12057,51 +11623,41 @@ msgstr "" msgid "/// The `IBirthdayService` implementation.\n" msgstr "" -#: src/android/aidl/example-service/service.md:18 -#: src/android/aidl/example-service/changing-implementation.md:16 +#: src/android/aidl/example-service/service.md:18 src/android/aidl/example-service/changing-implementation.md:16 #: src/android/aidl/types/file-descriptor.md:57 msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "" -#: src/android/aidl/example-service/service.md:23 -#: src/android/aidl/example-service/server.md:28 +#: src/android/aidl/example-service/service.md:23 src/android/aidl/example-service/server.md:28 #: src/android/aidl/example-service/client.md:31 msgid "_birthday_service/Android.bp_:" msgstr "" -#: src/android/aidl/example-service/service.md:27 -#: src/android/aidl/example-service/server.md:38 +#: src/android/aidl/example-service/service.md:27 src/android/aidl/example-service/server.md:38 msgid "\"libbirthdayservice\"" msgstr "" -#: src/android/aidl/example-service/service.md:29 -#: src/android/aidl/example-service/server.md:13 +#: src/android/aidl/example-service/service.md:29 src/android/aidl/example-service/server.md:13 #: src/android/aidl/example-service/client.md:11 msgid "\"birthdayservice\"" msgstr "" -#: src/android/aidl/example-service/service.md:31 -#: src/android/aidl/example-service/server.md:36 +#: src/android/aidl/example-service/service.md:31 src/android/aidl/example-service/server.md:36 #: src/android/aidl/example-service/client.md:39 msgid "\"com.example.birthdayservice-rust\"" msgstr "" -#: src/android/aidl/example-service/service.md:32 -#: src/android/aidl/example-service/server.md:37 +#: src/android/aidl/example-service/service.md:32 src/android/aidl/example-service/server.md:37 #: src/android/aidl/example-service/client.md:40 msgid "\"libbinder_rs\"" msgstr "" #: src/android/aidl/example-service/service.md:39 -msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain " -"why each of the segments is necessary." +msgid "Point out the path to the generated `IBirthdayService` trait, and explain why each of the segments is necessary." msgstr "" #: src/android/aidl/example-service/service.md:41 -msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to " -"override? Where source?" +msgid "TODO: What does the `binder::Interface` trait do? Are there methods to override? Where source?" msgstr "" #: src/android/aidl/example-service/server.md:1 @@ -12128,8 +11684,7 @@ msgstr "" msgid "\"Failed to register service\"" msgstr "" -#: src/android/aidl/example-service/server.md:32 -#: src/android/aidl/example-service/server.md:33 +#: src/android/aidl/example-service/server.md:32 src/android/aidl/example-service/server.md:33 msgid "\"birthday_server\"" msgstr "" @@ -12138,18 +11693,15 @@ msgstr "" msgid "\"src/server.rs\"" msgstr "سرورها" -#: src/android/aidl/example-service/server.md:40 -#: src/android/aidl/example-service/client.md:42 +#: src/android/aidl/example-service/server.md:40 src/android/aidl/example-service/client.md:42 msgid "// To avoid dynamic link error.\n" msgstr "" #: src/android/aidl/example-service/server.md:46 msgid "" -"The process for taking a user-defined service implementation (in this case " -"the `BirthdayService` type, which implements the `IBirthdayService`) and " -"starting it as a Binder service has multiple steps, and may appear more " -"complicated than students are used to if they've used Binder from C++ or " -"another language. Explain to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case the `BirthdayService` type, which implements the " +"`IBirthdayService`) and starting it as a Binder service has multiple steps, and may appear more complicated than students are used " +"to if they've used Binder from C++ or another language. Explain to students why each step is necessary." msgstr "" #: src/android/aidl/example-service/server.md:52 @@ -12158,23 +11710,17 @@ msgstr "" #: src/android/aidl/example-service/server.md:53 msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " -"this case). This type is generated by Binder and provides the common Binder " -"functionality that would be provided by the `BnBinder` base class in C++. We " -"don't have inheritance in Rust, so instead we use composition, putting our " -"`BirthdayService` within the generated `BnBinderService`." +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this case). This type is generated by Binder and " +"provides the common Binder functionality that would be provided by the `BnBinder` base class in C++. We don't have inheritance in " +"Rust, so instead we use composition, putting our `BirthdayService` within the generated `BnBinderService`." msgstr "" #: src/android/aidl/example-service/server.md:58 -msgid "" -"Call `add_service`, giving it a service identifier and your service object " -"(the `BnBirthdayService` object in the example)." +msgid "Call `add_service`, giving it a service identifier and your service object (the `BnBirthdayService` object in the example)." msgstr "" #: src/android/aidl/example-service/server.md:60 -msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool " -"and start listening for connections." +msgid "Call `join_thread_pool` to add the current thread to Binder's thread pool and start listening for connections." msgstr "" #: src/android/aidl/example-service/deploy.md:3 @@ -12185,8 +11731,7 @@ msgstr "" msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -12208,8 +11753,7 @@ msgstr "" msgid "Finally, we can create a Rust client for our new service." msgstr "" -#: src/android/aidl/example-service/client.md:5 -#: src/android/aidl/example-service/changing-implementation.md:29 +#: src/android/aidl/example-service/client.md:5 src/android/aidl/example-service/changing-implementation.md:29 msgid "_birthday_service/src/client.rs_:" msgstr "" @@ -12217,9 +11761,7 @@ msgstr "" msgid "/// Call the birthday service.\n" msgstr "" -#: src/android/aidl/example-service/client.md:23 -#: src/android/aidl/types/objects.md:54 -#: src/android/aidl/types/parcelables.md:32 +#: src/android/aidl/example-service/client.md:23 src/android/aidl/types/objects.md:54 src/android/aidl/types/parcelables.md:32 #: src/android/aidl/types/file-descriptor.md:20 msgid "\"Failed to connect to BirthdayService\"" msgstr "" @@ -12232,8 +11774,7 @@ msgstr "" msgid "\"{msg}\"" msgstr "" -#: src/android/aidl/example-service/client.md:35 -#: src/android/aidl/example-service/client.md:36 +#: src/android/aidl/example-service/client.md:35 src/android/aidl/example-service/client.md:36 msgid "\"birthday_client\"" msgstr "" @@ -12253,44 +11794,35 @@ msgstr "" msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" #: src/android/aidl/example-service/client.md:62 -msgid "" -"`Strong` is the trait object representing the service " -"that the client has connected to." +msgid "`Strong` is the trait object representing the service that the client has connected to." msgstr "" #: src/android/aidl/example-service/client.md:64 msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-" -"process ref count for the service trait object, and the global Binder ref " -"count that tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-process ref count for the service trait object, and the " +"global Binder ref count that tracks how many processes have a reference to the object." msgstr "" #: src/android/aidl/example-service/client.md:67 msgid "" -"Note that the trait object that the client uses to talk to the service uses " -"the exact same trait that the server implements. For a given Binder " -"interface, there is a single Rust trait generated that both client and " -"server use." +"Note that the trait object that the client uses to talk to the service uses the exact same trait that the server implements. For a " +"given Binder interface, there is a single Rust trait generated that both client and server use." msgstr "" #: src/android/aidl/example-service/client.md:71 msgid "" -"Use the same service identifier used when registering the service. This " -"should ideally be defined in a common crate that both the client and server " -"can depend on." +"Use the same service identifier used when registering the service. This should ideally be defined in a common crate that both the " +"client and server can depend on." msgstr "" #: src/android/aidl/example-service/changing-definition.md:3 -msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +msgid "Let us extend the API with more functionality: we want to let clients specify a list of lines for the birthday card:" msgstr "" #: src/android/aidl/example-service/changing-definition.md:16 @@ -12299,9 +11831,8 @@ msgstr "" #: src/android/aidl/example-service/changing-definition.md:31 msgid "" -"Note how the `String[]` in the AIDL definition is translated as a " -"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " -"generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in Rust, i.e. that idiomatic Rust types are used in " +"the generated bindings wherever possible:" msgstr "" #: src/android/aidl/example-service/changing-definition.md:34 @@ -12337,8 +11868,7 @@ msgid "\"And also: many more\"" msgstr "" #: src/android/aidl/example-service/changing-implementation.md:44 -msgid "" -"TODO: Move code snippets into project files where they'll actually be built?" +msgid "TODO: Move code snippets into project files where they'll actually be built?" msgstr "" #: src/android/aidl/types.md:1 @@ -12358,9 +11888,7 @@ msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" #: src/android/aidl/types.md:7 -msgid "" -"References to AIDL objects and file handles can be sent between clients and " -"services." +msgid "References to AIDL objects and file handles can be sent between clients and services." msgstr "" #: src/android/aidl/types.md:9 @@ -12376,8 +11904,7 @@ msgstr "" msgid "AIDL Type" msgstr "AIDL" -#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 -#: src/android/interoperability/cpp/type-mapping.md:3 +#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 src/android/interoperability/cpp/type-mapping.md:3 #, fuzzy msgid "Rust Type" msgstr "انواع داده‌های بازگشتی" @@ -12445,9 +11972,8 @@ msgstr "" #: src/android/aidl/types/arrays.md:3 msgid "" -"The array types (`T[]`, `byte[]`, and `List`) get translated to the " -"appropriate Rust array type depending on how they are used in the function " -"signature:" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the appropriate Rust array type depending on how they are used in " +"the function signature:" msgstr "" #: src/android/aidl/types/arrays.md:7 @@ -12476,17 +12002,14 @@ msgstr "" msgid "Return" msgstr "" -#: src/android/aidl/types/arrays.md:11 -#: src/android/interoperability/cpp/type-mapping.md:11 +#: src/android/aidl/types/arrays.md:11 src/android/interoperability/cpp/type-mapping.md:11 msgid "`Vec`" msgstr "" #: src/android/aidl/types/arrays.md:15 msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " -"array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes `[T; N]`. Fixed-size arrays can have multiple " +"dimensions (e.g. `int[3][4]`). In the Java backend, fixed-size arrays are represented as array types." msgstr "" #: src/android/aidl/types/arrays.md:18 @@ -12494,22 +12017,15 @@ msgid "Arrays in parcelable fields always get translated to `Vec`." msgstr "" #: src/android/aidl/types/objects.md:3 -msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-" -"erased `IBinder` interface:" +msgid "AIDL objects can be sent either as a concrete AIDL type or as the type-erased `IBinder` interface:" msgstr "" #: src/android/aidl/types/objects.md:6 -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" msgstr "" -#: src/android/aidl/types/objects.md:17 -#: src/android/aidl/types/parcelables.md:16 -#: src/android/aidl/types/file-descriptor.md:6 -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +#: src/android/aidl/types/objects.md:17 src/android/aidl/types/parcelables.md:16 src/android/aidl/types/file-descriptor.md:6 +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" #: src/android/aidl/types/objects.md:23 @@ -12520,9 +12036,7 @@ msgstr "" msgid "/** The same thing, but using `IBinder`. */" msgstr "" -#: src/android/aidl/types/objects.md:31 -#: src/android/aidl/types/parcelables.md:27 -#: src/android/aidl/types/file-descriptor.md:15 +#: src/android/aidl/types/objects.md:31 src/android/aidl/types/parcelables.md:27 src/android/aidl/types/file-descriptor.md:15 msgid "**birthday_service/src/client.rs**:" msgstr "" @@ -12539,14 +12053,11 @@ msgid "// Send the binder object to the service.\n" msgstr "" #: src/android/aidl/types/objects.md:65 -msgid "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" msgstr "" #: src/android/aidl/types/objects.md:72 -msgid "" -"Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " -"`BnBirthdayService` that we saw previously." +msgid "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as `BnBirthdayService` that we saw previously." msgstr "" #: src/android/aidl/types/parcelables.md:3 @@ -12554,8 +12065,7 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "" #: src/android/aidl/types/parcelables.md:5 -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" msgstr "" #: src/android/aidl/types/parcelables.md:22 @@ -12563,9 +12073,7 @@ msgid "/** The same thing, but with a parcelable. */" msgstr "" #: src/android/aidl/types/file-descriptor.md:3 -msgid "" -"Files can be sent between Binder clients/servers using the " -"`ParcelFileDescriptor` type:" +msgid "Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` type:" msgstr "" #: src/android/aidl/types/file-descriptor.md:10 @@ -12599,8 +12107,7 @@ msgstr "" #: src/android/aidl/types/file-descriptor.md:41 msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" msgstr "" @@ -12610,15 +12117,12 @@ msgstr "" #: src/android/aidl/types/file-descriptor.md:64 msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " -"`File` (or any other type that wraps an `OwnedFd`), and can be used to " -"create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` (or any other type that wraps an `OwnedFd`), and can " +"be used to create a new `File` handle on the other side." msgstr "" #: src/android/aidl/types/file-descriptor.md:67 -msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " -"UNIX sockets." +msgid "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX sockets." msgstr "" #: src/android/testing.md @@ -12628,8 +12132,8 @@ msgstr "Rust در اندروید" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests " -"work in AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests work in AOSP. Use the `rust_test` module for your unit " +"tests:" msgstr "" #: src/android/testing.md @@ -12695,8 +12199,7 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -12704,15 +12207,11 @@ msgid "" msgstr "" #: src/android/testing.md -msgid "" -"Notice how you only mention the root of the library crate. Tests are found " -"recursively in nested modules." +msgid "Notice how you only mention the root of the library crate. Tests are found recursively in nested modules." msgstr "" #: src/android/testing/googletest.md:3 -msgid "" -"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " -"assertions using _matchers_:" +msgid "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test assertions using _matchers_:" msgstr "" #: src/android/testing/googletest.md:11 @@ -12724,39 +12223,31 @@ msgid "\"xyz\"" msgstr "" #: src/android/testing/googletest.md:16 -msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +msgid "If we change the last element to `\"!\"`, the test fails with a structured error message pin-pointing the error:" msgstr "" #: src/android/testing/googletest.md:37 msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this example in a local environment. Use `cargo add googletest` to " +"quickly add it to an existing Cargo project." msgstr "" #: src/android/testing/googletest.md:41 msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used macros and types](https://docs.rs/googletest/latest/" +"googletest/prelude/index.html)." msgstr "" #: src/android/testing/googletest.md:44 msgid "" -"This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://github.com/mainmatter/rust-advanced-testing-" -"workshop), a self-guided Rust course: it provides a guided introduction to " -"the library, with exercises to help you get comfortable with `googletest` " -"macros, its matchers and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider going through the first chapter of [\"Advanced testing " +"for Rust applications\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-guided Rust course: it provides a " +"guided introduction to the library, with exercises to help you get comfortable with `googletest` macros, its matchers and its " +"overall philosophy." msgstr "" #: src/android/testing/googletest.md:51 -msgid "" -"A particularly nice feature is that mismatches in multi-line strings are " -"shown as a diff:" +msgid "A particularly nice feature is that mismatches in multi-line strings are shown as a diff:" msgstr "" #: src/android/testing/googletest.md:57 @@ -12778,75 +12269,62 @@ msgid "shows a color-coded diff (colors not shown here):" msgstr "" #: src/android/testing/googletest.md:86 -msgid "" -"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" -"googletest/)." +msgid "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/googletest/)." msgstr "" #: src/android/testing/mocking.md:3 msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You need to refactor your code to use traits, which you " +"can then quickly mock:" msgstr "" #: src/android/testing/mocking.md:27 msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are " -"other [mocking libraries available on crates.io](https://crates.io/keywords/" -"mock), in particular in the area of mocking HTTP services. The other mocking " -"libraries work in a similar fashion as Mockall, meaning that they make it " -"easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are other [mocking libraries available on crates.io](https://" +"crates.io/keywords/mock), in particular in the area of mocking HTTP services. The other mocking libraries work in a similar fashion " +"as Mockall, meaning that they make it easy to get a mock implementation of a given trait." msgstr "" #: src/android/testing/mocking.md:33 msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." +"Note that mocking is somewhat _controversial_: mocks allow you to completely isolate a test from its dependencies. The immediate " +"result is faster and more stable test execution. On the other hand, the mocks can be configured wrongly and return output different " +"from what the real dependencies would do." msgstr "" #: src/android/testing/mocking.md:38 msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As an example, many databases allow you to configure an in-" +"memory backend. This means that you get the correct behavior in your tests, plus they are fast and will automatically clean up after " +"themselves." msgstr "" #: src/android/testing/mocking.md:43 msgid "" -"Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." +"Similarly, many web frameworks allow you to start an in-process server which binds to a random port on `localhost`. Always prefer " +"this over mocking away the framework since it helps you test your code in the real environment." msgstr "" #: src/android/testing/mocking.md:47 msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example in a local environment. Use `cargo add mockall` to " +"quickly add Mockall to an existing Cargo project." msgstr "" #: src/android/testing/mocking.md:51 msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up expectations which depend on the arguments passed. Here we use " +"this to mock a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" #: src/android/testing/mocking.md:69 msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be called to `n` --- the mock will automatically panic when " +"dropped if this isn't satisfied." msgstr "" #: src/android/logging.md -msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) " -"or `stdout` (on-host):" +msgid "You should use the `log` crate to automatically log to `logcat` (on-device) or `stdout` (on-host):" msgstr "" #: src/android/logging.md @@ -12893,8 +12371,7 @@ msgstr "" msgid "\"Something went wrong!\"" msgstr "" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 -#: src/android/interoperability/with-c/rust.md:72 +#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 src/android/interoperability/with-c/rust.md:72 msgid "Build, push, and run the binary on your device:" msgstr "" @@ -12902,8 +12379,7 @@ msgstr "" msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" @@ -12913,9 +12389,7 @@ msgid "The logs show up in `adb logcat`:" msgstr "" #: src/android/interoperability.md -msgid "" -"Rust has excellent support for interoperability with other languages. This " -"means that you can:" +msgid "Rust has excellent support for interoperability with other languages. This means that you can:" msgstr "" #: src/android/interoperability.md @@ -12927,9 +12401,7 @@ msgid "Call functions written in other languages from Rust." msgstr "" #: src/android/interoperability.md -msgid "" -"When you call functions in a foreign language we say that you're using a " -"_foreign function interface_, also known as FFI." +msgid "When you call functions in a foreign language we say that you're using a _foreign function interface_, also known as FFI." msgstr "" #: src/android/interoperability/with-c.md:1 @@ -12938,8 +12410,8 @@ msgstr "" #: src/android/interoperability/with-c.md:3 msgid "" -"Rust has full support for linking object files with a C calling convention. " -"Similarly, you can export Rust functions and call them from C." +"Rust has full support for linking object files with a C calling convention. Similarly, you can export Rust functions and call them " +"from C." msgstr "" #: src/android/interoperability/with-c.md:6 @@ -12955,15 +12427,11 @@ msgid "\"{x}, {abs_x}\"" msgstr "" #: src/android/interoperability/with-c.md:21 -msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" -"exercise.md)." +msgid "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise.md)." msgstr "" #: src/android/interoperability/with-c.md:24 -msgid "" -"This assumes full knowledge of the target platform. Not recommended for " -"production." +msgid "This assumes full knowledge of the target platform. Not recommended for production." msgstr "" #: src/android/interoperability/with-c.md:27 @@ -12975,9 +12443,7 @@ msgid "Using Bindgen" msgstr "" #: src/android/interoperability/with-c/bindgen.md:3 -msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +msgid "The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool can auto-generate bindings from a C header file." msgstr "" #: src/android/interoperability/with-c/bindgen.md:6 @@ -12996,13 +12462,11 @@ msgstr "" msgid "" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:23 -#: src/android/interoperability/with-c/bindgen.md:50 +#: src/android/interoperability/with-c/bindgen.md:23 src/android/interoperability/with-c/bindgen.md:50 msgid "\"libbirthday.h\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:26 -#: src/android/interoperability/with-c/bindgen.md:29 +#: src/android/interoperability/with-c/bindgen.md:26 src/android/interoperability/with-c/bindgen.md:29 msgid "\"+--------------\\n\"" msgstr "" @@ -13018,15 +12482,12 @@ msgstr "" msgid "Add this to your `Android.bp` file:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:35 -#: src/android/interoperability/with-c/bindgen.md:55 -#: src/android/interoperability/with-c/bindgen.md:69 -#: src/android/interoperability/with-c/bindgen.md:109 +#: src/android/interoperability/with-c/bindgen.md:35 src/android/interoperability/with-c/bindgen.md:55 +#: src/android/interoperability/with-c/bindgen.md:69 src/android/interoperability/with-c/bindgen.md:109 msgid "_interoperability/bindgen/Android.bp_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:39 -#: src/android/interoperability/with-c/bindgen.md:63 +#: src/android/interoperability/with-c/bindgen.md:39 src/android/interoperability/with-c/bindgen.md:63 msgid "\"libbirthday\"" msgstr "" @@ -13035,9 +12496,7 @@ msgid "\"libbirthday.c\"" msgstr "" #: src/android/interoperability/with-c/bindgen.md:44 -msgid "" -"Create a wrapper header file for the library (not strictly needed in this " -"example):" +msgid "Create a wrapper header file for the library (not strictly needed in this example):" msgstr "" #: src/android/interoperability/with-c/bindgen.md:47 @@ -13048,8 +12507,7 @@ msgstr "" msgid "You can now auto-generate the bindings:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:59 -#: src/android/interoperability/with-c/bindgen.md:75 +#: src/android/interoperability/with-c/bindgen.md:59 src/android/interoperability/with-c/bindgen.md:75 msgid "\"libbirthday_bindgen\"" msgstr "" @@ -13088,10 +12546,8 @@ msgstr "" #: src/android/interoperability/with-c/bindgen.md:89 msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" msgstr "" @@ -13099,8 +12555,7 @@ msgstr "" msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" @@ -13109,8 +12564,7 @@ msgstr "" msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:113 -#: src/android/interoperability/with-c/bindgen.md:115 +#: src/android/interoperability/with-c/bindgen.md:113 src/android/interoperability/with-c/bindgen.md:115 msgid "\"libbirthday_bindgen_test\"" msgstr "" @@ -13118,8 +12572,7 @@ msgstr "" msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:118 -#: src/android/interoperability/with-c/bindgen.md:119 +#: src/android/interoperability/with-c/bindgen.md:118 src/android/interoperability/with-c/bindgen.md:119 msgid "\"none\"" msgstr "" @@ -13163,8 +12616,7 @@ msgstr "" msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "" -#: src/android/interoperability/with-c/rust.md:41 -#: src/android/interoperability/with-c/rust.md:68 +#: src/android/interoperability/with-c/rust.md:41 src/android/interoperability/with-c/rust.md:68 msgid "\"libanalyze_ffi\"" msgstr "" @@ -13204,23 +12656,19 @@ msgstr "" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" #: src/android/interoperability/with-c/rust.md:82 msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " -"\"some_name\"]` to specify whatever name you want." +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the name of the function. You can also use " +"`#[export_name = \"some_name\"]` to specify whatever name you want." msgstr "" #: src/android/interoperability/cpp.md:3 -msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe " -"interoperability between Rust and C++." +msgid "The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability between Rust and C++." msgstr "" #: src/android/interoperability/cpp.md:6 @@ -13229,9 +12677,8 @@ msgstr "" #: src/android/interoperability/cpp/bridge.md:3 msgid "" -"CXX relies on a description of the function signatures that will be exposed " -"from each language to the other. You provide this description using extern " -"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed from each language to the other. You provide this " +"description using extern blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" #: src/android/interoperability/cpp/bridge.md:9 @@ -13242,36 +12689,28 @@ msgstr "" msgid "// Shared structs with fields visible to both languages.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:17 -#: src/android/interoperability/cpp/generated-cpp.md:6 +#: src/android/interoperability/cpp/bridge.md:17 src/android/interoperability/cpp/generated-cpp.md:6 msgid "// Rust types and signatures exposed to C++.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:18 -#: src/android/interoperability/cpp/rust-bridge.md:6 -#: src/android/interoperability/cpp/generated-cpp.md:7 -#: src/android/interoperability/cpp/rust-result.md:6 -#: src/chromium/interoperability-with-cpp/example-bindings.md:9 -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:10 +#: src/android/interoperability/cpp/bridge.md:18 src/android/interoperability/cpp/rust-bridge.md:6 +#: src/android/interoperability/cpp/generated-cpp.md:7 src/android/interoperability/cpp/rust-result.md:6 +#: src/chromium/interoperability-with-cpp/example-bindings.md:9 src/chromium/interoperability-with-cpp/error-handling-qr.md:10 #: src/chromium/interoperability-with-cpp/error-handling-png.md:9 #, fuzzy msgid "\"Rust\"" msgstr "Rustdoc" -#: src/android/interoperability/cpp/bridge.md:24 -#: src/android/interoperability/cpp/cpp-bridge.md:6 +#: src/android/interoperability/cpp/bridge.md:24 src/android/interoperability/cpp/cpp-bridge.md:6 msgid "// C++ types and signatures exposed to Rust.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:25 -#: src/android/interoperability/cpp/cpp-bridge.md:7 -#: src/android/interoperability/cpp/cpp-exception.md:6 -#: src/chromium/interoperability-with-cpp/example-bindings.md:15 +#: src/android/interoperability/cpp/bridge.md:25 src/android/interoperability/cpp/cpp-bridge.md:7 +#: src/android/interoperability/cpp/cpp-exception.md:6 src/chromium/interoperability-with-cpp/example-bindings.md:15 msgid "\"C++\"" msgstr "" -#: src/android/interoperability/cpp/bridge.md:26 -#: src/android/interoperability/cpp/cpp-bridge.md:8 +#: src/android/interoperability/cpp/bridge.md:26 src/android/interoperability/cpp/cpp-bridge.md:8 msgid "\"include/blobstore.h\"" msgstr "" @@ -13281,17 +12720,15 @@ msgstr "" #: src/android/interoperability/cpp/bridge.md:41 msgid "" -"From the declarations made in the bridge module, CXX will generate matching " -"Rust and C++ type/function definitions in order to expose those items to " -"both languages." +"From the declarations made in the bridge module, CXX will generate matching Rust and C++ type/function definitions in order to " +"expose those items to both languages." msgstr "" #: src/android/interoperability/cpp/bridge.md:44 msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/" -"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " -"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " -"(though this doesn't apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/cargo-expand) to view the expanded proc macro. For " +"most of the examples you would use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't apply for Android " +"projects)." msgstr "" #: src/android/interoperability/cpp/bridge.md:47 @@ -13316,17 +12753,14 @@ msgid "// Free function\n" msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md:28 -msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in " -"the parent module." +msgid "Items declared in the `extern \"Rust\"` reference items that are in scope in the parent module." msgstr "" #: src/android/interoperability/cpp/rust-bridge.md:30 msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" -"+ header file containing the corresponding C++ declarations. The generated " -"header has the same path as the Rust source file containing the bridge, " -"except with a .rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ header file containing the corresponding C++ " +"declarations. The generated header has the same path as the Rust source file containing the bridge, except with a .rs.h file " +"extension." msgstr "" #: src/android/interoperability/cpp/generated-cpp.md:15 @@ -13351,15 +12785,12 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md:56 msgid "" -"The programmer does not need to promise that the signatures they have typed " -"in are accurate. CXX performs static assertions that the signatures exactly " -"correspond with what is declared in C++." +"The programmer does not need to promise that the signatures they have typed in are accurate. CXX performs static assertions that the " +"signatures exactly correspond with what is declared in C++." msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md:59 -msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to " -"call from Rust." +msgid "`unsafe extern` blocks allow you to declare C++ functions that are safe to call from Rust." msgstr "" #: src/android/interoperability/cpp/shared-types.md:9 @@ -13372,10 +12803,8 @@ msgstr "" #: src/android/interoperability/cpp/shared-types.md:24 msgid "" -"A limited number of traits are supported for `#[derive()]` on shared types. " -"Corresponding functionality is also generated for the C++ code, e.g. if you " -"derive `Hash` also generates an implementation of `std::hash` for the " -"corresponding C++ type." +"A limited number of traits are supported for `#[derive()]` on shared types. Corresponding functionality is also generated for the C+" +"+ code, e.g. if you derive `Hash` also generates an implementation of `std::hash` for the corresponding C++ type." msgstr "" #: src/android/interoperability/cpp/shared-enums.md:15 @@ -13389,10 +12818,9 @@ msgstr "" #: src/android/interoperability/cpp/shared-enums.md:46 msgid "" -"On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum " -"class to hold a value different from all of the listed variants, and our " -"Rust representation needs to have the same behavior." +"On the Rust side, the code generated for shared enums is actually a struct wrapping a numeric value. This is because it is not UB in " +"C++ for an enum class to hold a value different from all of the listed variants, and our Rust representation needs to have the same " +"behavior." msgstr "" #: src/android/interoperability/cpp/rust-result.md:13 @@ -13404,22 +12832,17 @@ msgid "\"Success!\"" msgstr "" #: src/android/interoperability/cpp/rust-result.md:22 -msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ " -"side." +msgid "Rust functions that return `Result` are translated to exceptions on the C++ side." msgstr "" #: src/android/interoperability/cpp/rust-result.md:24 msgid "" -"The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come " -"from the error type's `Display` impl." +"The exception thrown will always be of type `rust::Error`, which primarily exposes a way to get the error message string. The error " +"message will come from the error type's `Display` impl." msgstr "" #: src/android/interoperability/cpp/rust-result.md:27 -msgid "" -"A panic unwinding from Rust to C++ will always cause the process to " -"immediately terminate." +msgid "A panic unwinding from Rust to C++ will always cause the process to immediately terminate." msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:7 @@ -13432,16 +12855,14 @@ msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:22 msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception " -"on the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception on the C++ side and return it as an `Err` value to the " +"calling Rust function." msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:24 msgid "" -"If an exception is thrown from an extern \"C++\" function that is not " -"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" -"terminate`. The behavior is equivalent to the same exception being thrown " -"through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not declared by the CXX bridge to return `Result`, the program " +"calls C++'s `std::terminate`. The behavior is equivalent to the same exception being thrown through a `noexcept` C++ function." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:3 @@ -13482,11 +12903,11 @@ msgstr "" #: src/android/interoperability/cpp/type-mapping.md:9 msgid "`rust::Box`" -msgstr "" +msgstr "`rust::Box`" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`UniquePtr`" -msgstr "" +msgstr "`UniquePtr`" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`std::unique_ptr`" @@ -13505,49 +12926,37 @@ msgid "`std::vector`" msgstr "" #: src/android/interoperability/cpp/type-mapping.md:16 -msgid "" -"These types can be used in the fields of shared structs and the arguments " -"and returns of extern functions." +msgid "These types can be used in the fields of shared structs and the arguments and returns of extern functions." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:18 -msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are " -"a few reasons for this:" +msgid "Note that Rust's `String` does not map directly to `std::string`. There are a few reasons for this:" msgstr "" #: src/android/interoperability/cpp/type-mapping.md:20 -msgid "" -"`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:21 -msgid "" -"The two types have different layouts in memory and so can't be passed " -"directly between languages." +msgid "The two types have different layouts in memory and so can't be passed directly between languages." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:23 msgid "" -"`std::string` requires move constructors that don't match Rust's move " -"semantics, so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:1 -#: src/android/interoperability/cpp/android-cpp-genrules.md:1 +#: src/android/interoperability/cpp/android-build-cpp.md:1 src/android/interoperability/cpp/android-cpp-genrules.md:1 #: src/android/interoperability/cpp/android-build-rust.md:1 #, fuzzy msgid "Building in Android" msgstr "Rust در اندروید" #: src/android/interoperability/cpp/android-build-cpp.md:3 -msgid "" -"Create a `cc_library_static` to build the C++ library, including the CXX " -"generated header and source file." +msgid "Create a `cc_library_static` to build the C++ library, including the CXX generated header and source file." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:8 -#: src/android/interoperability/cpp/android-build-rust.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md:8 src/android/interoperability/cpp/android-build-rust.md:10 msgid "\"libcxx_test_cpp\"" msgstr "" @@ -13559,42 +12968,35 @@ msgstr "" msgid "\"cxx-bridge-header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:12 -#: src/android/interoperability/cpp/android-cpp-genrules.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md:12 src/android/interoperability/cpp/android-cpp-genrules.md:10 msgid "\"libcxx_test_bridge_header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:14 -#: src/android/interoperability/cpp/android-cpp-genrules.md:19 +#: src/android/interoperability/cpp/android-build-cpp.md:14 src/android/interoperability/cpp/android-cpp-genrules.md:19 msgid "\"libcxx_test_bridge_code\"" msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:20 msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the dependencies for the CXX-generated C++ bindings. " +"We'll show how these are setup on the next slide." msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:23 -msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." +msgid "Note that you also need to depend on the `cxx-bridge-header` library in order to pull in common CXX definitions." msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:25 msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" +"modules/android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share that link with the class so that students know " +"where they can find these instructions again in the future." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:3 msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the " -"CXX source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the CXX source file. These are then used as inputs to the " +"`cc_library_static`." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:7 @@ -13603,8 +13005,7 @@ msgid "" "// to the Rust exported functions in lib.rs.\n" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md:11 -#: src/android/interoperability/cpp/android-cpp-genrules.md:20 +#: src/android/interoperability/cpp/android-cpp-genrules.md:11 src/android/interoperability/cpp/android-cpp-genrules.md:20 msgid "\"cxxbridge\"" msgstr "" @@ -13612,8 +13013,7 @@ msgstr "" msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md:13 -#: src/android/interoperability/cpp/android-cpp-genrules.md:22 +#: src/android/interoperability/cpp/android-cpp-genrules.md:13 src/android/interoperability/cpp/android-cpp-genrules.md:22 #: src/android/interoperability/cpp/android-build-rust.md:8 msgid "\"lib.rs\"" msgstr "" @@ -13636,20 +13036,18 @@ msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:29 msgid "" -"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " -"bridge module. It is included in Android and available as a Soong tool." +"The `cxxbridge` tool is a standalone tool that generates the C++ side of the bridge module. It is included in Android and available " +"as a Soong tool." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:31 msgid "" -"By convention, if your Rust source file is `lib.rs` your header file will be " -"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " -"convention isn't enforced, though." +"By convention, if your Rust source file is `lib.rs` your header file will be named `lib.rs.h` and your source file will be named " +"`lib.rs.cc`. This naming convention isn't enforced, though." msgstr "" #: src/android/interoperability/cpp/android-build-rust.md:3 -msgid "" -"Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." +msgid "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" #: src/android/interoperability/cpp/android-build-rust.md:7 @@ -13666,9 +13064,8 @@ msgstr "" #: src/android/interoperability/java.md:3 msgid "" -"Java can load shared objects via [Java Native Interface (JNI)](https://en." -"wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" -"jni/) allows you to create a compatible library." +"Java can load shared objects via [Java Native Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface). The [`jni` " +"crate](https://docs.rs/jni/) allows you to create a compatible library." msgstr "" #: src/android/interoperability/java.md:8 @@ -13695,18 +13092,15 @@ msgstr "" msgid "\"Hello, {input}!\"" msgstr "" -#: src/android/interoperability/java.md:33 -#: src/android/interoperability/java.md:63 +#: src/android/interoperability/java.md:33 src/android/interoperability/java.md:63 msgid "_interoperability/java/Android.bp_:" msgstr "" -#: src/android/interoperability/java.md:37 -#: src/android/interoperability/java.md:70 +#: src/android/interoperability/java.md:37 src/android/interoperability/java.md:70 msgid "\"libhello_jni\"" msgstr "" -#: src/android/interoperability/java.md:38 -#: src/android/interoperability/java.md:53 +#: src/android/interoperability/java.md:38 src/android/interoperability/java.md:53 msgid "\"hello_jni\"" msgstr "" @@ -13742,8 +13136,7 @@ msgstr "" #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with and try to integrate some Rust into it. Some suggestions:" msgstr "" #: src/exercises/android/morning.md @@ -13756,8 +13149,8 @@ msgstr "" #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone in the class having a piece of code which you can turn " +"in to Rust on the fly." msgstr "" #: src/chromium.md @@ -13766,36 +13159,30 @@ msgstr "" #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party " -"glue code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party glue code to connect between Rust and existing Chromium C+" +"+ code." msgstr "" #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've " -"got a corner of the code where you're displaying a UTF8 string to the user, " -"feel free to follow this recipe in your part of the codebase instead of the " -"exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've got a corner of the code where you're displaying a UTF8 " +"string to the user, feel free to follow this recipe in your part of the codebase instead of the exact part we talk about." msgstr "" #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build " -"flags is OK, so long as your code is relatively recent (commit position " -"1223636 onwards, corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build flags is OK, so long as your code is relatively recent " +"(commit position 1223636 onwards, corresponding to November 2023):" msgstr "" #: src/chromium/setup.md -msgid "" -"(A component, debug build is recommended for quickest iteration time. This " -"is the default!)" +msgid "(A component, debug build is recommended for quickest iteration time. This is the default!)" msgstr "" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" -"the-code/) if you aren't already at that point. Be warned: setting up to " -"build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-code/) if you aren't already at that point. Be " +"warned: setting up to build Chromium takes time." msgstr "" #: src/chromium/setup.md @@ -13808,17 +13195,14 @@ msgstr "" #: src/chromium/setup.md msgid "" -"This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. " -"If you don't have time to complete a certain part, don't worry: you can " -"catch up in the next slot." +"This part of the course has a series of exercises which build on each other. We'll be doing them spread throughout the course " +"instead of just at the end. If you don't have time to complete a certain part, don't worry: you can catch up in the next slot." msgstr "" #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io]" -"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " -"set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io](https://crates.io/). Chromium is built using `gn` and " +"`ninja` and a curated set of dependencies." msgstr "" #: src/chromium/cargo.md @@ -13827,29 +13211,24 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." -"gni` (e.g. `rust_static_library` that we'll meet later). This uses " -"Chromium's audited toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e.g. `rust_static_library` that we'll meet later). " +"This uses Chromium's audited toolchain and crates." msgstr "" #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " -"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates](https://chromium.googlesource.com/chromium/src/+/" +"refs/heads/main/docs/rust.md#Using-cargo)" msgstr "" #: src/chromium/cargo.md -msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " -"downloaded from the internet](https://crates.io/)" +msgid "Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded from the internet](https://crates.io/)" msgstr "" #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " -"code can be built into the Chromium browser. At the same time, Cargo is an " -"important part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code can be built into the Chromium browser. At the " +"same time, Cargo is an important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" #: src/chromium/cargo.md @@ -13862,64 +13241,48 @@ msgid "Split into small groups and:" msgstr "" #: src/chromium/cargo.md -msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the " -"risk profile of these scenarios." +msgid "Brainstorm scenarios where `cargo` may offer an advantage and assess the risk profile of these scenarios." msgstr "" #: src/chromium/cargo.md -msgid "" -"Discuss which tools, libraries, and groups of people need to be trusted when " -"using `gn` and `ninja`, offline `cargo`, etc." +msgid "Discuss which tools, libraries, and groups of people need to be trusted when using `gn` and `ninja`, offline `cargo`, etc." msgstr "" #: src/chromium/cargo.md msgid "" -"Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them " -"to discuss in small groups of 3-4 people." +"Ask students to avoid peeking at the speaker notes before completing the exercise. Assuming folks taking the course are physically " +"together, ask them to discuss in small groups of 3-4 people." msgstr "" #: src/chromium/cargo.md -msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where " -"Cargo may offer an advantage\"):" +msgid "Notes/hints related to the first part of the exercise (\"scenarios where Cargo may offer an advantage\"):" msgstr "" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, " -"one has access to the rich ecosystem of crates.io libraries. There is a " -"crate for almost anything and they are usually quite pleasant to use. " -"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" -"from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, one has access to the rich ecosystem of crates.io " +"libraries. There is a crate for almost anything and they are usually quite pleasant to use. (`clap` for command-line parsing, " +"`serde` for serializing/deserializing to/from various formats, `itertools` for working with iterators, etc.)." msgstr "" #: src/chromium/cargo.md -msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo." -"toml` and start writing code)" +msgid "`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` and start writing code)" msgstr "" #: src/chromium/cargo.md -msgid "" -"It may be worth comparing how CPAN helped make `perl` a popular choice. Or " -"comparing with `python` + `pip`." +msgid "It may be worth comparing how CPAN helped make `perl` a popular choice. Or comparing with `python` + `pip`." msgstr "" #: src/chromium/cargo.md msgid "" -"Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate " -"that needs to work on nightly, current stable, and older stable) but also by " -"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a " -"streamlined way to run benchmarks)." +"Development experience is made really nice not only by core Rust tools (e.g. using `rustup` to switch to a different `rustc` version " +"when testing a crate that needs to work on nightly, current stable, and older stable) but also by an ecosystem of third-party tools " +"(e.g. Mozilla provides `cargo vet` for streamlining and sharing security audits; `criterion` crate gives a streamlined way to run " +"benchmarks)." msgstr "" #: src/chromium/cargo.md -msgid "" -"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" #: src/chromium/cargo.md @@ -13927,25 +13290,20 @@ msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" #: src/chromium/cargo.md -msgid "" -"Broad, generic examples of projects where `cargo` may be the right choice:" +msgid "Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " -"for writing command line tools. The breadth and ergonomics of libraries is " -"comparable to Python, while being more robust (thanks to the rich " -"typesystem) and running faster (as a compiled, rather than interpreted " -"language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for writing command line tools. The breadth and " +"ergonomics of libraries is comparable to Python, while being more robust (thanks to the rich typesystem) and running faster (as a " +"compiled, rather than interpreted language)." msgstr "" #: src/chromium/cargo.md msgid "" -"Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be " -"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " -"should probably use Cargo." +"Participating in the Rust ecosystem requires using standard Rust tools like Cargo. Libraries that want to get external " +"contributions, and want to be used outside of Chromium (e.g. in Bazel or Android/Soong build environments) should probably use Cargo." msgstr "" #: src/chromium/cargo.md @@ -13953,9 +13311,7 @@ msgid "Examples of Chromium-related projects that are `cargo`\\-based:" msgstr "" #: src/chromium/cargo.md -msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which " -"resulted in PRs with performance improvements)" +msgid "`serde_json_lenient` (experimented with in other parts of Google which resulted in PRs with performance improvements)" msgstr "" #: src/chromium/cargo.md @@ -13964,41 +13320,36 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` " -"for command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` for command-line parsing and on `toml` for configuration " +"files." msgstr "" #: src/chromium/cargo.md msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " -"when building and bootstrapping Rust standard library when building Rust " -"toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when building and bootstrapping Rust standard library when " +"building Rust toolchain." msgstr "" #: src/chromium/cargo.md msgid "" -"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " -"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " -"`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" +"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on third-party libraries downloaded from the internet, but " +"`run_gnrt.py` asks `cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" #: src/chromium/cargo.md -msgid "" -"Students may identify the following items as being implicitly or explicitly " -"trusted:" +msgid "Students may identify the following items as being implicitly or explicitly trusted:" msgstr "" #: src/chromium/cargo.md msgid "" -"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the " -"Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " -"compiler team), binary Rust compiler downloaded for bootstrapping" +"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the Clang compiler, the `rustc` sources (fetched from " +"GitHub, reviewed by Rust compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" #: src/chromium/cargo.md msgid "" -"`rustup` (it may be worth pointing out that `rustup` is developed under the " -"umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" +"`rustup` (it may be worth pointing out that `rustup` is developed under the umbrella of the https://github.com/rust-lang/ " +"organization - same as `rustc`)" msgstr "" #: src/chromium/cargo.md @@ -14007,8 +13358,7 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for " -"distributing the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" #: src/chromium/cargo.md @@ -14016,9 +13366,7 @@ msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." msgstr "" #: src/chromium/cargo.md -msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by " -"security@chromium.org)" +msgid "Rust libraries vendored into `//third_party/rust` (audited by security@chromium.org)" msgstr "" #: src/chromium/cargo.md @@ -14031,58 +13379,45 @@ msgstr "" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as approved by Chromium's [Area Tech Leads](https://source." +"chromium.org/chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"Chromium's policy on third party libraries is outlined [here](https://chromium.googlesource.com/chromium/src/+/main/docs/" +"adding_to_third_party.md#rust) - Rust is allowed for third party libraries under various circumstances, including if they're the " +"best option for performance or for security." msgstr "" #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"Very few Rust libraries directly expose a C/C++ API, so that means that nearly all such libraries will require a small amount of " +"first-party glue code." msgstr "" #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" -": \"C++\" : : \"wrapper\" " -"crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" +": \"C++\" : : \"wrapper\" crate :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should normally be kept in `third_party/rust///" +"wrapper`." msgstr "" #: src/chromium/policy.md @@ -14108,9 +13443,8 @@ msgstr "قوانین ساخت" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and " -"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " -"is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` for efficiency --- its static rules allow maximum " +"parallelism. Rust is no exception." msgstr "" #: src/chromium/build-rules.md @@ -14118,8 +13452,7 @@ msgid "Adding Rust code to Chromium" msgstr "" #: src/chromium/build-rules.md -msgid "" -"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" msgstr "" #: src/chromium/build-rules.md @@ -14135,33 +13468,27 @@ msgid "" msgstr "" #: src/chromium/build-rules.md -msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to " -"depend upon third party code." +msgid "You can also add `deps` on other Rust targets. Later we'll use this to depend upon third party code." msgstr "" #: src/chromium/build-rules.md msgid "" -"You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root " -"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " -"list of all source files which `ninja` needs in order to determine when " -"rebuilds are necessary." +"You must specify _both_ the crate root, _and_ a full list of sources. The `crate_root` is the file given to the Rust compiler " +"representing the root file of the compilation unit --- typically `lib.rs`. `sources` is a complete list of all source files which " +"`ninja` needs in order to determine when rebuilds are necessary." msgstr "" #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire " -"crate is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate is a compilation unit. A `static_library` is the " +"smallest unit.)" msgstr "" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using " -"[gn's built-in support for Rust static libraries](https://gn.googlesource." -"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " -"this template provides support for CXX interop, Rust features, and unit " -"tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using [gn's built-in support for Rust static libraries](https://" +"gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library). The answer is that this template provides support for CXX " +"interop, Rust features, and unit tests, some of which we'll use later." msgstr "" #: src/chromium/build-rules/unsafe.md:1 @@ -14170,10 +13497,8 @@ msgstr "" #: src/chromium/build-rules/unsafe.md:3 msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " -"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " -"the gn target. (Later in the course we'll see circumstances where this is " -"necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't compile. If you need unsafe Rust code, add " +"`allow_unsafe = true` to the gn target. (Later in the course we'll see circumstances where this is necessary.)" msgstr "" #: src/chromium/build-rules/unsafe.md:7 @@ -14215,20 +13540,16 @@ msgstr "" #: src/chromium/build-rules/vscode.md:3 msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than " -"for C++. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than for C++. Visual Studio code works well for Rust in " +"Chromium. To use it," msgstr "" #: src/chromium/build-rules/vscode.md:6 -msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " -"Rust support" +msgid "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust support" msgstr "" #: src/chromium/build-rules/vscode.md:8 -msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output " -"directory)" +msgid "`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" msgstr "" #: src/chromium/build-rules/vscode.md:10 @@ -14237,14 +13558,14 @@ msgstr "" #: src/chromium/build-rules/vscode.md:16 msgid "" -"A demo of some of the code annotation and exploration features of rust-" -"analyzer might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-analyzer might be beneficial if the audience are naturally " +"skeptical of IDEs." msgstr "" #: src/chromium/build-rules/vscode.md:19 msgid "" -"The following steps may help with the demo (but feel free to instead use a " -"piece of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a piece of Chromium-related Rust that you are most familiar " +"with):" msgstr "" #: src/chromium/build-rules/vscode.md:22 @@ -14252,41 +13573,33 @@ msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" #: src/chromium/build-rules/vscode.md:23 -msgid "" -"Place the cursor over the `QrCode::new` call (around line 26) in " -"\\`qr_code_generator_ffi_glue.rs" +msgid "Place the cursor over the `QrCode::new` call (around line 26) in \\`qr_code_generator_ffi_glue.rs" msgstr "" #: src/chromium/build-rules/vscode.md:25 -msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " -"K)." +msgid "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." msgstr "" #: src/chromium/build-rules/vscode.md:27 msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " -"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This will take you to `//third_party/rust/.../" +"qr_code-.../src/lib.rs`.)" msgstr "" #: src/chromium/build-rules/vscode.md:29 msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " -"164; the outline is in the file explorer pane in vscode; typical vim/CoC " -"bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; the outline is in the file explorer pane in " +"vscode; typical vim/CoC bindings = space o)" msgstr "" #: src/chromium/build-rules/vscode.md:32 -msgid "" -"Demo **type annotations** (there are quite a few nice examples in the " -"`QrCode::with_bits` method)" +msgid "Demo **type annotations** (there are quite a few nice examples in the `QrCode::with_bits` method)" msgstr "" #: src/chromium/build-rules/vscode.md:35 msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will " -"need to be rerun after editing `BUILD.gn` files (which we will do a few " -"times throughout the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will need to be rerun after editing `BUILD.gn` files (which we " +"will do a few times throughout the exercises in this session)." msgstr "" #: src/exercises/chromium/build-rules.md:1 @@ -14295,182 +13608,146 @@ msgid "Build rules exercise" msgstr "قوانین ساخت" #: src/exercises/chromium/build-rules.md:3 -msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " -"containing:" +msgid "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" msgstr "" #: src/exercises/chromium/build-rules.md:13 msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " -"target." +"**Important**: note that `no_mangle` here is considered a type of unsafety by the Rust compiler, so you'll need to allow unsafe code " +"in your `gn` target." msgstr "" #: src/exercises/chromium/build-rules.md:16 msgid "" -"Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " -"see how this can be automated by bindings generation tools):" +"Add this new Rust target as a dependency of `//ui/base:base`. Declare this function at the top of `ui/base/resource/resource_bundle." +"cc` (later, we'll see how this can be automated by bindings generation tools):" msgstr "" #: src/exercises/chromium/build-rules.md:24 msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " -"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " -"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " -"times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we suggest the top of `ResourceBundle::" +"MaybeMangleLocalizedString`. Build and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." msgstr "" #: src/exercises/chromium/build-rules.md:28 msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " -"in subsequent exercises. If you've succeeded, you will be able to use right-" -"click \"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in subsequent exercises. If you've succeeded, you will " +"be able to use right-click \"Go to definition\" on `println!`." msgstr "" -#: src/exercises/chromium/build-rules.md:32 -#: src/exercises/chromium/interoperability-with-cpp.md:48 +#: src/exercises/chromium/build-rules.md:32 src/exercises/chromium/interoperability-with-cpp.md:48 msgid "Where to find help" msgstr "" #: src/exercises/chromium/build-rules.md:34 msgid "" -"The options available to the [`rust_static_library` gn template](https://" -"source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"The options available to the [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" "rust_static_library.gni;l=16)" msgstr "" #: src/exercises/chromium/build-rules.md:35 -msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +msgid "Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-no_mangle-attribute)" msgstr "" #: src/exercises/chromium/build-rules.md:36 -msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." -"extern.html)" +msgid "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" msgstr "" #: src/exercises/chromium/build-rules.md:37 msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" #: src/exercises/chromium/build-rules.md:38 -msgid "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" -"languages/rust)" +msgid "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" msgstr "" #: src/exercises/chromium/build-rules.md:44 msgid "" -"This example is unusual because it boils down to the lowest-common-" -"denominator interop language, C. Both C++ and Rust can natively declare and " -"call C ABI functions. Later in the course, we'll connect C++ directly to " -"Rust." +"This example is unusual because it boils down to the lowest-common-denominator interop language, C. Both C++ and Rust can natively " +"declare and call C ABI functions. Later in the course, we'll connect C++ directly to Rust." msgstr "" #: src/exercises/chromium/build-rules.md:48 msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to generate two functions with the same name, and " +"Rust can no longer guarantee that the right one is called." msgstr "" #: src/exercises/chromium/build-rules.md:52 -msgid "" -"If you need a pure Rust executable, you can also do that using the " -"`rust_executable` gn template." +msgid "If you need a pure Rust executable, you can also do that using the `rust_executable` gn template." msgstr "" #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same " -"source file as the code being tested. This was covered [earlier](../testing." -"md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same source file as the code being tested. This was covered " +"[earlier](../testing.md) in the course and looks like this:" msgstr "" #: src/chromium/testing.md msgid "" -"In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable " -"and helps to avoid rebuilding `.rs` files a second time (in the `test` " -"configuration)." +"In Chromium we place unit tests in a separate source file and we continue to follow this practice for Rust --- this makes tests " +"consistently discoverable and helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." msgstr "" #: src/chromium/testing.md -msgid "" -"This results in the following options for testing Rust code in Chromium:" +msgid "This results in the following options for testing Rust code in Chromium:" msgstr "" #: src/chromium/testing.md -msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" -"rust`." +msgid "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." msgstr "" #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " -"when Rust code is just a thin FFI layer and the existing unit tests provide " -"sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when Rust code is just a thin FFI layer and the existing " +"unit tests provide sufficient coverage for the feature." msgstr "" #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its " -"public API (using `pub mod for_testing { ... }` if needed). This is the " -"subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its public API (using `pub mod for_testing { ... }` if " +"needed). This is the subject of the next few slides." msgstr "" #: src/chromium/testing.md msgid "" -"Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after " -"adding or updating third-party crates.)" +"Mention that native Rust tests of third-party crates should eventually be exercised by Chromium bots. (Such testing is needed rarely " +"--- only after adding or updating third-party crates.)" msgstr "" #: src/chromium/testing.md -msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " -"used:" +msgid "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" msgstr "" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a " -"thin FFI glue) and therefore uses the existing C++ unit tests for testing " -"both the C++ and the Rust implementation (parameterizing the tests so they " -"enable or disable Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a thin FFI glue) and therefore uses the existing C++ unit " +"tests for testing both the C++ and the Rust implementation (parameterizing the tests so they enable or disable Rust using a " +"`ScopedFeatureList`)." msgstr "" #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe " -"implementation of pixel transformations that are provided by `libpng` but " -"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " -"functionality may benefit from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe implementation of pixel transformations that are provided by " +"`libpng` but missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit from separate tests " +"authored in Rust." msgstr "" #: src/chromium/testing/rust-gtest-interop.md:3 msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/rust_gtest_interop/README.md) library " +"provides a way to:" msgstr "" #: src/chromium/testing/rust-gtest-interop.md:5 -msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " -"attribute)" +msgid "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" msgstr "" #: src/chromium/testing/rust-gtest-interop.md:7 msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " -"panicking and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking and not terminating the test when the assertion " +"fails)." msgstr "" #: src/chromium/testing/rust-gtest-interop.md:10 @@ -14480,8 +13757,8 @@ msgstr "مثال" #: src/chromium/testing/build-gn.md:3 msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing " -"test binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing test binary that already contains tests authored in C++. " +"For example:" msgstr "" #: src/chromium/testing/build-gn.md:6 @@ -14497,8 +13774,8 @@ msgstr "" #: src/chromium/testing/build-gn.md:14 msgid "" -"Authoring Rust tests in a separate `static_library` also works, but requires " -"manually declaring the dependency on the support libraries:" +"Authoring Rust tests in a separate `static_library` also works, but requires manually declaring the dependency on the support " +"libraries:" msgstr "" #: src/chromium/testing/build-gn.md:17 @@ -14524,12 +13801,10 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md:3 msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " -"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " -"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " -"computed based on the full target path and name. Fortunately we can avoid " -"working with such an unwieldy name by using the `chromium::import!` macro " -"from the automatically-imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. " +"We haven't provided an explicit `crate_name` for `my_rust_lib` so its crate name is computed based on the full target path and name. " +"Fortunately we can avoid working with such an unwieldy name by using the `chromium::import!` macro from the automatically-imported " +"`chromium` crate:" msgstr "" #: src/chromium/testing/chromium-import-macro.md:12 @@ -14542,19 +13817,16 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md:26 msgid "" -"More information can be found in [the doc comment](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" -"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" #: src/chromium/testing/chromium-import-macro.md:31 msgid "" -"`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the " -"crate name has to be globally unique. crates.io guarantees uniqueness of its " -"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " -"covered in a later section) use short crate names." +"`rust_static_library` supports specifying an explicit name via `crate_name` property, but doing this is discouraged. And it is " +"discouraged because the crate name has to be globally unique. crates.io guarantees uniqueness of its crate names so `cargo_crate` GN " +"targets (generated by the `gnrt` tool covered in a later section) use short crate names." msgstr "" #: src/exercises/chromium/testing.md:1 @@ -14572,9 +13844,8 @@ msgstr "" #: src/exercises/chromium/testing.md:7 msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding " -"two integers received as arguments, computing the nth Fibonacci number, " -"summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding two integers received as arguments, computing the nth " +"Fibonacci number, summing integers in a slice, etc." msgstr "" #: src/exercises/chromium/testing.md:10 @@ -14591,45 +13862,36 @@ msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new " -"tools being developed all the time. At the moment, Chromium uses a tool " -"called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new tools being developed all the time. At the moment, " +"Chromium uses a tool called CXX." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition " -"language (which looks a lot like Rust) and then CXX tools generate " -"declarations for functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition language (which looks a lot like Rust) and then CXX tools " +"generate declarations for functions and types in both Rust and C++." msgstr "" #: src/chromium/interoperability-with-cpp.md -msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " -"using this." +msgid "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using this." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just " -"the same as you previously did. Point out that automating the process has " -"the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just the same as you previously did. Point out that " +"automating the process has the following benefits:" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " -"definitions, but with out-of-sync manual bindings you'd get Undefined " -"Behavior)" +"The tool guarantees that the C++ and Rust sides match (e.g. you get compile errors if the `#[cxx::bridge]` doesn't match the actual " +"C++ or Rust definitions, but with out-of-sync manual bindings you'd get Undefined Behavior)" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " -"methods; manual bindings would require authoring such top-level, free " -"functions manually)" +"The tool automates generation of FFI thunks (small, C-ABI-compatible, free functions) for non-C features (e.g. enabling FFI calls " +"into Rust or C++ methods; manual bindings would require authoring such top-level, free functions manually)" msgstr "" #: src/chromium/interoperability-with-cpp.md @@ -14638,33 +13900,25 @@ msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't " -"guarantee any particular ABI or memory layout. With manual bindings `std::" -"span` / `&[T]` have to be manually destructured and rebuilt out of a " -"pointer and length - this is error-prone given that each language represents " -"empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee any particular ABI or memory layout. With manual " +"bindings `std::span` / `&[T]` have to be manually destructured and rebuilt out of a pointer and length - this is error-prone " +"given that each language represents empty slices slightly differently)" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " -"are natively supported. With manual bindings, one would have to pass C-ABI-" -"compatible raw pointers, which would increase lifetime and memory-safety " -"risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are natively supported. With manual bindings, one would " +"have to pass C-ABI-compatible raw pointers, which would increase lifetime and memory-safety risks." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can " -"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" -"terminate a string)." +"`rust::String` and `CxxString` types understand and maintain differences in string representation across the languages (e.g. `rust::" +"String::lossy` can build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a string)." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:3 -msgid "" -"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " -"modules inside `.rs` source code." +msgid "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` modules inside `.rs` source code." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:16 @@ -14681,10 +13935,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:32 msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " -"procedural macro does complex things to it. The generated code is quite a " -"bit more sophisticated - though this does still result in a `mod` called " -"`ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural macro does complex things to it. The generated code " +"is quite a bit more sophisticated - though this does still result in a `mod` called `ffi` in your code." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:36 @@ -14706,16 +13958,12 @@ msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:41 msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by " -"Rust, but this is misleading. This header is never interpreted by Rust, but " -"simply `#include`d in the generated C++ code for the benefit of C++ " -"compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, but this is misleading. This header is never " +"interpreted by Rust, but simply `#include`d in the generated C++ code for the benefit of C++ compilers." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:3 -msgid "" -"By far the most useful page when using CXX is the [type reference](https://" -"cxx.rs/bindings.html)." +msgid "By far the most useful page when using CXX is the [type reference](https://cxx.rs/bindings.html)." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:5 @@ -14723,41 +13971,30 @@ msgid "CXX fundamentally suits cases where:" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:7 -msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of " -"it." +msgid "Your Rust-C++ interface is sufficiently simple that you can declare all of it." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:8 -msgid "" -"You're using only the types natively supported by CXX already, for example " -"`std::unique_ptr`, `std::string`, `&[u8]` etc." +msgid "You're using only the types natively supported by CXX already, for example `std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:11 -msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` " -"type." +msgid "It has many limitations --- for example lack of support for Rust's `Option` type." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:14 msgid "" -"These limitations constrain us to using Rust in Chromium only for well " -"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " -"considering a use-case for Rust in Chromium, a good starting point is to " -"draft the CXX bindings for the language boundary to see if it appears simple " -"enough." +"These limitations constrain us to using Rust in Chromium only for well isolated \"leaf nodes\" rather than for arbitrary Rust-C++ " +"interop. When considering a use-case for Rust in Chromium, a good starting point is to draft the CXX bindings for the language " +"boundary to see if it appears simple enough." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:26 -msgid "" -"You should also discuss some of the other sticky points with CXX, for " -"example:" +msgid "You should also discuss some of the other sticky points with CXX, for example:" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:28 -msgid "" -"Its error handling is based around C++ exceptions (given on the next slide)" +msgid "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:29 @@ -14766,8 +14003,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:3 msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " -"on C++ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C++ exceptions, so we can't use that in Chromium. " +"Alternatives:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:6 @@ -14776,8 +14013,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:7 msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " -"be passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be passed across the FFI boundary - for example `T` has " +"to be:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:9 @@ -14786,15 +14023,14 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:10 msgid "" -"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " -"default value to use in a failure case (_unlike_ `Box`)." +"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable default value to use in a failure case (_unlike_ " +"`Box`)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:12 msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed " -"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " -"cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed when `T` is a Rust type, which cannot be passed across the " +"FFI boundary, and cannot be stored in `UniquePtr`." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:16 @@ -14802,15 +14038,11 @@ msgid "The `E` part of `Result` can be:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:17 -msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` " -"representing failure)" +msgid "Returned as a boolean (e.g. `true` representing success, and `false` representing failure)" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:19 -msgid "" -"Preserving error details is in theory possible, but so far hasn't been " -"needed in practice." +msgid "Preserving error details is in theory possible, but so far hasn't been needed in practice." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:1 @@ -14819,11 +14051,9 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:3 msgid "" -"The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." -"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " -"used to communicate success vs failure, and where the successful result can " -"be passed across the FFI boundary:" +"The QR code generator is [an example](https://source.chromium.org/chromium/chromium/src/+/main:components/qr_code_generator/" +"qr_code_generator_ffi_glue.rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to communicate success " +"vs failure, and where the successful result can be passed across the FFI boundary:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:8 @@ -14832,25 +14062,21 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:23 msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. " -"This is not the size of the vector, but the size of the QR code (and " -"admittedly it is a bit redundant - this is the square root of the size of " -"the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. This is not the size of the vector, but the size of the QR " +"code (and admittedly it is a bit redundant - this is the square root of the size of the vector)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:27 msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` " -"before calling into the Rust function. Creation of a Rust reference that " -"points to uninitialized memory results in Undefined Behavior (unlike in C++, " -"when only the act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` before calling into the Rust function. Creation of a Rust " +"reference that points to uninitialized memory results in Undefined Behavior (unlike in C++, when only the act of dereferencing such " +"memory results in UB)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:32 msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable " -"references to C++ data: the answer is that C++ data can’t be moved around " -"like Rust data, because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable references to C++ data: the answer is that C++ data can’t be " +"moved around like Rust data, because it may contain self-referential pointers." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:1 @@ -14858,9 +14084,7 @@ msgid "CXX Error Handling: PNG Example" msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md:3 -msgid "" -"A prototype of a PNG decoder illustrates what can be done when the " -"successful result cannot be passed across the FFI boundary:" +msgid "A prototype of a PNG decoder illustrates what can be done when the successful result cannot be passed across the FFI boundary:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:7 @@ -14883,20 +14107,15 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:32 msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " -"types cannot cross the FFI boundary without indirection of a `Box`. We " -"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " -"to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types cannot cross the FFI boundary without indirection of a " +"`Box`. We can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust objects by value." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:37 msgid "" -"This example illustrates that even though CXX doesn't support arbitrary " -"generics nor templates, we can still pass them across the FFI boundary by " -"manually specializing / monomorphizing them into a non-generic type. In the " -"example `ResultOfPngReader` is a non-generic type that forwards into " -"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " -"`as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary generics nor templates, we can still pass them across the " +"FFI boundary by manually specializing / monomorphizing them into a non-generic type. In the example `ResultOfPngReader` is a non-" +"generic type that forwards into appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:1 @@ -14905,9 +14124,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:3 msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" -"node where we want to use Rust. You'd typically have one for each " -"`rust_static_library`. Just add" +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node where we want to use Rust. You'd typically have one " +"for each `rust_static_library`. Just add" msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:7 @@ -14920,9 +14138,7 @@ msgid "" msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:13 -msgid "" -"to your existing `rust_static_library` target alongside `crate_root` and " -"`sources`." +msgid "to your existing `rust_static_library` target alongside `crate_root` and `sources`." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:16 @@ -14935,10 +14151,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:22 msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium " -"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" -"l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium C++ types to CXX Rust types --- for example " +"[`SpanToRustSlice`](https://source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:27 @@ -14947,21 +14161,16 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:29 msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " -"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " -"to memory, and compromise the safety of Rust's own data layouts. Presence of " -"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " -"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " -"binary can cause unexpected behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. Calling back and forth to C/C++ from Rust may do " +"arbitrary things to memory, and compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` keywords in C/C++ " +"interop can harm the signal-to-noise ratio of such a keyword, and is [controversial](https://steveklabnik.com/writing/the-cxx-" +"debate), but strictly, bringing any foreign code into a Rust binary can cause unexpected behavior from Rust's perspective." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:36 msgid "" -"The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " -"`unsafe` and `extern \"C\"` functions just like we did manually in the " -"previous section." +"The narrow answer lies in the diagram at the top of [this page](../interoperability-with-cpp.md) --- behind the scenes, CXX " +"generates Rust `unsafe` and `extern \"C\"` functions just like we did manually in the previous section." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:1 @@ -14975,15 +14184,14 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:5 msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which " -"specifies a single function, to be called from C++, called " +"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:8 msgid "" -"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " -"`#[no_mangle]`. This is now just a standard Rust function." +"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and `#[no_mangle]`. This is now just a standard Rust " +"function." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:10 @@ -14991,9 +14199,7 @@ msgid "Modify your `gn` target to build these bindings." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:11 -msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. " -"Instead, include the generated header file." +msgid "In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, include the generated header file." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:13 @@ -15005,9 +14211,7 @@ msgid "Part two" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:17 -msgid "" -"It's a good idea to play with CXX a little. It helps you think about how " -"flexible Rust in Chromium actually is." +msgid "It's a good idea to play with CXX a little. It helps you think about how flexible Rust in Chromium actually is." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:20 @@ -15021,21 +14225,18 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:23 msgid "" -"An additional header file which you can `include!` from your `cxx::bridge`. " -"You'll need to declare your C++ function in that new header file." +"An additional header file which you can `include!` from your `cxx::bridge`. You'll need to declare your C++ function in that new " +"header file." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:25 msgid "" -"An `unsafe` block to call such a function, or alternatively specify the " -"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" -"extern-c++.html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the `unsafe` keyword in your `#[cxx::bridge]` [as described here]" +"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 -msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +msgid "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -15047,27 +14248,19 @@ msgid "Pass a reference to a C++ object into Rust." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:31 -msgid "" -"Intentionally get the Rust function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." +msgid "Intentionally get the Rust function signatures mismatched from the `#[cxx::bridge]`, and get used to the errors you see." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:33 -msgid "" -"Intentionally get the C++ function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." +msgid "Intentionally get the C++ function signatures mismatched from the `#[cxx::bridge]`, and get used to the errors you see." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:35 -msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " -"own some C++ object." +msgid "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own some C++ object." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:37 -msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " -"need a `Box`)." +msgid "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a `Box`)." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:39 @@ -15084,9 +14277,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:44 msgid "" -"Now you understand the strengths and limitations of CXX interop, think of a " -"couple of use-cases for Rust in Chromium where the interface would be " -"sufficiently simple. Sketch how you might define that interface." +"Now you understand the strengths and limitations of CXX interop, think of a couple of use-cases for Rust in Chromium where the " +"interface would be sufficiently simple. Sketch how you might define that interface." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:50 @@ -15095,8 +14287,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:51 msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"The [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" +"l=16)" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:57 @@ -15105,24 +14297,21 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:59 msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X " -"and Y are both function types. This is because your C++ function doesn't " -"quite match the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X and Y are both function types. This is because your C++ " +"function doesn't quite match the declaration in your `cxx::bridge`." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:62 msgid "" -"I seem to be able to freely convert C++ references into Rust references. " -"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" -"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " -"CXX's design makes it quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. Doesn't that risk UB? For CXX's _opaque_ types, no, because " +"they are zero-sized. For CXX trivial types yes, it's _possible_ to cause UB, although CXX's design makes it quite difficult to craft " +"such an example." msgstr "" #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://crates.io). It's _very easy_ for Rust crates to depend " +"upon one another. So they do!" msgstr "" #: src/chromium/adding-third-party-crates.md @@ -15177,15 +14366,11 @@ msgid "For a Chromium engineer, this has pros and cons:" msgstr "" #: src/chromium/adding-third-party-crates.md -msgid "" -"All crates use a common build system so we can automate their inclusion into " -"Chromium..." +msgid "All crates use a common build system so we can automate their inclusion into Chromium..." msgstr "" #: src/chromium/adding-third-party-crates.md -msgid "" -"... but, crates typically have transitive dependencies, so you will likely " -"have to bring in multiple libraries." +msgid "... but, crates typically have transitive dependencies, so you will likely have to bring in multiple libraries." msgstr "" #: src/chromium/adding-third-party-crates.md @@ -15210,10 +14395,8 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. These are managed through a single [`Cargo.toml`](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 @@ -15229,29 +14412,24 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." +"As with any other `Cargo.toml`, you can specify [more details about the dependencies](https://doc.rust-lang.org/cargo/reference/" +"specifying-dependencies.html) --- most commonly, you'll want to specify the `features` that you wish to enable in the crate." msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 msgid "" -"When adding a crate to Chromium, you'll often need to provide some extra " -"information in an additional file, `gnrt_config.toml`, which we'll meet next." +"When adding a crate to Chromium, you'll often need to provide some extra information in an additional file, `gnrt_config.toml`, " +"which we'll meet next." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml). This contains Chromium-specific extensions to crate handling." +"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/gnrt_config.toml). This contains Chromium-specific extensions to crate handling." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 -msgid "" -"If you add a new crate, you should specify at least the `group`. This is one " -"of:" +msgid "If you add a new crate, you should specify at least the `group`. This is one of:" msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 @@ -15261,20 +14439,15 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 msgid "" -"Depending on the crate source code layout, you may also need to use this " -"file to specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this file to specify where its `LICENSE` file(s) can be found." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 -msgid "" -"Later, we'll see some other things you will need to configure in this file " -"to resolve problems." +msgid "Later, we'll see some other things you will need to configure in this file to resolve problems." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:3 -msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD." -"gn` rules." +msgid "A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` rules." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:6 @@ -15283,10 +14456,8 @@ msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:13 msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running " -"this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." +"Although the `gnrt` tool is part of the Chromium source code, by running this command you will be downloading and running its " +"dependencies from `crates.io`. See [the earlier section](../cargo.md) discussing this security decision." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:17 @@ -15303,21 +14474,17 @@ msgid "Direct and transitive dependencies" msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:21 -msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete " -"set of crates required by Chromium." +msgid "New versions of other crates, as required by `cargo` to resolve the complete set of crates required by Chromium." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:24 msgid "" -"Chromium maintains patches for some crates, kept in `//third_party/rust/" -"chromium_crates_io/patches`. These will be reapplied automatically, but if " -"patching fails you may need to take manual action." +"Chromium maintains patches for some crates, kept in `//third_party/rust/chromium_crates_io/patches`. These will be reapplied " +"automatically, but if patching fails you may need to take manual action." msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 -msgid "" -"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 @@ -15325,15 +14492,11 @@ msgid "Now run `git status`. You should find:" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 -msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/" -"vendor`" +msgid "At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 -msgid "" -"At least one new `BUILD.gn` in `third_party/rust//v`" +msgid "At least one new `BUILD.gn` in `third_party/rust//v`" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 @@ -15342,36 +14505,28 @@ msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 #, fuzzy -msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." -msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " -"مراجعه کنید." +msgid "The \"major semver version\" is a [Rust \"semver\" version number](https://doc.rust-lang.org/cargo/reference/semver.html)." +msgstr "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 -msgid "" -"Take a close look, especially at the things generated in `third_party/rust`." +msgid "Take a close look, especially at the things generated in `third_party/rust`." msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 msgid "" -"Talk a little about semver --- and specifically the way that in Chromium " -"it's to allow multiple incompatible versions of a crate, which is " -"discouraged but sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium it's to allow multiple incompatible versions of a crate, " +"which is discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:3 msgid "" -"If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the " -"design of `gn` and `ninja` which aim for static, deterministic, build rules " -"to maximize parallelism and repeatability of builds." +"If your build fails, it may be because of a `build.rs`: programs which do arbitrary things at build time. This is fundamentally at " +"odds with the design of `gn` and `ninja` which aim for static, deterministic, build rules to maximize parallelism and repeatability " +"of builds." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:8 -msgid "" -"Some `build.rs` actions are automatically supported; others require action:" +msgid "Some `build.rs` actions are automatically supported; others require action:" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:10 @@ -15390,14 +14545,12 @@ msgstr "" msgid "Checking rustc version to configure features on and off" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 src/chromium/adding-third-party-crates/resolving-problems.md:13 #: src/chromium/adding-third-party-crates/resolving-problems.md:14 msgid "Yes" msgstr "بلی" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 src/chromium/adding-third-party-crates/resolving-problems.md:13 msgid "None" msgstr "" @@ -15418,13 +14571,11 @@ msgstr "" msgid "Building C/C++" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 -#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "No" msgstr "خیر" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 -#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Patch around it" msgstr "" @@ -15433,24 +14584,18 @@ msgid "Arbitrary other actions" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:18 -msgid "" -"Fortunately, most crates don't contain a build script, and fortunately, most " -"build scripts only do the top two actions." +msgid "Fortunately, most crates don't contain a build script, and fortunately, most build scripts only do the top two actions." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:3 -msgid "" -"If `ninja` complains about missing files, check the `build.rs` to see if it " -"writes source code files." +msgid "If `ninja` complains about missing files, check the `build.rs` to see if it writes source code files." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:6 msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " -"add `build-script-outputs` to the crate. If this is a transitive dependency, " -"that is, one on which Chromium code should not directly depend, also add " -"`allow-first-party-usage=false`. There are several examples already in that " -"file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add `build-script-outputs` to the crate. If this is a " +"transitive dependency, that is, one on which Chromium code should not directly depend, also add `allow-first-party-usage=false`. " +"There are several examples already in that file:" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:11 @@ -15464,18 +14609,15 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:17 msgid "" -"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input " -"to subsequent build steps." +"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate `BUILD.gn` files to inform ninja that this particular " +"output file is input to subsequent build steps." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:3 msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " -"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" -"crates.io/crates/bindgen) within their build scripts. These actions can't be " -"supported in a Chromium context --- our gn, ninja and LLVM build system is " -"very specific in expressing relationships between build actions." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/C++ libraries. Other crates parse C/C++ using " +"[`bindgen`](https://crates.io/crates/bindgen) within their build scripts. These actions can't be supported in a Chromium context --- " +"our gn, ninja and LLVM build system is very specific in expressing relationships between build actions." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:8 @@ -15492,18 +14634,15 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:13 msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" -"` - see for example the [patches against the `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - and will be applied automatically by " -"`gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - see for example the [patches against the `cxx` " +"crate](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - and will be " +"applied automatically by `gnrt` each time it upgrades the crate." msgstr "" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:3 msgid "" -"Once you've added a third-party crate and generated build rules, depending " -"on a crate is simple. Find your `rust_static_library` target, and add a " -"`dep` on the `:lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending on a crate is simple. Find your `rust_static_library` " +"target, and add a `dep` on the `:lib` target within your crate." msgstr "" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:7 @@ -15514,8 +14653,7 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -15537,31 +14675,24 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:3 msgid "" -"Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Third_party-review), but of course also subject to security review. As " -"you may be bringing in not just a single crate but also transitive " -"dependencies, there may be a lot of code to review. On the other hand, safe " -"Rust code can have limited negative side effects. How should you review it?" +"Adding new libraries is subject to Chromium's standard [policies](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" +"docs/rust.md#Third_party-review), but of course also subject to security review. As you may be bringing in not just a single crate " +"but also transitive dependencies, there may be a lot of code to review. On the other hand, safe Rust code can have limited negative " +"side effects. How should you review it?" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:9 -msgid "" -"Over time Chromium aims to move to a process based around [cargo vet]" -"(https://mozilla.github.io/cargo-vet/)." +msgid "Over time Chromium aims to move to a process based around [cargo vet](https://mozilla.github.io/cargo-vet/)." msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:11 -msgid "" -"Meanwhile, for each new crate addition, we are checking for the following:" +msgid "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:13 msgid "" -"Understand why each crate is used. What's the relationship between crates? " -"If the build system for each crate contains a `build.rs` or procedural " -"macros, work out what they're for. Are they compatible with the way Chromium " -"is normally built?" +"Understand why each crate is used. What's the relationship between crates? If the build system for each crate contains a `build.rs` " +"or procedural macros, work out what they're for. Are they compatible with the way Chromium is normally built?" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:17 @@ -15570,17 +14701,14 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:18 msgid "" -"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " -"vulnerabilities (first you'll need to `cargo install cargo-audit`, which " -"ironically involves downloading lots of dependencies from the internet[2](../" -"cargo.md))" +"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known vulnerabilities (first you'll need to `cargo install " +"cargo-audit`, which ironically involves downloading lots of dependencies from the internet[2](../cargo.md))" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:21 msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." -"md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium.googlesource.com/chromium/src/+/main/docs/security/" +"rule-of-2.md#unsafe-code-in-safe-languages)" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:22 @@ -15589,15 +14717,14 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:23 msgid "" -"Read all the code at a sufficient level to look for anything out of place " -"that might have been maliciously inserted. (You can't realistically aim for " -"100% perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place that might have been maliciously inserted. (You can't " +"realistically aim for 100% perfection here: there's often just too much code.)" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:27 msgid "" -"These are just guidelines --- work with reviewers from `security@chromium." -"org` to work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium.org` to work out the right way to become confident of the " +"crate." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:1 @@ -15613,9 +14740,7 @@ msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:6 -msgid "" -"Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" -"`" +msgid "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//`" msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:9 @@ -15623,48 +14748,38 @@ msgid "Please also add an `OWNERS` file in the latter location." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:11 -msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config." -"toml` changes, into the Chromium repo." +msgid "You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into the Chromium repo." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:14 -msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` " -"files may result in some files being skipped." +msgid "**Important**: you need to use `git add -f` because otherwise `.gitignore` files may result in some files being skipped." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:17 msgid "" -"As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git " -"branches, and many projects still use non-inclusive terminology there. So " -"you may need to run:" +"As you do so, you might find presubmit checks fail because of non-inclusive language. This is because Rust crate data tends to " +"include names of git branches, and many projects still use non-inclusive terminology there. So you may need to run:" msgstr "" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md:3 msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to " -"keep it up to date with any security fixes](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " -"hoped that we will soon automate this for Rust crates, but for now, it's " -"still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to keep it up to date with any security fixes](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will soon automate this " +"for Rust crates, but for now, it's still your responsibility just as it is for any other third party dependency." msgstr "" #: src/exercises/chromium/third-party.md:3 msgid "" -"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/" -"features.html#the-default-feature). Assume that the crate will be used in " -"shipping Chromium, but won't be used to handle untrustworthy input." +"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the crate's [default features](https://doc.rust-lang.org/" +"cargo/reference/features.html#the-default-feature). Assume that the crate will be used in shipping Chromium, but won't be used to " +"handle untrustworthy input." msgstr "" #: src/exercises/chromium/third-party.md:7 msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " -"ahead and do that now if you like. Or, you could create a new " -"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead and do that now if you like. Or, you could create " +"a new [`rust_executable` target](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_executable.gni) which uses " +"`uwuify`)." msgstr "" #: src/exercises/chromium/third-party.md:13 @@ -15708,14 +14823,11 @@ msgid "`uwuify`." msgstr "" #: src/exercises/chromium/third-party.md:26 -msgid "" -"If students are downloading even more than that, they probably forgot to " -"turn off the default features." +msgid "If students are downloading even more than that, they probably forgot to turn off the default features." msgstr "" #: src/exercises/chromium/third-party.md:29 -msgid "" -"Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" +msgid "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -15723,9 +14835,7 @@ msgid "Bringing It Together --- Exercise" msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"In this exercise, you're going to add a whole new Chromium feature, bringing " -"together everything you already learned." +msgid "In this exercise, you're going to add a whole new Chromium feature, bringing together everything you already learned." msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -15734,34 +14844,26 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. " -"It's important that we get Chromium for Pixies delivered to them as soon as " -"possible." +"A community of pixies has been discovered living in a remote rainforest. It's important that we get Chromium for Pixies delivered to " +"them as soon as possible." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie " -"language." +msgid "The requirement is to translate all Chromium's UI strings into Pixie language." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie " -"language is very close to English, and it turns out there's a Rust crate " -"which does the translation." +"There's not time to wait for proper translations, but fortunately pixie language is very close to English, and it turns out there's " +"a Rust crate which does the translation." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"In fact, you already [imported that crate in the previous exercise](https://" -"crates.io/crates/uwuify)." +msgid "In fact, you already [imported that crate in the previous exercise](https://crates.io/crates/uwuify)." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"(Obviously, real translations of Chrome require incredible care and " -"diligence. Don't ship this!)" +msgid "(Obviously, real translations of Chrome require incredible care and diligence. Don't ship this!)" msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -15770,61 +14872,49 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always " -"do this irrespective of the setting of `mangle_localized_strings_`." +"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all strings before display. In this special build of " +"Chromium, it should always do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"If you've done everything right across all these exercises, congratulations, " -"you should have created Chrome for pixies!" +msgid "If you've done everything right across all these exercises, congratulations, you should have created Chrome for pixies!" msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " -"and will probably decide that it's better to do the conversion on the C++ " -"side using `base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and will probably decide that it's better to do the " +"conversion on the C++ side using `base::UTF16ToUTF8` and back again." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"If students decide to do the conversion on the Rust side, they'll need to " -"consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which " -"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" -"slice.html)." +"If students decide to do the conversion on the Rust side, they'll need to consider [`String::from_utf16`](https://doc.rust-lang.org/" +"std/string/struct.String.html#method.from_utf16), consider error handling, and consider which [CXX supported types can transfer a " +"lot of u16s](https://cxx.rs/binding/slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. " -"taking and returning strings by value, or taking a mutable reference to a " -"string. If a mutable reference is used, CXX will likely tell the student " -"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " -"need to explain what `Pin` does, and then explain why CXX needs it for " -"mutable references to C++ data: the answer is that C++ data can't be moved " -"around like Rust data, because it may contain self-referential pointers." +"Students may design the C++/Rust boundary in several different ways, e.g. taking and returning strings by value, or taking a mutable " +"reference to a string. If a mutable reference is used, CXX will likely tell the student that they need to use [`Pin`](https://doc." +"rust-lang.org/std/pin/). You may need to explain what `Pin` does, and then explain why CXX needs it for mutable references to C++ " +"data: the answer is that C++ data can't be moved around like Rust data, because it may contain self-referential pointers." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " -"need to depend on a `rust_static_library` target. The student probably " -"already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need to depend on a `rust_static_library` target. The " +"student probably already did this." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "" -"The `rust_static_library` target will need to depend on `//third_party/rust/" -"uwuify/v0_2:lib`." +msgid "The `rust_static_library` target will need to depend on `//third_party/rust/uwuify/v0_2:lib`." msgstr "" #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs]" -"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs](https://chromium-review.googlesource.com/c/chromium/src/" +"+/5096560)." msgstr "" #: src/bare-metal.md @@ -15833,16 +14923,14 @@ msgstr "" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people " -"who are familiar with the basics of Rust (perhaps from completing the " -"Comprehensive Rust course), and ideally also have some experience with bare-" -"metal programming in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people who are familiar with the basics of Rust (perhaps from " +"completing the Comprehensive Rust course), and ideally also have some experience with bare-metal programming in some other language " +"such as C." msgstr "" #: src/bare-metal.md msgid "" -"Today we will talk about 'bare-metal' Rust: running Rust code without an OS " -"underneath us. This will be divided into several parts:" +"Today we will talk about 'bare-metal' Rust: running Rust code without an OS underneath us. This will be divided into several parts:" msgstr "" #: src/bare-metal.md @@ -15863,21 +14951,17 @@ msgstr "" #: src/bare-metal.md msgid "" -"For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " -"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " -"an on-board SWD debugger." +"For the microcontroller part of the course we will use the [BBC micro:bit](https://microbit.org/) v2 as an example. It's a " +"[development board](https://tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some LEDs and buttons, an " +"I2C-connected accelerometer and compass, and an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "" -"To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" #: src/bare-metal.md -msgid "" -"And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md:33 @@ -16001,22 +15085,18 @@ msgid "It can also be provided by another crate, such as `panic-halt`." msgstr "" #: src/bare-metal/minimal.md:22 -msgid "" -"Depending on the target, you may need to compile with `panic = \"abort\"` to " -"avoid an error about `eh_personality`." +msgid "Depending on the target, you may need to compile with `panic = \"abort\"` to avoid an error about `eh_personality`." msgstr "" #: src/bare-metal/minimal.md:24 msgid "" -"Note that there is no `main` or any other entry point; it's up to you to " -"define your own entry point. This will typically involve a linker script and " -"some assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to define your own entry point. This will typically involve a " +"linker script and some assembly code to set things up ready for Rust code to run." msgstr "" #: src/bare-metal/alloc.md:3 msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc." -"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" #: src/bare-metal/alloc.md:23 @@ -16038,28 +15118,24 @@ msgstr "String" #: src/bare-metal/alloc.md:37 msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy system allocator. Other crates are available, or you can " +"write your own or hook into your existing allocator." msgstr "" #: src/bare-metal/alloc.md:40 msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " -"in this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in this case it can allocate regions of up to 2\\*\\*32 " +"bytes." msgstr "" #: src/bare-metal/alloc.md:42 msgid "" -"If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in " -"the top-level binary crate." +"If any crate in your dependency tree depends on `alloc` then you must have exactly one global allocator defined in your binary. " +"Usually this is done in the top-level binary crate." msgstr "" #: src/bare-metal/alloc.md:45 -msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " -"crate is linked in so we get its panic handler." +msgid "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in so we get its panic handler." msgstr "" #: src/bare-metal/alloc.md:47 @@ -16067,21 +15143,17 @@ msgid "This example will build but not run, as it doesn't have an entry point." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for " -"Cortex M microcontrollers." +msgid "The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex M microcontrollers." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "" -"Next we'll look at how to access peripherals, with increasing levels of " -"abstraction." +msgid "Next we'll look at how to access peripherals, with increasing levels of abstraction." msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" -"> !`, because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, because returning to the reset handler doesn't make " +"sense." msgstr "" #: src/bare-metal/microcontrollers.md @@ -16089,9 +15161,7 @@ msgid "Run the example with `cargo embed --bin minimal`" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:3 -msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try " -"turning on an LED on our micro:bit:" +msgid "Most microcontrollers access peripherals via memory-mapped IO. Let's try turning on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:16 @@ -16106,34 +15176,25 @@ msgstr "" msgid "// PIN_CNF fields\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:34 -#: src/bare-metal/microcontrollers/pacs.md:21 -#: src/bare-metal/microcontrollers/hals.md:26 +#: src/bare-metal/microcontrollers/mmio.md:34 src/bare-metal/microcontrollers/pacs.md:21 src/bare-metal/microcontrollers/hals.md:26 msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:37 -#: src/bare-metal/microcontrollers/mmio.md:59 +#: src/bare-metal/microcontrollers/mmio.md:37 src/bare-metal/microcontrollers/mmio.md:59 msgid "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:56 -#: src/bare-metal/microcontrollers/pacs.md:39 -#: src/bare-metal/microcontrollers/hals.md:30 +#: src/bare-metal/microcontrollers/mmio.md:56 src/bare-metal/microcontrollers/pacs.md:39 src/bare-metal/microcontrollers/hals.md:30 msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:72 -msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " -"to the first row." +msgid "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:75 -#: src/bare-metal/microcontrollers/pacs.md:61 -#: src/bare-metal/microcontrollers/hals.md:44 +#: src/bare-metal/microcontrollers/mmio.md:75 src/bare-metal/microcontrollers/pacs.md:61 src/bare-metal/microcontrollers/hals.md:44 #: src/bare-metal/microcontrollers/board-support.md:37 msgid "Run the example with:" msgstr "" @@ -16144,28 +15205,23 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md:3 msgid "" -"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" -"pack/doc/CMSIS/SVD/html/index.html) files." +"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust wrappers for memory-mapped peripherals from [CMSIS-SVD]" +"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:49 msgid "" -"SVD (System View Description) files are XML files typically provided by " -"silicon vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by silicon vendors which describe the memory map of the device." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:51 -msgid "" -"They are organised by peripheral, register, field and value, with names, " -"descriptions, addresses and so on." +msgid "They are organised by peripheral, register, field and value, with names, descriptions, addresses and so on." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:53 msgid "" -"SVD files are often buggy and incomplete, so there are various projects " -"which patch the mistakes, add missing details, and publish the generated " -"crates." +"SVD files are often buggy and incomplete, so there are various projects which patch the mistakes, add missing details, and publish " +"the generated crates." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:56 @@ -16174,8 +15230,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md:57 msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " -"pac -- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac -- -d --no-show-raw-insn` to see the resulting " +"binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md:1 @@ -16184,10 +15240,8 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md:3 msgid "" -"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around " -"various peripherals. These generally implement traits from [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal)." +"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-implementation-crates) for many microcontrollers provide " +"wrappers around various peripherals. These generally implement traits from [`embedded-hal`](https://crates.io/crates/embedded-hal)." msgstr "" #: src/bare-metal/microcontrollers/hals.md:23 @@ -16195,14 +15249,12 @@ msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "" #: src/bare-metal/microcontrollers/hals.md:40 -msgid "" -"`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." +msgid "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" #: src/bare-metal/microcontrollers/hals.md:41 msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various " -"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:1 @@ -16210,21 +15262,15 @@ msgid "Board support crates" msgstr "" #: src/bare-metal/microcontrollers/board-support.md:3 -msgid "" -"Board support crates provide a further level of wrapping for a specific " -"board for convenience." +msgid "Board support crates provide a further level of wrapping for a specific board for convenience." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:31 -msgid "" -"In this case the board support crate is just providing more useful names, " -"and a bit of initialisation." +msgid "In this case the board support crate is just providing more useful names, and a bit of initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:33 -msgid "" -"The crate may also include drivers for some on-board devices outside of the " -"microcontroller itself." +msgid "The crate may also include drivers for some on-board devices outside of the microcontroller itself." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:35 @@ -16245,29 +15291,23 @@ msgstr "" #: src/bare-metal/microcontrollers/type-state.md:33 msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can " -"exist. Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. Once a pin is moved out of the port struct nobody " +"else can take it." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:35 -msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you " -"can’t keep use the old instance afterwards." +msgid "Changing the configuration of a pin consumes the old pin instance, so you can’t keep use the old instance afterwards." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:37 msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, " -"the configuration state of a GPIO pin. This encodes the state machine into " -"the type system, and ensures that you don't try to use a pin in a certain " -"way without properly configuring it first. Illegal state transitions are " -"caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, the configuration state of a GPIO pin. This encodes the " +"state machine into the type system, and ensures that you don't try to use a pin in a certain way without properly configuring it " +"first. Illegal state transitions are caught at compile time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:42 -msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but " -"not vice-versa." +msgid "You can call `is_high` on an input pin and `set_high` on an output pin, but not vice-versa." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:44 @@ -16276,8 +15316,8 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:3 msgid "" -"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " -"number of traits covering common microcontroller peripherals:" +"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a number of traits covering common microcontroller " +"peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:6 @@ -16298,54 +15338,43 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:11 msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " -"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" -"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" -"crates.io/crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out into [`embedded-io`](https://crates.io/crates/" +"embedded-io), [`embedded-can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/crates/rand_core) " +"respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:14 msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-embedded-rust#driver-crates) in terms of these " +"traits, e.g. an accelerometer driver might need an I2C or SPI device instance." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:19 msgid "" -"The traits cover using the peripherals but not initialising or configuring " -"them, as initialisation and configuration is usually highly platform-" -"specific." +"The traits cover using the peripherals but not initialising or configuring them, as initialisation and configuration is usually " +"highly platform-specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:21 -msgid "" -"There are implementations for many microcontrollers, as well as other " -"platforms such as Linux on Raspberry Pi." +msgid "There are implementations for many microcontrollers, as well as other platforms such as Linux on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:23 -msgid "" -"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " -"async versions of the traits." +msgid "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides async versions of the traits." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:24 msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " -"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" -"crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another approach to non-blocking I/O, based on the [`nb`]" +"(https://crates.io/crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:3 -msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " -"like OpenOCD but better integrated." +msgid "[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like OpenOCD but better integrated." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:6 -msgid "" -"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:7 @@ -16358,42 +15387,33 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:10 msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " -"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." -"toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real Time Transfers) output and connect GDB. It's " +"configured by an `Embed.toml` file in your project directory." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:16 msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " -"an Arm standard protocol over USB for an in-circuit debugger to access the " -"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " -"on-board debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm standard protocol over USB for an in-circuit " +"debugger to access the CoreSight Debug Access Port of various Arm Cortex processors. It's what the on-board debugger on the BBC " +"micro:bit uses." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:20 -msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " -"is a range from SEGGER." +msgid "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a range from SEGGER." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:22 -msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " -"Serial Wire Debug." +msgid "The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:24 -msgid "" -"probe-rs is a library which you can integrate into your own tools if you " -"want to." +msgid "probe-rs is a library which you can integrate into your own tools if you want to." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:26 msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" -"adapter-protocol/) lets VSCode and other IDEs debug code running on any " -"supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) lets VSCode and other IDEs debug code " +"running on any supported microcontroller." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:30 @@ -16402,8 +15422,7 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:31 msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " -"host and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host and the target through a number of ringbuffers." msgstr "" #: src/bare-metal/microcontrollers/debugging.md:3 @@ -16426,8 +15445,7 @@ msgstr "" msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:1 -#: src/bare-metal/aps/other-projects.md:1 +#: src/bare-metal/microcontrollers/other-projects.md:1 src/bare-metal/aps/other-projects.md:1 msgid "Other projects" msgstr "" @@ -16437,11 +15455,10 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:4 msgid "\"Real-Time Interrupt-driven Concurrency\"" -msgstr "" +msgstr "همزمانی وقفه‌گرا و بلادرنگ" #: src/bare-metal/microcontrollers/other-projects.md:5 -msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +msgid "Shared resource management, message passing, task scheduling, timer queue" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:6 @@ -16457,9 +15474,7 @@ msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:9 -msgid "" -"Security-focused RTOS with preemptive scheduling and Memory Protection Unit " -"support" +msgid "Security-focused RTOS with preemptive scheduling and Memory Protection Unit support" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:11 @@ -16467,9 +15482,7 @@ msgid "[Hubris](https://hubris.oxide.computer/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:12 -msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +msgid "Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:14 @@ -16478,8 +15491,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:15 msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." -"github.io/book/overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github.io/book/overview/using-the-standard-library.html)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:20 @@ -16491,9 +15503,7 @@ msgid "It doesn't include any HALs." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:22 -msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " -"scheduling rather than a proper kernel." +msgid "It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling rather than a proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:24 @@ -16501,35 +15511,25 @@ msgid "Cortex-M only." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:25 -msgid "" -"Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:26 -msgid "" -"FreeRTOS is mostly written in C, but there are Rust bindings for writing " -"applications." +msgid "FreeRTOS is mostly written in C, but there are Rust bindings for writing applications." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port." +msgid "We will read the direction from an I2C compass, and log the readings to a serial port." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"morning.md) provided." -msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " -"نگاه کنید." +msgid "After looking at the exercises, you can look at the [solutions](solutions-morning.md) provided." +msgstr "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه کنید." #: src/exercises/bare-metal/compass.md:3 msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port. If you have time, try displaying it on the LEDs somehow too, or " -"use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a serial port. If you have time, try displaying it on the " +"LEDs somehow too, or use the buttons somehow." msgstr "" #: src/exercises/bare-metal/compass.md:7 @@ -16538,46 +15538,39 @@ msgstr "" #: src/exercises/bare-metal/compass.md:9 msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" -"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" -"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." -"org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/" +"microbit-v2/latest/microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." msgstr "" #: src/exercises/bare-metal/compass.md:13 -msgid "" -"The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." +msgid "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" #: src/exercises/bare-metal/compass.md:14 -msgid "" -"TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" #: src/exercises/bare-metal/compass.md:15 msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" -"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" -"microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/" +"microbit-v2/latest/microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md:19 msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct.Board.html) struct with fields for the various " +"pins and peripherals." msgstr "" #: src/exercises/bare-metal/compass.md:22 msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " -"this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it " +"shouldn't be necessary for this exercise." msgstr "" #: src/exercises/bare-metal/compass.md:26 msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `compass` directory for the following files." msgstr "" #: src/exercises/bare-metal/compass.md:29 src/exercises/bare-metal/rtc.md:22 @@ -16601,8 +15594,7 @@ msgid "See the serial output on Linux with:" msgstr "" #: src/exercises/bare-metal/compass.md:130 -msgid "" -"Or on Mac OS something like (the device name may be slightly different):" +msgid "Or on Mac OS something like (the device name may be slightly different):" msgstr "" #: src/exercises/bare-metal/compass.md:138 @@ -16651,8 +15643,7 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md:120 msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" msgstr "" @@ -16662,29 +15653,24 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now let's try writing something for Cortex-A. For " +"simplicity we'll just work with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" -"Broadly speaking, microcontrollers don't have an MMU or multiple levels of " -"privilege (exception levels on Arm CPUs, rings on x86), while application " -"processors do." +"Broadly speaking, microcontrollers don't have an MMU or multiple levels of privilege (exception levels on Arm CPUs, rings on x86), " +"while application processors do." msgstr "" #: src/bare-metal/aps.md msgid "" -"QEMU supports emulating various different machines or board models for each " -"architecture. The 'virt' board doesn't correspond to any particular real " -"hardware, but is designed purely for virtual machines." +"QEMU supports emulating various different machines or board models for each architecture. The 'virt' board doesn't correspond to any " +"particular real hardware, but is designed purely for virtual machines." msgstr "" #: src/bare-metal/aps/entry-point.md:3 -msgid "" -"Before we can start running Rust code, we need to do some initialisation." +msgid "Before we can start running Rust code, we need to do some initialisation." msgstr "" #: src/bare-metal/aps/entry-point.md:5 @@ -16694,8 +15680,7 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -16714,8 +15699,7 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -16725,8 +15709,7 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -16764,70 +15747,52 @@ msgid "" msgstr "" #: src/bare-metal/aps/entry-point.md:77 -msgid "" -"This is the same as it would be for C: initialising the processor state, " -"zeroing the BSS, and setting up the stack pointer." +msgid "This is the same as it would be for C: initialising the processor state, zeroing the BSS, and setting up the stack pointer." msgstr "" #: src/bare-metal/aps/entry-point.md:79 msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the " -"object file which containing statically allocated variables which are " -"initialised to zero. They are omitted from the image, to avoid wasting space " -"on zeroes. The compiler assumes that the loader will take care of zeroing " -"them." +"The BSS (block starting symbol, for historical reasons) is the part of the object file which containing statically allocated " +"variables which are initialised to zero. They are omitted from the image, to avoid wasting space on zeroes. The compiler assumes " +"that the loader will take care of zeroing them." msgstr "" #: src/bare-metal/aps/entry-point.md:84 -msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and " -"the image is loaded, but we zero it to be sure." +msgid "The BSS may already be zeroed, depending on how memory is initialised and the image is loaded, but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md:86 -msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If " -"we don't:" +msgid "We need to enable the MMU and cache before reading or writing any memory. If we don't:" msgstr "" #: src/bare-metal/aps/entry-point.md:88 msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-" -"unknown-none` target which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses, so it should be fine in this case, but this " -"is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-none` target which sets `+strict-align` to prevent " +"the compiler generating unaligned accesses, so it should be fine in this case, but this is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md:92 msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost when the cache " -"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " -"not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The problem is that the VM is accessing memory directly with " +"the cache disabled, while the host has cacheable aliases to the same memory. Even if the host doesn't explicitly access the memory, " +"speculative accesses can lead to cache fills, and then changes from one or the other will get lost when the cache is cleaned or the " +"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md:99 msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " -"identity maps the first 1 GiB of address space for devices, the next 1 GiB " -"for DRAM, and another 1 GiB higher up for more devices. This matches the " -"memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity maps the first 1 GiB of address space for devices, " +"the next 1 GiB for DRAM, and another 1 GiB higher up for more devices. This matches the memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md:103 -msgid "" -"We also set up the exception vector (`vbar_el1`), which we'll see more about " -"later." +msgid "We also set up the exception vector (`vbar_el1`), which we'll see more about later." msgstr "" #: src/bare-metal/aps/entry-point.md:105 msgid "" -"All examples this afternoon assume we will be running at exception level 1 " -"(EL1). If you need to run at a different exception level you'll need to " -"modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 (EL1). If you need to run at a different exception level " +"you'll need to modify `entry.S` accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md:1 @@ -16836,9 +15801,8 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md:3 msgid "" -"Sometimes we need to use assembly to do things that aren't possible with " -"Rust code. For example, to make an HVC (hypervisor call) to tell the " -"firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with Rust code. For example, to make an HVC (hypervisor call) to " +"tell the firmware to power off the system:" msgstr "" #: src/bare-metal/aps/inline-assembly.md:20 @@ -16885,45 +15849,36 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md:40 msgid "" -"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" -"smccc) crate which has wrappers for all these functions.)" +"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/smccc) crate which has wrappers for all these " +"functions.)" msgstr "" #: src/bare-metal/aps/inline-assembly.md:45 msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of " -"functions to manage system and CPU power states, among other things. It is " -"implemented by EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of functions to manage system and CPU power states, among other " +"things. It is implemented by EL3 firmware and hypervisors on many systems." msgstr "" #: src/bare-metal/aps/inline-assembly.md:48 msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the " -"inline assembly code, and ignore its contents afterwards. We need to use " -"`inout` rather than `in` because the call could potentially clobber the " -"contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the inline assembly code, and ignore its contents afterwards. " +"We need to use `inout` rather than `in` because the call could potentially clobber the contents of the registers." msgstr "" #: src/bare-metal/aps/inline-assembly.md:52 -msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +msgid "This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is called from our entry point in `entry.S`." msgstr "" #: src/bare-metal/aps/inline-assembly.md:54 msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " -"used by the bootloader to pass things like a pointer to the device tree. " -"According to the standard aarch64 calling convention (which is what `extern " -"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " -"arguments passed to a function, so `entry.S` doesn't need to do anything " -"special except make sure it doesn't change these registers." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used by the bootloader to pass things like a pointer to " +"the device tree. According to the standard aarch64 calling convention (which is what `extern \"C\"` specifies to use), registers " +"`x0`–`x7` are used for the first 8 arguments passed to a function, so `entry.S` doesn't need to do anything special except make sure " +"it doesn't change these registers." msgstr "" #: src/bare-metal/aps/inline-assembly.md:60 -msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" -"examples`." +msgid "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." msgstr "" #: src/bare-metal/aps/mmio.md:1 @@ -16939,35 +15894,29 @@ msgid "Never hold a reference." msgstr "" #: src/bare-metal/aps/mmio.md:5 -msgid "" -"`addr_of!` lets you get fields of structs without creating an intermediate " -"reference." +msgid "`addr_of!` lets you get fields of structs without creating an intermediate reference." msgstr "" #: src/bare-metal/aps/mmio.md:10 msgid "" -"Volatile access: read or write operations may have side-effects, so prevent " -"the compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent the compiler or hardware from reordering, duplicating or " +"eliding them." msgstr "" #: src/bare-metal/aps/mmio.md:12 msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the " -"compiler may assume that the value read is the same as the value just " -"written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the compiler may assume that the value read is the same as the " +"value just written, and not bother actually reading memory." msgstr "" #: src/bare-metal/aps/mmio.md:15 msgid "" -"Some existing crates for volatile access to hardware do hold references, but " -"this is unsound. Whenever a reference exist, the compiler may choose to " -"dereference it." +"Some existing crates for volatile access to hardware do hold references, but this is unsound. Whenever a reference exist, the " +"compiler may choose to dereference it." msgstr "" #: src/bare-metal/aps/mmio.md:18 -msgid "" -"Use the `addr_of!` macro to get struct field pointers from a pointer to the " -"struct." +msgid "Use the `addr_of!` macro to get struct field pointers from a pointer to the struct." msgstr "" #: src/bare-metal/aps/uart.md:1 @@ -16976,8 +15925,7 @@ msgstr "" #: src/bare-metal/aps/uart.md:3 msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" -"documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" #: src/bare-metal/aps/uart.md:9 @@ -16991,10 +15939,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" @@ -17022,26 +15968,21 @@ msgstr "" #: src/bare-metal/aps/uart.md:55 msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is " -"because as long as the caller of `Uart::new` guarantees that its safety " -"requirements are met (i.e. that there is only ever one instance of the " -"driver for a given UART, and nothing else aliasing its address space), then " -"it is always safe to call `write_byte` later because we can assume the " -"necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is because as long as the caller of `Uart::new` guarantees " +"that its safety requirements are met (i.e. that there is only ever one instance of the driver for a given UART, and nothing else " +"aliasing its address space), then it is always safe to call `write_byte` later because we can assume the necessary preconditions." msgstr "" #: src/bare-metal/aps/uart.md:61 msgid "" -"We could have done it the other way around (making `new` safe but " -"`write_byte` unsafe), but that would be much less convenient to use as every " -"place that calls `write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but `write_byte` unsafe), but that would be much less convenient to " +"use as every place that calls `write_byte` would need to reason about the safety" msgstr "" #: src/bare-metal/aps/uart.md:64 msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving " -"the burden of proof for soundness from a large number of places to a smaller " -"number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving the burden of proof for soundness from a large number of " +"places to a smaller number of places." msgstr "" #: src/bare-metal/aps/uart/traits.md:1 @@ -17049,9 +15990,7 @@ msgid "More traits" msgstr "" #: src/bare-metal/aps/uart/traits.md:3 -msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more " -"traits too." +msgid "We derived the `Debug` trait. It would be useful to implement a few more traits too." msgstr "" #: src/bare-metal/aps/uart/traits.md:17 @@ -17061,15 +16000,11 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart/traits.md:25 -msgid "" -"Implementing `Write` lets us use the `write!` and `writeln!` macros with our " -"`Uart` type." +msgid "Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type." msgstr "" #: src/bare-metal/aps/uart/traits.md:27 -msgid "" -"Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" -"examples`." +msgid "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/examples`." msgstr "" #: src/bare-metal/aps/better-uart.md:1 @@ -17078,11 +16013,9 @@ msgstr "" #: src/bare-metal/aps/better-uart.md:3 msgid "" -"The PL011 actually has [a bunch more registers](https://developer.arm.com/" -"documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to " -"read. Plus, some of them are bit fields which would be nice to access in a " -"structured way." +"The PL011 actually has [a bunch more registers](https://developer.arm.com/documentation/ddi0183/g/programmers-model/summary-of-" +"registers), and adding offsets to construct pointers to access them is error-prone and hard to read. Plus, some of them are bit " +"fields which would be nice to access in a structured way." msgstr "" #: src/bare-metal/aps/better-uart.md:7 @@ -17201,8 +16134,8 @@ msgstr "" msgid "IMSC" msgstr "" -#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 -#: src/bare-metal/aps/better-uart.md:20 src/bare-metal/aps/better-uart.md:21 +#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 src/bare-metal/aps/better-uart.md:20 +#: src/bare-metal/aps/better-uart.md:21 msgid "11" msgstr "" @@ -17247,9 +16180,7 @@ msgid "There are also some ID registers which have been omitted for brevity." msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:3 -msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " -"working with bitflags." +msgid "The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working with bitflags." msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:10 @@ -17294,8 +16225,8 @@ msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:38 msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a bunch of method implementations to get and set " +"flags." msgstr "" #: src/bare-metal/aps/better-uart/registers.md:1 @@ -17303,17 +16234,14 @@ msgid "Multiple registers" msgstr "" #: src/bare-metal/aps/better-uart/registers.md:3 -msgid "" -"We can use a struct to represent the memory layout of the UART's registers." +msgid "We can use a struct to represent the memory layout of the UART's registers." msgstr "" #: src/bare-metal/aps/better-uart/registers.md:43 msgid "" -"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) tells the compiler to lay the struct fields out in order, " -"following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to " -"(among other things) reorder fields however it sees fit." +"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) tells the compiler to lay the struct " +"fields out in order, following the same rules as C. This is necessary for our struct to have a predictable layout, as default Rust " +"representation allows the compiler to (among other things) reorder fields however it sees fit." msgstr "" #: src/bare-metal/aps/better-uart/driver.md:3 @@ -17324,8 +16252,7 @@ msgstr "" msgid "/// Driver for a PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/better-uart/driver.md:30 -#: src/bare-metal/aps/better-uart/driver.md:56 +#: src/bare-metal/aps/better-uart/driver.md:30 src/bare-metal/aps/better-uart/driver.md:56 msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL011 device which is appropriately mapped.\n" @@ -17349,37 +16276,29 @@ msgstr "" #: src/bare-metal/aps/better-uart/driver.md:65 msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " -"fields without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields without creating an intermediate reference, which " +"would be unsound." msgstr "" -#: src/bare-metal/aps/better-uart/using.md:1 -#: src/bare-metal/aps/logging/using.md:1 +#: src/bare-metal/aps/better-uart/using.md:1 src/bare-metal/aps/logging/using.md:1 msgid "Using it" msgstr "" #: src/bare-metal/aps/better-uart/using.md:3 -msgid "" -"Let's write a small program using our driver to write to the serial console, " -"and echo incoming bytes." +msgid "Let's write a small program using our driver to write to the serial console, and echo incoming bytes." msgstr "" -#: src/bare-metal/aps/better-uart/using.md:19 -#: src/bare-metal/aps/logging/using.md:18 -#: src/exercises/bare-metal/solutions-afternoon.md:33 +#: src/bare-metal/aps/better-uart/using.md:19 src/bare-metal/aps/logging/using.md:18 src/exercises/bare-metal/solutions-afternoon.md:33 msgid "/// Base address of the primary PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:25 -#: src/bare-metal/aps/logging/using.md:24 -#: src/exercises/bare-metal/solutions-afternoon.md:44 +#: src/bare-metal/aps/better-uart/using.md:25 src/bare-metal/aps/logging/using.md:24 src/exercises/bare-metal/solutions-afternoon.md:44 msgid "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" " // nothing else accesses that address range.\n" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:29 -#: src/bare-metal/aps/logging/using.md:29 +#: src/bare-metal/aps/better-uart/using.md:29 src/bare-metal/aps/logging/using.md:29 msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgstr "" @@ -17387,10 +16306,9 @@ msgstr "" msgid "b'\\r'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:36 -#: src/concurrency/async-pitfalls/cancellation.md:27 +#: src/bare-metal/aps/better-uart/using.md:36 src/concurrency/async-pitfalls/cancellation.md:27 msgid "b'\\n'" -msgstr "" +msgstr "b'\\n'" #: src/bare-metal/aps/better-uart/using.md:38 msgid "b'q'" @@ -17402,21 +16320,18 @@ msgstr "" #: src/bare-metal/aps/better-uart/using.md:51 msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` function is called from our entry point code in `entry.S`. " +"See the speaker notes there for details." msgstr "" #: src/bare-metal/aps/better-uart/using.md:54 -msgid "" -"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +msgid "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" #: src/bare-metal/aps/logging.md:3 msgid "" -"It would be nice to be able to use the logging macros from the [`log`]" -"(https://crates.io/crates/log) crate. We can do this by implementing the " -"`Log` trait." +"It would be nice to be able to use the logging macros from the [`log`](https://crates.io/crates/log) crate. We can do this by " +"implementing the `Log` trait." msgstr "" #: src/bare-metal/aps/logging.md:26 @@ -17428,17 +16343,14 @@ msgid "/// Initialises UART logger.\n" msgstr "" #: src/bare-metal/aps/logging.md:48 -msgid "" -"The unwrap in `log` is safe because we initialise `LOGGER` before calling " -"`set_logger`." +msgid "The unwrap in `log` is safe because we initialise `LOGGER` before calling `set_logger`." msgstr "" #: src/bare-metal/aps/logging/using.md:3 msgid "We need to initialise the logger before we use it." msgstr "" -#: src/bare-metal/aps/logging/using.md:38 -#: src/exercises/bare-metal/solutions-afternoon.md:115 +#: src/bare-metal/aps/logging/using.md:38 src/exercises/bare-metal/solutions-afternoon.md:115 msgid "\"{info}\"" msgstr "" @@ -17447,18 +16359,14 @@ msgid "Note that our panic handler can now log details of panics." msgstr "" #: src/bare-metal/aps/logging/using.md:47 -msgid "" -"Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" -"examples`." +msgid "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/examples`." msgstr "" #: src/bare-metal/aps/exceptions.md:3 msgid "" -"AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " -"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " -"We implement this in assembly to save volatile registers to the stack before " -"calling into Rust code:" +"AArch64 defines an exception vector table with 16 entries, for 4 types of exceptions (synchronous, IRQ, FIQ, SError) from 4 states " +"(current EL with SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). We implement this in assembly to save " +"volatile registers to the stack before calling into Rust code:" msgstr "" #: src/bare-metal/aps/exceptions.md:67 @@ -17467,25 +16375,25 @@ msgstr "" #: src/bare-metal/aps/exceptions.md:68 msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current " -"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current EL exceptions, or between AArch32 and AArch64 for the " +"lower EL exceptions." msgstr "" #: src/bare-metal/aps/exceptions.md:70 -msgid "" -"For this example we just log the exception and power down, as we don't " -"expect any of them to actually happen." +msgid "For this example we just log the exception and power down, as we don't expect any of them to actually happen." msgstr "" #: src/bare-metal/aps/exceptions.md:72 msgid "" -"We can think of exception handlers and our main execution context more or " -"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." -"md) will control what we can share between them, just like with threads. For " -"example, if we want to share some value between exception handlers and the " -"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " -"it in something like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or less like different threads. [`Send` and `Sync`](../../" +"concurrency/send-sync.md) will control what we can share between them, just like with threads. For example, if we want to share some " +"value between exception handlers and the rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap it in " +"something like a `Mutex` and put it in a static." msgstr "" +"ما می‌توانیم در مورد exception handlers و execution context اصلی تا حدودی مثل thread‌های مختلف فکر کنیم." +"‏ [`Send` و `Sync`](../../concurrency/send-sync.md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم را کنترل خواهند کرد، درست مانند threadها." +"برای مثال، اگر می‌خواهیم مقداری را بین exception handlers و بقیه برنامه به اشتراک بگذاریم، این کار به کمک `Send` است اما با `Sync` ممکن نیست،" +"پس در نتیجه باید آن را در چیزی مانند `Mutex` بپیچیم و در یک حالت static قرار دهیم." #: src/bare-metal/aps/other-projects.md:3 msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -17504,21 +16412,15 @@ msgid "Relies on LinuxBoot rather than having many drivers itself." msgstr "" #: src/bare-metal/aps/other-projects.md:7 -msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +msgid "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" msgstr "" #: src/bare-metal/aps/other-projects.md:8 -msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +msgid "Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception handling, page tables" msgstr "" #: src/bare-metal/aps/other-projects.md:10 -msgid "" -"Some dodginess around cache maintenance and initialisation in Rust, not " -"necessarily a good example to copy for production code." +msgid "Some dodginess around cache maintenance and initialisation in Rust, not necessarily a good example to copy for production code." msgstr "" #: src/bare-metal/aps/other-projects.md:12 @@ -17531,27 +16433,22 @@ msgstr "" #: src/bare-metal/aps/other-projects.md:17 msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. This will read and write memory (e.g. the stack). " +"However:" msgstr "" #: src/bare-metal/aps/other-projects.md:19 msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-unknown-none` which sets `+strict-align` to " +"prevent the compiler generating unaligned accesses so it should be alright, but this is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/other-projects.md:23 msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." +"If it were running in a VM, this can lead to cache coherency issues. The problem is that the VM is accessing memory directly with " +"the cache disabled, while the host has cacheable aliases to the same memory. Even if the host doesn't explicitly access the memory, " +"speculative accesses can lead to cache fills, and then changes from one or the other will get lost. Again this is alright in this " +"particular case (running directly on the hardware with no hypervisor), but isn't a good pattern in general." msgstr "" #: src/bare-metal/useful-crates.md @@ -17559,55 +16456,47 @@ msgid "Useful crates" msgstr "جعبه‌های (crates) کاربردی" #: src/bare-metal/useful-crates.md -msgid "" -"We'll go over a few crates which solve some common problems in bare-metal " -"programming." +msgid "We'll go over a few crates which solve some common problems in bare-metal programming." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:3 msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " -"traits and macros for safely converting between byte sequences and other " -"types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits and macros for safely converting between byte " +"sequences and other types." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:42 msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " -"but can be useful for working with structures shared with hardware e.g. by " -"DMA, or sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but can be useful for working with structures shared " +"with hardware e.g. by DMA, or sent over some external interface." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:48 msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is " -"valid, and so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is valid, and so can safely be converted from an untrusted " +"sequence of bytes." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:50 msgid "" -"Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not " -"all byte patterns are valid." +"Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use all possible u32 values as " +"discriminants, so not all byte patterns are valid." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:53 -msgid "" -"`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:54 msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"zerocopy-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-example/`. (It won't run in the Playground because of " +"the crate dependency.)" msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:3 msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " -"you create page tables according to the AArch64 Virtual Memory System " -"Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you create page tables according to the AArch64 Virtual " +"Memory System Architecture." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:14 @@ -17623,34 +16512,26 @@ msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:28 -msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." +msgid "For now it only supports EL1, but support for other exception levels should be straightforward to add." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:30 msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android.com/android/platform/superproject/+/master:packages/" +"modules/Virtualization/pvmfw/)." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:31 -msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +msgid "There's no easy way to run this example, as it needs to run on real hardware or under QEMU." msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:3 msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a third-party crate implementing a basic buddy system " +"allocator. It can be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct." +"LockedHeap.html) implementing [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " +"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other address space. For example, we might want to " +"allocate MMIO space for PCI BARs:" msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:29 @@ -17659,42 +16540,33 @@ msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:30 msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"allocator-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-example/`. (It won't run in the Playground because of " +"the crate dependency.)" msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:3 msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without " -"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " -"this: a vector backed by an array or slice, which could be statically " -"allocated or on the stack, which keeps track of how many elements are used " -"and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without heap allocation. [`tinyvec`](https://crates.io/crates/" +"tinyvec) provides this: a vector backed by an array or slice, which could be statically allocated or on the stack, which keeps track " +"of how many elements are used and panics if you try to use more than are allocated." msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:25 -msgid "" -"`tinyvec` requires that the element type implement `Default` for " -"initialisation." +msgid "`tinyvec` requires that the element type implement `Default` for initialisation." msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:27 -msgid "" -"The Rust Playground includes `tinyvec`, so this example will run fine inline." +msgid "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" #: src/bare-metal/useful-crates/spin.md:3 msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " -"are not available in `core` or `alloc`. How can we manage synchronisation or " -"interior mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are not available in `core` or `alloc`. How can we " +"manage synchronisation or interior mutability, such as for sharing state between different CPUs?" msgstr "" #: src/bare-metal/useful-crates/spin.md:7 -msgid "" -"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " -"equivalents of many of these primitives." +msgid "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based equivalents of many of these primitives." msgstr "" #: src/bare-metal/useful-crates/spin.md:26 @@ -17703,28 +16575,25 @@ msgstr "" #: src/bare-metal/useful-crates/spin.md:27 msgid "" -"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " -"`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." +"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, `Barrier` and `Once` from `std::sync`; and `Lazy` for " +"lazy initialisation." msgstr "" #: src/bare-metal/useful-crates/spin.md:29 msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " -"useful types for late initialisation with a slightly different approach to " -"`spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful types for late initialisation with a slightly " +"different approach to `spin::once::Once`." msgstr "" #: src/bare-metal/useful-crates/spin.md:31 -msgid "" -"The Rust Playground includes `spin`, so this example will run fine inline." +msgid "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a " -"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " -"with a linker script to produce the binary itself, and then a `raw_binary` " -"to convert the ELF to a raw binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` Soong rule to build your Rust code, then a " +"`cc_binary` with a linker script to produce the binary itself, and then a `raw_binary` to convert the ELF to a raw binary ready to " +"be run." msgstr "" #: src/bare-metal/android/vmbase.md:1 @@ -17733,22 +16602,19 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md:3 msgid "" -"For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" -"master/vmbase/) library provides a linker script and useful defaults for the " -"build rules, along with an entry point, UART console logging and more." +"For VMs running under crosvm on aarch64, the [vmbase](https://android.googlesource.com/platform/packages/modules/Virtualization/+/" +"refs/heads/master/vmbase/) library provides a linker script and useful defaults for the build rules, along with an entry point, UART " +"console logging and more." msgstr "" #: src/bare-metal/android/vmbase.md:24 -msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` " -"entry point." +msgid "The `main!` macro marks your main function, to be called from the `vmbase` entry point." msgstr "" #: src/bare-metal/android/vmbase.md:26 msgid "" -"The `vmbase` entry point handles console initialisation, and issues a " -"PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." +"The `vmbase` entry point handles console initialisation, and issues a PSCI_SYSTEM_OFF to shutdown the VM if your main function " +"returns." msgstr "" #: src/exercises/bare-metal/afternoon.md @@ -17756,43 +16622,35 @@ msgid "We will write a driver for the PL031 real-time clock device." msgstr "" #: src/exercises/bare-metal/afternoon.md -msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"afternoon.md) provided." -msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " -"شده نگاهی بیندازید." +msgid "After looking at the exercises, you can look at the [solutions](solutions-afternoon.md) provided." +msgstr "پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md:1 -#: src/exercises/bare-metal/solutions-afternoon.md:3 +#: src/exercises/bare-metal/rtc.md:1 src/exercises/bare-metal/solutions-afternoon.md:3 msgid "RTC driver" msgstr "" #: src/exercises/bare-metal/rtc.md:3 msgid "" -"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " -"you should write a driver for it." +"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/documentation/ddi0224/c) real-time clock at 0x9010000. For " +"this exercise, you should write a driver for it." msgstr "" #: src/exercises/bare-metal/rtc.md:6 msgid "" -"Use it to print the current time to the serial console. You can use the " -"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the [`chrono`](https://crates.io/crates/chrono) crate for date/" +"time formatting." msgstr "" #: src/exercises/bare-metal/rtc.md:8 msgid "" -"Use the match register and raw interrupt status to busy-wait until a given " -"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" -"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given time, e.g. 3 seconds in the future. (Call [`core::hint::" +"spin_loop`](https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" #: src/exercises/bare-metal/rtc.md:11 msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by " -"the RTC match. You can use the driver provided in the [`arm-gic`](https://" -"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by the RTC match. You can use the driver provided in the " +"[`arm-gic`](https://docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" #: src/exercises/bare-metal/rtc.md:14 @@ -17801,20 +16659,17 @@ msgstr "" #: src/exercises/bare-metal/rtc.md:15 msgid "" -"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" -"wfi()`, which will cause the core to sleep until it receives an interrupt." +"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::wfi()`, which will cause the core to sleep until it " +"receives an interrupt." msgstr "" #: src/exercises/bare-metal/rtc.md:19 msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `rtc` directory for the following files." msgstr "" #: src/exercises/bare-metal/rtc.md:79 -msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " -"the exercise):" +msgid "_src/exceptions.rs_ (you should only need to change this for the 3rd part of the exercise):" msgstr "" #: src/exercises/bare-metal/rtc.md:156 @@ -17902,20 +16757,16 @@ msgstr "" msgid "// Wait for 3 seconds, without interrupts.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:73 -#: src/exercises/bare-metal/solutions-afternoon.md:91 +#: src/exercises/bare-metal/solutions-afternoon.md:73 src/exercises/bare-metal/solutions-afternoon.md:91 msgid "\"Waiting for {}\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:75 -#: src/exercises/bare-metal/solutions-afternoon.md:83 -#: src/exercises/bare-metal/solutions-afternoon.md:96 -#: src/exercises/bare-metal/solutions-afternoon.md:104 +#: src/exercises/bare-metal/solutions-afternoon.md:75 src/exercises/bare-metal/solutions-afternoon.md:83 +#: src/exercises/bare-metal/solutions-afternoon.md:96 src/exercises/bare-metal/solutions-afternoon.md:104 msgid "\"matched={}, interrupt_pending={}\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:87 -#: src/exercises/bare-metal/solutions-afternoon.md:108 +#: src/exercises/bare-metal/solutions-afternoon.md:87 src/exercises/bare-metal/solutions-afternoon.md:108 msgid "\"Finished waiting\"" msgstr "" @@ -17970,10 +16821,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" @@ -17981,12 +16830,9 @@ msgstr "" msgid "/// Reads the current RTC value.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:172 -#: src/exercises/bare-metal/solutions-afternoon.md:180 -#: src/exercises/bare-metal/solutions-afternoon.md:188 -#: src/exercises/bare-metal/solutions-afternoon.md:199 -#: src/exercises/bare-metal/solutions-afternoon.md:211 -#: src/exercises/bare-metal/solutions-afternoon.md:218 +#: src/exercises/bare-metal/solutions-afternoon.md:172 src/exercises/bare-metal/solutions-afternoon.md:180 +#: src/exercises/bare-metal/solutions-afternoon.md:188 src/exercises/bare-metal/solutions-afternoon.md:199 +#: src/exercises/bare-metal/solutions-afternoon.md:211 src/exercises/bare-metal/solutions-afternoon.md:218 msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL031 device which is appropriately mapped.\n" @@ -18000,8 +16846,7 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md:185 msgid "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" msgstr "" @@ -18017,8 +16862,7 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" msgstr "" @@ -18034,46 +16878,41 @@ msgstr "" #: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" -msgstr "" +msgstr "به مبحث Concurrency در Rust خوش‌آمدید " #: src/concurrency/welcome.md -msgid "" -"Rust has full support for concurrency using OS threads with mutexes and " -"channels." -msgstr "" +msgid "Rust has full support for concurrency using OS threads with mutexes and channels." +msgstr "زبان Rust به طور کامل از concurrency با استفاده از threadهای سیستم‌عامل به همراه mutexeها و channelها استفاده می‌کند." #: src/concurrency/welcome.md msgid "" -"The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since " -"you can rely on the compiler to ensure correctness at runtime." +"The Rust type system plays an important role in making many concurrency bugs compile time bugs. This is often referred to as " +"_fearless concurrency_ since you can rely on the compiler to ensure correctness at runtime." msgstr "" +"تایپ سیستم Rustنقش مهمی در تولید بسیاری از concurrency باگ‌ها در زمان کامپایل ایجاد می‌کند." +"این مورد اغلب به عنوان _fearless concurrency_ شناخته می‌شود؛ زیرا می‌توانید به کامپایلر به عنوان تصحیح‌کننده خطاهای زمان اجرا (runtime) حساب کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md -msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 20 " -"minutes. It contains:" -msgstr "" +msgid "Including 10 minute breaks, this session should take about 3 hours and 20 minutes. It contains:" +msgstr "با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. و شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "" -"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." -msgstr "" +msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgstr "‏Rust به ما این امکان را می‌دهد به concurrency toolkit سیستم‌عامل دسترسی پیدا کنیم: threadها، sync، primitives و غیره." #: src/concurrency/welcome.md -msgid "" -"The type system gives us safety for concurrency without any special features." -msgstr "" +msgid "The type system gives us safety for concurrency without any special features." +msgstr "این سیستم تایپ بدون هیچ ویژگی خاص دیگر، دسترسی امن به concurrency برای ما به ارمغان می‌آورد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e." -"g., a called function that might mutate an argument or save references to it " -"to read later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e.g., a called function that might mutate an argument or " +"save references to it to read later) save us from multi-threading issues." msgstr "" +"همان ابزارهایی که به دسترسی \"concurrent\" در یک thread تنها کمک می‌کنند (به عنوان مثال، یک تابع فراخوانی که ممکن است یک آرگومان را تغییر دهد" +"یا ارجاعات به آن را ذخیره کند تا در آینده آن را بخوانید) ما را از مشکلات استفاده از حالت چندین thread ای نجات می‌دهد." -#: src/concurrency/threads.md src/concurrency/shared-state.md -#: src/concurrency/async.md +#: src/concurrency/threads.md src/concurrency/shared-state.md src/concurrency/async.md msgid "This segment should take about 30 minutes. It contains:" msgstr "" @@ -18110,9 +16949,7 @@ msgid "Run the example." msgstr "" #: src/concurrency/threads/plain.md:34 -msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in " -"lockstep." +msgid "5ms timing is loose enough that main and spawned threads stay mostly in lockstep." msgstr "" #: src/concurrency/threads/plain.md:36 @@ -18120,9 +16957,7 @@ msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" #: src/concurrency/threads/plain.md:37 -msgid "" -"This is because main ends the program and spawned threads do not make it " -"persist." +msgid "This is because main ends the program and spawned threads do not make it persist." msgstr "" #: src/concurrency/threads/plain.md:39 @@ -18134,21 +16969,17 @@ msgid "How do we wait around for the spawned thread to complete?" msgstr "" #: src/concurrency/threads/plain.md:42 -msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. Look at the docs." +msgid "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. Look at the docs." msgstr "" #: src/concurrency/threads/plain.md:43 -msgid "" -"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) method that blocks." +msgid "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join) method that blocks." msgstr "" #: src/concurrency/threads/plain.md:45 msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the thread to finish and have the program count all the " +"way to 10." msgstr "" #: src/concurrency/threads/plain.md:48 @@ -18160,21 +16991,15 @@ msgid "Look at docs again:" msgstr "" #: src/concurrency/threads/plain.md:50 -msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +msgid "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" msgstr "" #: src/concurrency/threads/plain.md:51 -msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +msgid "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join) returns `thread::Result`" msgstr "" #: src/concurrency/threads/plain.md:53 -msgid "" -"Use the `Result` return value from `handle.join()` to get access to the " -"returned value." +msgid "Use the `Result` return value from `handle.join()` to get access to the returned value." msgstr "" #: src/concurrency/threads/plain.md:56 @@ -18186,9 +17011,7 @@ msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" #: src/concurrency/threads/plain.md:58 -msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://" -"doc.rust-lang.org/std/any/index.html)." +msgid "Access the panic payload. This is a good time to talk about [`Any`](https://doc.rust-lang.org/std/any/index.html)." msgstr "" #: src/concurrency/threads/plain.md:60 @@ -18212,9 +17035,7 @@ msgid "If we want to borrow?" msgstr "" #: src/concurrency/threads/plain.md:66 -msgid "" -"Main kills child threads when it returns, but another function would just " -"return and leave them running." +msgid "Main kills child threads when it returns, but another function would just return and leave them running." msgstr "" #: src/concurrency/threads/plain.md:68 @@ -18230,21 +17051,17 @@ msgid "Normal threads cannot borrow from their environment:" msgstr "" #: src/concurrency/threads/scoped.md:20 -msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" -"fn.scope.html) for this:" +msgid "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope.html) for this:" msgstr "" #: src/concurrency/threads/scoped.md:41 msgid "" -"The reason for that is that when the `thread::scope` function completes, all " -"the threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all the threads are guaranteed to be joined, so they can " +"return borrowed data." msgstr "" #: src/concurrency/threads/scoped.md:43 -msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one " -"thread, or immutably by any number of threads." +msgid "Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably by any number of threads." msgstr "" #: src/concurrency/channels.md src/concurrency/async-control-flow.md @@ -18253,75 +17070,67 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md:3 msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts are connected via the channel, but you only see the " +"end-points." msgstr "" -#: src/concurrency/channels/senders-receivers.md:15 -#: src/concurrency/channels/senders-receivers.md:16 +#: src/concurrency/channels/senders-receivers.md:15 src/concurrency/channels/senders-receivers.md:16 #: src/concurrency/channels/senders-receivers.md:20 msgid "\"Received: {:?}\"" msgstr "" #: src/concurrency/channels/senders-receivers.md:27 msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` (so you can make multiple producers) " +"but `Receiver` does not." msgstr "" #: src/concurrency/channels/senders-receivers.md:30 msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the " -"counterpart `Sender` or `Receiver` is dropped and the channel is closed." +"`send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` or `Receiver` is dropped and the " +"channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md:3 msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" msgstr "" -#: src/concurrency/channels/unbounded.md:16 -#: src/concurrency/channels/bounded.md:16 +#: src/concurrency/channels/unbounded.md:16 src/concurrency/channels/bounded.md:16 msgid "\"Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:17 -#: src/concurrency/channels/bounded.md:17 +#: src/concurrency/channels/unbounded.md:17 src/concurrency/channels/bounded.md:17 msgid "\"{thread_id:?}: sent Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:19 -#: src/concurrency/channels/bounded.md:19 +#: src/concurrency/channels/unbounded.md:19 src/concurrency/channels/bounded.md:19 msgid "\"{thread_id:?}: done\"" msgstr "" -#: src/concurrency/channels/unbounded.md:24 -#: src/concurrency/channels/bounded.md:24 +#: src/concurrency/channels/unbounded.md:24 src/concurrency/channels/bounded.md:24 msgid "\"Main: got {msg}\"" msgstr "" #: src/concurrency/channels/bounded.md:3 -msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +msgid "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" #: src/concurrency/channels/bounded.md:32 msgid "" -"Calling `send` will block the current thread until there is space in the " -"channel for the new message. The thread can be blocked indefinitely if there " -"is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the channel for the new message. The thread can be blocked " +"indefinitely if there is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md:35 msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) if the channel is closed. A channel is closed when the " +"receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md:37 msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". Every send will block the current thread until another " +"thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -18333,35 +17142,29 @@ msgid "Sync" msgstr "همگام سازی" #: src/concurrency/send-sync/marker-traits.md:3 -msgid "" -"How does Rust know to forbid shared access across threads? The answer is in " -"two traits:" +msgid "How does Rust know to forbid shared access across threads? The answer is in two traits:" msgstr "" #: src/concurrency/send-sync/marker-traits.md:6 msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " -"is `Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is `Send` if it is safe to move a `T` across a thread " +"boundary." msgstr "" #: src/concurrency/send-sync/marker-traits.md:8 msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " -"is `Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is `Sync` if it is safe to move a `&T` across a thread " +"boundary." msgstr "" #: src/concurrency/send-sync/marker-traits.md:11 msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " -"The compiler will automatically derive them for your types as long as they " -"only contain `Send` and `Sync` types. You can also implement them manually " -"when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The compiler will automatically derive them for your " +"types as long as they only contain `Send` and `Sync` types. You can also implement them manually when you know it is valid." msgstr "" #: src/concurrency/send-sync/marker-traits.md:22 -msgid "" -"One can think of these traits as markers that the type has certain thread-" -"safety properties." +msgid "One can think of these traits as markers that the type has certain thread-safety properties." msgstr "" #: src/concurrency/send-sync/marker-traits.md:24 @@ -18370,27 +17173,23 @@ msgstr "" #: src/concurrency/send-sync/send.md:3 msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " -"if it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if it is safe to move a `T` value to another thread." msgstr "" #: src/concurrency/send-sync/send.md:5 msgid "" -"The effect of moving ownership to another thread is that _destructors_ will " -"run in that thread. So the question is when you can allocate a value in one " -"thread and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will run in that thread. So the question is when you can " +"allocate a value in one thread and deallocate it in another." msgstr "" #: src/concurrency/send-sync/send.md:14 -msgid "" -"As an example, a connection to the SQLite library must only be accessed from " -"a single thread." +msgid "As an example, a connection to the SQLite library must only be accessed from a single thread." msgstr "" #: src/concurrency/send-sync/sync.md:3 msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " -"if it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if it is safe to access a `T` value from multiple " +"threads at the same time." msgstr "" #: src/concurrency/send-sync/sync.md:6 @@ -18403,18 +17202,15 @@ msgstr "" #: src/concurrency/send-sync/sync.md:15 msgid "" -"This statement is essentially a shorthand way of saying that if a type is " -"thread-safe for shared use, it is also thread-safe to pass references of it " -"across threads." +"This statement is essentially a shorthand way of saying that if a type is thread-safe for shared use, it is also thread-safe to pass " +"references of it across threads." msgstr "" #: src/concurrency/send-sync/sync.md:19 msgid "" -"This is because if a type is Sync it means that it can be shared across " -"multiple threads without the risk of data races or other synchronization " -"issues, so it is safe to move it to another thread. A reference to the type " -"is also safe to move to another thread, because the data it references can " -"be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across multiple threads without the risk of data races or other " +"synchronization issues, so it is safe to move it to another thread. A reference to the type is also safe to move to another thread, " +"because the data it references can be accessed from any thread safely." msgstr "" #: src/concurrency/send-sync/examples.md:3 @@ -18454,9 +17250,7 @@ msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "" #: src/concurrency/send-sync/examples.md:15 -msgid "" -"The generic types are typically `Send + Sync` when the type parameters are " -"`Send + Sync`." +msgid "The generic types are typically `Send + Sync` when the type parameters are `Send + Sync`." msgstr "" #: src/concurrency/send-sync/examples.md:18 @@ -18464,9 +17258,7 @@ msgid "`Send + !Sync`" msgstr "" #: src/concurrency/send-sync/examples.md:20 -msgid "" -"These types can be moved to other threads, but they're not thread-safe. " -"Typically because of interior mutability:" +msgid "These types can be moved to other threads, but they're not thread-safe. Typically because of interior mutability:" msgstr "" #: src/concurrency/send-sync/examples.md:23 @@ -18486,14 +17278,11 @@ msgid "`!Send + Sync`" msgstr "" #: src/concurrency/send-sync/examples.md:29 -msgid "" -"These types are thread-safe, but they cannot be moved to another thread:" +msgid "These types are thread-safe, but they cannot be moved to another thread:" msgstr "" #: src/concurrency/send-sync/examples.md:31 -msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them." +msgid "`MutexGuard`: Uses OS level primitives which must be deallocated on the thread which created them." msgstr "" #: src/concurrency/send-sync/examples.md:34 @@ -18505,15 +17294,11 @@ msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" #: src/concurrency/send-sync/examples.md:38 -msgid "" -"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" -"atomic reference count." +msgid "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-atomic reference count." msgstr "" #: src/concurrency/send-sync/examples.md:40 -msgid "" -"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " -"considerations." +msgid "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency considerations." msgstr "" #: src/concurrency/shared-state.md @@ -18525,43 +17310,31 @@ msgid "Mutex" msgstr "Mutex" #: src/concurrency/shared-state/arc.md:3 -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +msgid "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-only access via `Arc::clone`:" msgstr "" #: src/concurrency/shared-state/arc.md:16 msgid "\"{thread_id:?}: {v:?}\"" msgstr "" -#: src/concurrency/shared-state/arc.md:21 -#: src/concurrency/shared-state/example.md:17 -#: src/concurrency/shared-state/example.md:46 +#: src/concurrency/shared-state/arc.md:21 src/concurrency/shared-state/example.md:17 src/concurrency/shared-state/example.md:46 msgid "\"v: {v:?}\"" msgstr "" #: src/concurrency/shared-state/arc.md:30 -msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " -"that uses atomic operations." +msgid "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that uses atomic operations." msgstr "" #: src/concurrency/shared-state/arc.md:32 -msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " -"and `Sync` if and only if `T` implements them both." +msgid "`Arc` implements `Clone` whether or not `T` does. It implements `Send` and `Sync` if and only if `T` implements them both." msgstr "" #: src/concurrency/shared-state/arc.md:34 -msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but " -"after that the use of the `T` is free." +msgid "`Arc::clone()` has the cost of atomic operations that get executed, but after that the use of the `T` is free." msgstr "" #: src/concurrency/shared-state/arc.md:36 -msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect " -"them." +msgid "Beware of reference cycles, `Arc` does not use a garbage collector to detect them." msgstr "" #: src/concurrency/shared-state/arc.md:38 @@ -18570,46 +17343,36 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:3 msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " -"mutual exclusion _and_ allows mutable access to `T` behind a read-only " -"interface (another form of [interior mutability](../../borrowing/interior-" -"mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual exclusion _and_ allows mutable access to `T` " +"behind a read-only interface (another form of [interior mutability](../../borrowing/interior-mutability.md)):" msgstr "" -#: src/concurrency/shared-state/mutex.md:12 -#: src/concurrency/shared-state/mutex.md:19 +#: src/concurrency/shared-state/mutex.md:12 src/concurrency/shared-state/mutex.md:19 msgid "\"v: {:?}\"" msgstr "" #: src/concurrency/shared-state/mutex.md:23 msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " -"implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#impl-Sync-for-" +"Mutex%3CT%3E) blanket implementation." msgstr "" #: src/concurrency/shared-state/mutex.md:33 -msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the " -"protected data." +msgid "`Mutex` in Rust looks like a collection with just one element --- the protected data." msgstr "" #: src/concurrency/shared-state/mutex.md:35 -msgid "" -"It is not possible to forget to acquire the mutex before accessing the " -"protected data." +msgid "It is not possible to forget to acquire the mutex before accessing the protected data." msgstr "" #: src/concurrency/shared-state/mutex.md:37 msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The " -"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that the `&mut T` doesn't outlive the lock " +"being held." msgstr "" #: src/concurrency/shared-state/mutex.md:39 -msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +msgid "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements `Send`." msgstr "" #: src/concurrency/shared-state/mutex.md:41 @@ -18622,11 +17385,9 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang.org/std/sync/struct." +"PoisonError.html). You can call `into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -18646,27 +17407,20 @@ msgid "Notable parts:" msgstr "" #: src/concurrency/shared-state/example.md:52 -msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " -"orthogonal." +msgid "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." msgstr "" #: src/concurrency/shared-state/example.md:54 -msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " -"between threads." +msgid "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between threads." msgstr "" #: src/concurrency/shared-state/example.md:56 msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " -"thread. Note `move` was added to the lambda signature." +"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` was added to the lambda signature." msgstr "" #: src/concurrency/shared-state/example.md:58 -msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as " -"possible." +msgid "Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:3 @@ -18675,93 +17429,71 @@ msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:5 msgid "" -"Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " -"philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " +"Five philosophers dine together at the same table. Each philosopher has their own place at the table. There is a fork between each " +"plate. The dish served is a kind of spaghetti which has to be eaten with two forks. Each philosopher can only alternately think and " +"eat. Moreover, a philosopher can only eat their spaghetti when they have both a left and right fork. Thus two forks will only be " +"available when their two nearest neighbors are thinking, not eating. After an individual philosopher finishes eating, they will put " "down both forks." msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:13 msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) " -"for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. Copy the code below to a file called " +"`src/main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:28 -#: src/concurrency/async-exercises/dining-philosophers.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md:28 src/concurrency/async-exercises/dining-philosophers.md:23 msgid "" "// left_fork: ...\n" " // right_fork: ...\n" " // thoughts: ...\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:36 -#: src/concurrency/sync-exercises/solutions.md:22 -#: src/concurrency/async-exercises/dining-philosophers.md:31 -#: src/concurrency/async-exercises/solutions.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md:36 src/concurrency/sync-exercises/solutions.md:22 +#: src/concurrency/async-exercises/dining-philosophers.md:31 src/concurrency/async-exercises/solutions.md:23 msgid "\"Eureka! {} has a new idea!\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:41 -#: src/concurrency/async-exercises/solutions.md:31 +#: src/concurrency/sync-exercises/dining-philosophers.md:41 src/concurrency/async-exercises/solutions.md:31 msgid "// Pick up forks...\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:42 -#: src/concurrency/sync-exercises/solutions.md:31 -#: src/concurrency/async-exercises/dining-philosophers.md:38 -#: src/concurrency/async-exercises/solutions.md:51 +#: src/concurrency/sync-exercises/dining-philosophers.md:42 src/concurrency/sync-exercises/solutions.md:31 +#: src/concurrency/async-exercises/dining-philosophers.md:38 src/concurrency/async-exercises/solutions.md:51 msgid "\"{} is eating...\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 msgid "\"Socrates\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 msgid "\"Hypatia\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 msgid "\"Plato\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 msgid "\"Aristotle\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 msgid "\"Pythagoras\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:51 -#: src/concurrency/async-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/dining-philosophers.md:51 src/concurrency/async-exercises/dining-philosophers.md:48 #: src/concurrency/async-exercises/solutions.md:63 msgid "// Create forks\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:53 -#: src/concurrency/async-exercises/dining-philosophers.md:50 +#: src/concurrency/sync-exercises/dining-philosophers.md:53 src/concurrency/async-exercises/dining-philosophers.md:50 #: src/concurrency/async-exercises/solutions.md:67 msgid "// Create philosophers\n" msgstr "" @@ -18770,8 +17502,7 @@ msgstr "" msgid "// Make each of them think and eat 100 times\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:57 -#: src/concurrency/async-exercises/dining-philosophers.md:54 +#: src/concurrency/sync-exercises/dining-philosophers.md:57 src/concurrency/async-exercises/dining-philosophers.md:54 #: src/concurrency/async-exercises/solutions.md:95 msgid "// Output their thoughts\n" msgstr "" @@ -18792,18 +17523,15 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:3 msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It " -"should start at a webpage and check that links on the page are valid. It " -"should recursively check other pages on the same domain and keep doing this " -"until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It should start at a webpage and check that links on the page " +"are valid. It should recursively check other pages on the same domain and keep doing this until all pages have been validated." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:8 msgid "" -"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`]" -"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " -"we will use [`thiserror`](https://docs.rs/thiserror/)." +"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/reqwest/). You will also need a way to find links, we can " +"use [`scraper`](https://docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use [`thiserror`](https://docs." +"rs/thiserror/)." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:12 @@ -18812,13 +17540,12 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:22 msgid "" -"If `cargo add` fails with `error: no such subcommand`, then please edit the " -"`Cargo.toml` file by hand. Add the dependencies listed below." +"If `cargo add` fails with `error: no such subcommand`, then please edit the `Cargo.toml` file by hand. Add the dependencies listed " +"below." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:25 -msgid "" -"The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" #: src/concurrency/sync-exercises/link-checker.md:29 @@ -18831,50 +17558,41 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" msgstr "" #: src/concurrency/sync-exercises/link-checker.md:42 -msgid "" -"You can now download the start page. Try with a small site such as `https://" -"www.google.org/`." +msgid "You can now download the start page. Try with a small site such as `https://www.google.org/`." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:45 msgid "Your `src/main.rs` file should look something like this:" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:57 -#: src/concurrency/sync-exercises/solutions.md:93 +#: src/concurrency/sync-exercises/link-checker.md:57 src/concurrency/sync-exercises/solutions.md:93 msgid "\"request error: {0}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:59 -#: src/concurrency/sync-exercises/solutions.md:95 +#: src/concurrency/sync-exercises/link-checker.md:59 src/concurrency/sync-exercises/solutions.md:95 msgid "\"bad http response: {0}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:70 -#: src/concurrency/sync-exercises/solutions.md:106 +#: src/concurrency/sync-exercises/link-checker.md:70 src/concurrency/sync-exercises/solutions.md:106 msgid "\"Checking {:#}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:88 -#: src/concurrency/sync-exercises/solutions.md:124 +#: src/concurrency/sync-exercises/link-checker.md:88 src/concurrency/sync-exercises/solutions.md:124 msgid "\"href\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:95 -#: src/concurrency/sync-exercises/solutions.md:131 +#: src/concurrency/sync-exercises/link-checker.md:95 src/concurrency/sync-exercises/solutions.md:131 msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:104 -#: src/concurrency/sync-exercises/solutions.md:241 +#: src/concurrency/sync-exercises/link-checker.md:104 src/concurrency/sync-exercises/solutions.md:241 msgid "\"https://www.google.org\"" msgstr "" @@ -18892,15 +17610,14 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:121 msgid "" -"Use threads to check the links in parallel: send the URLs to be checked to a " -"channel and let a few threads check the URLs in parallel." +"Use threads to check the links in parallel: send the URLs to be checked to a channel and let a few threads check the URLs in " +"parallel." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:123 msgid "" -"Extend this to recursively extract links from all pages on the `www.google." -"org` domain. Put an upper limit of 100 pages or so so that you don't end up " -"being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google.org` domain. Put an upper limit of 100 pages or so so " +"that you don't end up being blocked by the site." msgstr "" #: src/concurrency/sync-exercises/solutions.md:27 @@ -18923,8 +17640,7 @@ msgid "Link Checker" msgstr "" #: src/concurrency/sync-exercises/solutions.md:150 -msgid "" -"/// Determine whether links within the given page should be extracted.\n" +msgid "/// Determine whether links within the given page should be extracted.\n" msgstr "" #: src/concurrency/sync-exercises/solutions.md:158 @@ -18947,39 +17663,32 @@ msgstr "" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed " -"concurrently by executing each task until it would block, then switching to " -"another task that is ready to make progress. The model allows running a " -"larger number of tasks on a limited number of threads. This is because the " -"per-task overhead is typically very low and operating systems provide " -"primitives for efficiently identifying I/O that is able to proceed." +"\"Async\" is a concurrency model where multiple tasks are executed concurrently by executing each task until it would block, then " +"switching to another task that is ready to make progress. The model allows running a larger number of tasks on a limited number of " +"threads. This is because the per-task overhead is typically very low and operating systems provide primitives for efficiently " +"identifying I/O that is able to proceed." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work " -"that may be completed in the future. Futures are \"polled\" until they " -"signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work that may be completed in the future. Futures are " +"\"polled\" until they signal that they are complete." msgstr "" #: src/concurrency/welcome-async.md -msgid "" -"Futures are polled by an async runtime, and several different runtimes are " -"available." +msgid "Futures are polled by an async runtime, and several different runtimes are available." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", " -"similar to a runtime in Rust." +"Python has a similar model in its `asyncio`. However, its `Future` type is callback-based, and not polled. Async Python programs " +"require a \"loop\", similar to a runtime in Rust." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language " -"runtime implements the event loop, so many of the details of Promise " -"resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language runtime implements the event loop, so many of the details " +"of Promise resolution are hidden." msgstr "" #: src/concurrency/async.md @@ -18987,9 +17696,7 @@ msgid "async/await" msgstr "async/await" #: src/concurrency/async/async-await.md:3 -msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential " -"code:" +msgid "At a high level, async Rust code looks very much like \"normal\" sequential code:" msgstr "" #: src/concurrency/async/async-await.md:10 @@ -18997,9 +17704,7 @@ msgid "\"Count is: {i}!\"" msgstr "" #: src/concurrency/async/async-await.md:28 -msgid "" -"Note that this is a simplified example to show the syntax. There is no long " -"running operation or any real concurrency in it!" +msgid "Note that this is a simplified example to show the syntax. There is no long running operation or any real concurrency in it!" msgstr "" #: src/concurrency/async/async-await.md:31 @@ -19011,100 +17716,78 @@ msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" #: src/concurrency/async/async-await.md:34 -msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return " -"type with a future." +msgid "The \"async\" keyword is syntactic sugar. The compiler replaces the return type with a future." msgstr "" #: src/concurrency/async/async-await.md:37 -msgid "" -"You cannot make `main` async, without additional instructions to the " -"compiler on how to use the returned future." +msgid "You cannot make `main` async, without additional instructions to the compiler on how to use the returned future." msgstr "" #: src/concurrency/async/async-await.md:40 -msgid "" -"You need an executor to run async code. `block_on` blocks the current thread " -"until the provided future has run to completion." +msgid "You need an executor to run async code. `block_on` blocks the current thread until the provided future has run to completion." msgstr "" #: src/concurrency/async/async-await.md:43 msgid "" -"`.await` asynchronously waits for the completion of another operation. " -"Unlike `block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" #: src/concurrency/async/async-await.md:46 -msgid "" -"`.await` can only be used inside an `async` function (or block; these are " -"introduced later)." +msgid "`.await` can only be used inside an `async` function (or block; these are introduced later)." msgstr "" #: src/concurrency/async/futures.md:3 msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " -"trait, implemented by objects that represent an operation that may not be " -"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, implemented by objects that represent an operation " +"that may not be complete yet. A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll." +"html)." msgstr "" #: src/concurrency/async/futures.md:23 msgid "" -"An async function returns an `impl Future`. It's also possible (but " -"uncommon) to implement `Future` for your own types. For example, the " -"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " -"joining to it." +"An async function returns an `impl Future`. It's also possible (but uncommon) to implement `Future` for your own types. For example, " +"the `JoinHandle` returned from `tokio::spawn` implements `Future` to allow joining to it." msgstr "" #: src/concurrency/async/futures.md:27 msgid "" -"The `.await` keyword, applied to a Future, causes the current async function " -"to pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function to pause until that Future is ready, and then evaluates " +"to its output." msgstr "" #: src/concurrency/async/futures.md:33 -msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the " -"links to show the implementations in the docs." +msgid "The `Future` and `Poll` types are implemented exactly as shown; click the links to show the implementations in the docs." msgstr "" #: src/concurrency/async/futures.md:36 msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async code, rather than building new async primitives. Briefly:" msgstr "" #: src/concurrency/async/futures.md:39 -msgid "" -"`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +msgid "`Context` allows a Future to schedule itself to be polled again when an event occurs." msgstr "" #: src/concurrency/async/futures.md:42 msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into " -"that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into that future remain valid. This is required to allow " +"references to remain valid after an `.await`." msgstr "" #: src/concurrency/async/runtimes.md:3 msgid "" -"A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust " -"does not have a \"built-in\" runtime, but several options are available:" +"A _runtime_ provides support for performing operations asynchronously (a _reactor_) and is responsible for executing futures (an " +"_executor_). Rust does not have a \"built-in\" runtime, but several options are available:" msgstr "" #: src/concurrency/async/runtimes.md:7 msgid "" -"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" -"github.com/hyperium/tonic) for gRPC." +"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of functionality like [Hyper](https://hyper.rs/) for HTTP or " +"[Tonic](https://github.com/hyperium/tonic) for gRPC." msgstr "" #: src/concurrency/async/runtimes.md:10 -msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." +msgid "[async-std](https://async.rs/): aims to be a \"std for async\", and includes a basic runtime in `async::task`." msgstr "" #: src/concurrency/async/runtimes.md:12 @@ -19113,24 +17796,20 @@ msgstr "" #: src/concurrency/async/runtimes.md:14 msgid "" -"Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" -"async/src/lib.rs) already has one." +"Several larger applications have their own runtimes. For example, [Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/" +"main/src/lib/fuchsia-async/src/lib.rs) already has one." msgstr "" #: src/concurrency/async/runtimes.md:21 msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust " -"playground. The playground also does not permit any I/O, so most interesting " -"async things can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust playground. The playground also does not permit any I/O, so " +"most interesting async things can't run in the playground." msgstr "" #: src/concurrency/async/runtimes.md:25 msgid "" -"Futures are \"inert\" in that they do not do anything (not even start an I/O " -"operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never " -"used." +"Futures are \"inert\" in that they do not do anything (not even start an I/O operation) unless there is an executor polling them. " +"This differs from JS Promises, for example, which will run to completion even if they are never used." msgstr "" #: src/concurrency/async/runtimes/tokio.md:3 @@ -19175,9 +17854,8 @@ msgstr "" #: src/concurrency/async/runtimes/tokio.md:40 msgid "" -"Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " -"until it finishes." +"Why does `count_to` not (usually) get to 10? This is an example of async cancellation. `tokio::spawn` returns a handle which can be " +"awaited to wait until it finishes." msgstr "" #: src/concurrency/async/runtimes/tokio.md:44 @@ -19194,11 +17872,9 @@ msgstr "" #: src/concurrency/async/tasks.md:5 msgid "" -"A task has a single top-level future which the executor polls to make " -"progress. That future may have one or more nested futures that its `poll` " -"method polls, corresponding loosely to a call stack. Concurrency within a " -"task is possible by polling multiple child futures, such as racing a timer " -"and an I/O operation." +"A task has a single top-level future which the executor polls to make progress. That future may have one or more nested futures that " +"its `poll` method polls, corresponding loosely to a call stack. Concurrency within a task is possible by polling multiple child " +"futures, such as racing a timer and an I/O operation." msgstr "" #: src/concurrency/async/tasks.md:16 @@ -19217,8 +17893,7 @@ msgstr "" msgid "b\"Who are you?\\n\"" msgstr "" -#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 -#: src/concurrency/async/tasks.md:31 +#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 src/concurrency/async/tasks.md:31 msgid "\"socket error\"" msgstr "" @@ -19226,41 +17901,34 @@ msgstr "" msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "" -#: src/concurrency/async/tasks.md:40 -#: src/concurrency/async-control-flow/join.md:37 -msgid "" -"Copy this example into your prepared `src/main.rs` and run it from there." +#: src/concurrency/async/tasks.md:40 src/concurrency/async-control-flow/join.md:37 +msgid "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" #: src/concurrency/async/tasks.md:42 msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix." -"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" -"telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/man-page/linux/1/nc/) or [telnet](https://www.unix." +"com/man-page/linux/1/telnet/)." msgstr "" #: src/concurrency/async/tasks.md:46 msgid "" -"Ask students to visualize what the state of the example server would be with " -"a few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with a few connected clients. What tasks exist? What are " +"their Futures?" msgstr "" #: src/concurrency/async/tasks.md:49 msgid "" -"This is the first time we've seen an `async` block. This is similar to a " -"closure, but does not take any arguments. Its return value is a Future, " -"similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a closure, but does not take any arguments. Its return value " +"is a Future, similar to an `async fn`." msgstr "" #: src/concurrency/async/tasks.md:53 -msgid "" -"Refactor the async block into a function, and improve the error handling " -"using `?`." +msgid "Refactor the async block into a function, and improve the error handling using `?`." msgstr "" #: src/concurrency/async-control-flow/channels.md:3 -msgid "" -"Several crates have support for asynchronous channels. For instance `tokio`:" +msgid "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" #: src/concurrency/async-control-flow/channels.md:13 @@ -19288,9 +17956,7 @@ msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" #: src/concurrency/async-control-flow/channels.md:38 -msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](../channels.md)." +msgid "Overall, the interface is similar to the `sync` channels as seen in the [morning class](../channels.md)." msgstr "" #: src/concurrency/async-control-flow/channels.md:41 @@ -19299,23 +17965,20 @@ msgstr "" #: src/concurrency/async-control-flow/channels.md:43 msgid "" -"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient " -"for complex applications with both IO and heavy CPU processing tasks." +"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that implement both `sync` and `async` `send` and `recv`. This " +"can be convenient for complex applications with both IO and heavy CPU processing tasks." msgstr "" #: src/concurrency/async-control-flow/channels.md:47 msgid "" -"What makes working with `async` channels preferable is the ability to " -"combine them with other `future`s to combine them and create complex control " -"flow." +"What makes working with `async` channels preferable is the ability to combine them with other `future`s to combine them and create " +"complex control flow." msgstr "" #: src/concurrency/async-control-flow/join.md:3 msgid "" -"A join operation waits until all of a set of futures are ready, and returns " -"a collection of their results. This is similar to `Promise.all` in " -"JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns a collection of their results. This is similar to " +"`Promise.all` in JavaScript or `asyncio.gather` in Python." msgstr "" #: src/concurrency/async-control-flow/join.md:21 @@ -19336,41 +17999,32 @@ msgstr "" #: src/concurrency/async-control-flow/join.md:39 msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but " -"you must know how many futures you will have at compile time. This is " -"currently in the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but you must know how many futures you will have at compile " +"time. This is currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" #: src/concurrency/async-control-flow/join.md:43 -msgid "" -"The risk of `join` is that one of the futures may never resolve, this would " -"cause your program to stall." +msgid "The risk of `join` is that one of the futures may never resolve, this would cause your program to stall." msgstr "" #: src/concurrency/async-control-flow/join.md:46 msgid "" -"You can also combine `join_all` with `join!` for instance to join all " -"requests to an http service as well as a database query. Try adding a " -"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " -"timeout (that requires `select!`, explained in the next chapter), but " -"demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all requests to an http service as well as a database query. Try " +"adding a `tokio::time::sleep` to the future, using `futures::join!`. This is not a timeout (that requires `select!`, explained in " +"the next chapter), but demonstrates `join!`." msgstr "" #: src/concurrency/async-control-flow/select.md:3 msgid "" -"A select operation waits until any of a set of futures is ready, and " -"responds to that future's result. In JavaScript, this is similar to `Promise." -"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." -"FIRST_COMPLETED)`." +"A select operation waits until any of a set of futures is ready, and responds to that future's result. In JavaScript, this is " +"similar to `Promise.race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)`." msgstr "" #: src/concurrency/async-control-flow/select.md:8 msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, " -"each of the form `pattern = future => statement`. When a `future` is ready, " -"its return value is destructured by the `pattern`. The `statement` is then " -"run with the resulting variables. The `statement` result becomes the result " -"of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, each of the form `pattern = future => statement`. When a " +"`future` is ready, its return value is destructured by the `pattern`. The `statement` is then run with the resulting variables. The " +"`statement` result becomes the result of the `select!` macro." msgstr "" #: src/concurrency/async-control-flow/select.md:40 @@ -19395,42 +18049,34 @@ msgstr "" #: src/concurrency/async-control-flow/select.md:58 msgid "" -"In this example, we have a race between a cat and a dog. " -"`first_animal_to_finish_race` listens to both channels and will pick " -"whichever arrives first. Since the dog takes 50ms, it wins against the cat " -"that take 500ms." +"In this example, we have a race between a cat and a dog. `first_animal_to_finish_race` listens to both channels and will pick " +"whichever arrives first. Since the dog takes 50ms, it wins against the cat that take 500ms." msgstr "" #: src/concurrency/async-control-flow/select.md:63 -msgid "" -"You can use `oneshot` channels in this example as the channels are supposed " -"to receive only one `send`." +msgid "You can use `oneshot` channels in this example as the channels are supposed to receive only one `send`." msgstr "" #: src/concurrency/async-control-flow/select.md:66 -msgid "" -"Try adding a deadline to the race, demonstrating selecting different sorts " -"of futures." +msgid "Try adding a deadline to the race, demonstrating selecting different sorts of futures." msgstr "" #: src/concurrency/async-control-flow/select.md:69 msgid "" -"Note that `select!` drops unmatched branches, which cancels their futures. " -"It is easiest to use when every execution of `select!` creates new futures." +"Note that `select!` drops unmatched branches, which cancels their futures. It is easiest to use when every execution of `select!` " +"creates new futures." msgstr "" #: src/concurrency/async-control-flow/select.md:72 msgid "" -"An alternative is to pass `&mut future` instead of the future itself, but " -"this can lead to issues, further discussed in the pinning slide." +"An alternative is to pass `&mut future` instead of the future itself, but this can lead to issues, further discussed in the pinning " +"slide." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" -"Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes " -"with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter." +"Async / await provides convenient and efficient abstraction for concurrent asynchronous programming. However, the async/await model " +"in Rust also comes with its share of pitfalls and footguns. We illustrate some of them in this chapter." msgstr "" #: src/concurrency/async-pitfalls.md @@ -19443,10 +18089,8 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:3 msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that " -"CPU blocking tasks will block the executor and prevent other tasks from " -"being executed. An easy workaround is to use async equivalent methods where " -"possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that CPU blocking tasks will block the executor and prevent " +"other tasks from being executed. An easy workaround is to use async equivalent methods where possible." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:14 @@ -19458,65 +18102,54 @@ msgid "\"current_thread\"" msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:30 -msgid "" -"Run the code and see that the sleeps happen consecutively rather than " -"concurrently." +msgid "Run the code and see that the sleeps happen consecutively rather than concurrently." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:33 msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This " -"makes the effect more obvious, but the bug is still present in the multi-" -"threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the effect more obvious, but the bug is still present " +"in the multi-threaded flavor." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:37 -msgid "" -"Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." +msgid "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:39 msgid "" -"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " -"thread and transforms its handle into a future without blocking the executor." +"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual thread and transforms its handle into a future without " +"blocking the executor." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:42 msgid "" -"You should not think of tasks as OS threads. They do not map 1 to 1 and most " -"executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, " -"where that library might depend on thread-local storage or map to specific " -"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " -"situations." +"You should not think of tasks as OS threads. They do not map 1 to 1 and most executors will allow many tasks to run on a single OS " +"thread. This is particularly problematic when interacting with other libraries via FFI, where that library might depend on thread-" +"local storage or map to specific OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:48 msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause " -"another task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause another task to block, and that task may be running on the " +"same thread." msgstr "" #: src/concurrency/async-pitfalls/pin.md:3 msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The type returned is the result of a compiler " +"transformation which turns local variables into data stored inside the future." msgstr "" #: src/concurrency/async-pitfalls/pin.md:7 msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because of that, the future should never be moved to a different " +"memory location, as it would invalidate those pointers." msgstr "" #: src/concurrency/async-pitfalls/pin.md:11 msgid "" -"To prevent moving the future type in memory, it can only be polled through a " -"pinned pointer. `Pin` is a wrapper around a reference that disallows all " -"operations that would move the instance it points to into a different memory " -"location." +"To prevent moving the future type in memory, it can only be polled through a pinned pointer. `Pin` is a wrapper around a reference " +"that disallows all operations that would move the instance it points to into a different memory location." msgstr "" #: src/concurrency/async-pitfalls/pin.md:20 @@ -19558,109 +18191,84 @@ msgid "\"work result for iteration {i}: {resp}\"" msgstr "" #: src/concurrency/async-pitfalls/pin.md:70 -msgid "" -"You may recognize this as an example of the actor pattern. Actors typically " -"call `select!` in a loop." +msgid "You may recognize this as an example of the actor pattern. Actors typically call `select!` in a loop." msgstr "" #: src/concurrency/async-pitfalls/pin.md:73 -msgid "" -"This serves as a summation of a few of the previous lessons, so take your " -"time with it." +msgid "This serves as a summation of a few of the previous lessons, so take your time with it." msgstr "" #: src/concurrency/async-pitfalls/pin.md:76 -msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " -"the `select!`. This will never execute. Why?" +msgid "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the `select!`. This will never execute. Why?" msgstr "" #: src/concurrency/async-pitfalls/pin.md:79 -msgid "" -"Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:90 msgid "" -"This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::" -"pin`:" +"This still doesn't work. Follow the compiler errors, adding `&mut` to the `timeout_fut` in the `select!` to work around the move, " +"then using `Box::pin`:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:104 msgid "" -"This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires:" +"This compiles, but once the timeout expires it is `Poll::Ready` on every iteration (a fused future would help with this). Update to " +"reset `timeout_fut` every time it expires:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:119 msgid "" -"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, " -"but that is difficult to use for a future that is reassigned." +"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently stabilized, with older code often using `tokio::pin!`) is " +"also an option, but that is difficult to use for a future that is reassigned." msgstr "" #: src/concurrency/async-pitfalls/pin.md:123 -msgid "" -"Another alternative is to not use `pin` at all but spawn another task that " -"will send to a `oneshot` channel every 100ms." +msgid "Another alternative is to not use `pin` at all but spawn another task that will send to a `oneshot` channel every 100ms." msgstr "" #: src/concurrency/async-pitfalls/pin.md:126 msgid "" -"Data that contains pointers to itself is called self-referential. Normally, " -"the Rust borrow checker would prevent self-referential data from being " -"moved, as the references cannot outlive the data they point to. However, the " -"code transformation for async blocks and functions is not verified by the " -"borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, the Rust borrow checker would prevent self-referential " +"data from being moved, as the references cannot outlive the data they point to. However, the code transformation for async blocks " +"and functions is not verified by the borrow checker." msgstr "" #: src/concurrency/async-pitfalls/pin.md:132 msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its " -"place using a pinned pointer. However, it can still be moved through an " -"unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its place using a pinned pointer. However, it can still be " +"moved through an unpinned pointer." msgstr "" #: src/concurrency/async-pitfalls/pin.md:136 msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " -"`&mut Self` to refer to the instance. That's why it can only be called on a " -"pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut Self` to refer to the instance. That's why it can " +"only be called on a pinned pointer." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:3 msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 " -"release. This required support for using return-position `impl Trait` (RPIT) " -"in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 release. This required support for using return-position " +"`impl Trait` (RPIT) in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:7 -msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +msgid "However, even with the native support today there are some pitfalls around `async fn` and RPIT in traits:" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:10 -msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +msgid "Return-position impl Trait captures all in-scope lifetimes (so some patterns of borrowing cannot be expressed)" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:13 -msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +msgid "Traits whose methods use return-position `impl trait` or `async` are not `dyn` compatible." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:16 msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) provides a workaround through a macro, with some " -"caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/latest/async_trait/) provides a workaround through " +"a macro, with some caveats:" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:46 @@ -19673,35 +18281,28 @@ msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:68 msgid "" -"`async_trait` is easy to use, but note that it's using heap allocations to " -"achieve this. This heap allocation has performance overhead." +"`async_trait` is easy to use, but note that it's using heap allocations to achieve this. This heap allocation has performance " +"overhead." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:71 msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"The challenges in language support for `async trait` are deep Rust and probably not worth describing in-depth. Niko Matsakis did a " +"good job of explaining them in [this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) if " +"you are interested in digging deeper." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:77 -msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +msgid "Try creating a new sleeper struct that will sleep for a random amount of time and adding it to the Vec." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:3 msgid "" -"Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to " -"ensure the system works correctly even when futures are cancelled. For " -"example, it shouldn't deadlock or lose data." +"Dropping a future implies it can never be polled again. This is called _cancellation_ and it can occur at any `await` point. Care is " +"needed to ensure the system works correctly even when futures are cancelled. For example, it shouldn't deadlock or lose data." msgstr "" -#: src/concurrency/async-pitfalls/cancellation.md:35 -#: src/concurrency/async-pitfalls/cancellation.md:102 +#: src/concurrency/async-pitfalls/cancellation.md:35 src/concurrency/async-pitfalls/cancellation.md:102 msgid "\"not UTF-8\"" msgstr "" @@ -19715,14 +18316,11 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:73 msgid "" -"The compiler doesn't help with cancellation-safety. You need to read API " -"documentation and consider what state your `async fn` holds." +"The compiler doesn't help with cancellation-safety. You need to read API documentation and consider what state your `async fn` holds." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:76 -msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " -"error-handling)." +msgid "Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-handling)." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:79 @@ -19730,15 +18328,11 @@ msgid "The example loses parts of the string." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:81 -msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " -"dropped." +msgid "Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:84 -msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the " -"struct:" +msgid "`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:98 @@ -19747,58 +18341,47 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:108 msgid "" -"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a " -"tick has been 'delivered'." +"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) is cancellation-safe because it keeps " +"track of whether a tick has been 'delivered'." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:112 msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) is cancellation-safe because it either " -"returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method.read) is cancellation-safe because it " +"either returns or doesn't read data." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:115 msgid "" -"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " -"cancellation-safe. See its documentation for details and alternatives." +"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt.html#method.read_line) is similar to the " +"example and _isn't_ cancellation-safe. See its documentation for details and alternatives." msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:1 -#: src/concurrency/async-exercises/solutions.md:3 +#: src/concurrency/async-exercises/dining-philosophers.md:1 src/concurrency/async-exercises/solutions.md:3 #, fuzzy msgid "Dining Philosophers --- Async" msgstr "فلسفه Dining" #: src/concurrency/async-exercises/dining-philosophers.md:3 -msgid "" -"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " -"description of the problem." +msgid "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a description of the problem." msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:6 msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-" -"locally.md) for this exercise. Copy the code below to a file called `src/" -"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. Copy the code below to a " +"file called `src/main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:37 -#: src/concurrency/async-exercises/solutions.md:29 +#: src/concurrency/async-exercises/dining-philosophers.md:37 src/concurrency/async-exercises/solutions.md:29 msgid "// Keep trying until we have both forks\n" msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:52 -#: src/concurrency/async-exercises/solutions.md:85 +#: src/concurrency/async-exercises/dining-philosophers.md:52 src/concurrency/async-exercises/solutions.md:85 msgid "// Make them think and eat\n" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:58 -msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. " -"You can use the following `Cargo.toml`:" +msgid "Since this time you are using Async Rust, you'll need a `tokio` dependency. You can use the following `Cargo.toml`:" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:63 @@ -19810,15 +18393,12 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-thread\"] }\n" "```" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:73 -msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module " -"from the `tokio` crate." +msgid "Also note that this time you have to use the `Mutex` and the `mpsc` module from the `tokio` crate." msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:79 @@ -19827,19 +18407,15 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:3 msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast " -"chat application. We have a chat server that the clients connect to and " -"publish their messages. The client reads user messages from the standard " -"input, and sends them to the server. The chat server broadcasts each message " -"that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast chat application. We have a chat server that the clients " +"connect to and publish their messages. The client reads user messages from the standard input, and sends them to the server. The " +"chat server broadcasts each message that it receives to all the clients." msgstr "" #: src/concurrency/async-exercises/chat-app.md:9 msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/) for the communication between the client " -"and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn.channel.html) on the server, and " +"[`tokio_websockets`](https://docs.rs/tokio-websockets/) for the communication between the client and the server." msgstr "" #: src/concurrency/async-exercises/chat-app.md:12 @@ -19862,8 +18438,7 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -19873,36 +18448,32 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:33 msgid "" -"You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " -"to familiarize yourself with the API." +"You are going to need the following functions from `tokio` and [`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few " +"minutes to familiarize yourself with the API." msgstr "" #: src/concurrency/async-exercises/chat-app.md:37 msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " -"asynchronously reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt.html#method.next) implemented by " +"`WebSocketStream`: for asynchronously reading messages from a Websocket Stream." msgstr "" #: src/concurrency/async-exercises/chat-app.md:39 msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " -"asynchronously sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt.html#method.send) implemented by " +"`WebSocketStream`: for asynchronously sending messages on a Websocket Stream." msgstr "" #: src/concurrency/async-exercises/chat-app.md:41 msgid "" -"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): for asynchronously reading user messages from the " -"standard input." +"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method.next_line): for asynchronously reading user " +"messages from the standard input." msgstr "" #: src/concurrency/async-exercises/chat-app.md:43 msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender.html#method.subscribe): for subscribing to a " +"broadcast channel." msgstr "" #: src/concurrency/async-exercises/chat-app.md:45 @@ -19911,59 +18482,47 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:47 msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main." -"rs` file. In this project, we need two binaries. One for the client, and one " -"for the server. You could potentially make them two separate Cargo projects, " -"but we are going to put them in a single Cargo project with two binaries. " -"For this to work, the client and the server code should go under `src/bin` " -"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" -"targets.html#binaries))." +"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` file. In this project, we need two binaries. One " +"for the client, and one for the server. You could potentially make them two separate Cargo projects, but we are going to put them in " +"a single Cargo project with two binaries. For this to work, the client and the server code should go under `src/bin` (see the " +"[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." msgstr "" #: src/concurrency/async-exercises/chat-app.md:54 msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/" -"bin/client.rs`, respectively. Your task is to complete these files as " -"described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/bin/client.rs`, respectively. Your task is to complete " +"these files as described below." msgstr "" -#: src/concurrency/async-exercises/chat-app.md:58 -#: src/concurrency/async-exercises/solutions.md:104 +#: src/concurrency/async-exercises/chat-app.md:58 src/concurrency/async-exercises/solutions.md:104 msgid "_src/bin/server.rs_:" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:77 -#: src/concurrency/async-exercises/chat-app.md:124 +#: src/concurrency/async-exercises/chat-app.md:77 src/concurrency/async-exercises/chat-app.md:124 msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:85 -#: src/concurrency/async-exercises/solutions.md:154 +#: src/concurrency/async-exercises/chat-app.md:85 src/concurrency/async-exercises/solutions.md:154 msgid "\"127.0.0.1:2000\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:86 -#: src/concurrency/async-exercises/solutions.md:155 +#: src/concurrency/async-exercises/chat-app.md:86 src/concurrency/async-exercises/solutions.md:155 msgid "\"listening on port 2000\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:90 -#: src/concurrency/async-exercises/solutions.md:159 +#: src/concurrency/async-exercises/chat-app.md:90 src/concurrency/async-exercises/solutions.md:159 msgid "\"New connection from {addr:?}\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:93 -#: src/concurrency/async-exercises/solutions.md:162 +#: src/concurrency/async-exercises/chat-app.md:93 src/concurrency/async-exercises/solutions.md:162 msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:102 -#: src/concurrency/async-exercises/solutions.md:171 +#: src/concurrency/async-exercises/chat-app.md:102 src/concurrency/async-exercises/solutions.md:171 msgid "_src/bin/client.rs_:" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:116 -#: src/concurrency/async-exercises/solutions.md:183 +#: src/concurrency/async-exercises/chat-app.md:116 src/concurrency/async-exercises/solutions.md:183 msgid "\"ws://127.0.0.1:2000\"" msgstr "" @@ -19985,9 +18544,8 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:146 msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a " -"continuous loop. One task receives messages from the client and broadcasts " -"them. The other sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous loop. One task receives messages from the client " +"and broadcasts them. The other sends messages received by the server to the client." msgstr "" #: src/concurrency/async-exercises/chat-app.md:149 @@ -19996,16 +18554,12 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:150 msgid "" -"Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and " -"sending them to the server, and (2) receiving messages from the server, and " -"displaying them for the user." +"Hint: As before, use `tokio::select!` in a continuous loop for concurrently performing two tasks: (1) reading user messages from " +"standard input and sending them to the server, and (2) receiving messages from the server, and displaying them for the user." msgstr "" #: src/concurrency/async-exercises/chat-app.md:154 -msgid "" -"Optional: Once you are done, change the code to broadcast messages to all " -"clients, but the sender of the message." +msgid "Optional: Once you are done, change the code to broadcast messages to all clients, but the sender of the message." msgstr "" #: src/concurrency/async-exercises/solutions.md:35 @@ -20056,24 +18610,20 @@ msgid "\"From server: {}\"" msgstr "" #: src/thanks.md -msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +msgid "_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it was useful." msgstr "" #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not " -"perfect, so if you spotted any mistakes or have ideas for improvements, " -"please get in [contact with us on GitHub](https://github.com/google/" -"comprehensive-rust/discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not perfect, so if you spotted any mistakes or have ideas for " +"improvements, please get in [contact with us on GitHub](https://github.com/google/comprehensive-rust/discussions). We would love to " +"hear from you." msgstr "" #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many " -"Rust terms. For translations, this also serves to connect the term back to " -"the English original." +"The following is a glossary which aims to give a short definition of many Rust terms. For translations, this also serves to connect " +"the term back to the English original." msgstr "" #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. @@ -20092,8 +18642,7 @@ msgstr "" #: src/glossary.md msgid "" "Bare-metal Rust: \n" -"Low-level Rust development, often deployed to a system without an operating " -"system. See [Bare-metal Rust](bare-metal.md)." +"Low-level Rust development, often deployed to a system without an operating system. See [Bare-metal Rust](bare-metal.md)." msgstr "" #: src/glossary.md @@ -20123,8 +18672,7 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable " -"program." +"The process of converting source code into executable code or a usable program." msgstr "" #: src/glossary.md @@ -20166,8 +18714,7 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in " -"a program." +"The order in which the individual statements or instructions are executed in a program." msgstr "" #: src/glossary.md @@ -20179,8 +18726,7 @@ msgstr "" #: src/glossary.md msgid "" "enumeration: \n" -"A data type that holds one of several named constants, possibly with an " -"associated tuple or struct." +"A data type that holds one of several named constants, possibly with an associated tuple or struct." msgstr "" #: src/glossary.md @@ -20192,8 +18738,7 @@ msgstr "" #: src/glossary.md msgid "" "error handling: \n" -"The process of managing and responding to errors that occur during program " -"execution." +"The process of managing and responding to errors that occur during program execution." msgstr "" #: src/glossary.md @@ -20211,15 +18756,13 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are " -"no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are no longer in use." msgstr "" #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling " -"code reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling code reuse with different data types." msgstr "" #: src/glossary.md @@ -20231,15 +18774,13 @@ msgstr "" #: src/glossary.md msgid "" "integration test: \n" -"A type of test that verifies the interactions between different parts or " -"components of a system." +"A type of test that verifies the interactions between different parts or components of a system." msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and " -"cannot be used as an identifier." +"A reserved word in a programming language that has a specific meaning and cannot be used as an identifier." msgstr "" #: src/glossary.md @@ -20251,9 +18792,8 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when " -"normal functions are not enough. A typical example is `format!`, which takes " -"a variable number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when normal functions are not enough. A typical example is " +"`format!`, which takes a variable number of arguments, which isn't supported by Rust functions." msgstr "" #: src/glossary.md @@ -20265,15 +18805,13 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the " -"value of an expression." +"A control flow construct in Rust that allows for pattern matching on the value of an expression." msgstr "" #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer " -"needed, leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer needed, leading to a gradual increase in memory usage." msgstr "" #: src/glossary.md @@ -20285,8 +18823,7 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, " -"to organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, to organize code in Rust." msgstr "" #: src/glossary.md @@ -20298,22 +18835,19 @@ msgstr "" #: src/glossary.md msgid "" "mutable: \n" -"A property in Rust that allows variables to be modified after they have been " -"declared." +"A property in Rust that allows variables to be modified after they have been declared." msgstr "" #: src/glossary.md msgid "" "ownership: \n" -"The concept in Rust that defines which part of the code is responsible for " -"managing the memory associated with a value." +"The concept in Rust that defines which part of the code is responsible for managing the memory associated with a value." msgstr "" #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of " -"the program." +"An unrecoverable error condition in Rust that results in the termination of the program." msgstr "" #: src/glossary.md @@ -20325,8 +18859,7 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against " -"an expression in Rust." +"A combination of values, literals, or structures that can be matched against an expression in Rust." msgstr "" #: src/glossary.md @@ -20338,8 +18871,7 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task " -"or solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task or solve a particular problem." msgstr "" #: src/glossary.md @@ -20351,15 +18883,14 @@ msgstr "" #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which " -"the method is called." +"The first parameter in a Rust method that represents the instance on which the method is called." msgstr "" #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object " -"is tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object is tracked, and the object is deallocated when the " +"count reaches zero." msgstr "" #: src/glossary.md @@ -20371,8 +18902,7 @@ msgstr "" #: src/glossary.md msgid "" "Rust: \n" -"A systems programming language that focuses on safety, performance, and " -"concurrency." +"A systems programming language that focuses on safety, performance, and concurrency." msgstr "" #: src/glossary.md @@ -20396,8 +18926,7 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, " -"preventing memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, preventing memory-related errors." msgstr "" #: src/glossary.md @@ -20415,29 +18944,25 @@ msgstr "" #: src/glossary.md msgid "" "static: \n" -"A keyword in Rust used to define static variables or items with a `'static` " -"lifetime." +"A keyword in Rust used to define static variables or items with a `'static` lifetime." msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for " -"more." +"A data type storing textual data. See [Strings](references/strings.html) for more." msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different " -"types under a single name." +"A composite data type in Rust that groups together variables of different types under a single name." msgstr "" #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other " -"functions." +"A Rust module containing functions that test the correctness of other functions." msgstr "" #: src/glossary.md @@ -20449,50 +18974,44 @@ msgstr "" #: src/glossary.md msgid "" "thread safety: \n" -"The property of a program that ensures correct behavior in a multithreaded " -"environment." +"The property of a program that ensures correct behavior in a multithreaded environment." msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to " -"achieve polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to achieve polymorphism in Rust." msgstr "" #: src/glossary.md msgid "" "trait bound: \n" -"An abstraction where you can require types to implement some traits of your " -"interest." +"An abstraction where you can require types to implement some traits of your interest." msgstr "" #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple " -"fields have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple fields have no names, and are accessed by their ordinal " +"numbers." msgstr "" #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values " -"of a particular kind in Rust." +"A classification that specifies which operations can be performed on values of a particular kind in Rust." msgstr "" #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or " -"expression." +"The ability of the Rust compiler to deduce the type of a variable or expression." msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading " -"to unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading to unpredictable program behavior." msgstr "" #: src/glossary.md @@ -20504,8 +19023,8 @@ msgstr "" #: src/glossary.md msgid "" "unit test: \n" -"Rust comes with built-in support for running small unit tests and larger " -"integration tests. See [Unit Tests](testing/unit-tests.html)." +"Rust comes with built-in support for running small unit tests and larger integration tests. See [Unit Tests](testing/unit-tests." +"html)." msgstr "" #: src/glossary.md @@ -20517,8 +19036,7 @@ msgstr "" #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" #: src/glossary.md @@ -20532,9 +19050,7 @@ msgid "Other Rust Resources" msgstr "" #: src/other-resources.md -msgid "" -"The Rust community has created a wealth of high-quality and free resources " -"online." +msgid "The Rust community has created a wealth of high-quality and free resources online." msgstr "" #: src/other-resources.md @@ -20547,29 +19063,23 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " -"canonical free book about Rust. Covers the language in detail and includes a " -"few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical free book about Rust. Covers the language in detail " +"and includes a few projects for people to build." msgstr "" #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " -"Rust syntax via a series of examples which showcase different constructs. " -"Sometimes includes small exercises where you are asked to expand on the code " -"in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust syntax via a series of examples which showcase " +"different constructs. Sometimes includes small exercises where you are asked to expand on the code in the examples." msgstr "" #: src/other-resources.md -msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " -"of the standard library for Rust." +msgid "[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of the standard library for Rust." msgstr "" #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " -"book which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book which describes the Rust grammar and memory model." msgstr "" #: src/other-resources.md @@ -20578,23 +19088,20 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages " -"(FFI)." +"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, including working with raw pointers and interfacing with " +"other languages (FFI)." msgstr "" #: src/other-resources.md msgid "" -"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the " -"Rust Book was written." +"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): covers the new asynchronous programming model which was " +"introduced after the Rust Book was written." msgstr "" #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"an introduction to using Rust on embedded devices without an operating " -"system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an introduction to using Rust on embedded devices without " +"an operating system." msgstr "" #: src/other-resources.md @@ -20606,81 +19113,65 @@ msgid "A small selection of other guides and tutorial for Rust:" msgstr "" #: src/other-resources.md -msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " -"from the perspective of low-level C programmers." +msgid "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from the perspective of low-level C programmers." msgstr "" #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): covers Rust from the perspective of developers who " -"write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): covers Rust from the perspective of " +"developers who write firmware in C." msgstr "" #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): " -"covers the syntax of Rust using side-by-side comparisons with other " -"languages such as C, C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers the syntax of Rust using side-by-side comparisons " +"with other languages such as C, C++, Java, JavaScript, and Python." msgstr "" #: src/other-resources.md -msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " -"you learn Rust." +msgid "[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you learn Rust." msgstr "" #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): a series of small presentations covering both basic " -"and advanced part of the Rust language. Other topics such as WebAssembly, " -"and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): a series of small presentations " +"covering both basic and advanced part of the Rust language. Other topics such as WebAssembly, and async/await are also covered." msgstr "" #: src/other-resources.md msgid "" -"[Advanced testing for Rust applications](https://github.com/mainmatter/rust-" -"advanced-testing-workshop): a self-paced workshop that goes beyond Rust's " -"built-in testing framework. It covers `googletest`, snapshot testing, " -"mocking as well as how to write your own custom test harness." +"[Advanced testing for Rust applications](https://github.com/mainmatter/rust-advanced-testing-workshop): a self-paced workshop that " +"goes beyond Rust's built-in testing framework. It covers `googletest`, snapshot testing, mocking as well as how to write your own " +"custom test harness." msgstr "" #: src/other-resources.md msgid "" -"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs." -"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " -"new developers. The first is a set of 35 videos and the second is a set of " -"11 modules which covers Rust syntax and basic constructs." +"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) and [Take your first steps with Rust]" +"(https://docs.microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. The first is a set of 35 " +"videos and the second is a set of 11 modules which covers Rust syntax and basic constructs." msgstr "" #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." -"github.io/too-many-lists/): in-depth exploration of Rust's memory management " -"rules, through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github.io/too-many-lists/): in-depth exploration of Rust's " +"memory management rules, through implementing a few different types of list structures." msgstr "" #: src/other-resources.md -msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " -"for even more Rust books." +msgid "Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for even more Rust books." msgstr "" #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust " -"documentation. See the page on [other resources](other-resources.md) for a " -"full list of useful resources." +"The material here builds on top of the many great sources of Rust documentation. See the page on [other resources](other-resources." +"md) for a full list of useful resources." msgstr "" #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache " -"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" -"rust/blob/main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 license, please see [`LICENSE`](https://github.com/" +"google/comprehensive-rust/blob/main/LICENSE) for details." msgstr "" #: src/credits.md @@ -20689,10 +19180,8 @@ msgstr "" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by " -"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " -"`third_party/rust-by-example/` directory for details, including the license " -"terms." +"Some examples and exercises have been copied and adapted from [Rust by Example](https://doc.rust-lang.org/rust-by-example/). Please " +"see the `third_party/rust-by-example/` directory for details, including the license terms." msgstr "" #: src/credits.md @@ -20701,9 +19190,8 @@ msgstr "" #: src/credits.md msgid "" -"Some exercises have been copied and adapted from [Rust on Exercism](https://" -"exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " -"directory for details, including the license terms." +"Some exercises have been copied and adapted from [Rust on Exercism](https://exercism.org/tracks/rust). Please see the `third_party/" +"rust-on-exercism/` directory for details, including the license terms." msgstr "" #: src/credits.md @@ -20712,9 +19200,8 @@ msgstr "" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section " -"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " -"directory for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section uses an image from [CXX](https://cxx.rs/). Please see the " +"`third_party/cxx/` directory for details, including the license terms." msgstr "" #~ msgid "1 hour and 20 minutes" @@ -20750,9 +19237,7 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" -#~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ msgstr "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -20765,12 +19250,8 @@ msgstr "" #~ msgid "Blocks are delimited by curly braces." #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." -#~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/" -#~ "* ... */`." -#~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " -#~ "مشخص می‌شوند." +#~ msgid "Line comments are started with `//`, block comments are delimited by `/* ... */`." +#~ msgstr "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -20778,28 +19259,20 @@ msgstr "" #~ msgid "Variable assignment is done with `=`, comparison is done with `==`." #~ msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." -#~ msgid "" -#~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "" -#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgid "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" -#~ msgstr "" -#~ "[20, 30, 40], [0; " -#~ "3]" +#~ msgstr "[20, 30, 40], [0; 3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." -#~ msgstr "" -#~ "(), (T,), " -#~ "(T1, T2), …" +#~ msgstr "(), (T,), (T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." -#~ msgstr "" -#~ "(), ('x',), " -#~ "('x', 1.2), …" +#~ msgstr "(), ('x',), ('x', 1.2), …" #~ msgid "Array assignment and access:" #~ msgstr "انتساب و دسترسی به آرایه:" @@ -20815,31 +19288,21 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " -#~ "type, and the only valid value of that type --- that is to say both the " -#~ "type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, and the only valid value of that type --- that is to " +#~ "say both the type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " -#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " -#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " -#~ "که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی " +#~ "هم نوع و هم مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک تابع یا عبارت هیچ مقدار " +#~ "برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی خواهیم دید. " #, fuzzy -#~ msgid "" -#~ "You can think of it as `void` that can be familiar to you from other " -#~ "programming languages." -#~ msgstr "" -#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " -#~ "برنامه‌نویسی برایتان آشنا باشد." +#~ msgid "You can think of it as `void` that can be familiar to you from other programming languages." +#~ msgstr "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های برنامه‌نویسی برایتان آشنا باشد." #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" -#~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " -#~ "کنید." +#~ msgstr "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -20848,31 +19311,22 @@ msgstr "" #~ msgid "Add more values to the array." #~ msgstr "مقادیر بیشتری را به آرایه اضافه کنید." -#~ msgid "" -#~ "Point out that how `..` will expand to account for different number of " -#~ "elements." -#~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " -#~ "یافت." +#~ msgid "Point out that how `..` will expand to account for different number of elements." +#~ msgstr "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." -#~ msgid "" -#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" -#~ msgstr "" -#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " -#~ "`[a@..,b]` را نشان دهید." +#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgstr "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و `[a@..,b]` را نشان دهید." #~ msgid "Hard-code both functions to operate on 3 × 3 matrices." #~ msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-" -#~ "scoped values that cannot be moved or reallocated during the execution of " -#~ "the program." +#~ "Static and constant variables are two different ways to create globally-scoped values that cannot be moved or reallocated during " +#~ "the execution of the program." #~ msgstr "" -#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " -#~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " -#~ "دوباره تعریف شوند." +#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال (قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول " +#~ "اجرای برنامه منتقل یا دوباره تعریف شوند." #~ msgid "Properties table:" #~ msgstr "جدول خاصیت‌ها:" @@ -20903,17 +19357,13 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" -#~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ msgstr "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." -#~ msgstr "" -#~ "&str یک مرجع غیرقابل " -#~ "تغییر به یک برش از رشته‌ است." +#~ msgstr "&str یک مرجع غیرقابل تغییر به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -21141,13 +19591,10 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "" -#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." -#~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the " -#~ "standard library." +#~ msgid "Day 2: Memory management, ownership, compound data types, and the standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -21179,31 +19626,22 @@ msgstr "" #~ "}\n" #~ "```" -#~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " -#~ "and `continue`." -#~ msgstr "" -#~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " -#~ "`continue`. " +#~ msgid "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and `continue`." +#~ msgstr "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و `continue`. " #~ msgid "" -#~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a " -#~ "major feature and we should show students this right away." +#~ "The idea for the first day is to show _just enough_ of Rust to be able to 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 یک ویژگی مهم است و باید آن را بلافاصله به " -#~ "دانشجویان نشان دهیم." +#~ "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف " +#~ "صحبت کنیم.نحوه مدیریت حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over " -#~ "the schedule. We suggest splitting the day into two parts (following the " -#~ "slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over the schedule. We suggest splitting the day into two parts " +#~ "(following the slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت " +#~ "تقسیم کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -21211,12 +19649,10 @@ msgstr "" #~ msgid "Afternoon: 13:00 to 16:00." #~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" -#~ msgid "" -#~ "You can of course adjust this as necessary. Please make sure to include " -#~ "breaks, we recommend a break every hour!" +#~ msgid "You can of course adjust this as necessary. Please make sure to include breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت " +#~ "داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -21255,56 +19691,41 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop will always end, but this is not yet proved. Edit the " +#~ "code and play with different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این است که حلقه همیشه تمام می شود، اما این هنوز ثابت " +#~ "نشده است. کد را ویرایش کنید و با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to trigger type inference. Try with `i8` instead and trigger " +#~ "a runtime integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و " +#~ "سرریز (`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." -#~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." +#~ msgid "Show how `print!` gives a compilation error if the arguments don't match the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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." +#~ "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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "fmt` which has the rules of the formatting mini-language. It's important " -#~ "that the students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه `std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو " +#~ "کنند. مهم است که دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." -#~ 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` را توی مرورگر باز کند." +#~ 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` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -21316,15 +19737,12 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" -#~ msgid "" -#~ "Despite just 29 lines of code, this C example contains serious bugs in at " -#~ "least 11:" +#~ msgid "Despite just 29 lines of code, this C example contains serious bugs in at least 11:" #~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " #~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" @@ -21342,9 +19760,7 @@ msgstr "" #~ msgid "Forgotten `break` in a `switch` statement (line 32)" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" -#~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" +#~ msgid "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -21361,46 +19777,36 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning " -#~ "level, even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش فرض کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این " +#~ "کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security " -#~ "vulnerabilities in the past. Some examples:" +#~ "Absolutely not, these kind of bugs have lead to serious security vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند نمونه:" #~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-" -#~ "backdoor-attempt-of-2003)" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor 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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-" +#~ "backdoor-attempt-of-2003)" -#~ 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)" +#~ 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)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-" -#~ "the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-" +#~ "of-a-security-hole-the-break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -21421,128 +19827,86 @@ msgstr "" #~ msgid "All `if` clauses require braces." #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." -#~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " -#~ "you can't accidentally forget a `break`." +#~ 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 را " -#~ "فراموش کنید." +#~ "دستور`match` (به عنوان معادل Rust برای `switch`) فرو نمی‌پاشد (منظور fall-through پذیر بودن ان است) ، بنابراین نمی‌توانید به طور " +#~ "تصادفی یک break را فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." -#~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." -#~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ msgid "Heap-allocated memory is freed via the `Drop` trait when the corresponding `Box` leaves the scope." +#~ msgstr "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" -#~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." -#~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." +#~ msgid "Out-of-bounds accesses cause a panic or can be checked via the `get` method of a slice." +#~ msgstr "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped and 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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر " +#~ "بررسی مقدار برگشتی تابعی که با `#[must_use]` علامت گذاری شده است را فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "" -#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" +#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get " -#~ "runtime-initialized and runtime-sized static variables" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak) برای نشت دادن " +#~ "یک اشاره‌گر استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی اولیه و اندازه در زمان اجرا " +#~ "باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.html) to make the compiler \"forget\" about a value (meaning the " -#~ "destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.html) استفاده کنید تا " +#~ "کامپایلر «مقدار» را فراموش کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-" -#~ "lang.org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` " +#~ "ایجاد کنید." -#~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." -#~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ msgid "In fact, some will consider infinitely populating a collection a memory leak and Rust does not protect from those." +#~ msgstr "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." -#~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." -#~ msgstr "" -#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " -#~ "_تصادفی_» درنظر گرفته شود." +#~ msgid "For the purpose of this course, \"No memory leaks\" should be understood as \"Pretty much no _accidental_ memory leaks\"." +#~ msgstr "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "panics in debug mode (`cargo build`) and wrap-around in release mode " -#~ "(`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang.org/rustc/codegen-options/index.html#overflow-" +#~ "checks) compile-time flag. If enabled, the program will panic (a controlled crash of the program), otherwise you get wrap-around " +#~ "semantics. By default, you get 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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be disabled directly with the `unsafe` keyword. However, " +#~ "`unsafe` allows you to call functions such as `slice::get_unchecked` which does not do bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این " +#~ "حال، `unsafe` به شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." +#~ msgstr "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -21551,97 +19915,71 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, writing a loop using `for` should result in roughly the same low " -#~ "level instructions as using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for higher-level programming constructs with memory or " +#~ "CPU. For example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر " +#~ "با حافظه یا CPU «هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید تقریباً به همان دستورالعمل‌های سطح پایین " +#~ "به عنوان استفاده از ساختار `iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also 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` را بیان کند." #~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to " -#~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ "Remind people to read the errors --- many developers have gotten used to ignore lengthy compiler output. The Rust compiler is " +#~ "significantly more talkative than other compilers. It will often provide you with _actionable_ feedback, ready to copy-paste into " +#~ "your code." #~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. " +#~ "کامپایلر Rust به طور قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار شما قرار می‌دهد که آماده " +#~ "کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, Python, and Go. Rust does not come with several things you " +#~ "might consider standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک است. زبان Rust با چندین چیز که ممکن است آنها را " +#~ "استاندارد و ضروری در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." -#~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." +#~ msgstr "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." -#~ msgstr "" -#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" -#~ "(https://docs.rs/rustls/) را ببینید." +#~ msgstr "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`](https://docs.rs/rustls/) را ببینید." #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." -#~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." +#~ msgstr "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "Rust community is still working on finding the best solution --- and " -#~ "perhaps there isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library cannot go away, so it has to be very stable. For the " +#~ "examples above, the 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 هنوز در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "makes it trivial to download and compile third-party crates. A " -#~ "consequence of this is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this 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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این امر دانلود و کامپایل کردن crates شخص ثالث را بسیار " +#~ "آسان می کند. یکی از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health " +#~ "metrics for crates to find a good and trusted one." #~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای " +#~ "سلامت برای crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -21651,131 +19989,76 @@ msgstr "" #~ msgid "Like C++, Rust has references:" #~ msgstr "مانند C++، راست دارای مراجع است:" -#~ msgid "" -#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " -#~ "pointers." -#~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." +#~ msgid "We must dereference `ref_x` when assigning to it, similar to C and C++ pointers." +#~ msgstr "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای C و C++." -#~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." -#~ msgstr "" -#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " -#~ "مختلفی ارجاع داده شوند." +#~ msgid "References that are declared as `mut` can be bound to different values over their lifetime." +#~ msgstr "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر مختلفی ارجاع داده شوند." #~ msgid "A reference is said to \"borrow\" the value it refers to." #~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." -#~ msgid "" -#~ "Rust is tracking the lifetimes of all references to ensure they live long " -#~ "enough." -#~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." +#~ msgid "Rust is tracking the lifetimes of all references to ensure they live long enough." +#~ msgstr "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " -#~ msgid "" -#~ "You can borrow `&str` slices from `String` via `&` and optionally range " -#~ "selection." -#~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ msgid "You can borrow `&str` slices from `String` via `&` and optionally range selection." +#~ msgstr "شما می‌توانید برش‌های &str را از `String` از طریق `&` و انتخاب محدوده به صورت اختیاری، قرض بگیرید." -#~ 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):" +#~ 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):" -#~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " +#~ msgid "We refer in `main` to a function written below. Neither forward declarations nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر نیست. " -#~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains " -#~ "`=n`, which causes it to include the upper bound." +#~ 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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "عبارت تعیین محدوده در حلقه `for` در `print_fizzbuzz_to()` حاوی `=n` است که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." +#~ msgid "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." -#~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." -#~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." +#~ msgid "This course does not include rustdoc on slides, just to save space, but in real code they should be present." +#~ msgstr "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما در کدهای دنیای واقعی باید وجود داشته باشد." -#~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." -#~ msgstr "" -#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " -#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." +#~ msgid "Inner doc comments are discussed later (in the page on modules) and need not be addressed here." +#~ msgstr "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." +#~ "Rustdoc comments can contain code snippets that we can run and test using `cargo test`. We will discuss these tests in the " +#~ "[Testing section](../testing/doc-tests.html)." #~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با استفاده از `cargo test` اجرا و تست " +#~ "کنیم. ما در [بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." #~ 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` یک متد، نمونه‌ای " -#~ "از نوعی است که با آن مرتبط است:" +#~ "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` یک متد، نمونه‌ای از نوعی است که با آن مرتبط است:" -#~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." +#~ msgid "We will look much more at methods in today's exercise and in tomorrow's class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" -#~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" +#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgstr "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual constructor, `Rectangle { width, height }`, could be called " -#~ "directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/" -#~ "constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static methods are commonly used to initialize structs (but don't " +#~ "have to). The actual 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) را ببینید." -#~ msgid "" -#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " -#~ "static methods can take arbitrary parameters." +#~ msgid "Add a `Rectangle::square(width: u32)` constructor to illustrate that such static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، با ارگمان‌های یک سازنده `Rectangle::" +#~ "square(width: u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -21799,13 +20082,11 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." +#~ "When using generics, the standard library's `Into` can provide a kind of limited polymorphism on argument types. We will see " +#~ "more details in a later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع " +#~ "آرگومان‌ها فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -21823,99 +20104,71 @@ msgstr "" #~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" #~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." +#~ "Use a local Rust installation, if possible. This way you can get auto-completion in your editor. See the page about [Using Cargo]" +#~ "(../../cargo.md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات " +#~ "بیشتر در مورد نصب راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." -#~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." +#~ msgid "The code snippets are not editable on purpose: the inline code snippets lose their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " +#~ "شما درنظر گرفته نمی‌شود." #~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types " -#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" +#~ "Rust will not automatically apply _implicit conversions_ between types ([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/" +#~ "w/cpp/language/implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` trait has a single `into()` method. Implementing these traits " -#~ "is how a type expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]" +#~ "(https://doc.rust-lang.org/std/convert/trait.Into.html) traits to let us convert between them. The `From` trait has a single " +#~ "`from()` method and similarly, the `Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "همه انواع عدد صحیح راست، تریت‌های (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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which means that we can convert a variable `x` of type `i8` to " +#~ "an `i16` by calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From for i16` implementation automatically create " +#~ "an implementation of `Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد `i16` دارد، به این معنی که " +#~ "می‌توانیم یک متغیر `x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل " +#~ "کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " -#~ "implementation automatically." +#~ "The same applies for your own `From` implementations for your own types, so it is sufficient to only implement `From` to get a " +#~ "respective `Into` implementation automatically." #~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " -#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." -#~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." +#~ msgstr "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای انجام تبدیل استفاده شود." #~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " -#~ "`i128`) to see which types you can convert to which other types. Try " -#~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/" -#~ "trait.From.html) to see if `From` is implemented for the pairs you " -#~ "check." +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, `i128`) to see which types you can convert to which other " +#~ "types. Try converting small types to big types and the other way around. Check the [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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) تغییر دهید تا ببینید کدام انواع را می‌توانید به کدام انواع " +#~ "دیگر تبدیل کنید. سعی کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات کتابخانه استاندارد](https://doc.rust-lang.org/" +#~ "std/convert/trait.From.html) را بررسی کنید تا ببینید آیا `From` برای تبدیل انواع‌ایی که بررسی می‌کنید " +#~ "پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -21923,426 +20176,282 @@ msgstr "" #~ msgid "We saw that an array can be declared like this:" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " -#~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" -#~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" +#~ msgid "You can print such an array by asking for its debug representation with `{:?}`:" +#~ msgstr "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" -#~ msgid "" -#~ "Rust lets you iterate over things like arrays and ranges using the `for` " -#~ "keyword:" -#~ msgstr "" -#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " -#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" +#~ msgid "Rust lets you iterate over things like arrays and ranges using the `for` keyword:" +#~ msgstr "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" #~ msgid "Bonus Question" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your argument and return types? Something like `&[&[i32]]` " +#~ "for a two-dimensional slice-of-slices. Why or why not?" #~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود " +#~ "استفاده کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان پذیر هست؟ چرا اره و چرا نه؟" -#~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." -#~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ msgid "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality implementation." +#~ msgstr "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "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) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت " +#~ "است در قسمت عصر که بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." #~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change " -#~ "[introduced in the 2021 Edition](https://doc.rust-lang.org/edition-guide/" -#~ "rust-2021/IntoIterator-for-arrays.html)." +#~ "The loop would have been one that consumes the array. This is a change [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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال ۲۰۲۱ معرفی شده است.](https://doc.rust-lang.org/edition-" +#~ "guide/rust-2021/IntoIterator-for-arrays.html)" -#~ 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]` نیز یک نوع کپی است." +#~ 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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally evaluate one of two blocks, but the blocks can have a " +#~ "value which then becomes the value of the `if` expression. Other control flow expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه " +#~ "داشته باشید که در راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته باشند. بقیه عبارات کنترل " +#~ "جریان نیز مشابه این کار میکنند." -#~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" -#~ msgstr "" -#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " -#~ "برگشتی است: " +#~ msgid "The same rule is used for functions: the value of the function body is the return value:" +#~ msgstr "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار برگشتی است: " -#~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " -#~ msgstr "" -#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " -#~ "هستند. " +#~ msgid "The point of this slide is to show that blocks have a type and value in Rust. " +#~ msgstr "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely related to the [`while let` loop](while-let-expressions.md). It " -#~ "will automatically call `into_iter()` on the expression and then iterate " -#~ "over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely 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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور نزدیکی به حلقه [حلقه `while let` ](while-let-expressions.md) " +#~ "مرتبط است. حلقه `for` به طور خودکار `into_iter()` را روی عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام " +#~ "می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." +#~ msgstr "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " -#~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." +#~ msgstr "(0..10) یک محدوده است که ویژگی `Iterator` را پیاده‌سازی می‌کند." -#~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " -#~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." +#~ msgid "`step_by` is a method that returns another `Iterator` that skips every other element. " +#~ msgstr "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه عناصر را برمی‌گرداند." #~ 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()`." +#~ "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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را " +#~ "به `for x in v.iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" #~ msgid "" -#~ "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/" -#~ "expressions/loop-expr.html#infinite-loops) which creates an endless loop." +#~ "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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه " +#~ "بی‌پایان ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" +#~ msgstr "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." -#~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." +#~ msgstr "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." -#~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." -#~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." +#~ msgid "Due to type inference the `i32` is optional. We will gradually show the types less and less as the course progresses." +#~ msgstr "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic container without the code ever explicitly specifying the " +#~ "contained type, using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در یک کانتینر عمومی (generic container) خاص کپی کند، " +#~ "با استفاده از _ به عنوان یک جایگزین برای اعلام نوع داده: " #~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-" -#~ "HashSet%3CT,+S%3E) implements." +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) relies on [`FromIterator`](https://doc." +#~ "rust-lang.org/std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.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) آن را پیاده‌سازی می‌کند." +#~ "[`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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse memory locations when shadowing an immutable variable in a " +#~ "scope, even if the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی " +#~ "که یک متغییر غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" -#~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " -#~ "`Tails`. You might note the namespace when using variants." +#~ "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`ها، به این اینگونه نام‌ها توجه کنید." +#~ "در این صفحه نوع`Enum`به اسم `CoinFlip` که دارای `Heads` و `Tails` می‌باشد. هنگام استفاده از `Enum`ها، به این اینگونه نام‌ها توجه " +#~ "کنید." #~ msgid "In both, associated functions are defined within an `impl` block." #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده باشند. سپس می‌توانید از دستور `match` برای استخراج داده‌ها از " +#~ "هر فیلد استفاده کنید:" -#~ 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++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." +#~ 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++` طبیق الگو به صورت از بالا به پایین نمی‌باشد." -#~ msgid "" -#~ "The match expression has a value. The value is the last expression in the " -#~ "match arm which was executed." -#~ msgstr "" -#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " -#~ "`match` ای است که اجرا شده است." +#~ msgid "The match expression has a value. The value is the last expression in the match arm which was executed." +#~ msgstr "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی `match` ای است که اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته باشد، سپس کد پس از `=>` را اجرا می‌کنیم. " +#~ "بعد از اینکه توی match اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." -#~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." +#~ msgstr "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را بررسی می کند." -#~ msgid "" -#~ "It is possible to retrieve the discriminant by calling `std::mem::" -#~ "discriminant()`" -#~ msgstr "" -#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " -#~ "تشخیصی پنهان را دریافت کرد." +#~ msgid "It is possible to retrieve the discriminant by calling `std::mem::discriminant()`" +#~ msgstr "می توان با فراخوانی `std::mem::discriminant()` فیلد تشخیصی پنهان را دریافت کرد." -#~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." -#~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ msgid "This is useful, for example, if implementing `PartialEq` for structs where comparing field values doesn't affect equality." +#~ msgstr "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top level `struct Click { ... }`. The " +#~ "inlined version cannot implement traits, for example." #~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct " +#~ "Click { ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را پیاده‌سازی کند." -#~ msgid "" -#~ "Rust enums are packed tightly, taking constraints due to alignment into " -#~ "account:" -#~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" +#~ msgid "Rust enums are packed tightly, taking constraints due to alignment into account:" +#~ msgstr "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های ناشی از هم ترازی:" -#~ msgid "" -#~ "Internally Rust is using a field (discriminant) to keep track of the enum " -#~ "variant." -#~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." +#~ msgid "Internally Rust is using a field (discriminant) to keep track of the enum variant." +#~ msgstr "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای `enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," -#~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," +#~ msgid "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز " +#~ "1 بایت است (بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" +#~ "dbg_size!(&i32): اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت " +#~ "است (روی ماشین ۶۴ بیتی)" -#~ msgid "" -#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " -#~ "optimization, see below)." +#~ msgid "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ " +#~ "بایت است (بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" -#~ msgid "" -#~ "Niche optimization: Rust will merge unused bit patterns for the enum " -#~ "discriminant." -#~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." +#~ msgid "Niche optimization: Rust will merge unused bit patterns for the enum discriminant." +#~ msgstr "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` ادغام می‌کند." -#~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." +#~ msgid "More complex example if you want to discuss what happens when we chain more than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring assignment, or if it fails, execute a block which is " -#~ "required to abort normal control flow (with `panic`/`return`/`break`/" -#~ "`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) اجازه " +#~ "می‌دهد تا یک انتساب به صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا کند که برای خاتمه دادن به جریان کنترل عادی " +#~ "(با panic/return/break/continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو " +#~ "استفاده می‌شود. از این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "" -#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." +#~ msgstr "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." #~ msgid "Remove `.as_deref()` and explain the error." -#~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." +#~ msgstr ".as_deref() را حذف کنید و خطا را توضیح دهید." -#~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." +#~ msgid "`std::env::args().next()` returns an `Option`, but we cannot match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا " +#~ "نمی توانیم به عنوان `String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our " -#~ "case, this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "as_deref() یک `Option` را به `Option<&T::" +#~ "Target>` تبدیل می‌کند. در مورد ما، این `Option` را به `Option<&str>` " +#~ "تبدیل می‌کند." -#~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." -#~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." +#~ msgid "We can now use pattern matching to match against the `&str` inside `Option`." +#~ msgstr "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل `Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "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`، به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." -#~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable " -#~ "patterns, as the term can show up in error messages." +#~ 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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار (irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام " +#~ "های خطا ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" -#~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." -#~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." +#~ msgid "Destructuring of slices of unknown length also works with patterns of fixed length." +#~ msgstr "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "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_ به یک الگو اضافه کنید. این یک عبارت بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "You can use the variables defined in the pattern in your if expression." +#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -22357,42 +20466,29 @@ msgstr "" #~ msgstr "تمرینی درباره تطبیق الگو" #~ 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." +#~ "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`ها پیاده‌سازی " -#~ "کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح حل کنید. سپس، سعی کنید آن را با استفاده از " +#~ "`iterator`ها پیاده‌سازی کنید." -#~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." -#~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ msgid "Memory management: stack vs heap, manual memory management, scope-based memory management, and garbage collection." +#~ msgstr "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." -#~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." -#~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." +#~ msgid "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` and `Arc`." +#~ msgstr "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -22403,91 +20499,57 @@ msgstr "" #~ msgid "You allocate and deallocate heap memory yourself." #~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." -#~ msgid "" -#~ "If not done with care, this can lead to crashes, bugs, security " -#~ "vulnerabilities, and memory leaks." -#~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." +#~ msgid "If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory leaks." +#~ msgstr "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" +#~ msgstr "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and `free`: the pointer is lost and we cannot deallocate the " +#~ "memory. Worse, freeing the pointer twice, or accessing a freed pointer can lead to exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را " +#~ "تخصیص‌زدایی کنیم. بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر به آسیب‌پذیری‌های " +#~ "امنیتی قابل سوءاستفاده شود." -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." +#~ msgid "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object is destroyed. The compiler guarantees that this happens, " +#~ "even if an exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق " +#~ "می‌افتد، حتی اگر یک exception ایجاد شود." -#~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." -#~ msgstr "" -#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " -#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." +#~ msgid "This is often called _resource acquisition is initialization_ (RAII) and gives you smart pointers." +#~ msgstr "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده می‌شود و به شما اشاره گرهای هوشمند می‌دهد." -#~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." +#~ msgid "The `std::unique_ptr` object is allocated on the stack, and points to memory allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." +#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "Special move constructors are used when passing ownership to a function:" +#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" -#~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" -#~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" +#~ msgid "An alternative to manual and scope-based memory management is automatic memory management:" +#~ msgstr "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." -#~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." -#~ msgstr "" -#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " -#~ "تخصیص‌زدایی (آزاد) می‌کند." +#~ msgid "A garbage collector finds unused memory and deallocates it for the programmer." +#~ msgstr "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس تخصیص‌زدایی (آزاد) می‌کند." #~ msgid "Java Example" #~ msgstr "مثالی در Java" @@ -22505,43 +20567,31 @@ msgstr "" #~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." #~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." +#~ msgstr "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت می‌کند." -#~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." -#~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ msgid "A Rust user can choose the right abstraction for the situation, some even have no cost at runtime like C." +#~ msgstr "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." #~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually " -#~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "ownership and memory allocation via various means, and prevent the " -#~ "potential errors in C." +#~ "If asked how at this point, you can mention that in Rust this is usually handled by RAII wrapper types such as [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), or [Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate 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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید به این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی [Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) " +#~ "هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -22552,18 +20602,15 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way to generate code in Rust at compile time. In this case the default " -#~ "implementations of `Copy` and `Clone` traits are generated." +#~ "If students ask about `derive`, it is sufficient to say that this is a way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای تولید کد در`Rust` در زمان کامپایل است. در این مورد، " +#~ "پیاده‌سازی‌های پیش‌فرض صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From ae468d694f875209b6fe18d3f9df067272082680 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Sun, 11 Aug 2024 21:52:15 +0000 Subject: [PATCH 15/92] some edit on Part concurrency in Farsi --- po/fa.po | 6039 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 4008 insertions(+), 2031 deletions(-) diff --git a/po/fa.po b/po/fa.po index 9897a8849b0..319e3445dbb 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1266,7 +1266,7 @@ msgstr "همزمانی: عصر" #: src/SUMMARY.md src/running-the-course/course-structure.md:162 #: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" -msgstr "Async مبانی" +msgstr "مبانی Async" #: src/SUMMARY.md src/concurrency/async/async-await.md:1 msgid "`async`/`await`" @@ -1314,7 +1314,7 @@ msgstr "Select" #: src/SUMMARY.md src/running-the-course/course-structure.md:164 #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" -msgstr "هاPitfall" +msgstr "‏Pitfallها" #: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" @@ -9140,20 +9140,180 @@ msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 #: src/borrowing/exercise.md:60 src/borrowing/solution.md:52 -#: src/mes.md:26 +#: src/borrowing/solution.md:58 src/borrowing/solution.md:62 +#: src/android/build-rules/library.md:44 +#: src/android/aidl/example-service/client.md:15 +msgid "\"Bob\"" +msgstr "" + +#: src/borrowing/exercise.md:51 src/borrowing/solution.md:53 +msgid "\"I'm {} and my age is {}\"" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:3 +msgid "" +"A reference has a _lifetime_, which must not \"outlive\" the value it refers " +"to. This is verified by the borrow checker." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:6 +msgid "" +"The lifetime can be implicit - this is what we have seen so far. Lifetimes " +"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " +"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " +"`Point` which is valid for at least the lifetime `a`\"." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:11 +msgid "" +"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " +"yourself. Explicit lifetime annotations create constraints where there is " +"ambiguity; the compiler verifies that there is a valid solution." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:15 +msgid "" +"Lifetimes become more complicated when considering passing values to and " +"returning values from functions." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:36 +msgid "// What is the lifetime of p3?\n" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:37 +msgid "\"p3: {p3:?}\"" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:44 +msgid "" +"In this example, the compiler does not know what lifetime to infer for `p3`. " +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:50 +msgid "Add `'a` appropriately to `left_most`:" +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:56 +msgid "" +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " +"for at least `'a`." +msgstr "" + +#: src/lifetimes/lifetime-annotations.md:59 +msgid "" +"In common cases, lifetimes can be elided, as described on the next slide." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:1 +msgid "Lifetimes in Function Calls" +msgstr "طول عمر در فراخوانی‌ توابع" + +#: src/lifetimes/lifetime-elision.md:3 +msgid "" +"Lifetimes for function arguments and return values must be fully specified, " +"but Rust allows lifetimes to be elided in most cases with [a few simple " +"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " +"inference -- it is just a syntactic shorthand." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:8 +msgid "Each argument which does not have a lifetime annotation is given one." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:9 +msgid "" +"If there is only one argument lifetime, it is given to all un-annotated " +"return values." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:11 +msgid "" +"If there are multiple argument lifetimes, but the first one is for `self`, " +"that lifetime is given to all un-annotated return values." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:53 +msgid "In this example, `cab_distance` is trivially elided." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:55 +msgid "" +"The `nearest` function provides another example of a function with multiple " +"references in its arguments that requires explicit annotation." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:58 +msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" +msgstr "" + +#: src/lifetimes/lifetime-elision.md:64 +msgid "" +"This won't compile, demonstrating that the annotations are checked for " +"validity by the compiler. Note that this is not the case for raw pointers " +"(unsafe), and this is a common source of errors with unsafe Rust." +msgstr "" + +#: src/lifetimes/lifetime-elision.md:68 +msgid "" +"Students may ask when to use lifetimes. Rust borrows _always_ have " +"lifetimes. Most of the time, elision and type inference mean these don't " +"need to be written out. In more complicated cases, lifetime annotations can " +"help resolve ambiguity. Often, especially when prototyping, it's easier to " +"just work with owned data by cloning values where necessary." +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:1 +msgid "Lifetimes in Data Structures" +msgstr "طول عمر در ساختمان داده" + +#: src/lifetimes/struct-lifetimes.md:3 +msgid "" +"If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:10 +msgid "\"Bye {text}!\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:14 +msgid "\"The quick brown fox jumps over the lazy dog.\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:17 +msgid "// erase(text);\n" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:18 +msgid "\"{fox:?}\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:19 +msgid "\"{dog:?}\"" +msgstr "" + +#: src/lifetimes/struct-lifetimes.md:26 msgid "" -"In the above example, the annotation on `Highlight` enforces that the data underlying the contained `&str` lives at least as long as " -"any instance of `Highlight` that uses that data." +"In the above example, the annotation on `Highlight` enforces that the data " +"underlying the contained `&str` lives at least as long as any instance of " +"`Highlight` that uses that data." msgstr "" #: src/lifetimes/struct-lifetimes.md:29 -msgid "If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker throws an error." +msgid "" +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " +"the borrow checker throws an error." msgstr "" #: src/lifetimes/struct-lifetimes.md:31 msgid "" -"Types with borrowed data force users to hold on to the original data. This can be useful for creating lightweight views, but it " -"generally makes them somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This " +"can be useful for creating lightweight views, but it generally makes them " +"somewhat harder to use." msgstr "" #: src/lifetimes/struct-lifetimes.md:34 @@ -9162,23 +9322,26 @@ msgstr "" #: src/lifetimes/struct-lifetimes.md:35 msgid "" -"Some structs with multiple references inside can have more than one lifetime annotation. This can be necessary if there is a need to " -"describe lifetime relationships between the references themselves, in addition to the lifetime of the struct itself. Those are very " -"advanced use cases." +"Some structs with multiple references inside can have more than one lifetime " +"annotation. This can be necessary if there is a need to describe lifetime " +"relationships between the references themselves, in addition to the lifetime " +"of the struct itself. Those are very advanced use cases." msgstr "" #: src/lifetimes/exercise.md:3 msgid "" -"In this exercise, you will build a parser for the [protobuf binary encoding](https://protobuf.dev/programming-guides/encoding/). " -"Don't worry, it's simpler than it seems! This illustrates a common parsing pattern, passing slices of data. The underlying data " -"itself is never copied." +"In this exercise, you will build a parser for the [protobuf binary encoding]" +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " +"simpler than it seems! This illustrates a common parsing pattern, passing " +"slices of data. The underlying data itself is never copied." msgstr "" #: src/lifetimes/exercise.md:8 msgid "" -"Fully parsing a protobuf message requires knowing the types of the fields, indexed by their field numbers. That is typically " -"provided in a `proto` file. In this exercise, we'll encode that information into `match` statements in functions that get called for " -"each field." +"Fully parsing a protobuf message requires knowing the types of the fields, " +"indexed by their field numbers. That is typically provided in a `proto` " +"file. In this exercise, we'll encode that information into `match` " +"statements in functions that get called for each field." msgstr "" #: src/lifetimes/exercise.md:13 @@ -9187,20 +9350,24 @@ msgstr "" #: src/lifetimes/exercise.md:28 msgid "" -"A proto message is encoded as a series of fields, one after the next. Each is implemented as a \"tag\" followed by the value. The " -"tag contains a field number (e.g., `2` for the `id` field of a `Person` message) and a wire type defining how the payload should be " -"determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each " +"is implemented as a \"tag\" followed by the value. The tag contains a field " +"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " +"defining how the payload should be determined from the byte stream." msgstr "" #: src/lifetimes/exercise.md:33 msgid "" -"Integers, including the tag, are represented with a variable-length encoding called VARINT. Luckily, `parse_varint` is defined for " -"you below. The given code also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse a message into a series " -"of calls to those callbacks." +"Integers, including the tag, are represented with a variable-length encoding " +"called VARINT. Luckily, `parse_varint` is defined for you below. The given " +"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " +"to parse a message into a series of calls to those callbacks." msgstr "" #: src/lifetimes/exercise.md:38 -msgid "What remains for you is to implement the `parse_field` function and the `ProtoMessage` trait for `Person` and `PhoneNumber`." +msgid "" +"What remains for you is to implement the `parse_field` function and the " +"`ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" #: src/lifetimes/exercise.md:44 src/lifetimes/solution.md:4 @@ -9214,7 +9381,8 @@ msgstr "" #: src/lifetimes/exercise.md:48 src/lifetimes/solution.md:8 msgid "" "//I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" @@ -9266,7 +9434,8 @@ msgid "\"Expected `i32` to be an `I32` field\"" msgstr "" #: src/lifetimes/exercise.md:119 src/lifetimes/solution.md:79 -msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" #: src/lifetimes/exercise.md:124 src/lifetimes/solution.md:84 @@ -9296,7 +9465,9 @@ msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" #: src/lifetimes/exercise.md:154 -msgid "\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" +msgid "" +"\"Based on the wire type, build a Field, consuming as many bytes as " +"necessary.\"" msgstr "" #: src/lifetimes/exercise.md:156 @@ -9305,7 +9476,8 @@ msgstr "" #: src/lifetimes/exercise.md:158 src/lifetimes/solution.md:138 msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -9317,9 +9489,11 @@ msgstr "" #: src/lifetimes/exercise.md:204 msgid "" -"In this exercise there are various cases where protobuf parsing might fail, e.g. if you try to parse an `i32` when there are fewer " -"than 4 bytes left in the data buffer. In normal Rust code we'd handle this with the `Result` enum, but for simplicity in this " -"exercise we panic if any errors are encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" #: src/lifetimes/solution.md:119 @@ -9344,7 +9518,8 @@ msgid "Welcome to Day 4" msgstr "به روز ۱ خوش آمدید" #: src/welcome-day-4.md -msgid "Today we will cover topics relating to building large-scale software in Rust:" +msgid "" +"Today we will cover topics relating to building large-scale software in Rust:" msgstr "" #: src/welcome-day-4.md @@ -9365,11 +9540,14 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "" #: src/welcome-day-4.md -msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "" +"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md -msgid "Including 10 minute breaks, this session should take about 2 hours and 40 minutes. It contains:" +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 40 " +"minutes. It contains:" msgstr "" #: src/iterators.md @@ -9388,9 +9566,10 @@ msgstr "FromIterator" #: src/iterators/iterator.md:3 msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait supports iterating over values in a collection. It " -"requires a `next` method and provides lots of methods. Many standard library types implement `Iterator`, and you can implement it " -"yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait supports iterating over values in a collection. It requires a `next` " +"method and provides lots of methods. Many standard library types implement " +"`Iterator`, and you can implement it yourself, too:" msgstr "" #: src/iterators/iterator.md:27 @@ -9399,23 +9578,27 @@ msgstr "" #: src/iterators/iterator.md:35 msgid "" -"The `Iterator` trait implements many common functional programming operations over collections (e.g. `map`, `filter`, `reduce`, " -"etc). This is the trait where you can find all the documentation about them. In Rust these functions should produce the code as " -"efficient as equivalent imperative implementations." +"The `Iterator` trait implements many common functional programming " +"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " +"the trait where you can find all the documentation about them. In Rust these " +"functions should produce the code as efficient as equivalent imperative " +"implementations." msgstr "" #: src/iterators/iterator.md:40 msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by collection types such as `Vec` and references to them " -"such as `&Vec` and `&[T]`. Ranges also implement it. This is why you can iterate over a vector with `for i in some_vec { .. }` " -"but `some_vec.next()` doesn't exist." +"`IntoIterator` is the trait that makes for loops work. It is implemented by " +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" #: src/iterators/intoiterator.md:3 msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an iterator. The related trait [`IntoIterator`](https://doc." -"rust-lang.org/std/iter/trait.IntoIterator.html) defines how to create an iterator for a type. It is used automatically by the `for` " -"loop." +"The `Iterator` trait tells you how to _iterate_ once you have created an " +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " +"It is used automatically by the `for` loop." msgstr "" #: src/iterators/intoiterator.md:49 @@ -9423,7 +9606,9 @@ msgid "\"point = {x}, {y}\"" msgstr "" #: src/iterators/intoiterator.md:57 -msgid "Click through to the docs for `IntoIterator`. Every implementation of `IntoIterator` must declare two types:" +msgid "" +"Click through to the docs for `IntoIterator`. Every implementation of " +"`IntoIterator` must declare two types:" msgstr "" #: src/iterators/intoiterator.md:60 @@ -9436,7 +9621,8 @@ msgstr "" #: src/iterators/intoiterator.md:63 msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same `Item` type, which means that it returns `Option`" +"Note that `IntoIter` and `Item` are linked: the iterator must have the same " +"`Item` type, which means that it returns `Option`" msgstr "" #: src/iterators/intoiterator.md:66 @@ -9444,23 +9630,30 @@ msgid "The example iterates over all combinations of x and y coordinates." msgstr "" #: src/iterators/intoiterator.md:68 -msgid "Try iterating over the grid twice in `main`. Why does this fail? Note that `IntoIterator::into_iter` takes ownership of `self`." +msgid "" +"Try iterating over the grid twice in `main`. Why does this fail? Note that " +"`IntoIterator::into_iter` takes ownership of `self`." msgstr "" #: src/iterators/intoiterator.md:71 -msgid "Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference to the `Grid` in `GridIter`." +msgid "" +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " +"reference to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md:74 msgid "" -"The same problem can occur for standard library types: `for e in some_vector` will take ownership of `some_vector` and iterate over " -"owned elements from that vector. Use `for e in &some_vector` instead, to iterate over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in " +"some_vector` will take ownership of `some_vector` and iterate over owned " +"elements from that vector. Use `for e in &some_vector` instead, to iterate " +"over references to elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md:3 msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets you build a collection from an [`Iterator`]" -"(https://doc.rust-lang.org/std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" +"std/iter/trait.Iterator.html)." msgstr "" #: src/iterators/fromiterator.md:9 @@ -9477,35 +9670,42 @@ msgstr "" #: src/iterators/fromiterator.md:27 msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as shown. The `_` shorthand used here lets Rust infer the type " -"of the `Vec` elements." +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." msgstr "" #: src/iterators/fromiterator.md:29 -msgid "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. Rewrite the example to use this form." +msgid "" +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"Rewrite the example to use this form." msgstr "" #: src/iterators/fromiterator.md:32 msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. There are also more specialized implementations which " -"let you do cool things like convert an `Iterator>` into a `Result, E>`." +"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " +"There are also more specialized implementations which let you do cool things " +"like convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md:3 msgid "" -"In this exercise, you will need to find and use some of the provided methods in the [`Iterator`](https://doc.rust-lang.org/std/iter/" -"trait.Iterator.html) trait to implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods " +"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait to implement a complex calculation." msgstr "" #: src/iterators/exercise.md:6 msgid "" -"Copy the following code to and make the tests pass. Use an iterator expression and `collect` the " -"result to construct the return value." +"Copy the following code to and make the tests " +"pass. Use an iterator expression and `collect` the result to construct the " +"return value." msgstr "" #: src/iterators/exercise.md:11 src/iterators/solution.md:4 msgid "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -9532,11 +9732,15 @@ msgid "\"In the bar module\"" msgstr "" #: src/modules/modules.md:29 -msgid "Packages provide functionality and include a `Cargo.toml` file that describes how to build a bundle of 1+ crates." +msgid "" +"Packages provide functionality and include a `Cargo.toml` file that " +"describes how to build a bundle of 1+ crates." msgstr "" #: src/modules/modules.md:31 -msgid "Crates are a tree of modules, where a binary crate creates an executable and a library crate compiles to a library." +msgid "" +"Crates are a tree of modules, where a binary crate creates an executable and " +"a library crate compiles to a library." msgstr "" #: src/modules/modules.md:33 @@ -9544,13 +9748,15 @@ msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md:3 -msgid "Omitting the module content will tell Rust to look for it in another file:" +msgid "" +"Omitting the module content will tell Rust to look for it in another file:" msgstr "" #: src/modules/filesystem.md:9 msgid "" -"This tells rust that the `garden` module content is found at `src/garden.rs`. Similarly, a `garden::vegetables` module can be found " -"at `src/garden/vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden." +"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" +"vegetables.rs`." msgstr "" #: src/modules/filesystem.md:13 @@ -9567,13 +9773,14 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments\". These document the item that contains them -- in this " -"case, a module." +"Modules defined in files can be documented, too, using \"inner doc comments" +"\". These document the item that contains them -- in this case, a module." msgstr "" #: src/modules/filesystem.md:22 msgid "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" msgstr "" @@ -9591,14 +9798,14 @@ msgstr "" #: src/modules/filesystem.md:43 msgid "" -"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of `module.rs`, and this is still a working alternative " -"for editions after 2018." +"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " +"`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" #: src/modules/filesystem.md:46 msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` was because many files named `mod.rs` can be hard to " -"distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod." +"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" #: src/modules/filesystem.md:49 @@ -9606,7 +9813,9 @@ msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" #: src/modules/filesystem.md:59 -msgid "The place rust will look for modules can be changed with a compiler directive:" +msgid "" +"The place rust will look for modules can be changed with a compiler " +"directive:" msgstr "" #: src/modules/filesystem.md:62 @@ -9615,8 +9824,8 @@ msgstr "" #: src/modules/filesystem.md:66 msgid "" -"This is useful, for example, if you would like to place tests for a module in a file named `some_module_test.rs`, similar to the " -"convention in Go." +"This is useful, for example, if you would like to place tests for a module " +"in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" #: src/modules/visibility.md:3 @@ -9632,7 +9841,9 @@ msgid "Parent and sibling items are always visible." msgstr "" #: src/modules/visibility.md:7 -msgid "In other words, if an item is visible in module `foo`, it's visible in all the descendants of `foo`." +msgid "" +"In other words, if an item is visible in module `foo`, it's visible in all " +"the descendants of `foo`." msgstr "" #: src/modules/visibility.md:13 @@ -9656,12 +9867,15 @@ msgid "Use the `pub` keyword to make modules public." msgstr "" #: src/modules/visibility.md:42 -msgid "Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public visibility." +msgid "" +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " +"of public visibility." msgstr "" #: src/modules/visibility.md:45 msgid "" -"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." +"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" +"privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" #: src/modules/visibility.md:47 @@ -9673,13 +9887,15 @@ msgid "Less commonly, you can give visibility to a specific path." msgstr "" #: src/modules/visibility.md:49 -msgid "In any case, visibility must be granted to an ancestor module (and all of its descendants)." +msgid "" +"In any case, visibility must be granted to an ancestor module (and all of " +"its descendants)." msgstr "" #: src/modules/paths.md:3 msgid "" -"A module can bring symbols from another module into scope with `use`. You will typically see something like this at the top of each " -"module:" +"A module can bring symbols from another module into scope with `use`. You " +"will typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md:11 @@ -9715,35 +9931,44 @@ msgid "`bar::foo` refers to `foo` in the `bar` crate." msgstr "" #: src/modules/paths.md:26 -msgid "It is common to \"re-export\" symbols at a shorter path. For example, the top-level `lib.rs` in a crate might have" +msgid "" +"It is common to \"re-export\" symbols at a shorter path. For example, the " +"top-level `lib.rs` in a crate might have" msgstr "" #: src/modules/paths.md:36 -msgid "making `DiskStorage` and `NetworkStorage` available to other crates with a convenient, short path." +msgid "" +"making `DiskStorage` and `NetworkStorage` available to other crates with a " +"convenient, short path." msgstr "" #: src/modules/paths.md:39 msgid "" -"For the most part, only items that appear in a module need to be `use`'d. However, a trait must be in scope to call any methods on " -"that trait, even if a type implementing that trait is already in scope. For example, to use the `read_to_string` method on a type " -"implementing the `Read` trait, you need to `use std::io::Read`." +"For the most part, only items that appear in a module need to be `use`'d. " +"However, a trait must be in scope to call any methods on that trait, even if " +"a type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to " +"`use std::io::Read`." msgstr "" #: src/modules/paths.md:45 msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged because it is not clear which items are imported, and " -"those might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is " +"discouraged because it is not clear which items are imported, and those " +"might change over time." msgstr "" #: src/modules/exercise.md:3 msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. This library defines a `Widget` trait and a few " -"implementations of that trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. " +"This library defines a `Widget` trait and a few implementations of that " +"trait, as well as a `main` function." msgstr "" #: src/modules/exercise.md:7 msgid "" -"It is typical to put each type or set of closely-related types into its own module, so each widget type should get its own module." +"It is typical to put each type or set of closely-related types into its own " +"module, so each widget type should get its own module." msgstr "" #: src/modules/exercise.md:10 @@ -9752,11 +9977,15 @@ msgid "Cargo Setup" msgstr "تنظیم" #: src/modules/exercise.md:12 -msgid "The Rust playground only supports one file, so you will need to make a Cargo project on your local filesystem:" +msgid "" +"The Rust playground only supports one file, so you will need to make a Cargo " +"project on your local filesystem:" msgstr "" #: src/modules/exercise.md:21 -msgid "Edit the resulting `src/main.rs` to add `mod` statements, and add additional files in the `src` directory." +msgid "" +"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " +"files in the `src` directory." msgstr "" #: src/modules/exercise.md:24 @@ -9789,17 +10018,22 @@ msgstr "" #: src/modules/exercise.md:100 msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -#: src/modules/exercise.md:102 src/modules/exercise.md:108 src/modules/solution.md:165 src/modules/solution.md:171 +#: src/modules/exercise.md:102 src/modules/exercise.md:108 +#: src/modules/solution.md:165 src/modules/solution.md:171 msgid "\"+-{:-`1 + 4 = 5` تبدیل می‌شود." +"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. " +"بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." #: src/testing/exercise.md:17 msgid "Sum all the undoubled and doubled digits." @@ -10073,16 +10324,20 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md:21 msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, along with two basic unit tests that confirm that most of " -"the algorithm is implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, " +"along with two basic unit tests that confirm that most of the algorithm is " +"implemented correctly." msgstr "" #: src/testing/exercise.md:25 #, fuzzy msgid "" -"Copy the code below to and write additional tests to uncover bugs in the provided implementation, " -"fixing any bugs you find." -msgstr "کد زیر را به کپی کنید و تابع را پیاده‌سازی کنید." +"Copy the code below to and write additional " +"tests to uncover bugs in the provided implementation, fixing any bugs you " +"find." +msgstr "" +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." #: src/testing/exercise.md:57 src/testing/solution.md:69 msgid "\"4263 9826 4026 9299\"" @@ -10158,8 +10413,12 @@ msgstr "" #: src/welcome-day-4-afternoon.md #, fuzzy -msgid "Including 10 minute breaks, this session should take about 2 hours and 15 minutes. It contains:" -msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 15 " +"minutes. It contains:" +msgstr "" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/error-handling.md #, fuzzy @@ -10207,15 +10466,20 @@ msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" #: src/error-handling/panics.md:19 -msgid "A panic will \"unwind\" the stack, dropping values just as if the functions had returned." +msgid "" +"A panic will \"unwind\" the stack, dropping values just as if the functions " +"had returned." msgstr "" #: src/error-handling/panics.md:21 -msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "" +"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" #: src/error-handling/panics.md:26 -msgid "By default, a panic will cause the stack to unwind. The unwinding can be caught:" +msgid "" +"By default, a panic will cause the stack to unwind. The unwinding can be " +"caught:" msgstr "" #: src/error-handling/panics.md:32 @@ -10231,11 +10495,15 @@ msgid "\"oh no!\"" msgstr "" #: src/error-handling/panics.md:42 -msgid "Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" +msgid "" +"Catching is unusual; do not attempt to implement exceptions with " +"`catch_unwind`!" msgstr "" #: src/error-handling/panics.md:44 -msgid "This can be useful in servers which should keep running even if a single request crashes." +msgid "" +"This can be useful in servers which should keep running even if a single " +"request crashes." msgstr "" #: src/error-handling/panics.md:46 @@ -10244,32 +10512,38 @@ msgstr "" #: src/error-handling/result.md:3 msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://doc.rust-lang.org/stable/std/result/enum.Result.html) " -"enum, which we briefly saw when discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://" +"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " +"saw when discussing standard library types." msgstr "" #: src/error-handling/result.md:33 -msgid "`Result` has two variants: `Ok` which contains the success value, and `Err` which contains an error value of some kind." +msgid "" +"`Result` has two variants: `Ok` which contains the success value, and `Err` " +"which contains an error value of some kind." msgstr "" #: src/error-handling/result.md:36 msgid "" -"Whether or not a function can produce an error is encoded in the function's type signature by having the function return a `Result` " -"value." +"Whether or not a function can produce an error is encoded in the function's " +"type signature by having the function return a `Result` value." msgstr "" #: src/error-handling/result.md:39 msgid "" -"Like with `Option`, there is no way to forget to handle an error: You cannot access either the success value or the error value " -"without first pattern matching on the `Result` to check which variant you have. Methods like `unwrap` make it easier to write quick-" -"and-dirty code that doesn't do robust error handling, but means that you can always see in your source code where proper error " -"handling is being skipped." +"Like with `Option`, there is no way to forget to handle an error: You cannot " +"access either the success value or the error value without first pattern " +"matching on the `Result` to check which variant you have. Methods like " +"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " +"error handling, but means that you can always see in your source code where " +"proper error handling is being skipped." msgstr "" #: src/error-handling/result.md:48 msgid "" -"It may be helpful to compare error handling in Rust to error handling conventions that students may be familiar with from other " -"programming languages." +"It may be helpful to compare error handling in Rust to error handling " +"conventions that students may be familiar with from other programming " +"languages." msgstr "" #: src/error-handling/result.md:53 @@ -10278,14 +10552,17 @@ msgstr "" #: src/error-handling/result.md:55 msgid "" -"In most languages with exceptions, whether or not a function can throw an exception is not visible as part of its type signature. " -"This generally means that you can't tell when calling a function if it may throw an exception or not." +"In most languages with exceptions, whether or not a function can throw an " +"exception is not visible as part of its type signature. This generally means " +"that you can't tell when calling a function if it may throw an exception or " +"not." msgstr "" #: src/error-handling/result.md:60 msgid "" -"Exceptions generally unwind the call stack, propagating upward until a `try` block is reached. An error originating deep in the call " -"stack may impact an unrelated function further up." +"Exceptions generally unwind the call stack, propagating upward until a `try` " +"block is reached. An error originating deep in the call stack may impact an " +"unrelated function further up." msgstr "" #: src/error-handling/result.md:64 @@ -10294,20 +10571,24 @@ msgstr "" #: src/error-handling/result.md:66 msgid "" -"Some languages have functions return an error number (or some other error value) separately from the successful return value of the " -"function. Examples include C and Go." +"Some languages have functions return an error number (or some other error " +"value) separately from the successful return value of the function. Examples " +"include C and Go." msgstr "" #: src/error-handling/result.md:70 msgid "" -"Depending on the language it may be possible to forget to check the error value, in which case you may be accessing an uninitialized " -"or otherwise invalid success value." +"Depending on the language it may be possible to forget to check the error " +"value, in which case you may be accessing an uninitialized or otherwise " +"invalid success value." msgstr "" #: src/error-handling/try.md:3 msgid "" -"Runtime errors like connection-refused or file-not-found are handled with the `Result` type, but matching this type on every call " -"can be cumbersome. The try-operator `?` is used to return errors to the caller. It lets you turn the common" +"Runtime errors like connection-refused or file-not-found are handled with " +"the `Result` type, but matching this type on every call can be cumbersome. " +"The try-operator `?` is used to return errors to the caller. It lets you " +"turn the common" msgstr "" #: src/error-handling/try.md:15 @@ -10322,7 +10603,8 @@ msgstr "" msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" msgstr "" -#: src/error-handling/try.md:43 src/error-handling/try-conversions.md:65 src/error-handling/thiserror-and-anyhow.md:36 +#: src/error-handling/try.md:43 src/error-handling/try-conversions.md:65 +#: src/error-handling/thiserror-and-anyhow.md:36 msgid "\"config.dat\"" msgstr "" @@ -10339,17 +10621,23 @@ msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." msgstr "" #: src/error-handling/try.md:56 -msgid "Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username." +msgid "" +"Use the `fs::write` call to test out the different scenarios: no file, empty " +"file, file with username." msgstr "" #: src/error-handling/try.md:58 msgid "" -"Note that `main` can return a `Result<(), E>` as long as it implements `std::process::Termination`. In practice, this means that `E` " -"implements `Debug`. The executable will print the `Err` variant and return a nonzero exit status on error." +"Note that `main` can return a `Result<(), E>` as long as it implements `std::" +"process::Termination`. In practice, this means that `E` implements `Debug`. " +"The executable will print the `Err` variant and return a nonzero exit status " +"on error." msgstr "" #: src/error-handling/try-conversions.md:3 -msgid "The effective expansion of `?` is a little more complicated than previously indicated:" +msgid "" +"The effective expansion of `?` is a little more complicated than previously " +"indicated:" msgstr "" #: src/error-handling/try-conversions.md:10 @@ -10358,8 +10646,9 @@ msgstr "" #: src/error-handling/try-conversions.md:19 msgid "" -"The `From::from` call here means we attempt to convert the error type to the type returned by the function. This makes it easy to " -"encapsulate errors into higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the " +"type returned by the function. This makes it easy to encapsulate errors into " +"higher-level errors." msgstr "" #: src/error-handling/try-conversions.md:42 @@ -10376,25 +10665,31 @@ msgstr "" #: src/error-handling/try-conversions.md:73 msgid "" -"The `?` operator must return a value compatible with the return type of the function. For `Result`, it means that the error types " -"have to be compatible. A function that returns `Result` can only use `?` on a value of type `Result` " -"if `ErrorOuter` and `ErrorInner` are the same type or if `ErrorOuter` implements `From`." +"The `?` operator must return a value compatible with the return type of the " +"function. For `Result`, it means that the error types have to be compatible. " +"A function that returns `Result` can only use `?` on a value " +"of type `Result` if `ErrorOuter` and `ErrorInner` are the " +"same type or if `ErrorOuter` implements `From`." msgstr "" #: src/error-handling/try-conversions.md:79 -msgid "A common alternative to a `From` implementation is `Result::map_err`, especially when the conversion only happens in one place." +msgid "" +"A common alternative to a `From` implementation is `Result::map_err`, " +"especially when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md:82 msgid "" -"There is no compatibility requirement for `Option`. A function returning `Option` can use the `?` operator on `Option` for " -"arbitrary `T` and `U` types." +"There is no compatibility requirement for `Option`. A function returning " +"`Option` can use the `?` operator on `Option` for arbitrary `T` and " +"`U` types." msgstr "" #: src/error-handling/try-conversions.md:86 msgid "" -"A function that returns `Result` cannot use `?` on `Option` and vice versa. However, `Option::ok_or` converts `Option` to `Result` " -"whereas `Result::ok` turns `Result` into `Option`." +"A function that returns `Result` cannot use `?` on `Option` and vice versa. " +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md:1 @@ -10403,8 +10698,10 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md:3 msgid "" -"Sometimes we want to allow any type of error to be returned without writing our own enum covering all the different possibilities. " -"The `std::error::Error` trait makes it easy to create a trait object that can contain any error." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" #: src/error-handling/error.md:20 src/error-handling/error.md:21 @@ -10425,37 +10722,44 @@ msgstr "" #: src/error-handling/error.md:31 msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) or `std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" #: src/error-handling/error.md:34 msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle different error cases differently in the program. As such " -"it's generally not a good idea to use `Box` in the public API of a library, but it can be a good option in a program " -"where you just want to display the error message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" #: src/error-handling/error.md:40 msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom error type so it can be boxed. But if you need to " -"support the `no_std` attribute, keep in mind that the `std::error::Error` trait is currently compatible with `no_std` in [nightly]" -"(https://github.com/rust-lang/rust/issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed. But if you need to support the `no_std` " +"attribute, keep in mind that the `std::error::Error` trait is currently " +"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" +"issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:3 msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/anyhow/) crates are widely used to simplify error " -"handling." +"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" +"anyhow/) crates are widely used to simplify error handling." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:7 -msgid "`thiserror` is often used in libraries to create custom error types that implement `From`." +msgid "" +"`thiserror` is often used in libraries to create custom error types that " +"implement `From`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:9 msgid "" -"`anyhow` is often used by applications to help with error handling in functions, including adding contextual information to your " -"errors." +"`anyhow` is often used by applications to help with error handling in " +"functions, including adding contextual information to your errors." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:19 @@ -10488,7 +10792,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md:48 msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful attributes to help define error types in a compact way." +"The `Error` derive macro is provided by `thiserror`, and has lots of useful " +"attributes to help define error types in a compact way." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:50 @@ -10505,8 +10810,9 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md:55 msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally not a good choice for the public API " -"of a library, but is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:58 @@ -10514,30 +10820,36 @@ msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:59 -msgid "Actual error type inside of it can be extracted for examination if necessary." +msgid "" +"Actual error type inside of it can be extracted for examination if necessary." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:60 msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides similar usage patterns and ergonomics " -"to `(T, error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go " +"developers, as it provides similar usage patterns and ergonomics to `(T, " +"error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md:63 msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` types. `use anyhow::Context` is necessary to enable " -"`.context()` and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" #: src/error-handling/exercise.md:3 msgid "" -"The following implements a very simple parser for an expression language. However, it handles errors by panicking. Rewrite it to " -"instead use idiomatic error handling and propagate errors to a return from `main`. Feel free to use `thiserror` and `anyhow`." +"The following implements a very simple parser for an expression language. " +"However, it handles errors by panicking. Rewrite it to instead use idiomatic " +"error handling and propagate errors to a return from `main`. Feel free to " +"use `thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md:8 msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is working correctly, update `Tokenizer` to implement " +"HINT: start by fixing error handling in the `parse` function. Once that is " +"working correctly, update `Tokenizer` to implement " "`Iterator>` and handle that in the parser." msgstr "" @@ -10565,7 +10877,8 @@ msgstr "" msgid "/// A binary operation.\n" msgstr "" -#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 src/error-handling/solution.md:75 +#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 +#: src/error-handling/solution.md:75 msgid "'_'" msgstr "" @@ -10634,17 +10947,21 @@ msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" #: src/unsafe-rust/unsafe.md:6 -msgid "**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." +msgid "" +"**Unsafe Rust:** can trigger undefined behavior if preconditions are " +"violated." msgstr "" #: src/unsafe-rust/unsafe.md:8 -msgid "We saw mostly safe Rust in this course, but it's important to know what Unsafe Rust is." +msgid "" +"We saw mostly safe Rust in this course, but it's important to know what " +"Unsafe Rust is." msgstr "" #: src/unsafe-rust/unsafe.md:11 msgid "" -"Unsafe code is usually small and isolated, and its correctness should be carefully documented. It is usually wrapped in a safe " -"abstraction layer." +"Unsafe code is usually small and isolated, and its correctness should be " +"carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" #: src/unsafe-rust/unsafe.md:14 @@ -10673,14 +10990,17 @@ msgstr "" #: src/unsafe-rust/unsafe.md:22 msgid "" -"We will briefly cover unsafe capabilities next. For full details, please see [Chapter 19.1 in the Rust Book](https://doc.rust-lang." -"org/book/ch19-01-unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"We will briefly cover unsafe capabilities next. For full details, please see " +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" #: src/unsafe-rust/unsafe.md:29 msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers have turned off some compiler safety features and have to " -"write correct code by themselves. It means the compiler no longer enforces Rust's memory-safety rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers " +"have turned off some compiler safety features and have to write correct code " +"by themselves. It means the compiler no longer enforces Rust's memory-safety " +"rules." msgstr "" #: src/unsafe-rust/dereferencing.md:3 @@ -10694,7 +11014,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:12 msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -10724,14 +11045,15 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:35 msgid "" -"It is good practice (and required by the Android Rust style guide) to write a comment for each `unsafe` block explaining how the " -"code inside it satisfies the safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write " +"a comment for each `unsafe` block explaining how the code inside it " +"satisfies the safety requirements of the unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md:39 msgid "" -"In the case of pointer dereferences, this means that the pointers must be [_valid_](https://doc.rust-lang.org/std/ptr/index." -"html#safety), i.e.:" +"In the case of pointer dereferences, this means that the pointers must be " +"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" #: src/unsafe-rust/dereferencing.md:42 @@ -10739,7 +11061,9 @@ msgid "The pointer must be non-null." msgstr "" #: src/unsafe-rust/dereferencing.md:43 -msgid "The pointer must be _dereferenceable_ (within the bounds of a single allocated object)." +msgid "" +"The pointer must be _dereferenceable_ (within the bounds of a single " +"allocated object)." msgstr "" #: src/unsafe-rust/dereferencing.md:45 @@ -10752,8 +11076,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:47 msgid "" -"If the pointer was obtained by casting a reference, the underlying object must be live and no reference may be used to access the " -"memory." +"If the pointer was obtained by casting a reference, the underlying object " +"must be live and no reference may be used to access the memory." msgstr "" #: src/unsafe-rust/dereferencing.md:50 @@ -10762,8 +11086,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md:52 msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has the `'static` lifetime, so `r3` has type `&'static " -"String`, and thus outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " +"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " +"outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md:3 @@ -10780,11 +11105,14 @@ msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" msgstr "" #: src/unsafe-rust/mutable-static.md:13 -msgid "However, since data races can occur, it is unsafe to read and write mutable static variables:" +msgid "" +"However, since data races can occur, it is unsafe to read and write mutable " +"static variables:" msgstr "" #: src/unsafe-rust/mutable-static.md:20 src/unsafe-rust/mutable-static.md:29 -msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" #: src/unsafe-rust/mutable-static.md:31 @@ -10793,14 +11121,17 @@ msgstr "" #: src/unsafe-rust/mutable-static.md:39 msgid "" -"The program here is safe because it is single-threaded. However, the Rust compiler is conservative and will assume the worst. Try " -"removing the `unsafe` and see how the compiler explains that it is undefined behavior to mutate a static from multiple threads." +"The program here is safe because it is single-threaded. However, the Rust " +"compiler is conservative and will assume the worst. Try removing the " +"`unsafe` and see how the compiler explains that it is undefined behavior to " +"mutate a static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md:44 msgid "" -"Using a mutable static is generally a bad idea, but there are some cases where it might make sense in low-level `no_std` code, such " -"as implementing a heap allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases " +"where it might make sense in low-level `no_std` code, such as implementing a " +"heap allocator or working with some C APIs." msgstr "" #: src/unsafe-rust/unions.md:3 @@ -10822,14 +11153,16 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md:22 msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally needed for interacting with C library " -"APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They " +"are occasionally needed for interacting with C library APIs." msgstr "" #: src/unsafe-rust/unions.md:25 msgid "" -"If you just want to reinterpret bytes as a different type, you probably want [`std::mem::transmute`](https://doc.rust-lang.org/" -"stable/std/mem/fn.transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/zerocopy) crate." +"If you just want to reinterpret bytes as a different type, you probably want " +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." +"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" +"crates/zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md:3 src/unsafe-rust/unsafe-functions.md:76 @@ -10837,14 +11170,22 @@ msgid "Calling Unsafe Functions" msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md:5 -msgid "A function or method can be marked `unsafe` if it has extra preconditions you must uphold to avoid undefined behaviour:" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 src/unsafe-rust/solution.md:41 -#: src/android/interoperability/with-c.md:9 src/android/interoperability/with-c/rust.md:15 -#: src/android/interoperability/with-c/rust.md:30 src/android/interoperability/cpp/cpp-bridge.md:29 -#: src/android/interoperability/cpp/cpp-bridge.md:38 src/exercises/chromium/build-rules.md:8 src/exercises/chromium/build-rules.md:21 -#: src/bare-metal/aps/inline-assembly.md:19 src/bare-metal/aps/better-uart/using.md:24 src/bare-metal/aps/logging/using.md:23 +msgid "" +"A function or method can be marked `unsafe` if it has extra preconditions " +"you must uphold to avoid undefined behaviour:" +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 +#: src/unsafe-rust/solution.md:41 src/android/interoperability/with-c.md:9 +#: src/android/interoperability/with-c/rust.md:15 +#: src/android/interoperability/with-c/rust.md:30 +#: src/android/interoperability/cpp/cpp-bridge.md:29 +#: src/android/interoperability/cpp/cpp-bridge.md:38 +#: src/exercises/chromium/build-rules.md:8 +#: src/exercises/chromium/build-rules.md:21 +#: src/bare-metal/aps/inline-assembly.md:19 +#: src/bare-metal/aps/better-uart/using.md:24 +#: src/bare-metal/aps/logging/using.md:23 #: src/exercises/bare-metal/solutions-afternoon.md:43 msgid "\"C\"" msgstr "" @@ -10859,7 +11200,9 @@ msgid "" " // string slice, and lie on UTF-8 sequence boundaries.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:19 src/unsafe-rust/unsafe-functions.md:20 src/unsafe-rust/unsafe-functions.md:21 +#: src/unsafe-rust/unsafe-functions.md:19 +#: src/unsafe-rust/unsafe-functions.md:20 +#: src/unsafe-rust/unsafe-functions.md:21 msgid "\"emoji: {}\"" msgstr "" @@ -10885,12 +11228,15 @@ msgid "" " // emojis.get_unchecked(0..3) }));\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:43 src/unsafe-rust/unsafe-functions.md:88 +#: src/unsafe-rust/unsafe-functions.md:43 +#: src/unsafe-rust/unsafe-functions.md:88 msgid "Writing Unsafe Functions" msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md:45 -msgid "You can mark your own functions as `unsafe` if they require particular conditions to avoid undefined behaviour." +msgid "" +"You can mark your own functions as `unsafe` if they require particular " +"conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-functions.md:49 @@ -10912,26 +11258,32 @@ msgstr "" #: src/unsafe-rust/unsafe-functions.md:78 msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can create UB if the range is incorrect. `abs` is incorrect " -"for a different reason: it is an external function (FFI). Calling external functions is usually only a problem when those functions " -"do things with pointers which might violate Rust's memory model, but in general any C function might have undefined behaviour under " -"any arbitrary circumstances." +"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " +"create UB if the range is incorrect. `abs` is incorrect for a different " +"reason: it is an external function (FFI). Calling external functions is " +"usually only a problem when those functions do things with pointers which " +"might violate Rust's memory model, but in general any C function might have " +"undefined behaviour under any arbitrary circumstances." msgstr "" #: src/unsafe-rust/unsafe-functions.md:85 msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://doc.rust-lang.org/reference/items/external-blocks." -"html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too]" +"(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" #: src/unsafe-rust/unsafe-functions.md:90 -msgid "We wouldn't actually use pointers for a `swap` function - it can be done safely with references." +msgid "" +"We wouldn't actually use pointers for a `swap` function - it can be done " +"safely with references." msgstr "" #: src/unsafe-rust/unsafe-functions.md:93 msgid "" -"Note that unsafe code is allowed within an unsafe function without an `unsafe` block. We can prohibit this with " -"`#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it and see what happens. This will likely change in a future Rust edition." +"Note that unsafe code is allowed within an unsafe function without an " +"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " +"Try adding it and see what happens. This will likely change in a future Rust " +"edition." msgstr "" #: src/unsafe-rust/unsafe-traits.md:1 @@ -10940,14 +11292,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md:3 msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation must guarantee particular conditions to avoid undefined " -"behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation " +"must guarantee particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md:6 msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something like this](https://docs.rs/zerocopy/latest/zerocopy/" -"trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something " +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md:12 @@ -10963,11 +11315,14 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md:34 msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining the requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining " +"the requirements for the trait to be safely implemented." msgstr "" #: src/unsafe-rust/unsafe-traits.md:37 -msgid "The actual safety section for `AsBytes` is rather longer and more complicated." +msgid "" +"The actual safety section for `AsBytes` is rather longer and more " +"complicated." msgstr "" #: src/unsafe-rust/unsafe-traits.md:39 @@ -10980,8 +11335,9 @@ msgstr "امن بودن FFI Wrapper" #: src/unsafe-rust/exercise.md:3 msgid "" -"Rust has great support for calling functions through a _foreign function interface_ (FFI). We will use this to build a safe wrapper " -"for the `libc` functions you would use from C to read the names of files in a directory." +"Rust has great support for calling functions through a _foreign function " +"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " +"functions you would use from C to read the names of files in a directory." msgstr "" #: src/unsafe-rust/exercise.md:7 @@ -11002,8 +11358,9 @@ msgstr "" #: src/unsafe-rust/exercise.md:13 msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) module. There you find a number of string types " -"which you need for the exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" +"ffi/) module. There you find a number of string types which you need for the " +"exercise:" msgstr "" #: src/unsafe-rust/exercise.md:16 @@ -11016,7 +11373,8 @@ msgstr "" #: src/unsafe-rust/exercise.md:18 msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" #: src/unsafe-rust/exercise.md:18 @@ -11029,7 +11387,8 @@ msgstr "" #: src/unsafe-rust/exercise.md:19 msgid "" -"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`](https://doc.rust-lang.org/std/ffi/struct.CString.html)" +"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" +"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" #: src/unsafe-rust/exercise.md:19 @@ -11042,8 +11401,8 @@ msgstr "" #: src/unsafe-rust/exercise.md:20 msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString." -"html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " +"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" #: src/unsafe-rust/exercise.md:20 @@ -11059,7 +11418,9 @@ msgid "You will convert between all these types:" msgstr "" #: src/unsafe-rust/exercise.md:24 -msgid "`&str` to `CString`: you need to allocate space for a trailing `\\0` character," +msgid "" +"`&str` to `CString`: you need to allocate space for a trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md:25 @@ -11067,33 +11428,45 @@ msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" #: src/unsafe-rust/exercise.md:26 -msgid "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` character," +msgid "" +"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md:28 -msgid "`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some unknown data\"," +msgid "" +"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " +"unknown data\"," msgstr "" #: src/unsafe-rust/exercise.md:30 msgid "" -"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`](https://doc.rust-lang.org/std/os/unix/ffi/trait." -"OsStrExt.html) to create it," +"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" #: src/unsafe-rust/exercise.md:33 -msgid "`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to return it and call `readdir` again." +msgid "" +"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " +"return it and call `readdir` again." msgstr "" #: src/unsafe-rust/exercise.md:36 -msgid "The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful chapter about FFI." +msgid "" +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " +"useful chapter about FFI." msgstr "" #: src/unsafe-rust/exercise.md:47 -msgid "Copy the code below to and fill in the missing functions and methods:" +msgid "" +"Copy the code below to and fill in the missing " +"functions and methods:" msgstr "" -#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 -#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 +#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 +#: src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 +#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 +#: src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 #: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 msgid "\"macos\"" msgstr "" @@ -11113,7 +11486,8 @@ msgstr "" msgid "// Layout according to the macOS man page for dir(5).\n" msgstr "" -#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 +#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 msgid "\"x86_64\"" msgstr "" @@ -11122,8 +11496,10 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" msgstr "" #: src/unsafe-rust/exercise.md:103 src/unsafe-rust/solution.md:53 @@ -11144,7 +11520,8 @@ msgstr "" msgid "// Call closedir as needed.\n" msgstr "" -#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 +#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 #: src/android/interoperability/with-c/rust.md:44 msgid "\".\"" msgstr "" @@ -11231,52 +11608,71 @@ msgstr "" #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can write new services, libraries, drivers or even firmware in " -"Rust (or improve existing code as needed)." +"Rust is supported for system software on Android. This means that you can " +"write new services, libraries, drivers or even firmware in Rust (or improve " +"existing code as needed)." msgstr "" #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to find a little corner of your code base where we can move " -"some lines of code to Rust. The fewer dependencies and \"exotic\" types the better. Something that parses some raw bytes would be " -"ideal." +"We will attempt to call Rust from one of your own projects today. So try to " +"find a little corner of your code base where we can move some lines of code " +"to Rust. The fewer dependencies and \"exotic\" types the better. Something " +"that parses some raw bytes would be ideal." msgstr "" #: src/android.md -msgid "The speaker may mention any of the following given the increased use of Rust in Android:" +msgid "" +"The speaker may mention any of the following given the increased use of Rust " +"in Android:" msgstr "" #: src/android.md -msgid "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-android.html)" +msgid "" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" msgstr "" #: src/android.md -msgid "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/rutabaga_gfx.html)" +msgid "" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" msgstr "" #: src/android.md -msgid "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/)" +msgid "" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" #: src/android.md -msgid "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android.html)" +msgid "" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" msgstr "" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make " +"sure you have access to one or create a new one with:" msgstr "" #: src/android/setup.md -msgid "Please see the [Android Developer Codelab](https://source.android.com/docs/setup/start) for details." +msgid "" +"Please see the [Android Developer Codelab](https://source.android.com/docs/" +"setup/start) for details." msgstr "" #: src/android/setup.md -msgid "Cuttlefish is a reference Android device designed to work on generic Linux desktops. MacOS support is also planned." +msgid "" +"Cuttlefish is a reference Android device designed to work on generic Linux " +"desktops. MacOS support is also planned." msgstr "" #: src/android/setup.md -msgid "The Cuttlefish system image maintains high fidelity to real devices, and is the ideal emulator to run many Rust use cases." +msgid "" +"The Cuttlefish system image maintains high fidelity to real devices, and is " +"the ideal emulator to run many Rust use cases." msgstr "" #: src/android/build-rules.md @@ -11312,7 +11708,9 @@ msgid "`rust_ffi`" msgstr "" #: src/android/build-rules.md -msgid "Produces a Rust C library usable by `cc` modules, and provides both static and shared variants." +msgid "" +"Produces a Rust C library usable by `cc` modules, and provides both static " +"and shared variants." msgstr "" #: src/android/build-rules.md @@ -11320,7 +11718,9 @@ msgid "`rust_proc_macro`" msgstr "" #: src/android/build-rules.md -msgid "Produces a `proc-macro` Rust library. These are analogous to compiler plugins." +msgid "" +"Produces a `proc-macro` Rust library. These are analogous to compiler " +"plugins." msgstr "" #: src/android/build-rules.md @@ -11344,7 +11744,9 @@ msgid "`rust_protobuf`" msgstr "" #: src/android/build-rules.md -msgid "Generates source and produces a Rust library that provides an interface for a particular protobuf." +msgid "" +"Generates source and produces a Rust library that provides an interface for " +"a particular protobuf." msgstr "" #: src/android/build-rules.md @@ -11352,7 +11754,9 @@ msgid "`rust_bindgen`" msgstr "" #: src/android/build-rules.md -msgid "Generates source and produces a Rust library containing Rust bindings to C libraries." +msgid "" +"Generates source and produces a Rust library containing Rust bindings to C " +"libraries." msgstr "" #: src/android/build-rules.md @@ -11364,22 +11768,29 @@ msgid "Additional items speaker may mention:" msgstr "" #: src/android/build-rules.md -msgid "Cargo is not optimized for multi-language repos, and also downloads packages from the internet." +msgid "" +"Cargo is not optimized for multi-language repos, and also downloads packages " +"from the internet." msgstr "" #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must also interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must " +"also interop with C/C++/Java code. Soong fills that gap." msgstr "" #: src/android/build-rules.md -msgid "Soong has many similarities to Bazel, which is the open-source variant of Blaze (used in google3)." +msgid "" +"Soong has many similarities to Bazel, which is the open-source variant of " +"Blaze (used in google3)." msgstr "" #: src/android/build-rules.md msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/setup/build/bazel/introduction), [ChromeOS](https://chromium." -"googlesource.com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) to Bazel." +"There is a plan to transition [Android](https://source.android.com/docs/" +"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." +"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" +"build/bazel/introduction) to Bazel." msgstr "" #: src/android/build-rules.md @@ -11395,7 +11806,9 @@ msgid "Rust Binaries" msgstr "" #: src/android/build-rules/binary.md:3 -msgid "Let us start with a simple application. At the root of an AOSP checkout, create the following files:" +msgid "" +"Let us start with a simple application. At the root of an AOSP checkout, " +"create the following files:" msgstr "" #: src/android/build-rules/binary.md:6 src/android/build-rules/library.md:13 @@ -11406,7 +11819,8 @@ msgstr "" msgid "\"hello_rust\"" msgstr "" -#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 src/android/logging.md +#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 +#: src/android/logging.md msgid "\"src/main.rs\"" msgstr "" @@ -11457,8 +11871,9 @@ msgstr "" #: src/android/build-rules/library.md:8 msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`](https://cs.android.com/android/platform/superproject/+/" -"master:external/rust/crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/)." msgstr "" #: src/android/build-rules/library.md:17 src/android/build-rules/library.md:18 @@ -11481,7 +11896,8 @@ msgstr "" msgid "\"greetings\"" msgstr "" -#: src/android/build-rules/library.md:30 src/android/aidl/example-service/service.md:28 src/android/testing.md +#: src/android/build-rules/library.md:30 +#: src/android/aidl/example-service/service.md:28 src/android/testing.md #: src/android/interoperability/java.md:39 msgid "\"src/lib.rs\"" msgstr "" @@ -11510,13 +11926,16 @@ msgstr "" msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" #: src/android/aidl.md -msgid "The [Android Interface Definition Language (AIDL)](https://developer.android.com/guide/components/aidl) is supported in Rust:" +msgid "" +"The [Android Interface Definition Language (AIDL)](https://developer.android." +"com/guide/components/aidl) is supported in Rust:" msgstr "" #: src/android/aidl.md @@ -11529,8 +11948,9 @@ msgstr "" #: src/android/aidl/birthday-service.md:3 msgid "" -"To illustrate how to use Rust with Binder, we're going to walk through the process of creating a Binder interface. We're then going " -"to both implement the described service and write client code that talks to that service." +"To illustrate how to use Rust with Binder, we're going to walk through the " +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." msgstr "" #: src/android/aidl/example-service/interface.md:1 @@ -11541,16 +11961,20 @@ msgstr "" msgid "You declare the API of your service using an AIDL interface:" msgstr "" -#: src/android/aidl/example-service/interface.md:5 src/android/aidl/example-service/service-bindings.md:6 -msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +#: src/android/aidl/example-service/interface.md:5 +#: src/android/aidl/example-service/service-bindings.md:6 +msgid "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" -#: src/android/aidl/example-service/interface.md:8 src/android/aidl/example-service/service-bindings.md:9 +#: src/android/aidl/example-service/interface.md:8 +#: src/android/aidl/example-service/service-bindings.md:9 #: src/android/aidl/example-service/changing-definition.md:8 msgid "/** Birthday service interface. */" msgstr "" -#: src/android/aidl/example-service/interface.md:10 src/android/aidl/example-service/service-bindings.md:11 +#: src/android/aidl/example-service/interface.md:10 +#: src/android/aidl/example-service/service-bindings.md:11 #: src/android/aidl/example-service/changing-definition.md:11 msgid "/** Generate a Happy Birthday message. */" msgstr "" @@ -11573,8 +11997,9 @@ msgstr "" #: src/android/aidl/example-service/interface.md:32 msgid "" -"Note that the directory structure under the `aidl/` directory needs to match the package name used in the AIDL file, i.e. the " -"package is `com.example.birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." +"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" #: src/android/aidl/example-service/service-bindings.md:1 @@ -11582,7 +12007,9 @@ msgid "Generated Service API" msgstr "" #: src/android/aidl/example-service/service-bindings.md:3 -msgid "Binder generates a trait corresponding to the interface definition. trait to talk to the service." +msgid "" +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md:16 @@ -11591,20 +12018,27 @@ msgid "_Generated trait_:" msgstr "Rust ناایمن" #: src/android/aidl/example-service/service-bindings.md:24 -msgid "Your service will need to implement this trait, and your client will use this trait to talk to the service." +msgid "" +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md:29 -msgid "The generated bindings can be found at `out/soong/.intermediates//`." +msgid "" +"The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" #: src/android/aidl/example-service/service-bindings.md:31 msgid "" -"Point out how the generated function signature, specifically the argument and return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." msgstr "" #: src/android/aidl/example-service/service-bindings.md:33 -msgid "`String` for an argument results in a different Rust type than `String` as a return type." +msgid "" +"`String` for an argument results in a different Rust type than `String` as a " +"return type." msgstr "" #: src/android/aidl/example-service/service.md:1 @@ -11615,7 +12049,8 @@ msgstr "" msgid "We can now implement the AIDL service:" msgstr "" -#: src/android/aidl/example-service/service.md:5 src/android/aidl/example-service/changing-implementation.md:5 +#: src/android/aidl/example-service/service.md:5 +#: src/android/aidl/example-service/changing-implementation.md:5 msgid "_birthday_service/src/lib.rs_:" msgstr "" @@ -11623,41 +12058,51 @@ msgstr "" msgid "/// The `IBirthdayService` implementation.\n" msgstr "" -#: src/android/aidl/example-service/service.md:18 src/android/aidl/example-service/changing-implementation.md:16 +#: src/android/aidl/example-service/service.md:18 +#: src/android/aidl/example-service/changing-implementation.md:16 #: src/android/aidl/types/file-descriptor.md:57 msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "" -#: src/android/aidl/example-service/service.md:23 src/android/aidl/example-service/server.md:28 +#: src/android/aidl/example-service/service.md:23 +#: src/android/aidl/example-service/server.md:28 #: src/android/aidl/example-service/client.md:31 msgid "_birthday_service/Android.bp_:" msgstr "" -#: src/android/aidl/example-service/service.md:27 src/android/aidl/example-service/server.md:38 +#: src/android/aidl/example-service/service.md:27 +#: src/android/aidl/example-service/server.md:38 msgid "\"libbirthdayservice\"" msgstr "" -#: src/android/aidl/example-service/service.md:29 src/android/aidl/example-service/server.md:13 +#: src/android/aidl/example-service/service.md:29 +#: src/android/aidl/example-service/server.md:13 #: src/android/aidl/example-service/client.md:11 msgid "\"birthdayservice\"" msgstr "" -#: src/android/aidl/example-service/service.md:31 src/android/aidl/example-service/server.md:36 +#: src/android/aidl/example-service/service.md:31 +#: src/android/aidl/example-service/server.md:36 #: src/android/aidl/example-service/client.md:39 msgid "\"com.example.birthdayservice-rust\"" msgstr "" -#: src/android/aidl/example-service/service.md:32 src/android/aidl/example-service/server.md:37 +#: src/android/aidl/example-service/service.md:32 +#: src/android/aidl/example-service/server.md:37 #: src/android/aidl/example-service/client.md:40 msgid "\"libbinder_rs\"" msgstr "" #: src/android/aidl/example-service/service.md:39 -msgid "Point out the path to the generated `IBirthdayService` trait, and explain why each of the segments is necessary." +msgid "" +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." msgstr "" #: src/android/aidl/example-service/service.md:41 -msgid "TODO: What does the `binder::Interface` trait do? Are there methods to override? Where source?" +msgid "" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" msgstr "" #: src/android/aidl/example-service/server.md:1 @@ -11684,7 +12129,8 @@ msgstr "" msgid "\"Failed to register service\"" msgstr "" -#: src/android/aidl/example-service/server.md:32 src/android/aidl/example-service/server.md:33 +#: src/android/aidl/example-service/server.md:32 +#: src/android/aidl/example-service/server.md:33 msgid "\"birthday_server\"" msgstr "" @@ -11693,15 +12139,18 @@ msgstr "" msgid "\"src/server.rs\"" msgstr "سرورها" -#: src/android/aidl/example-service/server.md:40 src/android/aidl/example-service/client.md:42 +#: src/android/aidl/example-service/server.md:40 +#: src/android/aidl/example-service/client.md:42 msgid "// To avoid dynamic link error.\n" msgstr "" #: src/android/aidl/example-service/server.md:46 msgid "" -"The process for taking a user-defined service implementation (in this case the `BirthdayService` type, which implements the " -"`IBirthdayService`) and starting it as a Binder service has multiple steps, and may appear more complicated than students are used " -"to if they've used Binder from C++ or another language. Explain to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." msgstr "" #: src/android/aidl/example-service/server.md:52 @@ -11710,17 +12159,23 @@ msgstr "" #: src/android/aidl/example-service/server.md:53 msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this case). This type is generated by Binder and " -"provides the common Binder functionality that would be provided by the `BnBinder` base class in C++. We don't have inheritance in " -"Rust, so instead we use composition, putting our `BirthdayService` within the generated `BnBinderService`." +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " +"functionality that would be provided by the `BnBinder` base class in C++. We " +"don't have inheritance in Rust, so instead we use composition, putting our " +"`BirthdayService` within the generated `BnBinderService`." msgstr "" #: src/android/aidl/example-service/server.md:58 -msgid "Call `add_service`, giving it a service identifier and your service object (the `BnBirthdayService` object in the example)." +msgid "" +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." msgstr "" #: src/android/aidl/example-service/server.md:60 -msgid "Call `join_thread_pool` to add the current thread to Binder's thread pool and start listening for connections." +msgid "" +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." msgstr "" #: src/android/aidl/example-service/deploy.md:3 @@ -11731,7 +12186,8 @@ msgstr "" msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -11753,7 +12209,8 @@ msgstr "" msgid "Finally, we can create a Rust client for our new service." msgstr "" -#: src/android/aidl/example-service/client.md:5 src/android/aidl/example-service/changing-implementation.md:29 +#: src/android/aidl/example-service/client.md:5 +#: src/android/aidl/example-service/changing-implementation.md:29 msgid "_birthday_service/src/client.rs_:" msgstr "" @@ -11761,7 +12218,9 @@ msgstr "" msgid "/// Call the birthday service.\n" msgstr "" -#: src/android/aidl/example-service/client.md:23 src/android/aidl/types/objects.md:54 src/android/aidl/types/parcelables.md:32 +#: src/android/aidl/example-service/client.md:23 +#: src/android/aidl/types/objects.md:54 +#: src/android/aidl/types/parcelables.md:32 #: src/android/aidl/types/file-descriptor.md:20 msgid "\"Failed to connect to BirthdayService\"" msgstr "" @@ -11774,7 +12233,8 @@ msgstr "" msgid "\"{msg}\"" msgstr "" -#: src/android/aidl/example-service/client.md:35 src/android/aidl/example-service/client.md:36 +#: src/android/aidl/example-service/client.md:35 +#: src/android/aidl/example-service/client.md:36 msgid "\"birthday_client\"" msgstr "" @@ -11794,35 +12254,44 @@ msgstr "" msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" #: src/android/aidl/example-service/client.md:62 -msgid "`Strong` is the trait object representing the service that the client has connected to." +msgid "" +"`Strong` is the trait object representing the service " +"that the client has connected to." msgstr "" #: src/android/aidl/example-service/client.md:64 msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-process ref count for the service trait object, and the " -"global Binder ref count that tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." msgstr "" #: src/android/aidl/example-service/client.md:67 msgid "" -"Note that the trait object that the client uses to talk to the service uses the exact same trait that the server implements. For a " -"given Binder interface, there is a single Rust trait generated that both client and server use." +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." msgstr "" #: src/android/aidl/example-service/client.md:71 msgid "" -"Use the same service identifier used when registering the service. This should ideally be defined in a common crate that both the " -"client and server can depend on." +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." msgstr "" #: src/android/aidl/example-service/changing-definition.md:3 -msgid "Let us extend the API with more functionality: we want to let clients specify a list of lines for the birthday card:" +msgid "" +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" msgstr "" #: src/android/aidl/example-service/changing-definition.md:16 @@ -11831,8 +12300,9 @@ msgstr "" #: src/android/aidl/example-service/changing-definition.md:31 msgid "" -"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in Rust, i.e. that idiomatic Rust types are used in " -"the generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" msgstr "" #: src/android/aidl/example-service/changing-definition.md:34 @@ -11868,7 +12338,8 @@ msgid "\"And also: many more\"" msgstr "" #: src/android/aidl/example-service/changing-implementation.md:44 -msgid "TODO: Move code snippets into project files where they'll actually be built?" +msgid "" +"TODO: Move code snippets into project files where they'll actually be built?" msgstr "" #: src/android/aidl/types.md:1 @@ -11888,7 +12359,9 @@ msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" #: src/android/aidl/types.md:7 -msgid "References to AIDL objects and file handles can be sent between clients and services." +msgid "" +"References to AIDL objects and file handles can be sent between clients and " +"services." msgstr "" #: src/android/aidl/types.md:9 @@ -11904,7 +12377,8 @@ msgstr "" msgid "AIDL Type" msgstr "AIDL" -#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 src/android/interoperability/cpp/type-mapping.md:3 +#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 +#: src/android/interoperability/cpp/type-mapping.md:3 #, fuzzy msgid "Rust Type" msgstr "انواع داده‌های بازگشتی" @@ -11972,8 +12446,9 @@ msgstr "" #: src/android/aidl/types/arrays.md:3 msgid "" -"The array types (`T[]`, `byte[]`, and `List`) get translated to the appropriate Rust array type depending on how they are used in " -"the function signature:" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the " +"appropriate Rust array type depending on how they are used in the function " +"signature:" msgstr "" #: src/android/aidl/types/arrays.md:7 @@ -12002,14 +12477,17 @@ msgstr "" msgid "Return" msgstr "" -#: src/android/aidl/types/arrays.md:11 src/android/interoperability/cpp/type-mapping.md:11 +#: src/android/aidl/types/arrays.md:11 +#: src/android/interoperability/cpp/type-mapping.md:11 msgid "`Vec`" msgstr "" #: src/android/aidl/types/arrays.md:15 msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes `[T; N]`. Fixed-size arrays can have multiple " -"dimensions (e.g. `int[3][4]`). In the Java backend, fixed-size arrays are represented as array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" #: src/android/aidl/types/arrays.md:18 @@ -12017,15 +12495,22 @@ msgid "Arrays in parcelable fields always get translated to `Vec`." msgstr "" #: src/android/aidl/types/objects.md:3 -msgid "AIDL objects can be sent either as a concrete AIDL type or as the type-erased `IBinder` interface:" +msgid "" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" msgstr "" #: src/android/aidl/types/objects.md:6 -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" msgstr "" -#: src/android/aidl/types/objects.md:17 src/android/aidl/types/parcelables.md:16 src/android/aidl/types/file-descriptor.md:6 -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +#: src/android/aidl/types/objects.md:17 +#: src/android/aidl/types/parcelables.md:16 +#: src/android/aidl/types/file-descriptor.md:6 +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" #: src/android/aidl/types/objects.md:23 @@ -12036,7 +12521,9 @@ msgstr "" msgid "/** The same thing, but using `IBinder`. */" msgstr "" -#: src/android/aidl/types/objects.md:31 src/android/aidl/types/parcelables.md:27 src/android/aidl/types/file-descriptor.md:15 +#: src/android/aidl/types/objects.md:31 +#: src/android/aidl/types/parcelables.md:27 +#: src/android/aidl/types/file-descriptor.md:15 msgid "**birthday_service/src/client.rs**:" msgstr "" @@ -12053,11 +12540,14 @@ msgid "// Send the binder object to the service.\n" msgstr "" #: src/android/aidl/types/objects.md:65 -msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" msgstr "" #: src/android/aidl/types/objects.md:72 -msgid "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as `BnBirthdayService` that we saw previously." +msgid "" +"Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " +"`BnBirthdayService` that we saw previously." msgstr "" #: src/android/aidl/types/parcelables.md:3 @@ -12065,7 +12555,8 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "" #: src/android/aidl/types/parcelables.md:5 -msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" msgstr "" #: src/android/aidl/types/parcelables.md:22 @@ -12073,7 +12564,9 @@ msgid "/** The same thing, but with a parcelable. */" msgstr "" #: src/android/aidl/types/file-descriptor.md:3 -msgid "Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` type:" +msgid "" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" msgstr "" #: src/android/aidl/types/file-descriptor.md:10 @@ -12107,7 +12600,8 @@ msgstr "" #: src/android/aidl/types/file-descriptor.md:41 msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" msgstr "" @@ -12117,12 +12611,15 @@ msgstr "" #: src/android/aidl/types/file-descriptor.md:64 msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` (or any other type that wraps an `OwnedFd`), and can " -"be used to create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." msgstr "" #: src/android/aidl/types/file-descriptor.md:67 -msgid "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX sockets." +msgid "" +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" #: src/android/testing.md @@ -12132,8 +12629,8 @@ msgstr "Rust در اندروید" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests work in AOSP. Use the `rust_test` module for your unit " -"tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests " +"work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" #: src/android/testing.md @@ -12199,7 +12696,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -12207,11 +12705,15 @@ msgid "" msgstr "" #: src/android/testing.md -msgid "Notice how you only mention the root of the library crate. Tests are found recursively in nested modules." +msgid "" +"Notice how you only mention the root of the library crate. Tests are found " +"recursively in nested modules." msgstr "" #: src/android/testing/googletest.md:3 -msgid "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test assertions using _matchers_:" +msgid "" +"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " +"assertions using _matchers_:" msgstr "" #: src/android/testing/googletest.md:11 @@ -12223,31 +12725,39 @@ msgid "\"xyz\"" msgstr "" #: src/android/testing/googletest.md:16 -msgid "If we change the last element to `\"!\"`, the test fails with a structured error message pin-pointing the error:" +msgid "" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" msgstr "" #: src/android/testing/googletest.md:37 msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this example in a local environment. Use `cargo add googletest` to " -"quickly add it to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" #: src/android/testing/googletest.md:41 msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used macros and types](https://docs.rs/googletest/latest/" -"googletest/prelude/index.html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used " +"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." +"html)." msgstr "" #: src/android/testing/googletest.md:44 msgid "" -"This just scratches the surface, there are many builtin matchers. Consider going through the first chapter of [\"Advanced testing " -"for Rust applications\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-guided Rust course: it provides a " -"guided introduction to the library, with exercises to help you get comfortable with `googletest` macros, its matchers and its " -"overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust applications" +"\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-" +"guided Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" #: src/android/testing/googletest.md:51 -msgid "A particularly nice feature is that mismatches in multi-line strings are shown as a diff:" +msgid "" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" msgstr "" #: src/android/testing/googletest.md:57 @@ -12269,62 +12779,75 @@ msgid "shows a color-coded diff (colors not shown here):" msgstr "" #: src/android/testing/googletest.md:86 -msgid "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/googletest/)." +msgid "" +"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" +"googletest/)." msgstr "" #: src/android/testing/mocking.md:3 msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You need to refactor your code to use traits, which you " -"can then quickly mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " +"You need to refactor your code to use traits, which you can then quickly " +"mock:" msgstr "" #: src/android/testing/mocking.md:27 msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are other [mocking libraries available on crates.io](https://" -"crates.io/keywords/mock), in particular in the area of mocking HTTP services. The other mocking libraries work in a similar fashion " -"as Mockall, meaning that they make it easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other [mocking libraries available on crates.io](https://crates.io/keywords/" +"mock), in particular in the area of mocking HTTP services. The other mocking " +"libraries work in a similar fashion as Mockall, meaning that they make it " +"easy to get a mock implementation of a given trait." msgstr "" #: src/android/testing/mocking.md:33 msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely isolate a test from its dependencies. The immediate " -"result is faster and more stable test execution. On the other hand, the mocks can be configured wrongly and return output different " -"from what the real dependencies would do." +"Note that mocking is somewhat _controversial_: mocks allow you to completely " +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." msgstr "" #: src/android/testing/mocking.md:38 msgid "" -"If at all possible, it is recommended that you use the real dependencies. As an example, many databases allow you to configure an in-" -"memory backend. This means that you get the correct behavior in your tests, plus they are fast and will automatically clean up after " -"themselves." +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." msgstr "" #: src/android/testing/mocking.md:43 msgid "" -"Similarly, many web frameworks allow you to start an in-process server which binds to a random port on `localhost`. Always prefer " -"this over mocking away the framework since it helps you test your code in the real environment." +"Similarly, many web frameworks allow you to start an in-process server which " +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." msgstr "" #: src/android/testing/mocking.md:47 msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example in a local environment. Use `cargo add mockall` to " -"quickly add Mockall to an existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." msgstr "" #: src/android/testing/mocking.md:51 msgid "" -"Mockall has a lot more functionality. In particular, you can set up expectations which depend on the arguments passed. Here we use " -"this to mock a cat which becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" #: src/android/testing/mocking.md:69 msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be called to `n` --- the mock will automatically panic when " -"dropped if this isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" #: src/android/logging.md -msgid "You should use the `log` crate to automatically log to `logcat` (on-device) or `stdout` (on-host):" +msgid "" +"You should use the `log` crate to automatically log to `logcat` (on-device) " +"or `stdout` (on-host):" msgstr "" #: src/android/logging.md @@ -12371,7 +12894,8 @@ msgstr "" msgid "\"Something went wrong!\"" msgstr "" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 src/android/interoperability/with-c/rust.md:72 +#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 +#: src/android/interoperability/with-c/rust.md:72 msgid "Build, push, and run the binary on your device:" msgstr "" @@ -12379,7 +12903,8 @@ msgstr "" msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" @@ -12389,7 +12914,9 @@ msgid "The logs show up in `adb logcat`:" msgstr "" #: src/android/interoperability.md -msgid "Rust has excellent support for interoperability with other languages. This means that you can:" +msgid "" +"Rust has excellent support for interoperability with other languages. This " +"means that you can:" msgstr "" #: src/android/interoperability.md @@ -12401,7 +12928,9 @@ msgid "Call functions written in other languages from Rust." msgstr "" #: src/android/interoperability.md -msgid "When you call functions in a foreign language we say that you're using a _foreign function interface_, also known as FFI." +msgid "" +"When you call functions in a foreign language we say that you're using a " +"_foreign function interface_, also known as FFI." msgstr "" #: src/android/interoperability/with-c.md:1 @@ -12410,8 +12939,8 @@ msgstr "" #: src/android/interoperability/with-c.md:3 msgid "" -"Rust has full support for linking object files with a C calling convention. Similarly, you can export Rust functions and call them " -"from C." +"Rust has full support for linking object files with a C calling convention. " +"Similarly, you can export Rust functions and call them from C." msgstr "" #: src/android/interoperability/with-c.md:6 @@ -12427,11 +12956,15 @@ msgid "\"{x}, {abs_x}\"" msgstr "" #: src/android/interoperability/with-c.md:21 -msgid "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise.md)." +msgid "" +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." msgstr "" #: src/android/interoperability/with-c.md:24 -msgid "This assumes full knowledge of the target platform. Not recommended for production." +msgid "" +"This assumes full knowledge of the target platform. Not recommended for " +"production." msgstr "" #: src/android/interoperability/with-c.md:27 @@ -12443,7 +12976,9 @@ msgid "Using Bindgen" msgstr "" #: src/android/interoperability/with-c/bindgen.md:3 -msgid "The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool can auto-generate bindings from a C header file." +msgid "" +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"tool can auto-generate bindings from a C header file." msgstr "" #: src/android/interoperability/with-c/bindgen.md:6 @@ -12462,11 +12997,13 @@ msgstr "" msgid "" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:23 src/android/interoperability/with-c/bindgen.md:50 +#: src/android/interoperability/with-c/bindgen.md:23 +#: src/android/interoperability/with-c/bindgen.md:50 msgid "\"libbirthday.h\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:26 src/android/interoperability/with-c/bindgen.md:29 +#: src/android/interoperability/with-c/bindgen.md:26 +#: src/android/interoperability/with-c/bindgen.md:29 msgid "\"+--------------\\n\"" msgstr "" @@ -12482,12 +13019,15 @@ msgstr "" msgid "Add this to your `Android.bp` file:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:35 src/android/interoperability/with-c/bindgen.md:55 -#: src/android/interoperability/with-c/bindgen.md:69 src/android/interoperability/with-c/bindgen.md:109 +#: src/android/interoperability/with-c/bindgen.md:35 +#: src/android/interoperability/with-c/bindgen.md:55 +#: src/android/interoperability/with-c/bindgen.md:69 +#: src/android/interoperability/with-c/bindgen.md:109 msgid "_interoperability/bindgen/Android.bp_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:39 src/android/interoperability/with-c/bindgen.md:63 +#: src/android/interoperability/with-c/bindgen.md:39 +#: src/android/interoperability/with-c/bindgen.md:63 msgid "\"libbirthday\"" msgstr "" @@ -12496,7 +13036,9 @@ msgid "\"libbirthday.c\"" msgstr "" #: src/android/interoperability/with-c/bindgen.md:44 -msgid "Create a wrapper header file for the library (not strictly needed in this example):" +msgid "" +"Create a wrapper header file for the library (not strictly needed in this " +"example):" msgstr "" #: src/android/interoperability/with-c/bindgen.md:47 @@ -12507,7 +13049,8 @@ msgstr "" msgid "You can now auto-generate the bindings:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:59 src/android/interoperability/with-c/bindgen.md:75 +#: src/android/interoperability/with-c/bindgen.md:59 +#: src/android/interoperability/with-c/bindgen.md:75 msgid "\"libbirthday_bindgen\"" msgstr "" @@ -12546,8 +13089,10 @@ msgstr "" #: src/android/interoperability/with-c/bindgen.md:89 msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" msgstr "" @@ -12555,7 +13100,8 @@ msgstr "" msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" @@ -12564,7 +13110,8 @@ msgstr "" msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:113 src/android/interoperability/with-c/bindgen.md:115 +#: src/android/interoperability/with-c/bindgen.md:113 +#: src/android/interoperability/with-c/bindgen.md:115 msgid "\"libbirthday_bindgen_test\"" msgstr "" @@ -12572,7 +13119,8 @@ msgstr "" msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:118 src/android/interoperability/with-c/bindgen.md:119 +#: src/android/interoperability/with-c/bindgen.md:118 +#: src/android/interoperability/with-c/bindgen.md:119 msgid "\"none\"" msgstr "" @@ -12616,7 +13164,8 @@ msgstr "" msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "" -#: src/android/interoperability/with-c/rust.md:41 src/android/interoperability/with-c/rust.md:68 +#: src/android/interoperability/with-c/rust.md:41 +#: src/android/interoperability/with-c/rust.md:68 msgid "\"libanalyze_ffi\"" msgstr "" @@ -12656,19 +13205,23 @@ msgstr "" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" #: src/android/interoperability/with-c/rust.md:82 msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the name of the function. You can also use " -"`#[export_name = \"some_name\"]` to specify whatever name you want." +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " +"will just be the name of the function. You can also use `#[export_name = " +"\"some_name\"]` to specify whatever name you want." msgstr "" #: src/android/interoperability/cpp.md:3 -msgid "The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability between Rust and C++." +msgid "" +"The [CXX crate](https://cxx.rs/) makes it possible to do safe " +"interoperability between Rust and C++." msgstr "" #: src/android/interoperability/cpp.md:6 @@ -12677,8 +13230,9 @@ msgstr "" #: src/android/interoperability/cpp/bridge.md:3 msgid "" -"CXX relies on a description of the function signatures that will be exposed from each language to the other. You provide this " -"description using extern blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed " +"from each language to the other. You provide this description using extern " +"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" #: src/android/interoperability/cpp/bridge.md:9 @@ -12689,28 +13243,36 @@ msgstr "" msgid "// Shared structs with fields visible to both languages.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:17 src/android/interoperability/cpp/generated-cpp.md:6 +#: src/android/interoperability/cpp/bridge.md:17 +#: src/android/interoperability/cpp/generated-cpp.md:6 msgid "// Rust types and signatures exposed to C++.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:18 src/android/interoperability/cpp/rust-bridge.md:6 -#: src/android/interoperability/cpp/generated-cpp.md:7 src/android/interoperability/cpp/rust-result.md:6 -#: src/chromium/interoperability-with-cpp/example-bindings.md:9 src/chromium/interoperability-with-cpp/error-handling-qr.md:10 +#: src/android/interoperability/cpp/bridge.md:18 +#: src/android/interoperability/cpp/rust-bridge.md:6 +#: src/android/interoperability/cpp/generated-cpp.md:7 +#: src/android/interoperability/cpp/rust-result.md:6 +#: src/chromium/interoperability-with-cpp/example-bindings.md:9 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md:10 #: src/chromium/interoperability-with-cpp/error-handling-png.md:9 #, fuzzy msgid "\"Rust\"" msgstr "Rustdoc" -#: src/android/interoperability/cpp/bridge.md:24 src/android/interoperability/cpp/cpp-bridge.md:6 +#: src/android/interoperability/cpp/bridge.md:24 +#: src/android/interoperability/cpp/cpp-bridge.md:6 msgid "// C++ types and signatures exposed to Rust.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:25 src/android/interoperability/cpp/cpp-bridge.md:7 -#: src/android/interoperability/cpp/cpp-exception.md:6 src/chromium/interoperability-with-cpp/example-bindings.md:15 +#: src/android/interoperability/cpp/bridge.md:25 +#: src/android/interoperability/cpp/cpp-bridge.md:7 +#: src/android/interoperability/cpp/cpp-exception.md:6 +#: src/chromium/interoperability-with-cpp/example-bindings.md:15 msgid "\"C++\"" msgstr "" -#: src/android/interoperability/cpp/bridge.md:26 src/android/interoperability/cpp/cpp-bridge.md:8 +#: src/android/interoperability/cpp/bridge.md:26 +#: src/android/interoperability/cpp/cpp-bridge.md:8 msgid "\"include/blobstore.h\"" msgstr "" @@ -12720,15 +13282,17 @@ msgstr "" #: src/android/interoperability/cpp/bridge.md:41 msgid "" -"From the declarations made in the bridge module, CXX will generate matching Rust and C++ type/function definitions in order to " -"expose those items to both languages." +"From the declarations made in the bridge module, CXX will generate matching " +"Rust and C++ type/function definitions in order to expose those items to " +"both languages." msgstr "" #: src/android/interoperability/cpp/bridge.md:44 msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/cargo-expand) to view the expanded proc macro. For " -"most of the examples you would use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't apply for Android " -"projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/" +"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " +"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " +"(though this doesn't apply for Android projects)." msgstr "" #: src/android/interoperability/cpp/bridge.md:47 @@ -12753,14 +13317,17 @@ msgid "// Free function\n" msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md:28 -msgid "Items declared in the `extern \"Rust\"` reference items that are in scope in the parent module." +msgid "" +"Items declared in the `extern \"Rust\"` reference items that are in scope in " +"the parent module." msgstr "" #: src/android/interoperability/cpp/rust-bridge.md:30 msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ header file containing the corresponding C++ " -"declarations. The generated header has the same path as the Rust source file containing the bridge, except with a .rs.h file " -"extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" +"+ header file containing the corresponding C++ declarations. The generated " +"header has the same path as the Rust source file containing the bridge, " +"except with a .rs.h file extension." msgstr "" #: src/android/interoperability/cpp/generated-cpp.md:15 @@ -12785,12 +13352,15 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md:56 msgid "" -"The programmer does not need to promise that the signatures they have typed in are accurate. CXX performs static assertions that the " -"signatures exactly correspond with what is declared in C++." +"The programmer does not need to promise that the signatures they have typed " +"in are accurate. CXX performs static assertions that the signatures exactly " +"correspond with what is declared in C++." msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md:59 -msgid "`unsafe extern` blocks allow you to declare C++ functions that are safe to call from Rust." +msgid "" +"`unsafe extern` blocks allow you to declare C++ functions that are safe to " +"call from Rust." msgstr "" #: src/android/interoperability/cpp/shared-types.md:9 @@ -12803,8 +13373,10 @@ msgstr "" #: src/android/interoperability/cpp/shared-types.md:24 msgid "" -"A limited number of traits are supported for `#[derive()]` on shared types. Corresponding functionality is also generated for the C+" -"+ code, e.g. if you derive `Hash` also generates an implementation of `std::hash` for the corresponding C++ type." +"A limited number of traits are supported for `#[derive()]` on shared types. " +"Corresponding functionality is also generated for the C++ code, e.g. if you " +"derive `Hash` also generates an implementation of `std::hash` for the " +"corresponding C++ type." msgstr "" #: src/android/interoperability/cpp/shared-enums.md:15 @@ -12818,9 +13390,10 @@ msgstr "" #: src/android/interoperability/cpp/shared-enums.md:46 msgid "" -"On the Rust side, the code generated for shared enums is actually a struct wrapping a numeric value. This is because it is not UB in " -"C++ for an enum class to hold a value different from all of the listed variants, and our Rust representation needs to have the same " -"behavior." +"On the Rust side, the code generated for shared enums is actually a struct " +"wrapping a numeric value. This is because it is not UB in C++ for an enum " +"class to hold a value different from all of the listed variants, and our " +"Rust representation needs to have the same behavior." msgstr "" #: src/android/interoperability/cpp/rust-result.md:13 @@ -12832,17 +13405,22 @@ msgid "\"Success!\"" msgstr "" #: src/android/interoperability/cpp/rust-result.md:22 -msgid "Rust functions that return `Result` are translated to exceptions on the C++ side." +msgid "" +"Rust functions that return `Result` are translated to exceptions on the C++ " +"side." msgstr "" #: src/android/interoperability/cpp/rust-result.md:24 msgid "" -"The exception thrown will always be of type `rust::Error`, which primarily exposes a way to get the error message string. The error " -"message will come from the error type's `Display` impl." +"The exception thrown will always be of type `rust::Error`, which primarily " +"exposes a way to get the error message string. The error message will come " +"from the error type's `Display` impl." msgstr "" #: src/android/interoperability/cpp/rust-result.md:27 -msgid "A panic unwinding from Rust to C++ will always cause the process to immediately terminate." +msgid "" +"A panic unwinding from Rust to C++ will always cause the process to " +"immediately terminate." msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:7 @@ -12855,14 +13433,16 @@ msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:22 msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception on the C++ side and return it as an `Err` value to the " -"calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception " +"on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:24 msgid "" -"If an exception is thrown from an extern \"C++\" function that is not declared by the CXX bridge to return `Result`, the program " -"calls C++'s `std::terminate`. The behavior is equivalent to the same exception being thrown through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not " +"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" +"terminate`. The behavior is equivalent to the same exception being thrown " +"through a `noexcept` C++ function." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:3 @@ -12926,37 +13506,49 @@ msgid "`std::vector`" msgstr "" #: src/android/interoperability/cpp/type-mapping.md:16 -msgid "These types can be used in the fields of shared structs and the arguments and returns of extern functions." +msgid "" +"These types can be used in the fields of shared structs and the arguments " +"and returns of extern functions." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:18 -msgid "Note that Rust's `String` does not map directly to `std::string`. There are a few reasons for this:" +msgid "" +"Note that Rust's `String` does not map directly to `std::string`. There are " +"a few reasons for this:" msgstr "" #: src/android/interoperability/cpp/type-mapping.md:20 -msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "" +"`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:21 -msgid "The two types have different layouts in memory and so can't be passed directly between languages." +msgid "" +"The two types have different layouts in memory and so can't be passed " +"directly between languages." msgstr "" #: src/android/interoperability/cpp/type-mapping.md:23 msgid "" -"`std::string` requires move constructors that don't match Rust's move semantics, so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move " +"semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:1 src/android/interoperability/cpp/android-cpp-genrules.md:1 +#: src/android/interoperability/cpp/android-build-cpp.md:1 +#: src/android/interoperability/cpp/android-cpp-genrules.md:1 #: src/android/interoperability/cpp/android-build-rust.md:1 #, fuzzy msgid "Building in Android" msgstr "Rust در اندروید" #: src/android/interoperability/cpp/android-build-cpp.md:3 -msgid "Create a `cc_library_static` to build the C++ library, including the CXX generated header and source file." +msgid "" +"Create a `cc_library_static` to build the C++ library, including the CXX " +"generated header and source file." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:8 src/android/interoperability/cpp/android-build-rust.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md:8 +#: src/android/interoperability/cpp/android-build-rust.md:10 msgid "\"libcxx_test_cpp\"" msgstr "" @@ -12968,35 +13560,42 @@ msgstr "" msgid "\"cxx-bridge-header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:12 src/android/interoperability/cpp/android-cpp-genrules.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md:12 +#: src/android/interoperability/cpp/android-cpp-genrules.md:10 msgid "\"libcxx_test_bridge_header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md:14 src/android/interoperability/cpp/android-cpp-genrules.md:19 +#: src/android/interoperability/cpp/android-build-cpp.md:14 +#: src/android/interoperability/cpp/android-cpp-genrules.md:19 msgid "\"libcxx_test_bridge_code\"" msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:20 msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the dependencies for the CXX-generated C++ bindings. " -"We'll show how these are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:23 -msgid "Note that you also need to depend on the `cxx-bridge-header` library in order to pull in common CXX definitions." +msgid "" +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." msgstr "" #: src/android/interoperability/cpp/android-build-cpp.md:25 msgid "" -"Full docs for using CXX in Android can be found in [the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" -"modules/android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share that link with the class so that students know " -"where they can find these instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:3 msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the CXX source file. These are then used as inputs to the " -"`cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the " +"CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:7 @@ -13005,7 +13604,8 @@ msgid "" "// to the Rust exported functions in lib.rs.\n" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md:11 src/android/interoperability/cpp/android-cpp-genrules.md:20 +#: src/android/interoperability/cpp/android-cpp-genrules.md:11 +#: src/android/interoperability/cpp/android-cpp-genrules.md:20 msgid "\"cxxbridge\"" msgstr "" @@ -13013,7 +13613,8 @@ msgstr "" msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md:13 src/android/interoperability/cpp/android-cpp-genrules.md:22 +#: src/android/interoperability/cpp/android-cpp-genrules.md:13 +#: src/android/interoperability/cpp/android-cpp-genrules.md:22 #: src/android/interoperability/cpp/android-build-rust.md:8 msgid "\"lib.rs\"" msgstr "" @@ -13036,18 +13637,20 @@ msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:29 msgid "" -"The `cxxbridge` tool is a standalone tool that generates the C++ side of the bridge module. It is included in Android and available " -"as a Soong tool." +"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " +"bridge module. It is included in Android and available as a Soong tool." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md:31 msgid "" -"By convention, if your Rust source file is `lib.rs` your header file will be named `lib.rs.h` and your source file will be named " -"`lib.rs.cc`. This naming convention isn't enforced, though." +"By convention, if your Rust source file is `lib.rs` your header file will be " +"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " +"convention isn't enforced, though." msgstr "" #: src/android/interoperability/cpp/android-build-rust.md:3 -msgid "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." +msgid "" +"Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" #: src/android/interoperability/cpp/android-build-rust.md:7 @@ -13064,8 +13667,9 @@ msgstr "" #: src/android/interoperability/java.md:3 msgid "" -"Java can load shared objects via [Java Native Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface). The [`jni` " -"crate](https://docs.rs/jni/) allows you to create a compatible library." +"Java can load shared objects via [Java Native Interface (JNI)](https://en." +"wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" +"jni/) allows you to create a compatible library." msgstr "" #: src/android/interoperability/java.md:8 @@ -13092,15 +13696,18 @@ msgstr "" msgid "\"Hello, {input}!\"" msgstr "" -#: src/android/interoperability/java.md:33 src/android/interoperability/java.md:63 +#: src/android/interoperability/java.md:33 +#: src/android/interoperability/java.md:63 msgid "_interoperability/java/Android.bp_:" msgstr "" -#: src/android/interoperability/java.md:37 src/android/interoperability/java.md:70 +#: src/android/interoperability/java.md:37 +#: src/android/interoperability/java.md:70 msgid "\"libhello_jni\"" msgstr "" -#: src/android/interoperability/java.md:38 src/android/interoperability/java.md:53 +#: src/android/interoperability/java.md:38 +#: src/android/interoperability/java.md:53 msgid "\"hello_jni\"" msgstr "" @@ -13136,7 +13743,8 @@ msgstr "" #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with and try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with " +"and try to integrate some Rust into it. Some suggestions:" msgstr "" #: src/exercises/android/morning.md @@ -13149,8 +13757,8 @@ msgstr "" #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone in the class having a piece of code which you can turn " -"in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone " +"in the class having a piece of code which you can turn in to Rust on the fly." msgstr "" #: src/chromium.md @@ -13159,30 +13767,36 @@ msgstr "" #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party glue code to connect between Rust and existing Chromium C+" -"+ code." +"Rust is supported for third-party libraries in Chromium, with first-party " +"glue code to connect between Rust and existing Chromium C++ code." msgstr "" #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've got a corner of the code where you're displaying a UTF8 " -"string to the user, feel free to follow this recipe in your part of the codebase instead of the exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've " +"got a corner of the code where you're displaying a UTF8 string to the user, " +"feel free to follow this recipe in your part of the codebase instead of the " +"exact part we talk about." msgstr "" #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build flags is OK, so long as your code is relatively recent " -"(commit position 1223636 onwards, corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build " +"flags is OK, so long as your code is relatively recent (commit position " +"1223636 onwards, corresponding to November 2023):" msgstr "" #: src/chromium/setup.md -msgid "(A component, debug build is recommended for quickest iteration time. This is the default!)" +msgid "" +"(A component, debug build is recommended for quickest iteration time. This " +"is the default!)" msgstr "" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-code/) if you aren't already at that point. Be " -"warned: setting up to build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" +"the-code/) if you aren't already at that point. Be warned: setting up to " +"build Chromium takes time." msgstr "" #: src/chromium/setup.md @@ -13195,14 +13809,17 @@ msgstr "" #: src/chromium/setup.md msgid "" -"This part of the course has a series of exercises which build on each other. We'll be doing them spread throughout the course " -"instead of just at the end. If you don't have time to complete a certain part, don't worry: you can catch up in the next slot." +"This part of the course has a series of exercises which build on each other. " +"We'll be doing them spread throughout the course instead of just at the end. " +"If you don't have time to complete a certain part, don't worry: you can " +"catch up in the next slot." msgstr "" #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io](https://crates.io/). Chromium is built using `gn` and " -"`ninja` and a curated set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io]" +"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " +"set of dependencies." msgstr "" #: src/chromium/cargo.md @@ -13211,24 +13828,29 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e.g. `rust_static_library` that we'll meet later). " -"This uses Chromium's audited toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." +"gni` (e.g. `rust_static_library` that we'll meet later). This uses " +"Chromium's audited toolchain and crates." msgstr "" #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates](https://chromium.googlesource.com/chromium/src/+/" -"refs/heads/main/docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " +"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" +"docs/rust.md#Using-cargo)" msgstr "" #: src/chromium/cargo.md -msgid "Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded from the internet](https://crates.io/)" +msgid "" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " +"downloaded from the internet](https://crates.io/)" msgstr "" #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code can be built into the Chromium browser. At the " -"same time, Cargo is an important part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " +"code can be built into the Chromium browser. At the same time, Cargo is an " +"important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" #: src/chromium/cargo.md @@ -13241,48 +13863,64 @@ msgid "Split into small groups and:" msgstr "" #: src/chromium/cargo.md -msgid "Brainstorm scenarios where `cargo` may offer an advantage and assess the risk profile of these scenarios." +msgid "" +"Brainstorm scenarios where `cargo` may offer an advantage and assess the " +"risk profile of these scenarios." msgstr "" #: src/chromium/cargo.md -msgid "Discuss which tools, libraries, and groups of people need to be trusted when using `gn` and `ninja`, offline `cargo`, etc." +msgid "" +"Discuss which tools, libraries, and groups of people need to be trusted when " +"using `gn` and `ninja`, offline `cargo`, etc." msgstr "" #: src/chromium/cargo.md msgid "" -"Ask students to avoid peeking at the speaker notes before completing the exercise. Assuming folks taking the course are physically " -"together, ask them to discuss in small groups of 3-4 people." +"Ask students to avoid peeking at the speaker notes before completing the " +"exercise. Assuming folks taking the course are physically together, ask them " +"to discuss in small groups of 3-4 people." msgstr "" #: src/chromium/cargo.md -msgid "Notes/hints related to the first part of the exercise (\"scenarios where Cargo may offer an advantage\"):" +msgid "" +"Notes/hints related to the first part of the exercise (\"scenarios where " +"Cargo may offer an advantage\"):" msgstr "" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, one has access to the rich ecosystem of crates.io " -"libraries. There is a crate for almost anything and they are usually quite pleasant to use. (`clap` for command-line parsing, " -"`serde` for serializing/deserializing to/from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, " +"one has access to the rich ecosystem of crates.io libraries. There is a " +"crate for almost anything and they are usually quite pleasant to use. " +"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" +"from various formats, `itertools` for working with iterators, etc.)." msgstr "" #: src/chromium/cargo.md -msgid "`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` and start writing code)" +msgid "" +"`cargo` makes it easy to try a library (just add a single line to `Cargo." +"toml` and start writing code)" msgstr "" #: src/chromium/cargo.md -msgid "It may be worth comparing how CPAN helped make `perl` a popular choice. Or comparing with `python` + `pip`." +msgid "" +"It may be worth comparing how CPAN helped make `perl` a popular choice. Or " +"comparing with `python` + `pip`." msgstr "" #: src/chromium/cargo.md msgid "" -"Development experience is made really nice not only by core Rust tools (e.g. using `rustup` to switch to a different `rustc` version " -"when testing a crate that needs to work on nightly, current stable, and older stable) but also by an ecosystem of third-party tools " -"(e.g. Mozilla provides `cargo vet` for streamlining and sharing security audits; `criterion` crate gives a streamlined way to run " -"benchmarks)." +"Development experience is made really nice not only by core Rust tools (e.g. " +"using `rustup` to switch to a different `rustc` version when testing a crate " +"that needs to work on nightly, current stable, and older stable) but also by " +"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a " +"streamlined way to run benchmarks)." msgstr "" #: src/chromium/cargo.md -msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "" +"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" #: src/chromium/cargo.md @@ -13290,20 +13928,25 @@ msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" #: src/chromium/cargo.md -msgid "Broad, generic examples of projects where `cargo` may be the right choice:" +msgid "" +"Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for writing command line tools. The breadth and " -"ergonomics of libraries is comparable to Python, while being more robust (thanks to the rich typesystem) and running faster (as a " -"compiled, rather than interpreted language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " +"for writing command line tools. The breadth and ergonomics of libraries is " +"comparable to Python, while being more robust (thanks to the rich " +"typesystem) and running faster (as a compiled, rather than interpreted " +"language)." msgstr "" #: src/chromium/cargo.md msgid "" -"Participating in the Rust ecosystem requires using standard Rust tools like Cargo. Libraries that want to get external " -"contributions, and want to be used outside of Chromium (e.g. in Bazel or Android/Soong build environments) should probably use Cargo." +"Participating in the Rust ecosystem requires using standard Rust tools like " +"Cargo. Libraries that want to get external contributions, and want to be " +"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " +"should probably use Cargo." msgstr "" #: src/chromium/cargo.md @@ -13311,7 +13954,9 @@ msgid "Examples of Chromium-related projects that are `cargo`\\-based:" msgstr "" #: src/chromium/cargo.md -msgid "`serde_json_lenient` (experimented with in other parts of Google which resulted in PRs with performance improvements)" +msgid "" +"`serde_json_lenient` (experimented with in other parts of Google which " +"resulted in PRs with performance improvements)" msgstr "" #: src/chromium/cargo.md @@ -13320,36 +13965,41 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` for command-line parsing and on `toml` for configuration " -"files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` " +"for command-line parsing and on `toml` for configuration files." msgstr "" #: src/chromium/cargo.md msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when building and bootstrapping Rust standard library when " -"building Rust toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " +"when building and bootstrapping Rust standard library when building Rust " +"toolchain." msgstr "" #: src/chromium/cargo.md msgid "" -"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on third-party libraries downloaded from the internet, but " -"`run_gnrt.py` asks `cargo` that only `--locked` content is allowed via `Cargo.lock`.)" +"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " +"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " +"`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" #: src/chromium/cargo.md -msgid "Students may identify the following items as being implicitly or explicitly trusted:" +msgid "" +"Students may identify the following items as being implicitly or explicitly " +"trusted:" msgstr "" #: src/chromium/cargo.md msgid "" -"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the Clang compiler, the `rustc` sources (fetched from " -"GitHub, reviewed by Rust compiler team), binary Rust compiler downloaded for bootstrapping" +"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the " +"Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " +"compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" #: src/chromium/cargo.md msgid "" -"`rustup` (it may be worth pointing out that `rustup` is developed under the umbrella of the https://github.com/rust-lang/ " -"organization - same as `rustc`)" +"`rustup` (it may be worth pointing out that `rustup` is developed under the " +"umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" #: src/chromium/cargo.md @@ -13358,7 +14008,8 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for distributing the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for " +"distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" #: src/chromium/cargo.md @@ -13366,7 +14017,9 @@ msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." msgstr "" #: src/chromium/cargo.md -msgid "Rust libraries vendored into `//third_party/rust` (audited by security@chromium.org)" +msgid "" +"Rust libraries vendored into `//third_party/rust` (audited by " +"security@chromium.org)" msgstr "" #: src/chromium/cargo.md @@ -13379,45 +14032,58 @@ msgstr "" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as approved by Chromium's [Area Tech Leads](https://source." -"chromium.org/chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as " +"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" +"chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://chromium.googlesource.com/chromium/src/+/main/docs/" -"adding_to_third_party.md#rust) - Rust is allowed for third party libraries under various circumstances, including if they're the " -"best option for performance or for security." +"Chromium's policy on third party libraries is outlined [here](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." +"md#rust) - Rust is allowed for third party libraries under various " +"circumstances, including if they're the best option for performance or for " +"security." msgstr "" #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that nearly all such libraries will require a small amount of " -"first-party glue code." +"Very few Rust libraries directly expose a C/C++ API, so that means that " +"nearly all such libraries will require a small amount of first-party glue " +"code." msgstr "" #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" -": \"C++\" : : \"wrapper\" crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" +": \"C++\" : : \"wrapper\" " +"crate :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should normally be kept in `third_party/rust///" -"wrapper`." +"First-party Rust glue code for a particular third-party crate should " +"normally be kept in `third_party/rust///wrapper`." msgstr "" #: src/chromium/policy.md @@ -13443,8 +14109,9 @@ msgstr "قوانین ساخت" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` for efficiency --- its static rules allow maximum " -"parallelism. Rust is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and " +"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " +"is no exception." msgstr "" #: src/chromium/build-rules.md @@ -13452,7 +14119,8 @@ msgid "Adding Rust code to Chromium" msgstr "" #: src/chromium/build-rules.md -msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgid "" +"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" msgstr "" #: src/chromium/build-rules.md @@ -13468,27 +14136,33 @@ msgid "" msgstr "" #: src/chromium/build-rules.md -msgid "You can also add `deps` on other Rust targets. Later we'll use this to depend upon third party code." +msgid "" +"You can also add `deps` on other Rust targets. Later we'll use this to " +"depend upon third party code." msgstr "" #: src/chromium/build-rules.md msgid "" -"You must specify _both_ the crate root, _and_ a full list of sources. The `crate_root` is the file given to the Rust compiler " -"representing the root file of the compilation unit --- typically `lib.rs`. `sources` is a complete list of all source files which " -"`ninja` needs in order to determine when rebuilds are necessary." +"You must specify _both_ the crate root, _and_ a full list of sources. The " +"`crate_root` is the file given to the Rust compiler representing the root " +"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " +"list of all source files which `ninja` needs in order to determine when " +"rebuilds are necessary." msgstr "" #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate is a compilation unit. A `static_library` is the " -"smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire " +"crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using [gn's built-in support for Rust static libraries](https://" -"gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library). The answer is that this template provides support for CXX " -"interop, Rust features, and unit tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using " +"[gn's built-in support for Rust static libraries](https://gn.googlesource." +"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " +"this template provides support for CXX interop, Rust features, and unit " +"tests, some of which we'll use later." msgstr "" #: src/chromium/build-rules/unsafe.md:1 @@ -13497,8 +14171,10 @@ msgstr "" #: src/chromium/build-rules/unsafe.md:3 msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't compile. If you need unsafe Rust code, add " -"`allow_unsafe = true` to the gn target. (Later in the course we'll see circumstances where this is necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " +"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " +"the gn target. (Later in the course we'll see circumstances where this is " +"necessary.)" msgstr "" #: src/chromium/build-rules/unsafe.md:7 @@ -13540,16 +14216,20 @@ msgstr "" #: src/chromium/build-rules/vscode.md:3 msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than for C++. Visual Studio code works well for Rust in " -"Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than " +"for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" #: src/chromium/build-rules/vscode.md:6 -msgid "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust support" +msgid "" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " +"Rust support" msgstr "" #: src/chromium/build-rules/vscode.md:8 -msgid "`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" +msgid "" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output " +"directory)" msgstr "" #: src/chromium/build-rules/vscode.md:10 @@ -13558,14 +14238,14 @@ msgstr "" #: src/chromium/build-rules/vscode.md:16 msgid "" -"A demo of some of the code annotation and exploration features of rust-analyzer might be beneficial if the audience are naturally " -"skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-" +"analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" #: src/chromium/build-rules/vscode.md:19 msgid "" -"The following steps may help with the demo (but feel free to instead use a piece of Chromium-related Rust that you are most familiar " -"with):" +"The following steps may help with the demo (but feel free to instead use a " +"piece of Chromium-related Rust that you are most familiar with):" msgstr "" #: src/chromium/build-rules/vscode.md:22 @@ -13573,33 +14253,41 @@ msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" #: src/chromium/build-rules/vscode.md:23 -msgid "Place the cursor over the `QrCode::new` call (around line 26) in \\`qr_code_generator_ffi_glue.rs" +msgid "" +"Place the cursor over the `QrCode::new` call (around line 26) in " +"\\`qr_code_generator_ffi_glue.rs" msgstr "" #: src/chromium/build-rules/vscode.md:25 -msgid "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." +msgid "" +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " +"K)." msgstr "" #: src/chromium/build-rules/vscode.md:27 msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This will take you to `//third_party/rust/.../" -"qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " +"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" #: src/chromium/build-rules/vscode.md:29 msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; the outline is in the file explorer pane in " -"vscode; typical vim/CoC bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " +"164; the outline is in the file explorer pane in vscode; typical vim/CoC " +"bindings = space o)" msgstr "" #: src/chromium/build-rules/vscode.md:32 -msgid "Demo **type annotations** (there are quite a few nice examples in the `QrCode::with_bits` method)" +msgid "" +"Demo **type annotations** (there are quite a few nice examples in the " +"`QrCode::with_bits` method)" msgstr "" #: src/chromium/build-rules/vscode.md:35 msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will need to be rerun after editing `BUILD.gn` files (which we " -"will do a few times throughout the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will " +"need to be rerun after editing `BUILD.gn` files (which we will do a few " +"times throughout the exercises in this session)." msgstr "" #: src/exercises/chromium/build-rules.md:1 @@ -13608,146 +14296,182 @@ msgid "Build rules exercise" msgstr "قوانین ساخت" #: src/exercises/chromium/build-rules.md:3 -msgid "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" +msgid "" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " +"containing:" msgstr "" #: src/exercises/chromium/build-rules.md:13 msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety by the Rust compiler, so you'll need to allow unsafe code " -"in your `gn` target." +"**Important**: note that `no_mangle` here is considered a type of unsafety " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " +"target." msgstr "" #: src/exercises/chromium/build-rules.md:16 msgid "" -"Add this new Rust target as a dependency of `//ui/base:base`. Declare this function at the top of `ui/base/resource/resource_bundle." -"cc` (later, we'll see how this can be automated by bindings generation tools):" +"Add this new Rust target as a dependency of `//ui/base:base`. Declare this " +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " +"see how this can be automated by bindings generation tools):" msgstr "" #: src/exercises/chromium/build-rules.md:24 msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we suggest the top of `ResourceBundle::" -"MaybeMangleLocalizedString`. Build and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " +"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " +"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " +"times." msgstr "" #: src/exercises/chromium/build-rules.md:28 msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in subsequent exercises. If you've succeeded, you will " -"be able to use right-click \"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " +"in subsequent exercises. If you've succeeded, you will be able to use right-" +"click \"Go to definition\" on `println!`." msgstr "" -#: src/exercises/chromium/build-rules.md:32 src/exercises/chromium/interoperability-with-cpp.md:48 +#: src/exercises/chromium/build-rules.md:32 +#: src/exercises/chromium/interoperability-with-cpp.md:48 msgid "Where to find help" msgstr "" #: src/exercises/chromium/build-rules.md:34 msgid "" -"The options available to the [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"The options available to the [`rust_static_library` gn template](https://" +"source.chromium.org/chromium/chromium/src/+/main:build/rust/" "rust_static_library.gni;l=16)" msgstr "" #: src/exercises/chromium/build-rules.md:35 -msgid "Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-no_mangle-attribute)" +msgid "" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" +"abi.html#the-no_mangle-attribute)" msgstr "" #: src/exercises/chromium/build-rules.md:36 -msgid "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" +msgid "" +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." +"extern.html)" msgstr "" #: src/exercises/chromium/build-rules.md:37 msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" #: src/exercises/chromium/build-rules.md:38 -msgid "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" +msgid "" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" +"languages/rust)" msgstr "" #: src/exercises/chromium/build-rules.md:44 msgid "" -"This example is unusual because it boils down to the lowest-common-denominator interop language, C. Both C++ and Rust can natively " -"declare and call C ABI functions. Later in the course, we'll connect C++ directly to Rust." +"This example is unusual because it boils down to the lowest-common-" +"denominator interop language, C. Both C++ and Rust can natively declare and " +"call C ABI functions. Later in the course, we'll connect C++ directly to " +"Rust." msgstr "" #: src/exercises/chromium/build-rules.md:48 msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to generate two functions with the same name, and " -"Rust can no longer guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " +"Rust to generate two functions with the same name, and Rust can no longer " +"guarantee that the right one is called." msgstr "" #: src/exercises/chromium/build-rules.md:52 -msgid "If you need a pure Rust executable, you can also do that using the `rust_executable` gn template." +msgid "" +"If you need a pure Rust executable, you can also do that using the " +"`rust_executable` gn template." msgstr "" #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same source file as the code being tested. This was covered " -"[earlier](../testing.md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same " +"source file as the code being tested. This was covered [earlier](../testing." +"md) in the course and looks like this:" msgstr "" #: src/chromium/testing.md msgid "" -"In Chromium we place unit tests in a separate source file and we continue to follow this practice for Rust --- this makes tests " -"consistently discoverable and helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." +"In Chromium we place unit tests in a separate source file and we continue to " +"follow this practice for Rust --- this makes tests consistently discoverable " +"and helps to avoid rebuilding `.rs` files a second time (in the `test` " +"configuration)." msgstr "" #: src/chromium/testing.md -msgid "This results in the following options for testing Rust code in Chromium:" +msgid "" +"This results in the following options for testing Rust code in Chromium:" msgstr "" #: src/chromium/testing.md -msgid "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." +msgid "" +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" +"rust`." msgstr "" #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when Rust code is just a thin FFI layer and the existing " -"unit tests provide sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " +"when Rust code is just a thin FFI layer and the existing unit tests provide " +"sufficient coverage for the feature." msgstr "" #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its public API (using `pub mod for_testing { ... }` if " -"needed). This is the subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its " +"public API (using `pub mod for_testing { ... }` if needed). This is the " +"subject of the next few slides." msgstr "" #: src/chromium/testing.md msgid "" -"Mention that native Rust tests of third-party crates should eventually be exercised by Chromium bots. (Such testing is needed rarely " -"--- only after adding or updating third-party crates.)" +"Mention that native Rust tests of third-party crates should eventually be " +"exercised by Chromium bots. (Such testing is needed rarely --- only after " +"adding or updating third-party crates.)" msgstr "" #: src/chromium/testing.md -msgid "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" +msgid "" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " +"used:" msgstr "" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a thin FFI glue) and therefore uses the existing C++ unit " -"tests for testing both the C++ and the Rust implementation (parameterizing the tests so they enable or disable Rust using a " -"`ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a " +"thin FFI glue) and therefore uses the existing C++ unit tests for testing " +"both the C++ and the Rust implementation (parameterizing the tests so they " +"enable or disable Rust using a `ScopedFeatureList`)." msgstr "" #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe implementation of pixel transformations that are provided by " -"`libpng` but missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit from separate tests " -"authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe " +"implementation of pixel transformations that are provided by `libpng` but " +"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " +"functionality may benefit from separate tests authored in Rust." msgstr "" #: src/chromium/testing/rust-gtest-interop.md:3 msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/rust_gtest_interop/README.md) library " -"provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" #: src/chromium/testing/rust-gtest-interop.md:5 -msgid "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" +msgid "" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " +"attribute)" msgstr "" #: src/chromium/testing/rust-gtest-interop.md:7 msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking and not terminating the test when the assertion " -"fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " +"panicking and not terminating the test when the assertion fails)." msgstr "" #: src/chromium/testing/rust-gtest-interop.md:10 @@ -13757,8 +14481,8 @@ msgstr "مثال" #: src/chromium/testing/build-gn.md:3 msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing test binary that already contains tests authored in C++. " -"For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing " +"test binary that already contains tests authored in C++. For example:" msgstr "" #: src/chromium/testing/build-gn.md:6 @@ -13774,8 +14498,8 @@ msgstr "" #: src/chromium/testing/build-gn.md:14 msgid "" -"Authoring Rust tests in a separate `static_library` also works, but requires manually declaring the dependency on the support " -"libraries:" +"Authoring Rust tests in a separate `static_library` also works, but requires " +"manually declaring the dependency on the support libraries:" msgstr "" #: src/chromium/testing/build-gn.md:17 @@ -13801,10 +14525,12 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md:3 msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. " -"We haven't provided an explicit `crate_name` for `my_rust_lib` so its crate name is computed based on the full target path and name. " -"Fortunately we can avoid working with such an unwieldy name by using the `chromium::import!` macro from the automatically-imported " -"`chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " +"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " +"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " +"computed based on the full target path and name. Fortunately we can avoid " +"working with such an unwieldy name by using the `chromium::import!` macro " +"from the automatically-imported `chromium` crate:" msgstr "" #: src/chromium/testing/chromium-import-macro.md:12 @@ -13817,16 +14543,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md:26 msgid "" -"More information can be found in [the doc comment](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" +"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" #: src/chromium/testing/chromium-import-macro.md:31 msgid "" -"`rust_static_library` supports specifying an explicit name via `crate_name` property, but doing this is discouraged. And it is " -"discouraged because the crate name has to be globally unique. crates.io guarantees uniqueness of its crate names so `cargo_crate` GN " -"targets (generated by the `gnrt` tool covered in a later section) use short crate names." +"`rust_static_library` supports specifying an explicit name via `crate_name` " +"property, but doing this is discouraged. And it is discouraged because the " +"crate name has to be globally unique. crates.io guarantees uniqueness of its " +"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " +"covered in a later section) use short crate names." msgstr "" #: src/exercises/chromium/testing.md:1 @@ -13844,8 +14573,9 @@ msgstr "" #: src/exercises/chromium/testing.md:7 msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding two integers received as arguments, computing the nth " -"Fibonacci number, summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding " +"two integers received as arguments, computing the nth Fibonacci number, " +"summing integers in a slice, etc." msgstr "" #: src/exercises/chromium/testing.md:10 @@ -13862,36 +14592,45 @@ msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new tools being developed all the time. At the moment, " -"Chromium uses a tool called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new " +"tools being developed all the time. At the moment, Chromium uses a tool " +"called CXX." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition language (which looks a lot like Rust) and then CXX tools " -"generate declarations for functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition " +"language (which looks a lot like Rust) and then CXX tools generate " +"declarations for functions and types in both Rust and C++." msgstr "" #: src/chromium/interoperability-with-cpp.md -msgid "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using this." +msgid "" +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " +"using this." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just the same as you previously did. Point out that " -"automating the process has the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just " +"the same as you previously did. Point out that automating the process has " +"the following benefits:" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool guarantees that the C++ and Rust sides match (e.g. you get compile errors if the `#[cxx::bridge]` doesn't match the actual " -"C++ or Rust definitions, but with out-of-sync manual bindings you'd get Undefined Behavior)" +"The tool guarantees that the C++ and Rust sides match (e.g. you get compile " +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " +"definitions, but with out-of-sync manual bindings you'd get Undefined " +"Behavior)" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool automates generation of FFI thunks (small, C-ABI-compatible, free functions) for non-C features (e.g. enabling FFI calls " -"into Rust or C++ methods; manual bindings would require authoring such top-level, free functions manually)" +"The tool automates generation of FFI thunks (small, C-ABI-compatible, free " +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " +"methods; manual bindings would require authoring such top-level, free " +"functions manually)" msgstr "" #: src/chromium/interoperability-with-cpp.md @@ -13900,25 +14639,33 @@ msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee any particular ABI or memory layout. With manual " -"bindings `std::span` / `&[T]` have to be manually destructured and rebuilt out of a pointer and length - this is error-prone " -"given that each language represents empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't " +"guarantee any particular ABI or memory layout. With manual bindings `std::" +"span` / `&[T]` have to be manually destructured and rebuilt out of a " +"pointer and length - this is error-prone given that each language represents " +"empty slices slightly differently)" msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are natively supported. With manual bindings, one would " -"have to pass C-ABI-compatible raw pointers, which would increase lifetime and memory-safety risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " +"are natively supported. With manual bindings, one would have to pass C-ABI-" +"compatible raw pointers, which would increase lifetime and memory-safety " +"risks." msgstr "" #: src/chromium/interoperability-with-cpp.md msgid "" -"`rust::String` and `CxxString` types understand and maintain differences in string representation across the languages (e.g. `rust::" -"String::lossy` can build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a string)." +"`rust::String` and `CxxString` types understand and maintain differences in " +"string representation across the languages (e.g. `rust::String::lossy` can " +"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" +"terminate a string)." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:3 -msgid "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` modules inside `.rs` source code." +msgid "" +"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " +"modules inside `.rs` source code." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:16 @@ -13935,8 +14682,10 @@ msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:32 msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural macro does complex things to it. The generated code " -"is quite a bit more sophisticated - though this does still result in a `mod` called `ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " +"procedural macro does complex things to it. The generated code is quite a " +"bit more sophisticated - though this does still result in a `mod` called " +"`ffi` in your code." msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:36 @@ -13958,12 +14707,16 @@ msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:41 msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, but this is misleading. This header is never " -"interpreted by Rust, but simply `#include`d in the generated C++ code for the benefit of C++ compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by " +"Rust, but this is misleading. This header is never interpreted by Rust, but " +"simply `#include`d in the generated C++ code for the benefit of C++ " +"compilers." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:3 -msgid "By far the most useful page when using CXX is the [type reference](https://cxx.rs/bindings.html)." +msgid "" +"By far the most useful page when using CXX is the [type reference](https://" +"cxx.rs/bindings.html)." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:5 @@ -13971,30 +14724,41 @@ msgid "CXX fundamentally suits cases where:" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:7 -msgid "Your Rust-C++ interface is sufficiently simple that you can declare all of it." +msgid "" +"Your Rust-C++ interface is sufficiently simple that you can declare all of " +"it." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:8 -msgid "You're using only the types natively supported by CXX already, for example `std::unique_ptr`, `std::string`, `&[u8]` etc." +msgid "" +"You're using only the types natively supported by CXX already, for example " +"`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:11 -msgid "It has many limitations --- for example lack of support for Rust's `Option` type." +msgid "" +"It has many limitations --- for example lack of support for Rust's `Option` " +"type." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:14 msgid "" -"These limitations constrain us to using Rust in Chromium only for well isolated \"leaf nodes\" rather than for arbitrary Rust-C++ " -"interop. When considering a use-case for Rust in Chromium, a good starting point is to draft the CXX bindings for the language " -"boundary to see if it appears simple enough." +"These limitations constrain us to using Rust in Chromium only for well " +"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " +"considering a use-case for Rust in Chromium, a good starting point is to " +"draft the CXX bindings for the language boundary to see if it appears simple " +"enough." msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:26 -msgid "You should also discuss some of the other sticky points with CXX, for example:" +msgid "" +"You should also discuss some of the other sticky points with CXX, for " +"example:" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:28 -msgid "Its error handling is based around C++ exceptions (given on the next slide)" +msgid "" +"Its error handling is based around C++ exceptions (given on the next slide)" msgstr "" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:29 @@ -14003,8 +14767,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:3 msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C++ exceptions, so we can't use that in Chromium. " -"Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " +"on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:6 @@ -14013,8 +14777,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:7 msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be passed across the FFI boundary - for example `T` has " -"to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " +"be passed across the FFI boundary - for example `T` has to be:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:9 @@ -14023,14 +14787,15 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:10 msgid "" -"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable default value to use in a failure case (_unlike_ " -"`Box`)." +"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " +"default value to use in a failure case (_unlike_ `Box`)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:12 msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed when `T` is a Rust type, which cannot be passed across the " -"FFI boundary, and cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed " +"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " +"cannot be stored in `UniquePtr`." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:16 @@ -14038,11 +14803,15 @@ msgid "The `E` part of `Result` can be:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:17 -msgid "Returned as a boolean (e.g. `true` representing success, and `false` representing failure)" +msgid "" +"Returned as a boolean (e.g. `true` representing success, and `false` " +"representing failure)" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling.md:19 -msgid "Preserving error details is in theory possible, but so far hasn't been needed in practice." +msgid "" +"Preserving error details is in theory possible, but so far hasn't been " +"needed in practice." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:1 @@ -14051,9 +14820,11 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:3 msgid "" -"The QR code generator is [an example](https://source.chromium.org/chromium/chromium/src/+/main:components/qr_code_generator/" -"qr_code_generator_ffi_glue.rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to communicate success " -"vs failure, and where the successful result can be passed across the FFI boundary:" +"The QR code generator is [an example](https://source.chromium.org/chromium/" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." +"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " +"used to communicate success vs failure, and where the successful result can " +"be passed across the FFI boundary:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:8 @@ -14062,21 +14833,25 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:23 msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. This is not the size of the vector, but the size of the QR " -"code (and admittedly it is a bit redundant - this is the square root of the size of the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. " +"This is not the size of the vector, but the size of the QR code (and " +"admittedly it is a bit redundant - this is the square root of the size of " +"the vector)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:27 msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` before calling into the Rust function. Creation of a Rust " -"reference that points to uninitialized memory results in Undefined Behavior (unlike in C++, when only the act of dereferencing such " -"memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` " +"before calling into the Rust function. Creation of a Rust reference that " +"points to uninitialized memory results in Undefined Behavior (unlike in C++, " +"when only the act of dereferencing such memory results in UB)." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:32 msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable references to C++ data: the answer is that C++ data can’t be " -"moved around like Rust data, because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable " +"references to C++ data: the answer is that C++ data can’t be moved around " +"like Rust data, because it may contain self-referential pointers." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:1 @@ -14084,7 +14859,9 @@ msgid "CXX Error Handling: PNG Example" msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md:3 -msgid "A prototype of a PNG decoder illustrates what can be done when the successful result cannot be passed across the FFI boundary:" +msgid "" +"A prototype of a PNG decoder illustrates what can be done when the " +"successful result cannot be passed across the FFI boundary:" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:7 @@ -14107,15 +14884,20 @@ msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:32 msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types cannot cross the FFI boundary without indirection of a " -"`Box`. We can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " +"types cannot cross the FFI boundary without indirection of a `Box`. We " +"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " +"to store Rust objects by value." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md:37 msgid "" -"This example illustrates that even though CXX doesn't support arbitrary generics nor templates, we can still pass them across the " -"FFI boundary by manually specializing / monomorphizing them into a non-generic type. In the example `ResultOfPngReader` is a non-" -"generic type that forwards into appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary " +"generics nor templates, we can still pass them across the FFI boundary by " +"manually specializing / monomorphizing them into a non-generic type. In the " +"example `ResultOfPngReader` is a non-generic type that forwards into " +"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " +"`as_mut`)." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:1 @@ -14124,8 +14906,9 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:3 msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node where we want to use Rust. You'd typically have one " -"for each `rust_static_library`. Just add" +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" +"node where we want to use Rust. You'd typically have one for each " +"`rust_static_library`. Just add" msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:7 @@ -14138,7 +14921,9 @@ msgid "" msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:13 -msgid "to your existing `rust_static_library` target alongside `crate_root` and `sources`." +msgid "" +"to your existing `rust_static_library` target alongside `crate_root` and " +"`sources`." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:16 @@ -14151,8 +14936,10 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:22 msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium C++ types to CXX Rust types --- for example " -"[`SpanToRustSlice`](https://source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium " +"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" +"l=21)." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:27 @@ -14161,16 +14948,21 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:29 msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. Calling back and forth to C/C++ from Rust may do " -"arbitrary things to memory, and compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` keywords in C/C++ " -"interop can harm the signal-to-noise ratio of such a keyword, and is [controversial](https://steveklabnik.com/writing/the-cxx-" -"debate), but strictly, bringing any foreign code into a Rust binary can cause unexpected behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " +"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " +"to memory, and compromise the safety of Rust's own data layouts. Presence of " +"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " +"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" +"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " +"binary can cause unexpected behavior from Rust's perspective." msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:36 msgid "" -"The narrow answer lies in the diagram at the top of [this page](../interoperability-with-cpp.md) --- behind the scenes, CXX " -"generates Rust `unsafe` and `extern \"C\"` functions just like we did manually in the previous section." +"The narrow answer lies in the diagram at the top of [this page](../" +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " +"`unsafe` and `extern \"C\"` functions just like we did manually in the " +"previous section." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:1 @@ -14184,14 +14976,15 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:5 msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a single function, to be called from C++, called " +"In the Rust file you previously created, add a `#[cxx::bridge]` which " +"specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:8 msgid "" -"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and `#[no_mangle]`. This is now just a standard Rust " -"function." +"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " +"`#[no_mangle]`. This is now just a standard Rust function." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:10 @@ -14199,7 +14992,9 @@ msgid "Modify your `gn` target to build these bindings." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:11 -msgid "In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, include the generated header file." +msgid "" +"In your C++ code, remove the forward-declaration of `hello_from_rust`. " +"Instead, include the generated header file." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:13 @@ -14211,7 +15006,9 @@ msgid "Part two" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:17 -msgid "It's a good idea to play with CXX a little. It helps you think about how flexible Rust in Chromium actually is." +msgid "" +"It's a good idea to play with CXX a little. It helps you think about how " +"flexible Rust in Chromium actually is." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:20 @@ -14225,18 +15022,21 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:23 msgid "" -"An additional header file which you can `include!` from your `cxx::bridge`. You'll need to declare your C++ function in that new " -"header file." +"An additional header file which you can `include!` from your `cxx::bridge`. " +"You'll need to declare your C++ function in that new header file." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:25 msgid "" -"An `unsafe` block to call such a function, or alternatively specify the `unsafe` keyword in your `#[cxx::bridge]` [as described here]" -"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the " +"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" +"extern-c++.html#functions-and-member-functions)." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 -msgid "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" +msgid "" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" +"\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -14248,19 +15048,27 @@ msgid "Pass a reference to a C++ object into Rust." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:31 -msgid "Intentionally get the Rust function signatures mismatched from the `#[cxx::bridge]`, and get used to the errors you see." +msgid "" +"Intentionally get the Rust function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:33 -msgid "Intentionally get the C++ function signatures mismatched from the `#[cxx::bridge]`, and get used to the errors you see." +msgid "" +"Intentionally get the C++ function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:35 -msgid "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own some C++ object." +msgid "" +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " +"own some C++ object." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:37 -msgid "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a `Box`)." +msgid "" +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " +"need a `Box`)." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:39 @@ -14277,8 +15085,9 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:44 msgid "" -"Now you understand the strengths and limitations of CXX interop, think of a couple of use-cases for Rust in Chromium where the " -"interface would be sufficiently simple. Sketch how you might define that interface." +"Now you understand the strengths and limitations of CXX interop, think of a " +"couple of use-cases for Rust in Chromium where the interface would be " +"sufficiently simple. Sketch how you might define that interface." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:50 @@ -14287,8 +15096,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:51 msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" -"l=16)" +"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:57 @@ -14297,21 +15106,24 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:59 msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X and Y are both function types. This is because your C++ " -"function doesn't quite match the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X " +"and Y are both function types. This is because your C++ function doesn't " +"quite match the declaration in your `cxx::bridge`." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:62 msgid "" -"I seem to be able to freely convert C++ references into Rust references. Doesn't that risk UB? For CXX's _opaque_ types, no, because " -"they are zero-sized. For CXX trivial types yes, it's _possible_ to cause UB, although CXX's design makes it quite difficult to craft " -"such an example." +"I seem to be able to freely convert C++ references into Rust references. " +"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" +"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " +"CXX's design makes it quite difficult to craft such an example." msgstr "" #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://crates.io). It's _very easy_ for Rust crates to depend " -"upon one another. So they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://" +"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " +"they do!" msgstr "" #: src/chromium/adding-third-party-crates.md @@ -14366,11 +15178,15 @@ msgid "For a Chromium engineer, this has pros and cons:" msgstr "" #: src/chromium/adding-third-party-crates.md -msgid "All crates use a common build system so we can automate their inclusion into Chromium..." +msgid "" +"All crates use a common build system so we can automate their inclusion into " +"Chromium..." msgstr "" #: src/chromium/adding-third-party-crates.md -msgid "... but, crates typically have transitive dependencies, so you will likely have to bring in multiple libraries." +msgid "" +"... but, crates typically have transitive dependencies, so you will likely " +"have to bring in multiple libraries." msgstr "" #: src/chromium/adding-third-party-crates.md @@ -14395,8 +15211,10 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. These are managed through a single [`Cargo.toml`](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. " +"These are managed through a single [`Cargo.toml`](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." +"toml):" msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 @@ -14412,24 +15230,29 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the dependencies](https://doc.rust-lang.org/cargo/reference/" -"specifying-dependencies.html) --- most commonly, you'll want to specify the `features` that you wish to enable in the crate." +"As with any other `Cargo.toml`, you can specify [more details about the " +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" +"dependencies.html) --- most commonly, you'll want to specify the `features` " +"that you wish to enable in the crate." msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 msgid "" -"When adding a crate to Chromium, you'll often need to provide some extra information in an additional file, `gnrt_config.toml`, " -"which we'll meet next." +"When adding a crate to Chromium, you'll often need to provide some extra " +"information in an additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/gnrt_config.toml). This contains Chromium-specific extensions to crate handling." +"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml). This contains Chromium-specific extensions to crate handling." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 -msgid "If you add a new crate, you should specify at least the `group`. This is one of:" +msgid "" +"If you add a new crate, you should specify at least the `group`. This is one " +"of:" msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 @@ -14439,15 +15262,20 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 msgid "" -"Depending on the crate source code layout, you may also need to use this file to specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this " +"file to specify where its `LICENSE` file(s) can be found." msgstr "" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 -msgid "Later, we'll see some other things you will need to configure in this file to resolve problems." +msgid "" +"Later, we'll see some other things you will need to configure in this file " +"to resolve problems." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:3 -msgid "A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` rules." +msgid "" +"A tool called `gnrt` knows how to download crates and how to generate `BUILD." +"gn` rules." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:6 @@ -14456,8 +15284,10 @@ msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:13 msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running this command you will be downloading and running its " -"dependencies from `crates.io`. See [the earlier section](../cargo.md) discussing this security decision." +"Although the `gnrt` tool is part of the Chromium source code, by running " +"this command you will be downloading and running its dependencies from " +"`crates.io`. See [the earlier section](../cargo.md) discussing this security " +"decision." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:17 @@ -14474,17 +15304,21 @@ msgid "Direct and transitive dependencies" msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:21 -msgid "New versions of other crates, as required by `cargo` to resolve the complete set of crates required by Chromium." +msgid "" +"New versions of other crates, as required by `cargo` to resolve the complete " +"set of crates required by Chromium." msgstr "" #: src/chromium/adding-third-party-crates/downloading-crates.md:24 msgid "" -"Chromium maintains patches for some crates, kept in `//third_party/rust/chromium_crates_io/patches`. These will be reapplied " -"automatically, but if patching fails you may need to take manual action." +"Chromium maintains patches for some crates, kept in `//third_party/rust/" +"chromium_crates_io/patches`. These will be reapplied automatically, but if " +"patching fails you may need to take manual action." msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 -msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "" +"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 @@ -14492,11 +15326,15 @@ msgid "Now run `git status`. You should find:" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 -msgid "At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" +msgid "" +"At least one new crate source code in `third_party/rust/chromium_crates_io/" +"vendor`" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 -msgid "At least one new `BUILD.gn` in `third_party/rust//v`" +msgid "" +"At least one new `BUILD.gn` in `third_party/rust//v`" msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 @@ -14505,28 +15343,36 @@ msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 #, fuzzy -msgid "The \"major semver version\" is a [Rust \"semver\" version number](https://doc.rust-lang.org/cargo/reference/semver.html)." -msgstr "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه کنید." +msgid "" +"The \"major semver version\" is a [Rust \"semver\" version number](https://" +"doc.rust-lang.org/cargo/reference/semver.html)." +msgstr "" +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 -msgid "Take a close look, especially at the things generated in `third_party/rust`." +msgid "" +"Take a close look, especially at the things generated in `third_party/rust`." msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 msgid "" -"Talk a little about semver --- and specifically the way that in Chromium it's to allow multiple incompatible versions of a crate, " -"which is discouraged but sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium " +"it's to allow multiple incompatible versions of a crate, which is " +"discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:3 msgid "" -"If your build fails, it may be because of a `build.rs`: programs which do arbitrary things at build time. This is fundamentally at " -"odds with the design of `gn` and `ninja` which aim for static, deterministic, build rules to maximize parallelism and repeatability " -"of builds." +"If your build fails, it may be because of a `build.rs`: programs which do " +"arbitrary things at build time. This is fundamentally at odds with the " +"design of `gn` and `ninja` which aim for static, deterministic, build rules " +"to maximize parallelism and repeatability of builds." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:8 -msgid "Some `build.rs` actions are automatically supported; others require action:" +msgid "" +"Some `build.rs` actions are automatically supported; others require action:" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:10 @@ -14545,12 +15391,14 @@ msgstr "" msgid "Checking rustc version to configure features on and off" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 #: src/chromium/adding-third-party-crates/resolving-problems.md:14 msgid "Yes" msgstr "بلی" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 msgid "None" msgstr "" @@ -14571,11 +15419,13 @@ msgstr "" msgid "Building C/C++" msgstr "" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +#: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "No" msgstr "خیر" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +#: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Patch around it" msgstr "" @@ -14584,18 +15434,24 @@ msgid "Arbitrary other actions" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems.md:18 -msgid "Fortunately, most crates don't contain a build script, and fortunately, most build scripts only do the top two actions." +msgid "" +"Fortunately, most crates don't contain a build script, and fortunately, most " +"build scripts only do the top two actions." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:3 -msgid "If `ninja` complains about missing files, check the `build.rs` to see if it writes source code files." +msgid "" +"If `ninja` complains about missing files, check the `build.rs` to see if it " +"writes source code files." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:6 msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add `build-script-outputs` to the crate. If this is a " -"transitive dependency, that is, one on which Chromium code should not directly depend, also add `allow-first-party-usage=false`. " -"There are several examples already in that file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " +"add `build-script-outputs` to the crate. If this is a transitive dependency, " +"that is, one on which Chromium code should not directly depend, also add " +"`allow-first-party-usage=false`. There are several examples already in that " +"file:" msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:11 @@ -14609,15 +15465,18 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:17 msgid "" -"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate `BUILD.gn` files to inform ninja that this particular " -"output file is input to subsequent build steps." +"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " +"`BUILD.gn` files to inform ninja that this particular output file is input " +"to subsequent build steps." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:3 msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/C++ libraries. Other crates parse C/C++ using " -"[`bindgen`](https://crates.io/crates/bindgen) within their build scripts. These actions can't be supported in a Chromium context --- " -"our gn, ninja and LLVM build system is very specific in expressing relationships between build actions." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " +"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" +"crates.io/crates/bindgen) within their build scripts. These actions can't be " +"supported in a Chromium context --- our gn, ninja and LLVM build system is " +"very specific in expressing relationships between build actions." msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:8 @@ -14634,15 +15493,18 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:13 msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - see for example the [patches against the `cxx` " -"crate](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - and will be " -"applied automatically by `gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" +"` - see for example the [patches against the `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - and will be applied automatically by " +"`gnrt` each time it upgrades the crate." msgstr "" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:3 msgid "" -"Once you've added a third-party crate and generated build rules, depending on a crate is simple. Find your `rust_static_library` " -"target, and add a `dep` on the `:lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending " +"on a crate is simple. Find your `rust_static_library` target, and add a " +"`dep` on the `:lib` target within your crate." msgstr "" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:7 @@ -14653,7 +15515,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" +"\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -14675,24 +15538,31 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:3 msgid "" -"Adding new libraries is subject to Chromium's standard [policies](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Third_party-review), but of course also subject to security review. As you may be bringing in not just a single crate " -"but also transitive dependencies, there may be a lot of code to review. On the other hand, safe Rust code can have limited negative " -"side effects. How should you review it?" +"Adding new libraries is subject to Chromium's standard [policies](https://" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Third_party-review), but of course also subject to security review. As " +"you may be bringing in not just a single crate but also transitive " +"dependencies, there may be a lot of code to review. On the other hand, safe " +"Rust code can have limited negative side effects. How should you review it?" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:9 -msgid "Over time Chromium aims to move to a process based around [cargo vet](https://mozilla.github.io/cargo-vet/)." +msgid "" +"Over time Chromium aims to move to a process based around [cargo vet]" +"(https://mozilla.github.io/cargo-vet/)." msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:11 -msgid "Meanwhile, for each new crate addition, we are checking for the following:" +msgid "" +"Meanwhile, for each new crate addition, we are checking for the following:" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:13 msgid "" -"Understand why each crate is used. What's the relationship between crates? If the build system for each crate contains a `build.rs` " -"or procedural macros, work out what they're for. Are they compatible with the way Chromium is normally built?" +"Understand why each crate is used. What's the relationship between crates? " +"If the build system for each crate contains a `build.rs` or procedural " +"macros, work out what they're for. Are they compatible with the way Chromium " +"is normally built?" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:17 @@ -14701,14 +15571,17 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:18 msgid "" -"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known vulnerabilities (first you'll need to `cargo install " -"cargo-audit`, which ironically involves downloading lots of dependencies from the internet[2](../cargo.md))" +"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " +"vulnerabilities (first you'll need to `cargo install cargo-audit`, which " +"ironically involves downloading lots of dependencies from the internet[2](../" +"cargo.md))" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:21 msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium.googlesource.com/chromium/src/+/main/docs/security/" -"rule-of-2.md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." +"md#unsafe-code-in-safe-languages)" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:22 @@ -14717,14 +15590,15 @@ msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:23 msgid "" -"Read all the code at a sufficient level to look for anything out of place that might have been maliciously inserted. (You can't " -"realistically aim for 100% perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place " +"that might have been maliciously inserted. (You can't realistically aim for " +"100% perfection here: there's often just too much code.)" msgstr "" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:27 msgid "" -"These are just guidelines --- work with reviewers from `security@chromium.org` to work out the right way to become confident of the " -"crate." +"These are just guidelines --- work with reviewers from `security@chromium." +"org` to work out the right way to become confident of the crate." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:1 @@ -14740,7 +15614,9 @@ msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:6 -msgid "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//`" +msgid "" +"Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" +"`" msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:9 @@ -14748,38 +15624,48 @@ msgid "Please also add an `OWNERS` file in the latter location." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:11 -msgid "You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into the Chromium repo." +msgid "" +"You should land all this, along with your `Cargo.toml` and `gnrt_config." +"toml` changes, into the Chromium repo." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:14 -msgid "**Important**: you need to use `git add -f` because otherwise `.gitignore` files may result in some files being skipped." +msgid "" +"**Important**: you need to use `git add -f` because otherwise `.gitignore` " +"files may result in some files being skipped." msgstr "" #: src/chromium/adding-third-party-crates/checking-in.md:17 msgid "" -"As you do so, you might find presubmit checks fail because of non-inclusive language. This is because Rust crate data tends to " -"include names of git branches, and many projects still use non-inclusive terminology there. So you may need to run:" +"As you do so, you might find presubmit checks fail because of non-inclusive " +"language. This is because Rust crate data tends to include names of git " +"branches, and many projects still use non-inclusive terminology there. So " +"you may need to run:" msgstr "" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md:3 msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to keep it up to date with any security fixes](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will soon automate this " -"for Rust crates, but for now, it's still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to " +"keep it up to date with any security fixes](https://chromium.googlesource." +"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " +"hoped that we will soon automate this for Rust crates, but for now, it's " +"still your responsibility just as it is for any other third party dependency." msgstr "" #: src/exercises/chromium/third-party.md:3 msgid "" -"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the crate's [default features](https://doc.rust-lang.org/" -"cargo/reference/features.html#the-default-feature). Assume that the crate will be used in shipping Chromium, but won't be used to " -"handle untrustworthy input." +"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " +"crate's [default features](https://doc.rust-lang.org/cargo/reference/" +"features.html#the-default-feature). Assume that the crate will be used in " +"shipping Chromium, but won't be used to handle untrustworthy input." msgstr "" #: src/exercises/chromium/third-party.md:7 msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead and do that now if you like. Or, you could create " -"a new [`rust_executable` target](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_executable.gni) which uses " -"`uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " +"ahead and do that now if you like. Or, you could create a new " +"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" +"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" #: src/exercises/chromium/third-party.md:13 @@ -14823,11 +15709,14 @@ msgid "`uwuify`." msgstr "" #: src/exercises/chromium/third-party.md:26 -msgid "If students are downloading even more than that, they probably forgot to turn off the default features." +msgid "" +"If students are downloading even more than that, they probably forgot to " +"turn off the default features." msgstr "" #: src/exercises/chromium/third-party.md:29 -msgid "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" +msgid "" +"Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14835,7 +15724,9 @@ msgid "Bringing It Together --- Exercise" msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "In this exercise, you're going to add a whole new Chromium feature, bringing together everything you already learned." +msgid "" +"In this exercise, you're going to add a whole new Chromium feature, bringing " +"together everything you already learned." msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14844,26 +15735,34 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. It's important that we get Chromium for Pixies delivered to " -"them as soon as possible." +"A community of pixies has been discovered living in a remote rainforest. " +"It's important that we get Chromium for Pixies delivered to them as soon as " +"possible." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "The requirement is to translate all Chromium's UI strings into Pixie language." +msgid "" +"The requirement is to translate all Chromium's UI strings into Pixie " +"language." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie language is very close to English, and it turns out there's " -"a Rust crate which does the translation." +"There's not time to wait for proper translations, but fortunately pixie " +"language is very close to English, and it turns out there's a Rust crate " +"which does the translation." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "In fact, you already [imported that crate in the previous exercise](https://crates.io/crates/uwuify)." +msgid "" +"In fact, you already [imported that crate in the previous exercise](https://" +"crates.io/crates/uwuify)." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "(Obviously, real translations of Chrome require incredible care and diligence. Don't ship this!)" +msgid "" +"(Obviously, real translations of Chrome require incredible care and " +"diligence. Don't ship this!)" msgstr "" #: src/exercises/chromium/bringing-it-together.md @@ -14872,49 +15771,61 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all strings before display. In this special build of " -"Chromium, it should always do this irrespective of the setting of `mangle_localized_strings_`." +"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " +"strings before display. In this special build of Chromium, it should always " +"do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "If you've done everything right across all these exercises, congratulations, you should have created Chrome for pixies!" +msgid "" +"If you've done everything right across all these exercises, congratulations, " +"you should have created Chrome for pixies!" msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and will probably decide that it's better to do the " -"conversion on the C++ side using `base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " +"and will probably decide that it's better to do the conversion on the C++ " +"side using `base::UTF16ToUTF8` and back again." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"If students decide to do the conversion on the Rust side, they'll need to consider [`String::from_utf16`](https://doc.rust-lang.org/" -"std/string/struct.String.html#method.from_utf16), consider error handling, and consider which [CXX supported types can transfer a " -"lot of u16s](https://cxx.rs/binding/slice.html)." +"If students decide to do the conversion on the Rust side, they'll need to " +"consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." +"String.html#method.from_utf16), consider error handling, and consider which " +"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" +"slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. taking and returning strings by value, or taking a mutable " -"reference to a string. If a mutable reference is used, CXX will likely tell the student that they need to use [`Pin`](https://doc." -"rust-lang.org/std/pin/). You may need to explain what `Pin` does, and then explain why CXX needs it for mutable references to C++ " -"data: the answer is that C++ data can't be moved around like Rust data, because it may contain self-referential pointers." +"Students may design the C++/Rust boundary in several different ways, e.g. " +"taking and returning strings by value, or taking a mutable reference to a " +"string. If a mutable reference is used, CXX will likely tell the student " +"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " +"need to explain what `Pin` does, and then explain why CXX needs it for " +"mutable references to C++ data: the answer is that C++ data can't be moved " +"around like Rust data, because it may contain self-referential pointers." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need to depend on a `rust_static_library` target. The " -"student probably already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " +"need to depend on a `rust_static_library` target. The student probably " +"already did this." msgstr "" #: src/exercises/chromium/bringing-it-together.md -msgid "The `rust_static_library` target will need to depend on `//third_party/rust/uwuify/v0_2:lib`." +msgid "" +"The `rust_static_library` target will need to depend on `//third_party/rust/" +"uwuify/v0_2:lib`." msgstr "" #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs](https://chromium-review.googlesource.com/c/chromium/src/" -"+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs]" +"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" #: src/bare-metal.md @@ -14923,14 +15834,16 @@ msgstr "" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people who are familiar with the basics of Rust (perhaps from " -"completing the Comprehensive Rust course), and ideally also have some experience with bare-metal programming in some other language " -"such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people " +"who are familiar with the basics of Rust (perhaps from completing the " +"Comprehensive Rust course), and ideally also have some experience with bare-" +"metal programming in some other language such as C." msgstr "" #: src/bare-metal.md msgid "" -"Today we will talk about 'bare-metal' Rust: running Rust code without an OS underneath us. This will be divided into several parts:" +"Today we will talk about 'bare-metal' Rust: running Rust code without an OS " +"underneath us. This will be divided into several parts:" msgstr "" #: src/bare-metal.md @@ -14951,17 +15864,21 @@ msgstr "" #: src/bare-metal.md msgid "" -"For the microcontroller part of the course we will use the [BBC micro:bit](https://microbit.org/) v2 as an example. It's a " -"[development board](https://tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some LEDs and buttons, an " -"I2C-connected accelerometer and compass, and an on-board SWD debugger." +"For the microcontroller part of the course we will use the [BBC micro:bit]" +"(https://microbit.org/) v2 as an example. It's a [development board](https://" +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " +"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " +"an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "" +"To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" #: src/bare-metal.md -msgid "And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "" +"And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md:33 @@ -15085,18 +16002,22 @@ msgid "It can also be provided by another crate, such as `panic-halt`." msgstr "" #: src/bare-metal/minimal.md:22 -msgid "Depending on the target, you may need to compile with `panic = \"abort\"` to avoid an error about `eh_personality`." +msgid "" +"Depending on the target, you may need to compile with `panic = \"abort\"` to " +"avoid an error about `eh_personality`." msgstr "" #: src/bare-metal/minimal.md:24 msgid "" -"Note that there is no `main` or any other entry point; it's up to you to define your own entry point. This will typically involve a " -"linker script and some assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to " +"define your own entry point. This will typically involve a linker script and " +"some assembly code to set things up ready for Rust code to run." msgstr "" #: src/bare-metal/alloc.md:3 msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc." +"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" #: src/bare-metal/alloc.md:23 @@ -15118,24 +16039,28 @@ msgstr "String" #: src/bare-metal/alloc.md:37 msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy system allocator. Other crates are available, or you can " -"write your own or hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy " +"system allocator. Other crates are available, or you can write your own or " +"hook into your existing allocator." msgstr "" #: src/bare-metal/alloc.md:40 msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in this case it can allocate regions of up to 2\\*\\*32 " -"bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " +"in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" #: src/bare-metal/alloc.md:42 msgid "" -"If any crate in your dependency tree depends on `alloc` then you must have exactly one global allocator defined in your binary. " -"Usually this is done in the top-level binary crate." +"If any crate in your dependency tree depends on `alloc` then you must have " +"exactly one global allocator defined in your binary. Usually this is done in " +"the top-level binary crate." msgstr "" #: src/bare-metal/alloc.md:45 -msgid "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in so we get its panic handler." +msgid "" +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " +"crate is linked in so we get its panic handler." msgstr "" #: src/bare-metal/alloc.md:47 @@ -15143,17 +16068,21 @@ msgid "This example will build but not run, as it doesn't have an entry point." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex M microcontrollers." +msgid "" +"The `cortex_m_rt` crate provides (among other things) a reset handler for " +"Cortex M microcontrollers." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "Next we'll look at how to access peripherals, with increasing levels of abstraction." +msgid "" +"Next we'll look at how to access peripherals, with increasing levels of " +"abstraction." msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, because returning to the reset handler doesn't make " -"sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" +"> !`, because returning to the reset handler doesn't make sense." msgstr "" #: src/bare-metal/microcontrollers.md @@ -15161,7 +16090,9 @@ msgid "Run the example with `cargo embed --bin minimal`" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:3 -msgid "Most microcontrollers access peripherals via memory-mapped IO. Let's try turning on an LED on our micro:bit:" +msgid "" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try " +"turning on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:16 @@ -15176,25 +16107,34 @@ msgstr "" msgid "// PIN_CNF fields\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:34 src/bare-metal/microcontrollers/pacs.md:21 src/bare-metal/microcontrollers/hals.md:26 +#: src/bare-metal/microcontrollers/mmio.md:34 +#: src/bare-metal/microcontrollers/pacs.md:21 +#: src/bare-metal/microcontrollers/hals.md:26 msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:37 src/bare-metal/microcontrollers/mmio.md:59 +#: src/bare-metal/microcontrollers/mmio.md:37 +#: src/bare-metal/microcontrollers/mmio.md:59 msgid "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:56 src/bare-metal/microcontrollers/pacs.md:39 src/bare-metal/microcontrollers/hals.md:30 +#: src/bare-metal/microcontrollers/mmio.md:56 +#: src/bare-metal/microcontrollers/pacs.md:39 +#: src/bare-metal/microcontrollers/hals.md:30 msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md:72 -msgid "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to the first row." +msgid "" +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " +"to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:75 src/bare-metal/microcontrollers/pacs.md:61 src/bare-metal/microcontrollers/hals.md:44 +#: src/bare-metal/microcontrollers/mmio.md:75 +#: src/bare-metal/microcontrollers/pacs.md:61 +#: src/bare-metal/microcontrollers/hals.md:44 #: src/bare-metal/microcontrollers/board-support.md:37 msgid "Run the example with:" msgstr "" @@ -15205,23 +16145,28 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md:3 msgid "" -"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust wrappers for memory-mapped peripherals from [CMSIS-SVD]" -"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) files." +"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" +"pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:49 msgid "" -"SVD (System View Description) files are XML files typically provided by silicon vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by " +"silicon vendors which describe the memory map of the device." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:51 -msgid "They are organised by peripheral, register, field and value, with names, descriptions, addresses and so on." +msgid "" +"They are organised by peripheral, register, field and value, with names, " +"descriptions, addresses and so on." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:53 msgid "" -"SVD files are often buggy and incomplete, so there are various projects which patch the mistakes, add missing details, and publish " -"the generated crates." +"SVD files are often buggy and incomplete, so there are various projects " +"which patch the mistakes, add missing details, and publish the generated " +"crates." msgstr "" #: src/bare-metal/microcontrollers/pacs.md:56 @@ -15230,8 +16175,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md:57 msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac -- -d --no-show-raw-insn` to see the resulting " -"binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " +"pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md:1 @@ -15240,8 +16185,10 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md:3 msgid "" -"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-implementation-crates) for many microcontrollers provide " -"wrappers around various peripherals. These generally implement traits from [`embedded-hal`](https://crates.io/crates/embedded-hal)." +"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" +"implementation-crates) for many microcontrollers provide wrappers around " +"various peripherals. These generally implement traits from [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal)." msgstr "" #: src/bare-metal/microcontrollers/hals.md:23 @@ -15249,12 +16196,14 @@ msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "" #: src/bare-metal/microcontrollers/hals.md:40 -msgid "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." +msgid "" +"`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" #: src/bare-metal/microcontrollers/hals.md:41 msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various " +"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:1 @@ -15262,15 +16211,21 @@ msgid "Board support crates" msgstr "" #: src/bare-metal/microcontrollers/board-support.md:3 -msgid "Board support crates provide a further level of wrapping for a specific board for convenience." +msgid "" +"Board support crates provide a further level of wrapping for a specific " +"board for convenience." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:31 -msgid "In this case the board support crate is just providing more useful names, and a bit of initialisation." +msgid "" +"In this case the board support crate is just providing more useful names, " +"and a bit of initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:33 -msgid "The crate may also include drivers for some on-board devices outside of the microcontroller itself." +msgid "" +"The crate may also include drivers for some on-board devices outside of the " +"microcontroller itself." msgstr "" #: src/bare-metal/microcontrollers/board-support.md:35 @@ -15291,23 +16246,29 @@ msgstr "" #: src/bare-metal/microcontrollers/type-state.md:33 msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. Once a pin is moved out of the port struct nobody " -"else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can " +"exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:35 -msgid "Changing the configuration of a pin consumes the old pin instance, so you can’t keep use the old instance afterwards." +msgid "" +"Changing the configuration of a pin consumes the old pin instance, so you " +"can’t keep use the old instance afterwards." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:37 msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, the configuration state of a GPIO pin. This encodes the " -"state machine into the type system, and ensures that you don't try to use a pin in a certain way without properly configuring it " -"first. Illegal state transitions are caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, " +"the configuration state of a GPIO pin. This encodes the state machine into " +"the type system, and ensures that you don't try to use a pin in a certain " +"way without properly configuring it first. Illegal state transitions are " +"caught at compile time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:42 -msgid "You can call `is_high` on an input pin and `set_high` on an output pin, but not vice-versa." +msgid "" +"You can call `is_high` on an input pin and `set_high` on an output pin, but " +"not vice-versa." msgstr "" #: src/bare-metal/microcontrollers/type-state.md:44 @@ -15316,8 +16277,8 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:3 msgid "" -"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a number of traits covering common microcontroller " -"peripherals:" +"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " +"number of traits covering common microcontroller peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:6 @@ -15338,43 +16299,54 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:11 msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out into [`embedded-io`](https://crates.io/crates/" -"embedded-io), [`embedded-can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/crates/rand_core) " -"respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:14 msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-embedded-rust#driver-crates) in terms of these " -"traits, e.g. an accelerometer driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/" +"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:19 msgid "" -"The traits cover using the peripherals but not initialising or configuring them, as initialisation and configuration is usually " -"highly platform-specific." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:21 -msgid "There are implementations for many microcontrollers, as well as other platforms such as Linux on Raspberry Pi." +msgid "" +"There are implementations for many microcontrollers, as well as other " +"platforms such as Linux on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:23 -msgid "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides async versions of the traits." +msgid "" +"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " +"async versions of the traits." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md:24 msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another approach to non-blocking I/O, based on the [`nb`]" -"(https://crates.io/crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:3 -msgid "[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like OpenOCD but better integrated." +msgid "" +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " +"like OpenOCD but better integrated." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:6 -msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgid "" +"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:7 @@ -15387,33 +16359,42 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:10 msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real Time Transfers) output and connect GDB. It's " -"configured by an `Embed.toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " +"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." +"toml` file in your project directory." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:16 msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm standard protocol over USB for an in-circuit " -"debugger to access the CoreSight Debug Access Port of various Arm Cortex processors. It's what the on-board debugger on the BBC " -"micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " +"an Arm standard protocol over USB for an in-circuit debugger to access the " +"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " +"on-board debugger on the BBC micro:bit uses." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:20 -msgid "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a range from SEGGER." +msgid "" +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " +"is a range from SEGGER." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:22 -msgid "The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial Wire Debug." +msgid "" +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " +"Serial Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:24 -msgid "probe-rs is a library which you can integrate into your own tools if you want to." +msgid "" +"probe-rs is a library which you can integrate into your own tools if you " +"want to." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:26 msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) lets VSCode and other IDEs debug code " -"running on any supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" +"adapter-protocol/) lets VSCode and other IDEs debug code running on any " +"supported microcontroller." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:30 @@ -15422,7 +16403,8 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md:31 msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " +"host and the target through a number of ringbuffers." msgstr "" #: src/bare-metal/microcontrollers/debugging.md:3 @@ -15445,7 +16427,8 @@ msgstr "" msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:1 src/bare-metal/aps/other-projects.md:1 +#: src/bare-metal/microcontrollers/other-projects.md:1 +#: src/bare-metal/aps/other-projects.md:1 msgid "Other projects" msgstr "" @@ -15458,7 +16441,8 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "همزمانی وقفه‌گرا و بلادرنگ" #: src/bare-metal/microcontrollers/other-projects.md:5 -msgid "Shared resource management, message passing, task scheduling, timer queue" +msgid "" +"Shared resource management, message passing, task scheduling, timer queue" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:6 @@ -15474,7 +16458,9 @@ msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:9 -msgid "Security-focused RTOS with preemptive scheduling and Memory Protection Unit support" +msgid "" +"Security-focused RTOS with preemptive scheduling and Memory Protection Unit " +"support" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:11 @@ -15482,7 +16468,9 @@ msgid "[Hubris](https://hubris.oxide.computer/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:12 -msgid "Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged drivers, IPC" +msgid "" +"Microkernel RTOS from Oxide Computer Company with memory protection, " +"unprivileged drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:14 @@ -15491,7 +16479,8 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:15 msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github.io/book/overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." +"github.io/book/overview/using-the-standard-library.html)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:20 @@ -15503,7 +16492,9 @@ msgid "It doesn't include any HALs." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:22 -msgid "It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling rather than a proper kernel." +msgid "" +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " +"scheduling rather than a proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:24 @@ -15511,25 +16502,35 @@ msgid "Cortex-M only." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:25 -msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "" +"Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:26 -msgid "FreeRTOS is mostly written in C, but there are Rust bindings for writing applications." +msgid "" +"FreeRTOS is mostly written in C, but there are Rust bindings for writing " +"applications." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "We will read the direction from an I2C compass, and log the readings to a serial port." +msgid "" +"We will read the direction from an I2C compass, and log the readings to a " +"serial port." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "After looking at the exercises, you can look at the [solutions](solutions-morning.md) provided." -msgstr "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه کنید." +msgid "" +"After looking at the exercises, you can look at the [solutions](solutions-" +"morning.md) provided." +msgstr "" +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " +"نگاه کنید." #: src/exercises/bare-metal/compass.md:3 msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial port. If you have time, try displaying it on the " -"LEDs somehow too, or use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port. If you have time, try displaying it on the LEDs somehow too, or " +"use the buttons somehow." msgstr "" #: src/exercises/bare-metal/compass.md:7 @@ -15538,39 +16539,46 @@ msgstr "" #: src/exercises/bare-metal/compass.md:9 msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/" -"microbit-v2/latest/microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" +"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" +"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." +"org/hardware/)." msgstr "" #: src/exercises/bare-metal/compass.md:13 -msgid "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." +msgid "" +"The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" #: src/exercises/bare-metal/compass.md:14 -msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "" +"TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" #: src/exercises/bare-metal/compass.md:15 msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/" -"microbit-v2/latest/microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md:19 msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct.Board.html) struct with fields for the various " -"pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" #: src/exercises/bare-metal/compass.md:22 msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it " -"shouldn't be necessary for this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " +"this exercise." msgstr "" #: src/exercises/bare-metal/compass.md:26 msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `compass` directory for the following files." msgstr "" #: src/exercises/bare-metal/compass.md:29 src/exercises/bare-metal/rtc.md:22 @@ -15594,7 +16602,8 @@ msgid "See the serial output on Linux with:" msgstr "" #: src/exercises/bare-metal/compass.md:130 -msgid "Or on Mac OS something like (the device name may be slightly different):" +msgid "" +"Or on Mac OS something like (the device name may be slightly different):" msgstr "" #: src/exercises/bare-metal/compass.md:138 @@ -15643,7 +16652,8 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md:120 msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" msgstr "" @@ -15653,24 +16663,29 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now let's try writing something for Cortex-A. For " -"simplicity we'll just work with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " +"Now let's try writing something for Cortex-A. For simplicity we'll just work " +"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" +"virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" -"Broadly speaking, microcontrollers don't have an MMU or multiple levels of privilege (exception levels on Arm CPUs, rings on x86), " -"while application processors do." +"Broadly speaking, microcontrollers don't have an MMU or multiple levels of " +"privilege (exception levels on Arm CPUs, rings on x86), while application " +"processors do." msgstr "" #: src/bare-metal/aps.md msgid "" -"QEMU supports emulating various different machines or board models for each architecture. The 'virt' board doesn't correspond to any " -"particular real hardware, but is designed purely for virtual machines." +"QEMU supports emulating various different machines or board models for each " +"architecture. The 'virt' board doesn't correspond to any particular real " +"hardware, but is designed purely for virtual machines." msgstr "" #: src/bare-metal/aps/entry-point.md:3 -msgid "Before we can start running Rust code, we need to do some initialisation." +msgid "" +"Before we can start running Rust code, we need to do some initialisation." msgstr "" #: src/bare-metal/aps/entry-point.md:5 @@ -15680,7 +16695,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -15699,7 +16715,8 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -15709,7 +16726,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -15747,52 +16765,70 @@ msgid "" msgstr "" #: src/bare-metal/aps/entry-point.md:77 -msgid "This is the same as it would be for C: initialising the processor state, zeroing the BSS, and setting up the stack pointer." +msgid "" +"This is the same as it would be for C: initialising the processor state, " +"zeroing the BSS, and setting up the stack pointer." msgstr "" #: src/bare-metal/aps/entry-point.md:79 msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the object file which containing statically allocated " -"variables which are initialised to zero. They are omitted from the image, to avoid wasting space on zeroes. The compiler assumes " -"that the loader will take care of zeroing them." +"The BSS (block starting symbol, for historical reasons) is the part of the " +"object file which containing statically allocated variables which are " +"initialised to zero. They are omitted from the image, to avoid wasting space " +"on zeroes. The compiler assumes that the loader will take care of zeroing " +"them." msgstr "" #: src/bare-metal/aps/entry-point.md:84 -msgid "The BSS may already be zeroed, depending on how memory is initialised and the image is loaded, but we zero it to be sure." +msgid "" +"The BSS may already be zeroed, depending on how memory is initialised and " +"the image is loaded, but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md:86 -msgid "We need to enable the MMU and cache before reading or writing any memory. If we don't:" +msgid "" +"We need to enable the MMU and cache before reading or writing any memory. If " +"we don't:" msgstr "" #: src/bare-metal/aps/entry-point.md:88 msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-none` target which sets `+strict-align` to prevent " -"the compiler generating unaligned accesses, so it should be fine in this case, but this is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-" +"unknown-none` target which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses, so it should be fine in this case, but this " +"is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md:92 msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem is that the VM is accessing memory directly with " -"the cache disabled, while the host has cacheable aliases to the same memory. Even if the host doesn't explicitly access the memory, " -"speculative accesses can lead to cache fills, and then changes from one or the other will get lost when the cache is cleaned or the " -"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost when the cache " +"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " +"not VA or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md:99 msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity maps the first 1 GiB of address space for devices, " -"the next 1 GiB for DRAM, and another 1 GiB higher up for more devices. This matches the memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " +"identity maps the first 1 GiB of address space for devices, the next 1 GiB " +"for DRAM, and another 1 GiB higher up for more devices. This matches the " +"memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md:103 -msgid "We also set up the exception vector (`vbar_el1`), which we'll see more about later." +msgid "" +"We also set up the exception vector (`vbar_el1`), which we'll see more about " +"later." msgstr "" #: src/bare-metal/aps/entry-point.md:105 msgid "" -"All examples this afternoon assume we will be running at exception level 1 (EL1). If you need to run at a different exception level " -"you'll need to modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 " +"(EL1). If you need to run at a different exception level you'll need to " +"modify `entry.S` accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md:1 @@ -15801,8 +16837,9 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md:3 msgid "" -"Sometimes we need to use assembly to do things that aren't possible with Rust code. For example, to make an HVC (hypervisor call) to " -"tell the firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with " +"Rust code. For example, to make an HVC (hypervisor call) to tell the " +"firmware to power off the system:" msgstr "" #: src/bare-metal/aps/inline-assembly.md:20 @@ -15849,36 +16886,45 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md:40 msgid "" -"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/smccc) crate which has wrappers for all these " -"functions.)" +"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" +"smccc) crate which has wrappers for all these functions.)" msgstr "" #: src/bare-metal/aps/inline-assembly.md:45 msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of functions to manage system and CPU power states, among other " -"things. It is implemented by EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of " +"functions to manage system and CPU power states, among other things. It is " +"implemented by EL3 firmware and hypervisors on many systems." msgstr "" #: src/bare-metal/aps/inline-assembly.md:48 msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the inline assembly code, and ignore its contents afterwards. " -"We need to use `inout` rather than `in` because the call could potentially clobber the contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the " +"inline assembly code, and ignore its contents afterwards. We need to use " +"`inout` rather than `in` because the call could potentially clobber the " +"contents of the registers." msgstr "" #: src/bare-metal/aps/inline-assembly.md:52 -msgid "This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is called from our entry point in `entry.S`." +msgid "" +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " +"it is called from our entry point in `entry.S`." msgstr "" #: src/bare-metal/aps/inline-assembly.md:54 msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used by the bootloader to pass things like a pointer to " -"the device tree. According to the standard aarch64 calling convention (which is what `extern \"C\"` specifies to use), registers " -"`x0`–`x7` are used for the first 8 arguments passed to a function, so `entry.S` doesn't need to do anything special except make sure " -"it doesn't change these registers." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " +"used by the bootloader to pass things like a pointer to the device tree. " +"According to the standard aarch64 calling convention (which is what `extern " +"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " +"arguments passed to a function, so `entry.S` doesn't need to do anything " +"special except make sure it doesn't change these registers." msgstr "" #: src/bare-metal/aps/inline-assembly.md:60 -msgid "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." +msgid "" +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" +"examples`." msgstr "" #: src/bare-metal/aps/mmio.md:1 @@ -15894,29 +16940,35 @@ msgid "Never hold a reference." msgstr "" #: src/bare-metal/aps/mmio.md:5 -msgid "`addr_of!` lets you get fields of structs without creating an intermediate reference." +msgid "" +"`addr_of!` lets you get fields of structs without creating an intermediate " +"reference." msgstr "" #: src/bare-metal/aps/mmio.md:10 msgid "" -"Volatile access: read or write operations may have side-effects, so prevent the compiler or hardware from reordering, duplicating or " -"eliding them." +"Volatile access: read or write operations may have side-effects, so prevent " +"the compiler or hardware from reordering, duplicating or eliding them." msgstr "" #: src/bare-metal/aps/mmio.md:12 msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the compiler may assume that the value read is the same as the " -"value just written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the " +"compiler may assume that the value read is the same as the value just " +"written, and not bother actually reading memory." msgstr "" #: src/bare-metal/aps/mmio.md:15 msgid "" -"Some existing crates for volatile access to hardware do hold references, but this is unsound. Whenever a reference exist, the " -"compiler may choose to dereference it." +"Some existing crates for volatile access to hardware do hold references, but " +"this is unsound. Whenever a reference exist, the compiler may choose to " +"dereference it." msgstr "" #: src/bare-metal/aps/mmio.md:18 -msgid "Use the `addr_of!` macro to get struct field pointers from a pointer to the struct." +msgid "" +"Use the `addr_of!` macro to get struct field pointers from a pointer to the " +"struct." msgstr "" #: src/bare-metal/aps/uart.md:1 @@ -15925,7 +16977,8 @@ msgstr "" #: src/bare-metal/aps/uart.md:3 msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" +"documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" #: src/bare-metal/aps/uart.md:9 @@ -15939,8 +16992,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" @@ -15968,21 +17023,26 @@ msgstr "" #: src/bare-metal/aps/uart.md:55 msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is because as long as the caller of `Uart::new` guarantees " -"that its safety requirements are met (i.e. that there is only ever one instance of the driver for a given UART, and nothing else " -"aliasing its address space), then it is always safe to call `write_byte` later because we can assume the necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is " +"because as long as the caller of `Uart::new` guarantees that its safety " +"requirements are met (i.e. that there is only ever one instance of the " +"driver for a given UART, and nothing else aliasing its address space), then " +"it is always safe to call `write_byte` later because we can assume the " +"necessary preconditions." msgstr "" #: src/bare-metal/aps/uart.md:61 msgid "" -"We could have done it the other way around (making `new` safe but `write_byte` unsafe), but that would be much less convenient to " -"use as every place that calls `write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but " +"`write_byte` unsafe), but that would be much less convenient to use as every " +"place that calls `write_byte` would need to reason about the safety" msgstr "" #: src/bare-metal/aps/uart.md:64 msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving the burden of proof for soundness from a large number of " -"places to a smaller number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving " +"the burden of proof for soundness from a large number of places to a smaller " +"number of places." msgstr "" #: src/bare-metal/aps/uart/traits.md:1 @@ -15990,7 +17050,9 @@ msgid "More traits" msgstr "" #: src/bare-metal/aps/uart/traits.md:3 -msgid "We derived the `Debug` trait. It would be useful to implement a few more traits too." +msgid "" +"We derived the `Debug` trait. It would be useful to implement a few more " +"traits too." msgstr "" #: src/bare-metal/aps/uart/traits.md:17 @@ -16000,11 +17062,15 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart/traits.md:25 -msgid "Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type." +msgid "" +"Implementing `Write` lets us use the `write!` and `writeln!` macros with our " +"`Uart` type." msgstr "" #: src/bare-metal/aps/uart/traits.md:27 -msgid "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/examples`." +msgid "" +"Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" +"examples`." msgstr "" #: src/bare-metal/aps/better-uart.md:1 @@ -16013,9 +17079,11 @@ msgstr "" #: src/bare-metal/aps/better-uart.md:3 msgid "" -"The PL011 actually has [a bunch more registers](https://developer.arm.com/documentation/ddi0183/g/programmers-model/summary-of-" -"registers), and adding offsets to construct pointers to access them is error-prone and hard to read. Plus, some of them are bit " -"fields which would be nice to access in a structured way." +"The PL011 actually has [a bunch more registers](https://developer.arm.com/" +"documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " +"offsets to construct pointers to access them is error-prone and hard to " +"read. Plus, some of them are bit fields which would be nice to access in a " +"structured way." msgstr "" #: src/bare-metal/aps/better-uart.md:7 @@ -16134,8 +17202,8 @@ msgstr "" msgid "IMSC" msgstr "" -#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 src/bare-metal/aps/better-uart.md:20 -#: src/bare-metal/aps/better-uart.md:21 +#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 +#: src/bare-metal/aps/better-uart.md:20 src/bare-metal/aps/better-uart.md:21 msgid "11" msgstr "" @@ -16180,7 +17248,9 @@ msgid "There are also some ID registers which have been omitted for brevity." msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:3 -msgid "The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working with bitflags." +msgid "" +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " +"working with bitflags." msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:10 @@ -16225,8 +17295,8 @@ msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md:38 msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a bunch of method implementations to get and set " -"flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " +"with a bunch of method implementations to get and set flags." msgstr "" #: src/bare-metal/aps/better-uart/registers.md:1 @@ -16234,14 +17304,17 @@ msgid "Multiple registers" msgstr "" #: src/bare-metal/aps/better-uart/registers.md:3 -msgid "We can use a struct to represent the memory layout of the UART's registers." +msgid "" +"We can use a struct to represent the memory layout of the UART's registers." msgstr "" #: src/bare-metal/aps/better-uart/registers.md:43 msgid "" -"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) tells the compiler to lay the struct " -"fields out in order, following the same rules as C. This is necessary for our struct to have a predictable layout, as default Rust " -"representation allows the compiler to (among other things) reorder fields however it sees fit." +"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" +"representation) tells the compiler to lay the struct fields out in order, " +"following the same rules as C. This is necessary for our struct to have a " +"predictable layout, as default Rust representation allows the compiler to " +"(among other things) reorder fields however it sees fit." msgstr "" #: src/bare-metal/aps/better-uart/driver.md:3 @@ -16252,7 +17325,8 @@ msgstr "" msgid "/// Driver for a PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/better-uart/driver.md:30 src/bare-metal/aps/better-uart/driver.md:56 +#: src/bare-metal/aps/better-uart/driver.md:30 +#: src/bare-metal/aps/better-uart/driver.md:56 msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL011 device which is appropriately mapped.\n" @@ -16276,29 +17350,37 @@ msgstr "" #: src/bare-metal/aps/better-uart/driver.md:65 msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields without creating an intermediate reference, which " -"would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"fields without creating an intermediate reference, which would be unsound." msgstr "" -#: src/bare-metal/aps/better-uart/using.md:1 src/bare-metal/aps/logging/using.md:1 +#: src/bare-metal/aps/better-uart/using.md:1 +#: src/bare-metal/aps/logging/using.md:1 msgid "Using it" msgstr "" #: src/bare-metal/aps/better-uart/using.md:3 -msgid "Let's write a small program using our driver to write to the serial console, and echo incoming bytes." +msgid "" +"Let's write a small program using our driver to write to the serial console, " +"and echo incoming bytes." msgstr "" -#: src/bare-metal/aps/better-uart/using.md:19 src/bare-metal/aps/logging/using.md:18 src/exercises/bare-metal/solutions-afternoon.md:33 +#: src/bare-metal/aps/better-uart/using.md:19 +#: src/bare-metal/aps/logging/using.md:18 +#: src/exercises/bare-metal/solutions-afternoon.md:33 msgid "/// Base address of the primary PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:25 src/bare-metal/aps/logging/using.md:24 src/exercises/bare-metal/solutions-afternoon.md:44 +#: src/bare-metal/aps/better-uart/using.md:25 +#: src/bare-metal/aps/logging/using.md:24 +#: src/exercises/bare-metal/solutions-afternoon.md:44 msgid "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" " // nothing else accesses that address range.\n" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:29 src/bare-metal/aps/logging/using.md:29 +#: src/bare-metal/aps/better-uart/using.md:29 +#: src/bare-metal/aps/logging/using.md:29 msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgstr "" @@ -16306,7 +17388,8 @@ msgstr "" msgid "b'\\r'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md:36 src/concurrency/async-pitfalls/cancellation.md:27 +#: src/bare-metal/aps/better-uart/using.md:36 +#: src/concurrency/async-pitfalls/cancellation.md:27 msgid "b'\\n'" msgstr "b'\\n'" @@ -16320,18 +17403,21 @@ msgstr "" #: src/bare-metal/aps/better-uart/using.md:51 msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` function is called from our entry point code in `entry.S`. " -"See the speaker notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." msgstr "" #: src/bare-metal/aps/better-uart/using.md:54 -msgid "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +msgid "" +"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" #: src/bare-metal/aps/logging.md:3 msgid "" -"It would be nice to be able to use the logging macros from the [`log`](https://crates.io/crates/log) crate. We can do this by " -"implementing the `Log` trait." +"It would be nice to be able to use the logging macros from the [`log`]" +"(https://crates.io/crates/log) crate. We can do this by implementing the " +"`Log` trait." msgstr "" #: src/bare-metal/aps/logging.md:26 @@ -16343,14 +17429,17 @@ msgid "/// Initialises UART logger.\n" msgstr "" #: src/bare-metal/aps/logging.md:48 -msgid "The unwrap in `log` is safe because we initialise `LOGGER` before calling `set_logger`." +msgid "" +"The unwrap in `log` is safe because we initialise `LOGGER` before calling " +"`set_logger`." msgstr "" #: src/bare-metal/aps/logging/using.md:3 msgid "We need to initialise the logger before we use it." msgstr "" -#: src/bare-metal/aps/logging/using.md:38 src/exercises/bare-metal/solutions-afternoon.md:115 +#: src/bare-metal/aps/logging/using.md:38 +#: src/exercises/bare-metal/solutions-afternoon.md:115 msgid "\"{info}\"" msgstr "" @@ -16359,14 +17448,18 @@ msgid "Note that our panic handler can now log details of panics." msgstr "" #: src/bare-metal/aps/logging/using.md:47 -msgid "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/examples`." +msgid "" +"Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" +"examples`." msgstr "" #: src/bare-metal/aps/exceptions.md:3 msgid "" -"AArch64 defines an exception vector table with 16 entries, for 4 types of exceptions (synchronous, IRQ, FIQ, SError) from 4 states " -"(current EL with SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). We implement this in assembly to save " -"volatile registers to the stack before calling into Rust code:" +"AArch64 defines an exception vector table with 16 entries, for 4 types of " +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " +"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " +"We implement this in assembly to save volatile registers to the stack before " +"calling into Rust code:" msgstr "" #: src/bare-metal/aps/exceptions.md:67 @@ -16375,25 +17468,32 @@ msgstr "" #: src/bare-metal/aps/exceptions.md:68 msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current EL exceptions, or between AArch32 and AArch64 for the " -"lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current " +"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" #: src/bare-metal/aps/exceptions.md:70 -msgid "For this example we just log the exception and power down, as we don't expect any of them to actually happen." +msgid "" +"For this example we just log the exception and power down, as we don't " +"expect any of them to actually happen." msgstr "" #: src/bare-metal/aps/exceptions.md:72 msgid "" -"We can think of exception handlers and our main execution context more or less like different threads. [`Send` and `Sync`](../../" -"concurrency/send-sync.md) will control what we can share between them, just like with threads. For example, if we want to share some " -"value between exception handlers and the rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap it in " -"something like a `Mutex` and put it in a static." -msgstr "" -"ما می‌توانیم در مورد exception handlers و execution context اصلی تا حدودی مثل thread‌های مختلف فکر کنیم." -"‏ [`Send` و `Sync`](../../concurrency/send-sync.md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم را کنترل خواهند کرد، درست مانند threadها." -"برای مثال، اگر می‌خواهیم مقداری را بین exception handlers و بقیه برنامه به اشتراک بگذاریم، این کار به کمک `Send` است اما با `Sync` ممکن نیست،" -"پس در نتیجه باید آن را در چیزی مانند `Mutex` بپیچیم و در یک حالت static قرار دهیم." +"We can think of exception handlers and our main execution context more or " +"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." +"md) will control what we can share between them, just like with threads. For " +"example, if we want to share some value between exception handlers and the " +"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " +"it in something like a `Mutex` and put it in a static." +msgstr "" +"ما می‌توانیم در مورد exception handlers و execution context اصلی تا حدودی " +"مثل thread‌های مختلف فکر کنیم.‏ [`Send` و `Sync`](../../concurrency/send-sync." +"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم را کنترل خواهند کرد، درست " +"مانند threadها.برای مثال، اگر می‌خواهیم مقداری را بین exception handlers و " +"بقیه برنامه به اشتراک بگذاریم، این کار به کمک `Send` است اما با `Sync` ممکن " +"نیست،پس در نتیجه باید آن را در چیزی مانند `Mutex` بپیچیم و در یک حالت " +"static قرار دهیم." #: src/bare-metal/aps/other-projects.md:3 msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -16412,15 +17512,21 @@ msgid "Relies on LinuxBoot rather than having many drivers itself." msgstr "" #: src/bare-metal/aps/other-projects.md:7 -msgid "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" +msgid "" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" msgstr "" #: src/bare-metal/aps/other-projects.md:8 -msgid "Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception handling, page tables" +msgid "" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " +"exception handling, page tables" msgstr "" #: src/bare-metal/aps/other-projects.md:10 -msgid "Some dodginess around cache maintenance and initialisation in Rust, not necessarily a good example to copy for production code." +msgid "" +"Some dodginess around cache maintenance and initialisation in Rust, not " +"necessarily a good example to copy for production code." msgstr "" #: src/bare-metal/aps/other-projects.md:12 @@ -16433,22 +17539,27 @@ msgstr "" #: src/bare-metal/aps/other-projects.md:17 msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. This will read and write memory (e.g. the stack). " -"However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " +"enabled. This will read and write memory (e.g. the stack). However:" msgstr "" #: src/bare-metal/aps/other-projects.md:19 msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-unknown-none` which sets `+strict-align` to " -"prevent the compiler generating unaligned accesses so it should be alright, but this is not necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with " +"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses so it should be alright, but this is not " +"necessarily the case in general." msgstr "" #: src/bare-metal/aps/other-projects.md:23 msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem is that the VM is accessing memory directly with " -"the cache disabled, while the host has cacheable aliases to the same memory. Even if the host doesn't explicitly access the memory, " -"speculative accesses can lead to cache fills, and then changes from one or the other will get lost. Again this is alright in this " -"particular case (running directly on the hardware with no hypervisor), but isn't a good pattern in general." +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost. Again this is " +"alright in this particular case (running directly on the hardware with no " +"hypervisor), but isn't a good pattern in general." msgstr "" #: src/bare-metal/useful-crates.md @@ -16456,47 +17567,55 @@ msgid "Useful crates" msgstr "جعبه‌های (crates) کاربردی" #: src/bare-metal/useful-crates.md -msgid "We'll go over a few crates which solve some common problems in bare-metal programming." +msgid "" +"We'll go over a few crates which solve some common problems in bare-metal " +"programming." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:3 msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits and macros for safely converting between byte " -"sequences and other types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " +"traits and macros for safely converting between byte sequences and other " +"types." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:42 msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but can be useful for working with structures shared " -"with hardware e.g. by DMA, or sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " +"but can be useful for working with structures shared with hardware e.g. by " +"DMA, or sent over some external interface." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:48 msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is valid, and so can safely be converted from an untrusted " -"sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is " +"valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:50 msgid "" -"Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use all possible u32 values as " -"discriminants, so not all byte patterns are valid." +"Attempting to derive `FromBytes` for these types would fail, because " +"`RequestType` doesn't use all possible u32 values as discriminants, so not " +"all byte patterns are valid." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:53 -msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "" +"`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" #: src/bare-metal/useful-crates/zerocopy.md:54 msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-example/`. (It won't run in the Playground because of " -"the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"zerocopy-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:3 msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you create page tables according to the AArch64 Virtual " -"Memory System Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " +"you create page tables according to the AArch64 Virtual Memory System " +"Architecture." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:14 @@ -16512,26 +17631,34 @@ msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:28 -msgid "For now it only supports EL1, but support for other exception levels should be straightforward to add." +msgid "" +"For now it only supports EL1, but support for other exception levels should " +"be straightforward to add." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:30 msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android.com/android/platform/superproject/+/master:packages/" -"modules/Virtualization/pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android." +"com/android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/)." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md:31 -msgid "There's no easy way to run this example, as it needs to run on real hardware or under QEMU." +msgid "" +"There's no easy way to run this example, as it needs to run on real hardware " +"or under QEMU." msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:3 msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a third-party crate implementing a basic buddy system " -"allocator. It can be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct." -"LockedHeap.html) implementing [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " -"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other address space. For example, we might want to " -"allocate MMIO space for PCI BARs:" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " +"is a third-party crate implementing a basic buddy system allocator. It can " +"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " +"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " +"allocating other address space. For example, we might want to allocate MMIO " +"space for PCI BARs:" msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:29 @@ -16540,33 +17667,42 @@ msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md:30 msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-example/`. (It won't run in the Playground because of " -"the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"allocator-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:3 msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without heap allocation. [`tinyvec`](https://crates.io/crates/" -"tinyvec) provides this: a vector backed by an array or slice, which could be statically allocated or on the stack, which keeps track " -"of how many elements are used and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without " +"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " +"this: a vector backed by an array or slice, which could be statically " +"allocated or on the stack, which keeps track of how many elements are used " +"and panics if you try to use more than are allocated." msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:25 -msgid "`tinyvec` requires that the element type implement `Default` for initialisation." +msgid "" +"`tinyvec` requires that the element type implement `Default` for " +"initialisation." msgstr "" #: src/bare-metal/useful-crates/tinyvec.md:27 -msgid "The Rust Playground includes `tinyvec`, so this example will run fine inline." +msgid "" +"The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" #: src/bare-metal/useful-crates/spin.md:3 msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are not available in `core` or `alloc`. How can we " -"manage synchronisation or interior mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " +"are not available in `core` or `alloc`. How can we manage synchronisation or " +"interior mutability, such as for sharing state between different CPUs?" msgstr "" #: src/bare-metal/useful-crates/spin.md:7 -msgid "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based equivalents of many of these primitives." +msgid "" +"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " +"equivalents of many of these primitives." msgstr "" #: src/bare-metal/useful-crates/spin.md:26 @@ -16575,25 +17711,28 @@ msgstr "" #: src/bare-metal/useful-crates/spin.md:27 msgid "" -"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, `Barrier` and `Once` from `std::sync`; and `Lazy` for " -"lazy initialisation." +"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " +"`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" #: src/bare-metal/useful-crates/spin.md:29 msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful types for late initialisation with a slightly " -"different approach to `spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " +"useful types for late initialisation with a slightly different approach to " +"`spin::once::Once`." msgstr "" #: src/bare-metal/useful-crates/spin.md:31 -msgid "The Rust Playground includes `spin`, so this example will run fine inline." +msgid "" +"The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` Soong rule to build your Rust code, then a " -"`cc_binary` with a linker script to produce the binary itself, and then a `raw_binary` to convert the ELF to a raw binary ready to " -"be run." +"To build a bare-metal Rust binary in AOSP, you need to use a " +"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " +"with a linker script to produce the binary itself, and then a `raw_binary` " +"to convert the ELF to a raw binary ready to be run." msgstr "" #: src/bare-metal/android/vmbase.md:1 @@ -16602,19 +17741,22 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md:3 msgid "" -"For VMs running under crosvm on aarch64, the [vmbase](https://android.googlesource.com/platform/packages/modules/Virtualization/+/" -"refs/heads/master/vmbase/) library provides a linker script and useful defaults for the build rules, along with an entry point, UART " -"console logging and more." +"For VMs running under crosvm on aarch64, the [vmbase](https://android." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" +"master/vmbase/) library provides a linker script and useful defaults for the " +"build rules, along with an entry point, UART console logging and more." msgstr "" #: src/bare-metal/android/vmbase.md:24 -msgid "The `main!` macro marks your main function, to be called from the `vmbase` entry point." +msgid "" +"The `main!` macro marks your main function, to be called from the `vmbase` " +"entry point." msgstr "" #: src/bare-metal/android/vmbase.md:26 msgid "" -"The `vmbase` entry point handles console initialisation, and issues a PSCI_SYSTEM_OFF to shutdown the VM if your main function " -"returns." +"The `vmbase` entry point handles console initialisation, and issues a " +"PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" #: src/exercises/bare-metal/afternoon.md @@ -16622,35 +17764,43 @@ msgid "We will write a driver for the PL031 real-time clock device." msgstr "" #: src/exercises/bare-metal/afternoon.md -msgid "After looking at the exercises, you can look at the [solutions](solutions-afternoon.md) provided." -msgstr "پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده نگاهی بیندازید." +msgid "" +"After looking at the exercises, you can look at the [solutions](solutions-" +"afternoon.md) provided." +msgstr "" +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +"شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md:1 src/exercises/bare-metal/solutions-afternoon.md:3 +#: src/exercises/bare-metal/rtc.md:1 +#: src/exercises/bare-metal/solutions-afternoon.md:3 msgid "RTC driver" msgstr "" #: src/exercises/bare-metal/rtc.md:3 msgid "" -"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/documentation/ddi0224/c) real-time clock at 0x9010000. For " -"this exercise, you should write a driver for it." +"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " +"you should write a driver for it." msgstr "" #: src/exercises/bare-metal/rtc.md:6 msgid "" -"Use it to print the current time to the serial console. You can use the [`chrono`](https://crates.io/crates/chrono) crate for date/" -"time formatting." +"Use it to print the current time to the serial console. You can use the " +"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" #: src/exercises/bare-metal/rtc.md:8 msgid "" -"Use the match register and raw interrupt status to busy-wait until a given time, e.g. 3 seconds in the future. (Call [`core::hint::" -"spin_loop`](https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given " +"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" +"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" #: src/exercises/bare-metal/rtc.md:11 msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by the RTC match. You can use the driver provided in the " -"[`arm-gic`](https://docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by " +"the RTC match. You can use the driver provided in the [`arm-gic`](https://" +"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" #: src/exercises/bare-metal/rtc.md:14 @@ -16659,17 +17809,20 @@ msgstr "" #: src/exercises/bare-metal/rtc.md:15 msgid "" -"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::wfi()`, which will cause the core to sleep until it " -"receives an interrupt." +"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" +"wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" #: src/exercises/bare-metal/rtc.md:19 msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `rtc` directory for the following files." msgstr "" #: src/exercises/bare-metal/rtc.md:79 -msgid "_src/exceptions.rs_ (you should only need to change this for the 3rd part of the exercise):" +msgid "" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " +"the exercise):" msgstr "" #: src/exercises/bare-metal/rtc.md:156 @@ -16757,16 +17910,20 @@ msgstr "" msgid "// Wait for 3 seconds, without interrupts.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:73 src/exercises/bare-metal/solutions-afternoon.md:91 +#: src/exercises/bare-metal/solutions-afternoon.md:73 +#: src/exercises/bare-metal/solutions-afternoon.md:91 msgid "\"Waiting for {}\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:75 src/exercises/bare-metal/solutions-afternoon.md:83 -#: src/exercises/bare-metal/solutions-afternoon.md:96 src/exercises/bare-metal/solutions-afternoon.md:104 +#: src/exercises/bare-metal/solutions-afternoon.md:75 +#: src/exercises/bare-metal/solutions-afternoon.md:83 +#: src/exercises/bare-metal/solutions-afternoon.md:96 +#: src/exercises/bare-metal/solutions-afternoon.md:104 msgid "\"matched={}, interrupt_pending={}\"" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:87 src/exercises/bare-metal/solutions-afternoon.md:108 +#: src/exercises/bare-metal/solutions-afternoon.md:87 +#: src/exercises/bare-metal/solutions-afternoon.md:108 msgid "\"Finished waiting\"" msgstr "" @@ -16821,8 +17978,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" @@ -16830,9 +17989,12 @@ msgstr "" msgid "/// Reads the current RTC value.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md:172 src/exercises/bare-metal/solutions-afternoon.md:180 -#: src/exercises/bare-metal/solutions-afternoon.md:188 src/exercises/bare-metal/solutions-afternoon.md:199 -#: src/exercises/bare-metal/solutions-afternoon.md:211 src/exercises/bare-metal/solutions-afternoon.md:218 +#: src/exercises/bare-metal/solutions-afternoon.md:172 +#: src/exercises/bare-metal/solutions-afternoon.md:180 +#: src/exercises/bare-metal/solutions-afternoon.md:188 +#: src/exercises/bare-metal/solutions-afternoon.md:199 +#: src/exercises/bare-metal/solutions-afternoon.md:211 +#: src/exercises/bare-metal/solutions-afternoon.md:218 msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL031 device which is appropriately mapped.\n" @@ -16846,7 +18008,8 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md:185 msgid "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" msgstr "" @@ -16862,7 +18025,8 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" msgstr "" @@ -16881,38 +18045,59 @@ msgid "Welcome to Concurrency in Rust" msgstr "به مبحث Concurrency در Rust خوش‌آمدید " #: src/concurrency/welcome.md -msgid "Rust has full support for concurrency using OS threads with mutexes and channels." -msgstr "زبان Rust به طور کامل از concurrency با استفاده از threadهای سیستم‌عامل به همراه mutexeها و channelها استفاده می‌کند." +msgid "" +"Rust has full support for concurrency using OS threads with mutexes and " +"channels." +msgstr "" +"زبان Rust به طور کامل از concurrency با استفاده از threadهای سیستم‌عامل به " +"همراه mutexeها و channelها استفاده می‌کند." #: src/concurrency/welcome.md msgid "" -"The Rust type system plays an important role in making many concurrency bugs compile time bugs. This is often referred to as " -"_fearless concurrency_ since you can rely on the compiler to ensure correctness at runtime." +"The Rust type system plays an important role in making many concurrency bugs " +"compile time bugs. This is often referred to as _fearless concurrency_ since " +"you can rely on the compiler to ensure correctness at runtime." msgstr "" -"تایپ سیستم Rustنقش مهمی در تولید بسیاری از concurrency باگ‌ها در زمان کامپایل ایجاد می‌کند." -"این مورد اغلب به عنوان _fearless concurrency_ شناخته می‌شود؛ زیرا می‌توانید به کامپایلر به عنوان تصحیح‌کننده خطاهای زمان اجرا (runtime) حساب کنید." +"تایپ سیستم Rustنقش مهمی در تولید بسیاری از concurrency باگ‌ها در زمان کامپایل " +"ایجاد می‌کند.این مورد اغلب به عنوان _fearless concurrency_ شناخته می‌شود؛ زیرا " +"می‌توانید به کامپایلر به عنوان تصحیح‌کننده خطاهای زمان اجرا (runtime) حساب " +"کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md -msgid "Including 10 minute breaks, this session should take about 3 hours and 20 minutes. It contains:" -msgstr "با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. و شامل موارد زیر است:" +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 20 " +"minutes. It contains:" +msgstr "" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. و " +"شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." -msgstr "‏Rust به ما این امکان را می‌دهد به concurrency toolkit سیستم‌عامل دسترسی پیدا کنیم: threadها، sync، primitives و غیره." +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgstr "" +"‏Rust به ما این امکان را می‌دهد به concurrency toolkit سیستم‌عامل دسترسی پیدا " +"کنیم: threadها، sync، primitives و غیره." #: src/concurrency/welcome.md -msgid "The type system gives us safety for concurrency without any special features." -msgstr "این سیستم تایپ بدون هیچ ویژگی خاص دیگر، دسترسی امن به concurrency برای ما به ارمغان می‌آورد." +msgid "" +"The type system gives us safety for concurrency without any special features." +msgstr "" +"این سیستم تایپ بدون هیچ ویژگی خاص دیگر، دسترسی امن به concurrency برای ما به " +"ارمغان می‌آورد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e.g., a called function that might mutate an argument or " -"save references to it to read later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." msgstr "" -"همان ابزارهایی که به دسترسی \"concurrent\" در یک thread تنها کمک می‌کنند (به عنوان مثال، یک تابع فراخوانی که ممکن است یک آرگومان را تغییر دهد" -"یا ارجاعات به آن را ذخیره کند تا در آینده آن را بخوانید) ما را از مشکلات استفاده از حالت چندین thread ای نجات می‌دهد." +"همان ابزارهایی که به دسترسی \"concurrent\" در یک thread تنها کمک می‌کنند (به " +"عنوان مثال، یک تابع فراخوانی که ممکن است یک آرگومان را تغییر دهدیا ارجاعات " +"به آن را ذخیره کند تا در آینده آن را بخوانید) ما را از مشکلات استفاده از " +"حالت چندین thread ای نجات می‌دهد." -#: src/concurrency/threads.md src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/threads.md src/concurrency/shared-state.md +#: src/concurrency/async.md msgid "This segment should take about 30 minutes. It contains:" msgstr "" @@ -16949,7 +18134,9 @@ msgid "Run the example." msgstr "" #: src/concurrency/threads/plain.md:34 -msgid "5ms timing is loose enough that main and spawned threads stay mostly in lockstep." +msgid "" +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." msgstr "" #: src/concurrency/threads/plain.md:36 @@ -16957,7 +18144,9 @@ msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" #: src/concurrency/threads/plain.md:37 -msgid "This is because main ends the program and spawned threads do not make it persist." +msgid "" +"This is because main ends the program and spawned threads do not make it " +"persist." msgstr "" #: src/concurrency/threads/plain.md:39 @@ -16969,17 +18158,21 @@ msgid "How do we wait around for the spawned thread to complete?" msgstr "" #: src/concurrency/threads/plain.md:42 -msgid "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. Look at the docs." +msgid "" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. Look at the docs." msgstr "" #: src/concurrency/threads/plain.md:43 -msgid "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join) method that blocks." +msgid "" +"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) method that blocks." msgstr "" #: src/concurrency/threads/plain.md:45 msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the thread to finish and have the program count all the " -"way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " +"the thread to finish and have the program count all the way to 10." msgstr "" #: src/concurrency/threads/plain.md:48 @@ -16991,15 +18184,21 @@ msgid "Look at docs again:" msgstr "" #: src/concurrency/threads/plain.md:50 -msgid "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" +msgid "" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" msgstr "" #: src/concurrency/threads/plain.md:51 -msgid "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join) returns `thread::Result`" +msgid "" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" msgstr "" #: src/concurrency/threads/plain.md:53 -msgid "Use the `Result` return value from `handle.join()` to get access to the returned value." +msgid "" +"Use the `Result` return value from `handle.join()` to get access to the " +"returned value." msgstr "" #: src/concurrency/threads/plain.md:56 @@ -17011,7 +18210,9 @@ msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" #: src/concurrency/threads/plain.md:58 -msgid "Access the panic payload. This is a good time to talk about [`Any`](https://doc.rust-lang.org/std/any/index.html)." +msgid "" +"Access the panic payload. This is a good time to talk about [`Any`](https://" +"doc.rust-lang.org/std/any/index.html)." msgstr "" #: src/concurrency/threads/plain.md:60 @@ -17035,7 +18236,9 @@ msgid "If we want to borrow?" msgstr "" #: src/concurrency/threads/plain.md:66 -msgid "Main kills child threads when it returns, but another function would just return and leave them running." +msgid "" +"Main kills child threads when it returns, but another function would just " +"return and leave them running." msgstr "" #: src/concurrency/threads/plain.md:68 @@ -17051,17 +18254,21 @@ msgid "Normal threads cannot borrow from their environment:" msgstr "" #: src/concurrency/threads/scoped.md:20 -msgid "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope.html) for this:" +msgid "" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" +"fn.scope.html) for this:" msgstr "" #: src/concurrency/threads/scoped.md:41 msgid "" -"The reason for that is that when the `thread::scope` function completes, all the threads are guaranteed to be joined, so they can " -"return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all " +"the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" #: src/concurrency/threads/scoped.md:43 -msgid "Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably by any number of threads." +msgid "" +"Normal Rust borrowing rules apply: you can either borrow mutably by one " +"thread, or immutably by any number of threads." msgstr "" #: src/concurrency/channels.md src/concurrency/async-control-flow.md @@ -17070,67 +18277,75 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md:3 msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts are connected via the channel, but you only see the " -"end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two " +"parts are connected via the channel, but you only see the end-points." msgstr "" -#: src/concurrency/channels/senders-receivers.md:15 src/concurrency/channels/senders-receivers.md:16 +#: src/concurrency/channels/senders-receivers.md:15 +#: src/concurrency/channels/senders-receivers.md:16 #: src/concurrency/channels/senders-receivers.md:20 msgid "\"Received: {:?}\"" msgstr "" #: src/concurrency/channels/senders-receivers.md:27 msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` (so you can make multiple producers) " -"but `Receiver` does not." +"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " +"implement `Clone` (so you can make multiple producers) but `Receiver` does " +"not." msgstr "" #: src/concurrency/channels/senders-receivers.md:30 msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` or `Receiver` is dropped and the " -"channel is closed." +"`send()` and `recv()` return `Result`. If they return `Err`, it means the " +"counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md:3 msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" msgstr "" -#: src/concurrency/channels/unbounded.md:16 src/concurrency/channels/bounded.md:16 +#: src/concurrency/channels/unbounded.md:16 +#: src/concurrency/channels/bounded.md:16 msgid "\"Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:17 src/concurrency/channels/bounded.md:17 +#: src/concurrency/channels/unbounded.md:17 +#: src/concurrency/channels/bounded.md:17 msgid "\"{thread_id:?}: sent Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:19 src/concurrency/channels/bounded.md:19 +#: src/concurrency/channels/unbounded.md:19 +#: src/concurrency/channels/bounded.md:19 msgid "\"{thread_id:?}: done\"" msgstr "" -#: src/concurrency/channels/unbounded.md:24 src/concurrency/channels/bounded.md:24 +#: src/concurrency/channels/unbounded.md:24 +#: src/concurrency/channels/bounded.md:24 msgid "\"Main: got {msg}\"" msgstr "" #: src/concurrency/channels/bounded.md:3 -msgid "With bounded (synchronous) channels, `send` can block the current thread:" +msgid "" +"With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" #: src/concurrency/channels/bounded.md:32 msgid "" -"Calling `send` will block the current thread until there is space in the channel for the new message. The thread can be blocked " -"indefinitely if there is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the " +"channel for the new message. The thread can be blocked indefinitely if there " +"is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md:35 msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) if the channel is closed. A channel is closed when the " -"receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) " +"if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md:37 msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". Every send will block the current thread until another " -"thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". " +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -17142,29 +18357,35 @@ msgid "Sync" msgstr "همگام سازی" #: src/concurrency/send-sync/marker-traits.md:3 -msgid "How does Rust know to forbid shared access across threads? The answer is in two traits:" +msgid "" +"How does Rust know to forbid shared access across threads? The answer is in " +"two traits:" msgstr "" #: src/concurrency/send-sync/marker-traits.md:6 msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is `Send` if it is safe to move a `T` across a thread " -"boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " +"is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" #: src/concurrency/send-sync/marker-traits.md:8 msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is `Sync` if it is safe to move a `&T` across a thread " -"boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " +"is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" #: src/concurrency/send-sync/marker-traits.md:11 msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The compiler will automatically derive them for your " -"types as long as they only contain `Send` and `Sync` types. You can also implement them manually when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" #: src/concurrency/send-sync/marker-traits.md:22 -msgid "One can think of these traits as markers that the type has certain thread-safety properties." +msgid "" +"One can think of these traits as markers that the type has certain thread-" +"safety properties." msgstr "" #: src/concurrency/send-sync/marker-traits.md:24 @@ -17173,23 +18394,27 @@ msgstr "" #: src/concurrency/send-sync/send.md:3 msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " +"if it is safe to move a `T` value to another thread." msgstr "" #: src/concurrency/send-sync/send.md:5 msgid "" -"The effect of moving ownership to another thread is that _destructors_ will run in that thread. So the question is when you can " -"allocate a value in one thread and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will " +"run in that thread. So the question is when you can allocate a value in one " +"thread and deallocate it in another." msgstr "" #: src/concurrency/send-sync/send.md:14 -msgid "As an example, a connection to the SQLite library must only be accessed from a single thread." +msgid "" +"As an example, a connection to the SQLite library must only be accessed from " +"a single thread." msgstr "" #: src/concurrency/send-sync/sync.md:3 msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if it is safe to access a `T` value from multiple " -"threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " +"if it is safe to access a `T` value from multiple threads at the same time." msgstr "" #: src/concurrency/send-sync/sync.md:6 @@ -17202,15 +18427,18 @@ msgstr "" #: src/concurrency/send-sync/sync.md:15 msgid "" -"This statement is essentially a shorthand way of saying that if a type is thread-safe for shared use, it is also thread-safe to pass " -"references of it across threads." +"This statement is essentially a shorthand way of saying that if a type is " +"thread-safe for shared use, it is also thread-safe to pass references of it " +"across threads." msgstr "" #: src/concurrency/send-sync/sync.md:19 msgid "" -"This is because if a type is Sync it means that it can be shared across multiple threads without the risk of data races or other " -"synchronization issues, so it is safe to move it to another thread. A reference to the type is also safe to move to another thread, " -"because the data it references can be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across " +"multiple threads without the risk of data races or other synchronization " +"issues, so it is safe to move it to another thread. A reference to the type " +"is also safe to move to another thread, because the data it references can " +"be accessed from any thread safely." msgstr "" #: src/concurrency/send-sync/examples.md:3 @@ -17250,7 +18478,9 @@ msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "" #: src/concurrency/send-sync/examples.md:15 -msgid "The generic types are typically `Send + Sync` when the type parameters are `Send + Sync`." +msgid "" +"The generic types are typically `Send + Sync` when the type parameters are " +"`Send + Sync`." msgstr "" #: src/concurrency/send-sync/examples.md:18 @@ -17258,7 +18488,9 @@ msgid "`Send + !Sync`" msgstr "" #: src/concurrency/send-sync/examples.md:20 -msgid "These types can be moved to other threads, but they're not thread-safe. Typically because of interior mutability:" +msgid "" +"These types can be moved to other threads, but they're not thread-safe. " +"Typically because of interior mutability:" msgstr "" #: src/concurrency/send-sync/examples.md:23 @@ -17278,11 +18510,14 @@ msgid "`!Send + Sync`" msgstr "" #: src/concurrency/send-sync/examples.md:29 -msgid "These types are thread-safe, but they cannot be moved to another thread:" +msgid "" +"These types are thread-safe, but they cannot be moved to another thread:" msgstr "" #: src/concurrency/send-sync/examples.md:31 -msgid "`MutexGuard`: Uses OS level primitives which must be deallocated on the thread which created them." +msgid "" +"`MutexGuard`: Uses OS level primitives which must be deallocated on " +"the thread which created them." msgstr "" #: src/concurrency/send-sync/examples.md:34 @@ -17294,11 +18529,15 @@ msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" #: src/concurrency/send-sync/examples.md:38 -msgid "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-atomic reference count." +msgid "" +"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" +"atomic reference count." msgstr "" #: src/concurrency/send-sync/examples.md:40 -msgid "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency considerations." +msgid "" +"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " +"considerations." msgstr "" #: src/concurrency/shared-state.md @@ -17310,31 +18549,43 @@ msgid "Mutex" msgstr "Mutex" #: src/concurrency/shared-state/arc.md:3 -msgid "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-only access via `Arc::clone`:" +msgid "" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " +"read-only access via `Arc::clone`:" msgstr "" #: src/concurrency/shared-state/arc.md:16 msgid "\"{thread_id:?}: {v:?}\"" msgstr "" -#: src/concurrency/shared-state/arc.md:21 src/concurrency/shared-state/example.md:17 src/concurrency/shared-state/example.md:46 +#: src/concurrency/shared-state/arc.md:21 +#: src/concurrency/shared-state/example.md:17 +#: src/concurrency/shared-state/example.md:46 msgid "\"v: {v:?}\"" msgstr "" #: src/concurrency/shared-state/arc.md:30 -msgid "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that uses atomic operations." +msgid "" +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " +"that uses atomic operations." msgstr "" #: src/concurrency/shared-state/arc.md:32 -msgid "`Arc` implements `Clone` whether or not `T` does. It implements `Send` and `Sync` if and only if `T` implements them both." +msgid "" +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " +"and `Sync` if and only if `T` implements them both." msgstr "" #: src/concurrency/shared-state/arc.md:34 -msgid "`Arc::clone()` has the cost of atomic operations that get executed, but after that the use of the `T` is free." +msgid "" +"`Arc::clone()` has the cost of atomic operations that get executed, but " +"after that the use of the `T` is free." msgstr "" #: src/concurrency/shared-state/arc.md:36 -msgid "Beware of reference cycles, `Arc` does not use a garbage collector to detect them." +msgid "" +"Beware of reference cycles, `Arc` does not use a garbage collector to detect " +"them." msgstr "" #: src/concurrency/shared-state/arc.md:38 @@ -17343,36 +18594,46 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:3 msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual exclusion _and_ allows mutable access to `T` " -"behind a read-only interface (another form of [interior mutability](../../borrowing/interior-mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " +"mutual exclusion _and_ allows mutable access to `T` behind a read-only " +"interface (another form of [interior mutability](../../borrowing/interior-" +"mutability.md)):" msgstr "" -#: src/concurrency/shared-state/mutex.md:12 src/concurrency/shared-state/mutex.md:19 +#: src/concurrency/shared-state/mutex.md:12 +#: src/concurrency/shared-state/mutex.md:19 msgid "\"v: {:?}\"" msgstr "" #: src/concurrency/shared-state/mutex.md:23 msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#impl-Sync-for-" -"Mutex%3CT%3E) blanket implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " +"implementation." msgstr "" #: src/concurrency/shared-state/mutex.md:33 -msgid "`Mutex` in Rust looks like a collection with just one element --- the protected data." +msgid "" +"`Mutex` in Rust looks like a collection with just one element --- the " +"protected data." msgstr "" #: src/concurrency/shared-state/mutex.md:35 -msgid "It is not possible to forget to acquire the mutex before accessing the protected data." +msgid "" +"It is not possible to forget to acquire the mutex before accessing the " +"protected data." msgstr "" #: src/concurrency/shared-state/mutex.md:37 msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that the `&mut T` doesn't outlive the lock " -"being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The " +"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" #: src/concurrency/shared-state/mutex.md:39 -msgid "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements `Send`." +msgid "" +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " +"implements `Send`." msgstr "" #: src/concurrency/shared-state/mutex.md:41 @@ -17385,9 +18646,11 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang.org/std/sync/struct." -"PoisonError.html). You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" +"\" to signal that the data it protected might be in an inconsistent state. " +"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" +"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " +"`into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -17407,20 +18670,27 @@ msgid "Notable parts:" msgstr "" #: src/concurrency/shared-state/example.md:52 -msgid "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." +msgid "" +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " +"orthogonal." msgstr "" #: src/concurrency/shared-state/example.md:54 -msgid "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between threads." +msgid "" +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " +"between threads." msgstr "" #: src/concurrency/shared-state/example.md:56 msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` was added to the lambda signature." +"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " +"thread. Note `move` was added to the lambda signature." msgstr "" #: src/concurrency/shared-state/example.md:58 -msgid "Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." +msgid "" +"Blocks are introduced to narrow the scope of the `LockGuard` as much as " +"possible." msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:3 @@ -17429,71 +18699,93 @@ msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:5 msgid "" -"Five philosophers dine together at the same table. Each philosopher has their own place at the table. There is a fork between each " -"plate. The dish served is a kind of spaghetti which has to be eaten with two forks. Each philosopher can only alternately think and " -"eat. Moreover, a philosopher can only eat their spaghetti when they have both a left and right fork. Thus two forks will only be " -"available when their two nearest neighbors are thinking, not eating. After an individual philosopher finishes eating, they will put " +"Five philosophers dine together at the same table. Each philosopher has " +"their own place at the table. There is a fork between each plate. The dish " +"served is a kind of spaghetti which has to be eaten with two forks. Each " +"philosopher can only alternately think and eat. Moreover, a philosopher can " +"only eat their spaghetti when they have both a left and right fork. Thus two " +"forks will only be available when their two nearest neighbors are thinking, " +"not eating. After an individual philosopher finishes eating, they will put " "down both forks." msgstr "" #: src/concurrency/sync-exercises/dining-philosophers.md:13 msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. Copy the code below to a file called " -"`src/main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) " +"for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:28 src/concurrency/async-exercises/dining-philosophers.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md:28 +#: src/concurrency/async-exercises/dining-philosophers.md:23 msgid "" "// left_fork: ...\n" " // right_fork: ...\n" " // thoughts: ...\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:36 src/concurrency/sync-exercises/solutions.md:22 -#: src/concurrency/async-exercises/dining-philosophers.md:31 src/concurrency/async-exercises/solutions.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md:36 +#: src/concurrency/sync-exercises/solutions.md:22 +#: src/concurrency/async-exercises/dining-philosophers.md:31 +#: src/concurrency/async-exercises/solutions.md:23 msgid "\"Eureka! {} has a new idea!\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:41 src/concurrency/async-exercises/solutions.md:31 +#: src/concurrency/sync-exercises/dining-philosophers.md:41 +#: src/concurrency/async-exercises/solutions.md:31 msgid "// Pick up forks...\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:42 src/concurrency/sync-exercises/solutions.md:31 -#: src/concurrency/async-exercises/dining-philosophers.md:38 src/concurrency/async-exercises/solutions.md:51 +#: src/concurrency/sync-exercises/dining-philosophers.md:42 +#: src/concurrency/sync-exercises/solutions.md:31 +#: src/concurrency/async-exercises/dining-philosophers.md:38 +#: src/concurrency/async-exercises/solutions.md:51 msgid "\"{} is eating...\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Socrates\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Hypatia\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Plato\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Aristotle\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/solutions.md:37 +#: src/concurrency/async-exercises/dining-philosophers.md:44 +#: src/concurrency/async-exercises/solutions.md:59 msgid "\"Pythagoras\"" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:51 src/concurrency/async-exercises/dining-philosophers.md:48 +#: src/concurrency/sync-exercises/dining-philosophers.md:51 +#: src/concurrency/async-exercises/dining-philosophers.md:48 #: src/concurrency/async-exercises/solutions.md:63 msgid "// Create forks\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:53 src/concurrency/async-exercises/dining-philosophers.md:50 +#: src/concurrency/sync-exercises/dining-philosophers.md:53 +#: src/concurrency/async-exercises/dining-philosophers.md:50 #: src/concurrency/async-exercises/solutions.md:67 msgid "// Create philosophers\n" msgstr "" @@ -17502,7 +18794,8 @@ msgstr "" msgid "// Make each of them think and eat 100 times\n" msgstr "" -#: src/concurrency/sync-exercises/dining-philosophers.md:57 src/concurrency/async-exercises/dining-philosophers.md:54 +#: src/concurrency/sync-exercises/dining-philosophers.md:57 +#: src/concurrency/async-exercises/dining-philosophers.md:54 #: src/concurrency/async-exercises/solutions.md:95 msgid "// Output their thoughts\n" msgstr "" @@ -17523,15 +18816,18 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:3 msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It should start at a webpage and check that links on the page " -"are valid. It should recursively check other pages on the same domain and keep doing this until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It " +"should start at a webpage and check that links on the page are valid. It " +"should recursively check other pages on the same domain and keep doing this " +"until all pages have been validated." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:8 msgid "" -"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/reqwest/). You will also need a way to find links, we can " -"use [`scraper`](https://docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use [`thiserror`](https://docs." -"rs/thiserror/)." +"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`]" +"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " +"we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:12 @@ -17540,12 +18836,13 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:22 msgid "" -"If `cargo add` fails with `error: no such subcommand`, then please edit the `Cargo.toml` file by hand. Add the dependencies listed " -"below." +"If `cargo add` fails with `error: no such subcommand`, then please edit the " +"`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:25 -msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgid "" +"The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" #: src/concurrency/sync-exercises/link-checker.md:29 @@ -17558,41 +18855,50 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" +"\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" msgstr "" #: src/concurrency/sync-exercises/link-checker.md:42 -msgid "You can now download the start page. Try with a small site such as `https://www.google.org/`." +msgid "" +"You can now download the start page. Try with a small site such as `https://" +"www.google.org/`." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:45 msgid "Your `src/main.rs` file should look something like this:" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:57 src/concurrency/sync-exercises/solutions.md:93 +#: src/concurrency/sync-exercises/link-checker.md:57 +#: src/concurrency/sync-exercises/solutions.md:93 msgid "\"request error: {0}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:59 src/concurrency/sync-exercises/solutions.md:95 +#: src/concurrency/sync-exercises/link-checker.md:59 +#: src/concurrency/sync-exercises/solutions.md:95 msgid "\"bad http response: {0}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:70 src/concurrency/sync-exercises/solutions.md:106 +#: src/concurrency/sync-exercises/link-checker.md:70 +#: src/concurrency/sync-exercises/solutions.md:106 msgid "\"Checking {:#}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:88 src/concurrency/sync-exercises/solutions.md:124 +#: src/concurrency/sync-exercises/link-checker.md:88 +#: src/concurrency/sync-exercises/solutions.md:124 msgid "\"href\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:95 src/concurrency/sync-exercises/solutions.md:131 +#: src/concurrency/sync-exercises/link-checker.md:95 +#: src/concurrency/sync-exercises/solutions.md:131 msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "" -#: src/concurrency/sync-exercises/link-checker.md:104 src/concurrency/sync-exercises/solutions.md:241 +#: src/concurrency/sync-exercises/link-checker.md:104 +#: src/concurrency/sync-exercises/solutions.md:241 msgid "\"https://www.google.org\"" msgstr "" @@ -17610,14 +18916,15 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:121 msgid "" -"Use threads to check the links in parallel: send the URLs to be checked to a channel and let a few threads check the URLs in " -"parallel." +"Use threads to check the links in parallel: send the URLs to be checked to a " +"channel and let a few threads check the URLs in parallel." msgstr "" #: src/concurrency/sync-exercises/link-checker.md:123 msgid "" -"Extend this to recursively extract links from all pages on the `www.google.org` domain. Put an upper limit of 100 pages or so so " -"that you don't end up being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google." +"org` domain. Put an upper limit of 100 pages or so so that you don't end up " +"being blocked by the site." msgstr "" #: src/concurrency/sync-exercises/solutions.md:27 @@ -17640,7 +18947,8 @@ msgid "Link Checker" msgstr "" #: src/concurrency/sync-exercises/solutions.md:150 -msgid "/// Determine whether links within the given page should be extracted.\n" +msgid "" +"/// Determine whether links within the given page should be extracted.\n" msgstr "" #: src/concurrency/sync-exercises/solutions.md:158 @@ -17663,32 +18971,39 @@ msgstr "" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed concurrently by executing each task until it would block, then " -"switching to another task that is ready to make progress. The model allows running a larger number of tasks on a limited number of " -"threads. This is because the per-task overhead is typically very low and operating systems provide primitives for efficiently " -"identifying I/O that is able to proceed." +"\"Async\" is a concurrency model where multiple tasks are executed " +"concurrently by executing each task until it would block, then switching to " +"another task that is ready to make progress. The model allows running a " +"larger number of tasks on a limited number of threads. This is because the " +"per-task overhead is typically very low and operating systems provide " +"primitives for efficiently identifying I/O that is able to proceed." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work that may be completed in the future. Futures are " -"\"polled\" until they signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work " +"that may be completed in the future. Futures are \"polled\" until they " +"signal that they are complete." msgstr "" #: src/concurrency/welcome-async.md -msgid "Futures are polled by an async runtime, and several different runtimes are available." +msgid "" +"Futures are polled by an async runtime, and several different runtimes are " +"available." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"Python has a similar model in its `asyncio`. However, its `Future` type is callback-based, and not polled. Async Python programs " -"require a \"loop\", similar to a runtime in Rust." +"Python has a similar model in its `asyncio`. However, its `Future` type is " +"callback-based, and not polled. Async Python programs require a \"loop\", " +"similar to a runtime in Rust." msgstr "" #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language runtime implements the event loop, so many of the details " -"of Promise resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language " +"runtime implements the event loop, so many of the details of Promise " +"resolution are hidden." msgstr "" #: src/concurrency/async.md @@ -17696,7 +19011,9 @@ msgid "async/await" msgstr "async/await" #: src/concurrency/async/async-await.md:3 -msgid "At a high level, async Rust code looks very much like \"normal\" sequential code:" +msgid "" +"At a high level, async Rust code looks very much like \"normal\" sequential " +"code:" msgstr "" #: src/concurrency/async/async-await.md:10 @@ -17704,7 +19021,9 @@ msgid "\"Count is: {i}!\"" msgstr "" #: src/concurrency/async/async-await.md:28 -msgid "Note that this is a simplified example to show the syntax. There is no long running operation or any real concurrency in it!" +msgid "" +"Note that this is a simplified example to show the syntax. There is no long " +"running operation or any real concurrency in it!" msgstr "" #: src/concurrency/async/async-await.md:31 @@ -17716,78 +19035,100 @@ msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" #: src/concurrency/async/async-await.md:34 -msgid "The \"async\" keyword is syntactic sugar. The compiler replaces the return type with a future." +msgid "" +"The \"async\" keyword is syntactic sugar. The compiler replaces the return " +"type with a future." msgstr "" #: src/concurrency/async/async-await.md:37 -msgid "You cannot make `main` async, without additional instructions to the compiler on how to use the returned future." +msgid "" +"You cannot make `main` async, without additional instructions to the " +"compiler on how to use the returned future." msgstr "" #: src/concurrency/async/async-await.md:40 -msgid "You need an executor to run async code. `block_on` blocks the current thread until the provided future has run to completion." +msgid "" +"You need an executor to run async code. `block_on` blocks the current thread " +"until the provided future has run to completion." msgstr "" #: src/concurrency/async/async-await.md:43 msgid "" -"`.await` asynchronously waits for the completion of another operation. Unlike `block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. " +"Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" #: src/concurrency/async/async-await.md:46 -msgid "`.await` can only be used inside an `async` function (or block; these are introduced later)." +msgid "" +"`.await` can only be used inside an `async` function (or block; these are " +"introduced later)." msgstr "" #: src/concurrency/async/futures.md:3 msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, implemented by objects that represent an operation " -"that may not be complete yet. A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll." -"html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " +"trait, implemented by objects that represent an operation that may not be " +"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" #: src/concurrency/async/futures.md:23 msgid "" -"An async function returns an `impl Future`. It's also possible (but uncommon) to implement `Future` for your own types. For example, " -"the `JoinHandle` returned from `tokio::spawn` implements `Future` to allow joining to it." +"An async function returns an `impl Future`. It's also possible (but " +"uncommon) to implement `Future` for your own types. For example, the " +"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " +"joining to it." msgstr "" #: src/concurrency/async/futures.md:27 msgid "" -"The `.await` keyword, applied to a Future, causes the current async function to pause until that Future is ready, and then evaluates " -"to its output." +"The `.await` keyword, applied to a Future, causes the current async function " +"to pause until that Future is ready, and then evaluates to its output." msgstr "" #: src/concurrency/async/futures.md:33 -msgid "The `Future` and `Poll` types are implemented exactly as shown; click the links to show the implementations in the docs." +msgid "" +"The `Future` and `Poll` types are implemented exactly as shown; click the " +"links to show the implementations in the docs." msgstr "" #: src/concurrency/async/futures.md:36 msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async code, rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async " +"code, rather than building new async primitives. Briefly:" msgstr "" #: src/concurrency/async/futures.md:39 -msgid "`Context` allows a Future to schedule itself to be polled again when an event occurs." +msgid "" +"`Context` allows a Future to schedule itself to be polled again when an " +"event occurs." msgstr "" #: src/concurrency/async/futures.md:42 msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into that future remain valid. This is required to allow " -"references to remain valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into " +"that future remain valid. This is required to allow references to remain " +"valid after an `.await`." msgstr "" #: src/concurrency/async/runtimes.md:3 msgid "" -"A _runtime_ provides support for performing operations asynchronously (a _reactor_) and is responsible for executing futures (an " -"_executor_). Rust does not have a \"built-in\" runtime, but several options are available:" +"A _runtime_ provides support for performing operations asynchronously (a " +"_reactor_) and is responsible for executing futures (an _executor_). Rust " +"does not have a \"built-in\" runtime, but several options are available:" msgstr "" #: src/concurrency/async/runtimes.md:7 msgid "" -"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of functionality like [Hyper](https://hyper.rs/) for HTTP or " -"[Tonic](https://github.com/hyperium/tonic) for gRPC." +"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" +"github.com/hyperium/tonic) for gRPC." msgstr "" #: src/concurrency/async/runtimes.md:10 -msgid "[async-std](https://async.rs/): aims to be a \"std for async\", and includes a basic runtime in `async::task`." +msgid "" +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " +"a basic runtime in `async::task`." msgstr "" #: src/concurrency/async/runtimes.md:12 @@ -17796,20 +19137,24 @@ msgstr "" #: src/concurrency/async/runtimes.md:14 msgid "" -"Several larger applications have their own runtimes. For example, [Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/" -"main/src/lib/fuchsia-async/src/lib.rs) already has one." +"Several larger applications have their own runtimes. For example, [Fuchsia]" +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" +"async/src/lib.rs) already has one." msgstr "" #: src/concurrency/async/runtimes.md:21 msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust playground. The playground also does not permit any I/O, so " -"most interesting async things can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust " +"playground. The playground also does not permit any I/O, so most interesting " +"async things can't run in the playground." msgstr "" #: src/concurrency/async/runtimes.md:25 msgid "" -"Futures are \"inert\" in that they do not do anything (not even start an I/O operation) unless there is an executor polling them. " -"This differs from JS Promises, for example, which will run to completion even if they are never used." +"Futures are \"inert\" in that they do not do anything (not even start an I/O " +"operation) unless there is an executor polling them. This differs from JS " +"Promises, for example, which will run to completion even if they are never " +"used." msgstr "" #: src/concurrency/async/runtimes/tokio.md:3 @@ -17854,8 +19199,9 @@ msgstr "" #: src/concurrency/async/runtimes/tokio.md:40 msgid "" -"Why does `count_to` not (usually) get to 10? This is an example of async cancellation. `tokio::spawn` returns a handle which can be " -"awaited to wait until it finishes." +"Why does `count_to` not (usually) get to 10? This is an example of async " +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " +"until it finishes." msgstr "" #: src/concurrency/async/runtimes/tokio.md:44 @@ -17872,9 +19218,11 @@ msgstr "" #: src/concurrency/async/tasks.md:5 msgid "" -"A task has a single top-level future which the executor polls to make progress. That future may have one or more nested futures that " -"its `poll` method polls, corresponding loosely to a call stack. Concurrency within a task is possible by polling multiple child " -"futures, such as racing a timer and an I/O operation." +"A task has a single top-level future which the executor polls to make " +"progress. That future may have one or more nested futures that its `poll` " +"method polls, corresponding loosely to a call stack. Concurrency within a " +"task is possible by polling multiple child futures, such as racing a timer " +"and an I/O operation." msgstr "" #: src/concurrency/async/tasks.md:16 @@ -17893,7 +19241,8 @@ msgstr "" msgid "b\"Who are you?\\n\"" msgstr "" -#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 src/concurrency/async/tasks.md:31 +#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 +#: src/concurrency/async/tasks.md:31 msgid "\"socket error\"" msgstr "" @@ -17901,34 +19250,41 @@ msgstr "" msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "" -#: src/concurrency/async/tasks.md:40 src/concurrency/async-control-flow/join.md:37 -msgid "Copy this example into your prepared `src/main.rs` and run it from there." +#: src/concurrency/async/tasks.md:40 +#: src/concurrency/async-control-flow/join.md:37 +msgid "" +"Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" #: src/concurrency/async/tasks.md:42 msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/man-page/linux/1/nc/) or [telnet](https://www.unix." -"com/man-page/linux/1/telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix." +"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" +"telnet/)." msgstr "" #: src/concurrency/async/tasks.md:46 msgid "" -"Ask students to visualize what the state of the example server would be with a few connected clients. What tasks exist? What are " -"their Futures?" +"Ask students to visualize what the state of the example server would be with " +"a few connected clients. What tasks exist? What are their Futures?" msgstr "" #: src/concurrency/async/tasks.md:49 msgid "" -"This is the first time we've seen an `async` block. This is similar to a closure, but does not take any arguments. Its return value " -"is a Future, similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a " +"closure, but does not take any arguments. Its return value is a Future, " +"similar to an `async fn`." msgstr "" #: src/concurrency/async/tasks.md:53 -msgid "Refactor the async block into a function, and improve the error handling using `?`." +msgid "" +"Refactor the async block into a function, and improve the error handling " +"using `?`." msgstr "" #: src/concurrency/async-control-flow/channels.md:3 -msgid "Several crates have support for asynchronous channels. For instance `tokio`:" +msgid "" +"Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" #: src/concurrency/async-control-flow/channels.md:13 @@ -17956,7 +19312,9 @@ msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" #: src/concurrency/async-control-flow/channels.md:38 -msgid "Overall, the interface is similar to the `sync` channels as seen in the [morning class](../channels.md)." +msgid "" +"Overall, the interface is similar to the `sync` channels as seen in the " +"[morning class](../channels.md)." msgstr "" #: src/concurrency/async-control-flow/channels.md:41 @@ -17965,20 +19323,23 @@ msgstr "" #: src/concurrency/async-control-flow/channels.md:43 msgid "" -"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that implement both `sync` and `async` `send` and `recv`. This " -"can be convenient for complex applications with both IO and heavy CPU processing tasks." +"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " +"implement both `sync` and `async` `send` and `recv`. This can be convenient " +"for complex applications with both IO and heavy CPU processing tasks." msgstr "" #: src/concurrency/async-control-flow/channels.md:47 msgid "" -"What makes working with `async` channels preferable is the ability to combine them with other `future`s to combine them and create " -"complex control flow." +"What makes working with `async` channels preferable is the ability to " +"combine them with other `future`s to combine them and create complex control " +"flow." msgstr "" #: src/concurrency/async-control-flow/join.md:3 msgid "" -"A join operation waits until all of a set of futures are ready, and returns a collection of their results. This is similar to " -"`Promise.all` in JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns " +"a collection of their results. This is similar to `Promise.all` in " +"JavaScript or `asyncio.gather` in Python." msgstr "" #: src/concurrency/async-control-flow/join.md:21 @@ -17999,32 +19360,41 @@ msgstr "" #: src/concurrency/async-control-flow/join.md:39 msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but you must know how many futures you will have at compile " -"time. This is currently in the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but " +"you must know how many futures you will have at compile time. This is " +"currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" #: src/concurrency/async-control-flow/join.md:43 -msgid "The risk of `join` is that one of the futures may never resolve, this would cause your program to stall." +msgid "" +"The risk of `join` is that one of the futures may never resolve, this would " +"cause your program to stall." msgstr "" #: src/concurrency/async-control-flow/join.md:46 msgid "" -"You can also combine `join_all` with `join!` for instance to join all requests to an http service as well as a database query. Try " -"adding a `tokio::time::sleep` to the future, using `futures::join!`. This is not a timeout (that requires `select!`, explained in " -"the next chapter), but demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all " +"requests to an http service as well as a database query. Try adding a " +"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " +"timeout (that requires `select!`, explained in the next chapter), but " +"demonstrates `join!`." msgstr "" #: src/concurrency/async-control-flow/select.md:3 msgid "" -"A select operation waits until any of a set of futures is ready, and responds to that future's result. In JavaScript, this is " -"similar to `Promise.race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)`." +"A select operation waits until any of a set of futures is ready, and " +"responds to that future's result. In JavaScript, this is similar to `Promise." +"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)`." msgstr "" #: src/concurrency/async-control-flow/select.md:8 msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, each of the form `pattern = future => statement`. When a " -"`future` is ready, its return value is destructured by the `pattern`. The `statement` is then run with the resulting variables. The " -"`statement` result becomes the result of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, " +"each of the form `pattern = future => statement`. When a `future` is ready, " +"its return value is destructured by the `pattern`. The `statement` is then " +"run with the resulting variables. The `statement` result becomes the result " +"of the `select!` macro." msgstr "" #: src/concurrency/async-control-flow/select.md:40 @@ -18049,34 +19419,42 @@ msgstr "" #: src/concurrency/async-control-flow/select.md:58 msgid "" -"In this example, we have a race between a cat and a dog. `first_animal_to_finish_race` listens to both channels and will pick " -"whichever arrives first. Since the dog takes 50ms, it wins against the cat that take 500ms." +"In this example, we have a race between a cat and a dog. " +"`first_animal_to_finish_race` listens to both channels and will pick " +"whichever arrives first. Since the dog takes 50ms, it wins against the cat " +"that take 500ms." msgstr "" #: src/concurrency/async-control-flow/select.md:63 -msgid "You can use `oneshot` channels in this example as the channels are supposed to receive only one `send`." +msgid "" +"You can use `oneshot` channels in this example as the channels are supposed " +"to receive only one `send`." msgstr "" #: src/concurrency/async-control-flow/select.md:66 -msgid "Try adding a deadline to the race, demonstrating selecting different sorts of futures." +msgid "" +"Try adding a deadline to the race, demonstrating selecting different sorts " +"of futures." msgstr "" #: src/concurrency/async-control-flow/select.md:69 msgid "" -"Note that `select!` drops unmatched branches, which cancels their futures. It is easiest to use when every execution of `select!` " -"creates new futures." +"Note that `select!` drops unmatched branches, which cancels their futures. " +"It is easiest to use when every execution of `select!` creates new futures." msgstr "" #: src/concurrency/async-control-flow/select.md:72 msgid "" -"An alternative is to pass `&mut future` instead of the future itself, but this can lead to issues, further discussed in the pinning " -"slide." +"An alternative is to pass `&mut future` instead of the future itself, but " +"this can lead to issues, further discussed in the pinning slide." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" -"Async / await provides convenient and efficient abstraction for concurrent asynchronous programming. However, the async/await model " -"in Rust also comes with its share of pitfalls and footguns. We illustrate some of them in this chapter." +"Async / await provides convenient and efficient abstraction for concurrent " +"asynchronous programming. However, the async/await model in Rust also comes " +"with its share of pitfalls and footguns. We illustrate some of them in this " +"chapter." msgstr "" #: src/concurrency/async-pitfalls.md @@ -18089,8 +19467,10 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:3 msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that CPU blocking tasks will block the executor and prevent " -"other tasks from being executed. An easy workaround is to use async equivalent methods where possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that " +"CPU blocking tasks will block the executor and prevent other tasks from " +"being executed. An easy workaround is to use async equivalent methods where " +"possible." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:14 @@ -18102,54 +19482,65 @@ msgid "\"current_thread\"" msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:30 -msgid "Run the code and see that the sleeps happen consecutively rather than concurrently." +msgid "" +"Run the code and see that the sleeps happen consecutively rather than " +"concurrently." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:33 msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the effect more obvious, but the bug is still present " -"in the multi-threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This " +"makes the effect more obvious, but the bug is still present in the multi-" +"threaded flavor." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:37 -msgid "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." +msgid "" +"Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:39 msgid "" -"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual thread and transforms its handle into a future without " -"blocking the executor." +"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " +"thread and transforms its handle into a future without blocking the executor." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:42 msgid "" -"You should not think of tasks as OS threads. They do not map 1 to 1 and most executors will allow many tasks to run on a single OS " -"thread. This is particularly problematic when interacting with other libraries via FFI, where that library might depend on thread-" -"local storage or map to specific OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." +"You should not think of tasks as OS threads. They do not map 1 to 1 and most " +"executors will allow many tasks to run on a single OS thread. This is " +"particularly problematic when interacting with other libraries via FFI, " +"where that library might depend on thread-local storage or map to specific " +"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " +"situations." msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md:48 msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause another task to block, and that task may be running on the " -"same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause " +"another task to block, and that task may be running on the same thread." msgstr "" #: src/concurrency/async-pitfalls/pin.md:3 msgid "" -"Async blocks and functions return types implementing the `Future` trait. The type returned is the result of a compiler " -"transformation which turns local variables into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The " +"type returned is the result of a compiler transformation which turns local " +"variables into data stored inside the future." msgstr "" #: src/concurrency/async-pitfalls/pin.md:7 msgid "" -"Some of those variables can hold pointers to other local variables. Because of that, the future should never be moved to a different " -"memory location, as it would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because " +"of that, the future should never be moved to a different memory location, as " +"it would invalidate those pointers." msgstr "" #: src/concurrency/async-pitfalls/pin.md:11 msgid "" -"To prevent moving the future type in memory, it can only be polled through a pinned pointer. `Pin` is a wrapper around a reference " -"that disallows all operations that would move the instance it points to into a different memory location." +"To prevent moving the future type in memory, it can only be polled through a " +"pinned pointer. `Pin` is a wrapper around a reference that disallows all " +"operations that would move the instance it points to into a different memory " +"location." msgstr "" #: src/concurrency/async-pitfalls/pin.md:20 @@ -18191,84 +19582,109 @@ msgid "\"work result for iteration {i}: {resp}\"" msgstr "" #: src/concurrency/async-pitfalls/pin.md:70 -msgid "You may recognize this as an example of the actor pattern. Actors typically call `select!` in a loop." +msgid "" +"You may recognize this as an example of the actor pattern. Actors typically " +"call `select!` in a loop." msgstr "" #: src/concurrency/async-pitfalls/pin.md:73 -msgid "This serves as a summation of a few of the previous lessons, so take your time with it." +msgid "" +"This serves as a summation of a few of the previous lessons, so take your " +"time with it." msgstr "" #: src/concurrency/async-pitfalls/pin.md:76 -msgid "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the `select!`. This will never execute. Why?" +msgid "" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " +"the `select!`. This will never execute. Why?" msgstr "" #: src/concurrency/async-pitfalls/pin.md:79 -msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "" +"Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:90 msgid "" -"This still doesn't work. Follow the compiler errors, adding `&mut` to the `timeout_fut` in the `select!` to work around the move, " -"then using `Box::pin`:" +"This still doesn't work. Follow the compiler errors, adding `&mut` to the " +"`timeout_fut` in the `select!` to work around the move, then using `Box::" +"pin`:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:104 msgid "" -"This compiles, but once the timeout expires it is `Poll::Ready` on every iteration (a fused future would help with this). Update to " -"reset `timeout_fut` every time it expires:" +"This compiles, but once the timeout expires it is `Poll::Ready` on every " +"iteration (a fused future would help with this). Update to reset " +"`timeout_fut` every time it expires:" msgstr "" #: src/concurrency/async-pitfalls/pin.md:119 msgid "" -"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently stabilized, with older code often using `tokio::pin!`) is " -"also an option, but that is difficult to use for a future that is reassigned." +"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " +"stabilized, with older code often using `tokio::pin!`) is also an option, " +"but that is difficult to use for a future that is reassigned." msgstr "" #: src/concurrency/async-pitfalls/pin.md:123 -msgid "Another alternative is to not use `pin` at all but spawn another task that will send to a `oneshot` channel every 100ms." +msgid "" +"Another alternative is to not use `pin` at all but spawn another task that " +"will send to a `oneshot` channel every 100ms." msgstr "" #: src/concurrency/async-pitfalls/pin.md:126 msgid "" -"Data that contains pointers to itself is called self-referential. Normally, the Rust borrow checker would prevent self-referential " -"data from being moved, as the references cannot outlive the data they point to. However, the code transformation for async blocks " -"and functions is not verified by the borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, " +"the Rust borrow checker would prevent self-referential data from being " +"moved, as the references cannot outlive the data they point to. However, the " +"code transformation for async blocks and functions is not verified by the " +"borrow checker." msgstr "" #: src/concurrency/async-pitfalls/pin.md:132 msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its place using a pinned pointer. However, it can still be " -"moved through an unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its " +"place using a pinned pointer. However, it can still be moved through an " +"unpinned pointer." msgstr "" #: src/concurrency/async-pitfalls/pin.md:136 msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut Self` to refer to the instance. That's why it can " -"only be called on a pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " +"`&mut Self` to refer to the instance. That's why it can only be called on a " +"pinned pointer." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:3 msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 release. This required support for using return-position " -"`impl Trait` (RPIT) in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:7 -msgid "However, even with the native support today there are some pitfalls around `async fn` and RPIT in traits:" +msgid "" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:10 -msgid "Return-position impl Trait captures all in-scope lifetimes (so some patterns of borrowing cannot be expressed)" +msgid "" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:13 -msgid "Traits whose methods use return-position `impl trait` or `async` are not `dyn` compatible." +msgid "" +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:16 msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/latest/async_trait/) provides a workaround through " -"a macro, with some caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) provides a workaround through a macro, with some " +"caveats:" msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:46 @@ -18281,28 +19697,35 @@ msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:68 msgid "" -"`async_trait` is easy to use, but note that it's using heap allocations to achieve this. This heap allocation has performance " -"overhead." +"`async_trait` is easy to use, but note that it's using heap allocations to " +"achieve this. This heap allocation has performance overhead." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:71 msgid "" -"The challenges in language support for `async trait` are deep Rust and probably not worth describing in-depth. Niko Matsakis did a " -"good job of explaining them in [this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) if " -"you are interested in digging deeper." +"The challenges in language support for `async trait` are deep Rust and " +"probably not worth describing in-depth. Niko Matsakis did a good job of " +"explaining them in [this post](https://smallcultfollowing.com/babysteps/" +"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " +"digging deeper." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md:77 -msgid "Try creating a new sleeper struct that will sleep for a random amount of time and adding it to the Vec." +msgid "" +"Try creating a new sleeper struct that will sleep for a random amount of " +"time and adding it to the Vec." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:3 msgid "" -"Dropping a future implies it can never be polled again. This is called _cancellation_ and it can occur at any `await` point. Care is " -"needed to ensure the system works correctly even when futures are cancelled. For example, it shouldn't deadlock or lose data." +"Dropping a future implies it can never be polled again. This is called " +"_cancellation_ and it can occur at any `await` point. Care is needed to " +"ensure the system works correctly even when futures are cancelled. For " +"example, it shouldn't deadlock or lose data." msgstr "" -#: src/concurrency/async-pitfalls/cancellation.md:35 src/concurrency/async-pitfalls/cancellation.md:102 +#: src/concurrency/async-pitfalls/cancellation.md:35 +#: src/concurrency/async-pitfalls/cancellation.md:102 msgid "\"not UTF-8\"" msgstr "" @@ -18316,11 +19739,14 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:73 msgid "" -"The compiler doesn't help with cancellation-safety. You need to read API documentation and consider what state your `async fn` holds." +"The compiler doesn't help with cancellation-safety. You need to read API " +"documentation and consider what state your `async fn` holds." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:76 -msgid "Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-handling)." +msgid "" +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " +"error-handling)." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:79 @@ -18328,11 +19754,15 @@ msgid "The example loses parts of the string." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:81 -msgid "Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." +msgid "" +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " +"dropped." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:84 -msgid "`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" +msgid "" +"`LinesReader` can be made cancellation-safe by making `buf` part of the " +"struct:" msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:98 @@ -18341,47 +19771,58 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:108 msgid "" -"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) is cancellation-safe because it keeps " -"track of whether a tick has been 'delivered'." +"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." +"html#method.tick) is cancellation-safe because it keeps track of whether a " +"tick has been 'delivered'." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:112 msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method.read) is cancellation-safe because it " -"either returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) is cancellation-safe because it either " +"returns or doesn't read data." msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:115 msgid "" -"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt.html#method.read_line) is similar to the " -"example and _isn't_ cancellation-safe. See its documentation for details and alternatives." +"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " +"cancellation-safe. See its documentation for details and alternatives." msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:1 src/concurrency/async-exercises/solutions.md:3 +#: src/concurrency/async-exercises/dining-philosophers.md:1 +#: src/concurrency/async-exercises/solutions.md:3 #, fuzzy msgid "Dining Philosophers --- Async" msgstr "فلسفه Dining" #: src/concurrency/async-exercises/dining-philosophers.md:3 -msgid "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a description of the problem." +msgid "" +"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " +"description of the problem." msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:6 msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. Copy the code below to a " -"file called `src/main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-" +"locally.md) for this exercise. Copy the code below to a file called `src/" +"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:37 src/concurrency/async-exercises/solutions.md:29 +#: src/concurrency/async-exercises/dining-philosophers.md:37 +#: src/concurrency/async-exercises/solutions.md:29 msgid "// Keep trying until we have both forks\n" msgstr "" -#: src/concurrency/async-exercises/dining-philosophers.md:52 src/concurrency/async-exercises/solutions.md:85 +#: src/concurrency/async-exercises/dining-philosophers.md:52 +#: src/concurrency/async-exercises/solutions.md:85 msgid "// Make them think and eat\n" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:58 -msgid "Since this time you are using Async Rust, you'll need a `tokio` dependency. You can use the following `Cargo.toml`:" +msgid "" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. " +"You can use the following `Cargo.toml`:" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:63 @@ -18393,12 +19834,15 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:73 -msgid "Also note that this time you have to use the `Mutex` and the `mpsc` module from the `tokio` crate." +msgid "" +"Also note that this time you have to use the `Mutex` and the `mpsc` module " +"from the `tokio` crate." msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md:79 @@ -18407,15 +19851,19 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:3 msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast chat application. We have a chat server that the clients " -"connect to and publish their messages. The client reads user messages from the standard input, and sends them to the server. The " -"chat server broadcasts each message that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast " +"chat application. We have a chat server that the clients connect to and " +"publish their messages. The client reads user messages from the standard " +"input, and sends them to the server. The chat server broadcasts each message " +"that it receives to all the clients." msgstr "" #: src/concurrency/async-exercises/chat-app.md:9 msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn.channel.html) on the server, and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/) for the communication between the client and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" +"(https://docs.rs/tokio-websockets/) for the communication between the client " +"and the server." msgstr "" #: src/concurrency/async-exercises/chat-app.md:12 @@ -18438,7 +19886,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" +"\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -18448,32 +19897,36 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:33 msgid "" -"You are going to need the following functions from `tokio` and [`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few " -"minutes to familiarize yourself with the API." +"You are going to need the following functions from `tokio` and " +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " +"to familiarize yourself with the API." msgstr "" #: src/concurrency/async-exercises/chat-app.md:37 msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt.html#method.next) implemented by " -"`WebSocketStream`: for asynchronously reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " +"asynchronously reading messages from a Websocket Stream." msgstr "" #: src/concurrency/async-exercises/chat-app.md:39 msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt.html#method.send) implemented by " -"`WebSocketStream`: for asynchronously sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " +"asynchronously sending messages on a Websocket Stream." msgstr "" #: src/concurrency/async-exercises/chat-app.md:41 msgid "" -"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method.next_line): for asynchronously reading user " -"messages from the standard input." +"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." +"html#method.next_line): for asynchronously reading user messages from the " +"standard input." msgstr "" #: src/concurrency/async-exercises/chat-app.md:43 msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender.html#method.subscribe): for subscribing to a " -"broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" #: src/concurrency/async-exercises/chat-app.md:45 @@ -18482,47 +19935,59 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:47 msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` file. In this project, we need two binaries. One " -"for the client, and one for the server. You could potentially make them two separate Cargo projects, but we are going to put them in " -"a single Cargo project with two binaries. For this to work, the client and the server code should go under `src/bin` (see the " -"[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." +"Normally in a Cargo project, you can have only one binary, and one `src/main." +"rs` file. In this project, we need two binaries. One for the client, and one " +"for the server. You could potentially make them two separate Cargo projects, " +"but we are going to put them in a single Cargo project with two binaries. " +"For this to work, the client and the server code should go under `src/bin` " +"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" +"targets.html#binaries))." msgstr "" #: src/concurrency/async-exercises/chat-app.md:54 msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/bin/client.rs`, respectively. Your task is to complete " -"these files as described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/" +"bin/client.rs`, respectively. Your task is to complete these files as " +"described below." msgstr "" -#: src/concurrency/async-exercises/chat-app.md:58 src/concurrency/async-exercises/solutions.md:104 +#: src/concurrency/async-exercises/chat-app.md:58 +#: src/concurrency/async-exercises/solutions.md:104 msgid "_src/bin/server.rs_:" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:77 src/concurrency/async-exercises/chat-app.md:124 +#: src/concurrency/async-exercises/chat-app.md:77 +#: src/concurrency/async-exercises/chat-app.md:124 msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:85 src/concurrency/async-exercises/solutions.md:154 +#: src/concurrency/async-exercises/chat-app.md:85 +#: src/concurrency/async-exercises/solutions.md:154 msgid "\"127.0.0.1:2000\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:86 src/concurrency/async-exercises/solutions.md:155 +#: src/concurrency/async-exercises/chat-app.md:86 +#: src/concurrency/async-exercises/solutions.md:155 msgid "\"listening on port 2000\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:90 src/concurrency/async-exercises/solutions.md:159 +#: src/concurrency/async-exercises/chat-app.md:90 +#: src/concurrency/async-exercises/solutions.md:159 msgid "\"New connection from {addr:?}\"" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:93 src/concurrency/async-exercises/solutions.md:162 +#: src/concurrency/async-exercises/chat-app.md:93 +#: src/concurrency/async-exercises/solutions.md:162 msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:102 src/concurrency/async-exercises/solutions.md:171 +#: src/concurrency/async-exercises/chat-app.md:102 +#: src/concurrency/async-exercises/solutions.md:171 msgid "_src/bin/client.rs_:" msgstr "" -#: src/concurrency/async-exercises/chat-app.md:116 src/concurrency/async-exercises/solutions.md:183 +#: src/concurrency/async-exercises/chat-app.md:116 +#: src/concurrency/async-exercises/solutions.md:183 msgid "\"ws://127.0.0.1:2000\"" msgstr "" @@ -18544,8 +20009,9 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:146 msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous loop. One task receives messages from the client " -"and broadcasts them. The other sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a " +"continuous loop. One task receives messages from the client and broadcasts " +"them. The other sends messages received by the server to the client." msgstr "" #: src/concurrency/async-exercises/chat-app.md:149 @@ -18554,12 +20020,16 @@ msgstr "" #: src/concurrency/async-exercises/chat-app.md:150 msgid "" -"Hint: As before, use `tokio::select!` in a continuous loop for concurrently performing two tasks: (1) reading user messages from " -"standard input and sending them to the server, and (2) receiving messages from the server, and displaying them for the user." +"Hint: As before, use `tokio::select!` in a continuous loop for concurrently " +"performing two tasks: (1) reading user messages from standard input and " +"sending them to the server, and (2) receiving messages from the server, and " +"displaying them for the user." msgstr "" #: src/concurrency/async-exercises/chat-app.md:154 -msgid "Optional: Once you are done, change the code to broadcast messages to all clients, but the sender of the message." +msgid "" +"Optional: Once you are done, change the code to broadcast messages to all " +"clients, but the sender of the message." msgstr "" #: src/concurrency/async-exercises/solutions.md:35 @@ -18610,20 +20080,24 @@ msgid "\"From server: {}\"" msgstr "" #: src/thanks.md -msgid "_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it was useful." +msgid "" +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " +"it was useful." msgstr "" #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not perfect, so if you spotted any mistakes or have ideas for " -"improvements, please get in [contact with us on GitHub](https://github.com/google/comprehensive-rust/discussions). We would love to " -"hear from you." +"We've had a lot of fun putting the course together. The course is not " +"perfect, so if you spotted any mistakes or have ideas for improvements, " +"please get in [contact with us on GitHub](https://github.com/google/" +"comprehensive-rust/discussions). We would love to hear from you." msgstr "" #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many Rust terms. For translations, this also serves to connect " -"the term back to the English original." +"The following is a glossary which aims to give a short definition of many " +"Rust terms. For translations, this also serves to connect the term back to " +"the English original." msgstr "" #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. @@ -18642,7 +20116,8 @@ msgstr "" #: src/glossary.md msgid "" "Bare-metal Rust: \n" -"Low-level Rust development, often deployed to a system without an operating system. See [Bare-metal Rust](bare-metal.md)." +"Low-level Rust development, often deployed to a system without an operating " +"system. See [Bare-metal Rust](bare-metal.md)." msgstr "" #: src/glossary.md @@ -18672,7 +20147,8 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable program." +"The process of converting source code into executable code or a usable " +"program." msgstr "" #: src/glossary.md @@ -18714,7 +20190,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in a program." +"The order in which the individual statements or instructions are executed in " +"a program." msgstr "" #: src/glossary.md @@ -18726,7 +20203,8 @@ msgstr "" #: src/glossary.md msgid "" "enumeration: \n" -"A data type that holds one of several named constants, possibly with an associated tuple or struct." +"A data type that holds one of several named constants, possibly with an " +"associated tuple or struct." msgstr "" #: src/glossary.md @@ -18738,7 +20216,8 @@ msgstr "" #: src/glossary.md msgid "" "error handling: \n" -"The process of managing and responding to errors that occur during program execution." +"The process of managing and responding to errors that occur during program " +"execution." msgstr "" #: src/glossary.md @@ -18756,13 +20235,15 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are " +"no longer in use." msgstr "" #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling code reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling " +"code reuse with different data types." msgstr "" #: src/glossary.md @@ -18774,13 +20255,15 @@ msgstr "" #: src/glossary.md msgid "" "integration test: \n" -"A type of test that verifies the interactions between different parts or components of a system." +"A type of test that verifies the interactions between different parts or " +"components of a system." msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and cannot be used as an identifier." +"A reserved word in a programming language that has a specific meaning and " +"cannot be used as an identifier." msgstr "" #: src/glossary.md @@ -18792,8 +20275,9 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when normal functions are not enough. A typical example is " -"`format!`, which takes a variable number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when " +"normal functions are not enough. A typical example is `format!`, which takes " +"a variable number of arguments, which isn't supported by Rust functions." msgstr "" #: src/glossary.md @@ -18805,13 +20289,15 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the value of an expression." +"A control flow construct in Rust that allows for pattern matching on the " +"value of an expression." msgstr "" #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer needed, leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer " +"needed, leading to a gradual increase in memory usage." msgstr "" #: src/glossary.md @@ -18823,7 +20309,8 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, to organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, " +"to organize code in Rust." msgstr "" #: src/glossary.md @@ -18835,19 +20322,22 @@ msgstr "" #: src/glossary.md msgid "" "mutable: \n" -"A property in Rust that allows variables to be modified after they have been declared." +"A property in Rust that allows variables to be modified after they have been " +"declared." msgstr "" #: src/glossary.md msgid "" "ownership: \n" -"The concept in Rust that defines which part of the code is responsible for managing the memory associated with a value." +"The concept in Rust that defines which part of the code is responsible for " +"managing the memory associated with a value." msgstr "" #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of the program." +"An unrecoverable error condition in Rust that results in the termination of " +"the program." msgstr "" #: src/glossary.md @@ -18859,7 +20349,8 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against an expression in Rust." +"A combination of values, literals, or structures that can be matched against " +"an expression in Rust." msgstr "" #: src/glossary.md @@ -18871,7 +20362,8 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task or solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task " +"or solve a particular problem." msgstr "" #: src/glossary.md @@ -18883,14 +20375,15 @@ msgstr "" #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which the method is called." +"The first parameter in a Rust method that represents the instance on which " +"the method is called." msgstr "" #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object is tracked, and the object is deallocated when the " -"count reaches zero." +"A memory management technique in which the number of references to an object " +"is tracked, and the object is deallocated when the count reaches zero." msgstr "" #: src/glossary.md @@ -18902,7 +20395,8 @@ msgstr "" #: src/glossary.md msgid "" "Rust: \n" -"A systems programming language that focuses on safety, performance, and concurrency." +"A systems programming language that focuses on safety, performance, and " +"concurrency." msgstr "" #: src/glossary.md @@ -18926,7 +20420,8 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, preventing memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, " +"preventing memory-related errors." msgstr "" #: src/glossary.md @@ -18944,25 +20439,29 @@ msgstr "" #: src/glossary.md msgid "" "static: \n" -"A keyword in Rust used to define static variables or items with a `'static` lifetime." +"A keyword in Rust used to define static variables or items with a `'static` " +"lifetime." msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different types under a single name." +"A composite data type in Rust that groups together variables of different " +"types under a single name." msgstr "" #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other functions." +"A Rust module containing functions that test the correctness of other " +"functions." msgstr "" #: src/glossary.md @@ -18974,44 +20473,50 @@ msgstr "" #: src/glossary.md msgid "" "thread safety: \n" -"The property of a program that ensures correct behavior in a multithreaded environment." +"The property of a program that ensures correct behavior in a multithreaded " +"environment." msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to achieve polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to " +"achieve polymorphism in Rust." msgstr "" #: src/glossary.md msgid "" "trait bound: \n" -"An abstraction where you can require types to implement some traits of your interest." +"An abstraction where you can require types to implement some traits of your " +"interest." msgstr "" #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple fields have no names, and are accessed by their ordinal " -"numbers." +"A composite data type that contains variables of different types. Tuple " +"fields have no names, and are accessed by their ordinal numbers." msgstr "" #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values of a particular kind in Rust." +"A classification that specifies which operations can be performed on values " +"of a particular kind in Rust." msgstr "" #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or expression." +"The ability of the Rust compiler to deduce the type of a variable or " +"expression." msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading to unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading " +"to unpredictable program behavior." msgstr "" #: src/glossary.md @@ -19023,8 +20528,8 @@ msgstr "" #: src/glossary.md msgid "" "unit test: \n" -"Rust comes with built-in support for running small unit tests and larger integration tests. See [Unit Tests](testing/unit-tests." -"html)." +"Rust comes with built-in support for running small unit tests and larger " +"integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" #: src/glossary.md @@ -19036,7 +20541,8 @@ msgstr "" #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See " +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" #: src/glossary.md @@ -19050,7 +20556,9 @@ msgid "Other Rust Resources" msgstr "" #: src/other-resources.md -msgid "The Rust community has created a wealth of high-quality and free resources online." +msgid "" +"The Rust community has created a wealth of high-quality and free resources " +"online." msgstr "" #: src/other-resources.md @@ -19063,23 +20571,29 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical free book about Rust. Covers the language in detail " -"and includes a few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " +"canonical free book about Rust. Covers the language in detail and includes a " +"few projects for people to build." msgstr "" #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust syntax via a series of examples which showcase " -"different constructs. Sometimes includes small exercises where you are asked to expand on the code in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " +"Rust syntax via a series of examples which showcase different constructs. " +"Sometimes includes small exercises where you are asked to expand on the code " +"in the examples." msgstr "" #: src/other-resources.md -msgid "[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of the standard library for Rust." +msgid "" +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " +"of the standard library for Rust." msgstr "" #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " +"book which describes the Rust grammar and memory model." msgstr "" #: src/other-resources.md @@ -19088,20 +20602,23 @@ msgstr "" #: src/other-resources.md msgid "" -"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, including working with raw pointers and interfacing with " -"other languages (FFI)." +"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " +"including working with raw pointers and interfacing with other languages " +"(FFI)." msgstr "" #: src/other-resources.md msgid "" -"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): covers the new asynchronous programming model which was " -"introduced after the Rust Book was written." +"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " +"covers the new asynchronous programming model which was introduced after the " +"Rust Book was written." msgstr "" #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an introduction to using Rust on embedded devices without " -"an operating system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"an introduction to using Rust on embedded devices without an operating " +"system." msgstr "" #: src/other-resources.md @@ -19113,65 +20630,81 @@ msgid "A small selection of other guides and tutorial for Rust:" msgstr "" #: src/other-resources.md -msgid "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from the perspective of low-level C programmers." +msgid "" +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " +"from the perspective of low-level C programmers." msgstr "" #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): covers Rust from the perspective of " -"developers who write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers the syntax of Rust using side-by-side comparisons " -"with other languages such as C, C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): " +"covers the syntax of Rust using side-by-side comparisons with other " +"languages such as C, C++, Java, JavaScript, and Python." msgstr "" #: src/other-resources.md -msgid "[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you learn Rust." +msgid "" +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " +"you learn Rust." msgstr "" #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): a series of small presentations " -"covering both basic and advanced part of the Rust language. Other topics such as WebAssembly, and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): a series of small presentations covering both basic " +"and advanced part of the Rust language. Other topics such as WebAssembly, " +"and async/await are also covered." msgstr "" #: src/other-resources.md msgid "" -"[Advanced testing for Rust applications](https://github.com/mainmatter/rust-advanced-testing-workshop): a self-paced workshop that " -"goes beyond Rust's built-in testing framework. It covers `googletest`, snapshot testing, mocking as well as how to write your own " -"custom test harness." +"[Advanced testing for Rust applications](https://github.com/mainmatter/rust-" +"advanced-testing-workshop): a self-paced workshop that goes beyond Rust's " +"built-in testing framework. It covers `googletest`, snapshot testing, " +"mocking as well as how to write your own custom test harness." msgstr "" #: src/other-resources.md msgid "" -"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) and [Take your first steps with Rust]" -"(https://docs.microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. The first is a set of 35 " -"videos and the second is a set of 11 modules which covers Rust syntax and basic constructs." +"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" +"series-to-rust/) and [Take your first steps with Rust](https://docs." +"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " +"new developers. The first is a set of 35 videos and the second is a set of " +"11 modules which covers Rust syntax and basic constructs." msgstr "" #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github.io/too-many-lists/): in-depth exploration of Rust's " -"memory management rules, through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." +"github.io/too-many-lists/): in-depth exploration of Rust's memory management " +"rules, through implementing a few different types of list structures." msgstr "" #: src/other-resources.md -msgid "Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for even more Rust books." +msgid "" +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " +"for even more Rust books." msgstr "" #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust documentation. See the page on [other resources](other-resources." -"md) for a full list of useful resources." +"The material here builds on top of the many great sources of Rust " +"documentation. See the page on [other resources](other-resources.md) for a " +"full list of useful resources." msgstr "" #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 license, please see [`LICENSE`](https://github.com/" -"google/comprehensive-rust/blob/main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache " +"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" +"rust/blob/main/LICENSE) for details." msgstr "" #: src/credits.md @@ -19180,8 +20713,10 @@ msgstr "" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by Example](https://doc.rust-lang.org/rust-by-example/). Please " -"see the `third_party/rust-by-example/` directory for details, including the license terms." +"Some examples and exercises have been copied and adapted from [Rust by " +"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " +"`third_party/rust-by-example/` directory for details, including the license " +"terms." msgstr "" #: src/credits.md @@ -19190,8 +20725,9 @@ msgstr "" #: src/credits.md msgid "" -"Some exercises have been copied and adapted from [Rust on Exercism](https://exercism.org/tracks/rust). Please see the `third_party/" -"rust-on-exercism/` directory for details, including the license terms." +"Some exercises have been copied and adapted from [Rust on Exercism](https://" +"exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " +"directory for details, including the license terms." msgstr "" #: src/credits.md @@ -19200,8 +20736,9 @@ msgstr "" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section uses an image from [CXX](https://cxx.rs/). Please see the " -"`third_party/cxx/` directory for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section " +"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " +"directory for details, including the license terms." msgstr "" #~ msgid "1 hour and 20 minutes" @@ -19237,7 +20774,9 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" -#~ msgstr "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات بیشتری کسب کنید." +#~ msgstr "" +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -19250,8 +20789,12 @@ msgstr "" #~ msgid "Blocks are delimited by curly braces." #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." -#~ msgid "Line comments are started with `//`, block comments are delimited by `/* ... */`." -#~ msgstr "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص می‌شوند." +#~ msgid "" +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." +#~ msgstr "" +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " +#~ "مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -19259,20 +20802,28 @@ msgstr "" #~ msgid "Variable assignment is done with `=`, comparison is done with `==`." #~ msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." -#~ msgid "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgid "" +#~ "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "" +#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" -#~ msgstr "[20, 30, 40], [0; 3]" +#~ msgstr "" +#~ "[20, 30, 40], [0; " +#~ "3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." -#~ msgstr "(), (T,), (T1, T2), …" +#~ msgstr "" +#~ "(), (T,), " +#~ "(T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." -#~ msgstr "(), ('x',), ('x', 1.2), …" +#~ msgstr "" +#~ "(), ('x',), " +#~ "('x', 1.2), …" #~ msgid "Array assignment and access:" #~ msgstr "انتساب و دسترسی به آرایه:" @@ -19288,21 +20839,31 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, and the only valid value of that type --- that is to " -#~ "say both the type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی " -#~ "هم نوع و هم مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک تابع یا عبارت هیچ مقدار " -#~ "برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " +#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " +#~ "که در اسلاید بعدی خواهیم دید. " #, fuzzy -#~ msgid "You can think of it as `void` that can be familiar to you from other programming languages." -#~ msgstr "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های برنامه‌نویسی برایتان آشنا باشد." +#~ msgid "" +#~ "You can think of it as `void` that can be familiar to you from other " +#~ "programming languages." +#~ msgstr "" +#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " +#~ "برنامه‌نویسی برایتان آشنا باشد." #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" -#~ msgstr "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." +#~ msgstr "" +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " +#~ "کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -19311,22 +20872,31 @@ msgstr "" #~ msgid "Add more values to the array." #~ msgstr "مقادیر بیشتری را به آرایه اضافه کنید." -#~ msgid "Point out that how `..` will expand to account for different number of elements." -#~ msgstr "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." +#~ msgid "" +#~ "Point out that how `..` will expand to account for different number of " +#~ "elements." +#~ msgstr "" +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +#~ "یافت." -#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" -#~ msgstr "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و `[a@..,b]` را نشان دهید." +#~ msgid "" +#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgstr "" +#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " +#~ "`[a@..,b]` را نشان دهید." #~ msgid "Hard-code both functions to operate on 3 × 3 matrices." #~ msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-scoped values that cannot be moved or reallocated during " -#~ "the execution of the program." +#~ "Static and constant variables are two different ways to create globally-" +#~ "scoped values that cannot be moved or reallocated during the execution of " +#~ "the program." #~ msgstr "" -#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال (قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول " -#~ "اجرای برنامه منتقل یا دوباره تعریف شوند." +#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " +#~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " +#~ "دوباره تعریف شوند." #~ msgid "Properties table:" #~ msgstr "جدول خاصیت‌ها:" @@ -19357,13 +20927,17 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" -#~ msgstr "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات بیشتری کسب کنید." +#~ msgstr "" +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." -#~ msgstr "&str یک مرجع غیرقابل تغییر به یک برش از رشته‌ است." +#~ msgstr "" +#~ "&str یک مرجع غیرقابل " +#~ "تغییر به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -19591,10 +21165,13 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "" +#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." -#~ msgid "Day 2: Memory management, ownership, compound data types, and the standard library." +#~ msgid "" +#~ "Day 2: Memory management, ownership, compound data types, and the " +#~ "standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -19626,22 +21203,31 @@ msgstr "" #~ "}\n" #~ "```" -#~ msgid "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and `continue`." -#~ msgstr "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و `continue`. " +#~ msgid "" +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " +#~ "and `continue`." +#~ msgstr "" +#~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " +#~ "`continue`. " #~ msgid "" -#~ "The idea for the first day is to show _just enough_ of Rust to be able to speak about the famous borrow checker. The way Rust " -#~ "handles memory is a major feature and we should show students this right away." +#~ "The idea for the first day is to show _just enough_ of Rust to be able to " +#~ "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 یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." +#~ "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا " +#~ "بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه " +#~ "مدیریت حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به " +#~ "دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over the schedule. We suggest splitting the day into two parts " -#~ "(following the slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over " +#~ "the schedule. We suggest splitting the day into two parts (following the " +#~ "slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت " -#~ "تقسیم کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -19649,10 +21235,12 @@ msgstr "" #~ msgid "Afternoon: 13:00 to 16:00." #~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" -#~ msgid "You can of course adjust this as necessary. Please make sure to include breaks, we recommend a break every hour!" +#~ msgid "" +#~ "You can of course adjust this as necessary. Please make sure to include " +#~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت " -#~ "داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -19691,41 +21279,56 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop will always end, but this is not yet proved. Edit the " -#~ "code and play with different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این است که حلقه همیشه تمام می شود، اما این هنوز ثابت " -#~ "نشده است. کد را ویرایش کنید و با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to trigger type inference. Try with `i8` instead and trigger " -#~ "a runtime integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و " -#~ "سرریز (`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." -#~ msgid "Show how `print!` gives a compilation error if the arguments don't match the format string." +#~ msgid "" +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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." +#~ "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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::fmt` which has the rules of the formatting mini-" -#~ "language. It's important that the students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو " -#~ "کنند. مهم است که دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " +#~ "`std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." -#~ 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` را توی مرورگر باز کند." +#~ 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` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -19737,12 +21340,15 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" -#~ msgid "Despite just 29 lines of code, this C example contains serious bugs in at least 11:" +#~ msgid "" +#~ "Despite just 29 lines of code, this C example contains serious bugs in at " +#~ "least 11:" #~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " #~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" @@ -19760,7 +21366,9 @@ msgstr "" #~ msgid "Forgotten `break` in a `switch` statement (line 32)" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" -#~ msgid "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow (line 29)" +#~ msgid "" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -19777,36 +21385,46 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning level, even in the latest GCC version (13.2 as of " -#~ "writing)." +#~ "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 (۱۳.۲ این " -#~ "کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش " +#~ "فرض کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security vulnerabilities in the past. Some examples:" +#~ "Absolutely not, these kind of bugs have lead to serious security " +#~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" #~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor 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-" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " +#~ "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)" -#~ 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)" +#~ 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)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-" -#~ "security-hole-the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke " +#~ "sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-" +#~ "hole-the-break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -19827,86 +21445,128 @@ msgstr "" #~ msgid "All `if` clauses require braces." #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." -#~ msgid "`match` (as the Rust equivalent to `switch`) does not fall-through, hence you can't accidentally forget a `break`." +#~ 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 را فراموش کنید." +#~ "دستور`match` (به عنوان معادل Rust برای `switch`) فرو نمی‌پاشد (منظور fall-" +#~ "through پذیر بودن ان است) ، بنابراین نمی‌توانید به طور تصادفی یک break را " +#~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." -#~ msgid "Heap-allocated memory is freed via the `Drop` trait when the corresponding `Box` leaves the scope." -#~ msgstr "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ msgid "" +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." +#~ msgstr "" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" -#~ msgid "Out-of-bounds accesses cause a panic or can be checked via the `get` method of a slice." -#~ msgstr "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get یک برش (`slice`) بررسی کرد." +#~ msgid "" +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." +#~ msgstr "" +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند " +#~ "و در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی " +#~ "تابعی که با `#[must_use]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "" +#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak) to leak a pointer. A use of this could " -#~ "be to get runtime-initialized and runtime-sized static variables" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." +#~ "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) برای نشت دادن " -#~ "یک اشاره‌گر استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی اولیه و اندازه در زمان اجرا " -#~ "باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/" +#~ "boxed/struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.html) to make the compiler \"forget\" about a value " -#~ "(meaning the destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" +#~ "std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را " +#~ "فراموش کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-lang.org/book/ch15-06-reference-cycles.html) with `Rc` or " -#~ "`Arc`." +#~ "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` ایجاد کنید." -#~ msgid "In fact, some will consider infinitely populating a collection a memory leak and Rust does not protect from those." -#~ msgstr "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ msgid "" +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." +#~ msgstr "" +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." -#~ msgid "For the purpose of this course, \"No memory leaks\" should be understood as \"Pretty much no _accidental_ memory leaks\"." -#~ msgstr "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» درنظر گرفته شود." +#~ msgid "" +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ msgstr "" +#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " +#~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang.org/rustc/codegen-options/index.html#overflow-" -#~ "checks) compile-time flag. If enabled, the program will panic (a controlled crash of the program), otherwise you get wrap-around " -#~ "semantics. By default, you get panics in debug mode (`cargo build`) and wrap-around in release mode (`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be disabled directly with the `unsafe` keyword. However, " -#~ "`unsafe` allows you to call functions such as `slice::get_unchecked` which does not do bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این " -#~ "حال، `unsafe` به شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده است." +#~ msgstr "" +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -19915,71 +21575,97 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for higher-level programming constructs with memory or " -#~ "CPU. For example, writing a loop using `for` should result in roughly the same low level instructions as using the `.iter()." -#~ "fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " +#~ "شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +#~ "«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for " +#~ "باید تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار " +#~ "`iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also known as 'sum types', which allow the type system to " -#~ "express things like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also 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` را بیان کند." #~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to ignore lengthy compiler output. The Rust compiler is " -#~ "significantly more talkative than other compilers. It will often provide you with _actionable_ feedback, ready to copy-paste into " -#~ "your code." +#~ "Remind people to read the errors --- many developers have gotten used to " +#~ "ignore lengthy compiler output. The Rust compiler is significantly more " +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. " -#~ "کامپایلر Rust به طور قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار شما قرار می‌دهد که آماده " -#~ "کپی و پیست کردن در کد شما هستند." +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, Python, and Go. Rust does not come with several things you " -#~ "might consider standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک است. زبان Rust با چندین چیز که ممکن است آنها را " -#~ "استاندارد و ضروری در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." -#~ msgstr "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/rand/) را ببینید." +#~ msgstr "" +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." -#~ msgstr "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`](https://docs.rs/rustls/) را ببینید." +#~ msgstr "" +#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" +#~ "(https://docs.rs/rustls/) را ببینید." #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." -#~ msgstr "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/serde_json/) را ببینید." +#~ msgstr "" +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library cannot go away, so it has to be very stable. For the " -#~ "examples above, the Rust community is still working on finding the best solution --- and perhaps there isn't a single \"best " -#~ "solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this makes it trivial to download and compile third-party " -#~ "crates. A consequence of this is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار " -#~ "آسان می کند. یکی از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و " +#~ "این امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health " -#~ "metrics for crates to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." #~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای " -#~ "سلامت برای crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -19989,76 +21675,131 @@ msgstr "" #~ msgid "Like C++, Rust has references:" #~ msgstr "مانند C++، راست دارای مراجع است:" -#~ msgid "We must dereference `ref_x` when assigning to it, similar to C and C++ pointers." -#~ msgstr "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای C و C++." +#~ msgid "" +#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " +#~ "pointers." +#~ msgstr "" +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." -#~ msgid "References that are declared as `mut` can be bound to different values over their lifetime." -#~ msgstr "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر مختلفی ارجاع داده شوند." +#~ msgid "" +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." +#~ msgstr "" +#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +#~ "مختلفی ارجاع داده شوند." #~ msgid "A reference is said to \"borrow\" the value it refers to." #~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." -#~ msgid "Rust is tracking the lifetimes of all references to ensure they live long enough." -#~ msgstr "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را رهگیری می‌کند." +#~ msgid "" +#~ "Rust is tracking the lifetimes of all references to ensure they live long " +#~ "enough." +#~ msgstr "" +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " -#~ msgid "You can borrow `&str` slices from `String` via `&` and optionally range selection." -#~ msgstr "شما می‌توانید برش‌های &str را از `String` از طریق `&` و انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ msgid "" +#~ "You can borrow `&str` slices from `String` via `&` and optionally range " +#~ "selection." +#~ msgstr "" +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." -#~ 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):" +#~ 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):" -#~ msgid "We refer in `main` to a function written below. Neither forward declarations nor headers are necessary. " +#~ msgid "" +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " -#~ msgid "The range expression in the `for` loop in `print_fizzbuzz_to()` contains `=n`, which causes it to include the upper bound." +#~ 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` است که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "عبارت تعیین محدوده در حلقه `for` در `print_fizzbuzz_to()` حاوی `=n` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "" +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." -#~ msgid "This course does not include rustdoc on slides, just to save space, but in real code they should be present." -#~ msgstr "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما در کدهای دنیای واقعی باید وجود داشته باشد." +#~ msgid "" +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." +#~ msgstr "" +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." -#~ msgid "Inner doc comments are discussed later (in the page on modules) and need not be addressed here." -#~ msgstr "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." +#~ msgid "" +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." +#~ msgstr "" +#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " +#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using `cargo test`. We will discuss these tests in the " -#~ "[Testing section](../testing/doc-tests.html)." +#~ "Rustdoc comments can contain code snippets that we can run and test using " +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." #~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با استفاده از `cargo test` اجرا و تست " -#~ "کنیم. ما در [بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." #~ 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` یک متد، نمونه‌ای از نوعی است که با آن مرتبط است:" +#~ "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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" -#~ msgid "We will look much more at methods in today's exercise and in tomorrow's class." +#~ msgid "" +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" -#~ msgstr "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را از `main` فراخوانی کنید:" +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgstr "" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static methods are commonly used to initialize structs (but don't " -#~ "have to). The actual constructor, `Rectangle { width, height }`, could be called directly. See the [Rustnomicon](https://doc.rust-" -#~ "lang.org/nomicon/constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." -#~ msgid "Add a `Rectangle::square(width: u32)` constructor to illustrate that such static methods can take arbitrary parameters." +#~ msgid "" +#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " +#~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، با ارگمان‌های یک سازنده `Rectangle::" -#~ "square(width: u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -20082,11 +21823,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind of limited polymorphism on argument types. We will see " -#~ "more details in a later section." +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع " -#~ "آرگومان‌ها فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -20104,71 +21847,99 @@ msgstr "" #~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" #~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-completion in your editor. See the page about [Using Cargo]" -#~ "(../../cargo.md) for details on installing Rust." +#~ "Use a local Rust installation, if possible. This way you can get auto-" +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات " -#~ "بیشتر در مورد نصب راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." -#~ msgid "The code snippets are not editable on purpose: the inline code snippets lose their state if you navigate away from the page." +#~ msgid "" +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات " -#~ "شما درنظر گرفته نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." #~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types ([unlike C++](https://en.cppreference.com/w/cpp/language/" +#~ "Rust will not automatically apply _implicit conversions_ between types " +#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/" -#~ "w/cpp/language/implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]" -#~ "(https://doc.rust-lang.org/std/convert/trait.Into.html) traits to let us convert between them. The `From` trait has a single " -#~ "`from()` method and similarly, the `Into` trait has a single `into()` method. Implementing these traits is how a type " -#~ "expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "همه انواع عدد صحیح راست، تریت‌های (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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which means that we can convert a variable `x` of type `i8` to " -#~ "an `i16` by calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From for i16` implementation automatically create " -#~ "an implementation of `Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد `i16` دارد، به این معنی که " -#~ "می‌توانیم یک متغیر `x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل " -#~ "کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, so it is sufficient to only implement `From` to get a " -#~ "respective `Into` implementation automatically." +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "implementation automatically." #~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه را دریافت کنید." +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " +#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." -#~ msgstr "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای انجام تبدیل استفاده شود." +#~ msgstr "" +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." #~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, `i128`) to see which types you can convert to which other " -#~ "types. Try converting small types to big types and the other way around. Check the [standard library documentation](https://doc." -#~ "rust-lang.org/std/convert/trait.From.html) to see if `From` is implemented for the pairs you check." +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " +#~ "`i128`) to see which types you can convert to which other types. Try " +#~ "converting small types to big types and the other way around. Check the " +#~ "[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` برای تبدیل انواع‌ایی که بررسی می‌کنید " -#~ "پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) " +#~ "تغییر دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل " +#~ "کنید. سعی کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات " +#~ "کتابخانه استاندارد](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را بررسی کنید تا ببینید آیا `From` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -20176,282 +21947,426 @@ msgstr "" #~ msgid "We saw that an array can be declared like this:" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " -#~ msgid "You can print such an array by asking for its debug representation with `{:?}`:" -#~ msgstr "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" +#~ msgid "" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" +#~ msgstr "" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" -#~ msgid "Rust lets you iterate over things like arrays and ranges using the `for` keyword:" -#~ msgstr "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" +#~ msgid "" +#~ "Rust lets you iterate over things like arrays and ranges using the `for` " +#~ "keyword:" +#~ msgstr "" +#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " +#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" #~ msgid "Bonus Question" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your argument and return types? Something like `&[&[i32]]` " -#~ "for a two-dimensional slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" #~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود " -#~ "استفاده کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" -#~ msgid "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality implementation." -#~ msgstr "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ msgid "" +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." +#~ msgstr "" +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "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) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت " -#~ "است در قسمت عصر که بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for " +#~ "n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." #~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change [introduced in the 2021 Edition](https://doc.rust-lang." -#~ "org/edition-guide/rust-2021/IntoIterator-for-arrays.html)." +#~ "The loop would have been one that consumes the array. This is a change " +#~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال " +#~ "۲۰۲۱ معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/" +#~ "IntoIterator-for-arrays.html)" -#~ 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]` نیز یک نوع کپی است." +#~ 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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally evaluate one of two blocks, but the blocks can have a " -#~ "value which then becomes the value of the `if` expression. Other control flow expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه " -#~ "داشته باشید که در راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته باشند. بقیه عبارات کنترل " -#~ "جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." -#~ msgid "The same rule is used for functions: the value of the function body is the return value:" -#~ msgstr "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار برگشتی است: " +#~ msgid "" +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" +#~ msgstr "" +#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " +#~ "برگشتی است: " -#~ msgid "The point of this slide is to show that blocks have a type and value in Rust. " -#~ msgstr "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " +#~ msgid "" +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " +#~ msgstr "" +#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +#~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely related to the [`while let` loop](while-let-" -#~ "expressions.md). It will automatically call `into_iter()` on the expression and then iterate over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام " -#~ "می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور " +#~ "نزدیکی به حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. " +#~ "حلقه `for` به طور خودکار `into_iter()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." +#~ msgstr "" +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " -#~ msgstr "(0..10) یک محدوده است که ویژگی `Iterator` را پیاده‌سازی می‌کند." +#~ msgstr "" +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." -#~ msgid "`step_by` is a method that returns another `Iterator` that skips every other element. " -#~ msgstr "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه عناصر را برمی‌گرداند." +#~ msgid "" +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " +#~ msgstr "" +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." #~ 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()`." +#~ "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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را " +#~ "قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v.iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" #~ msgid "" -#~ "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr.html#infinite-loops) which creates " -#~ "an endless loop." +#~ "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) وجود دارد که یک حلقه " -#~ "بی‌پایان ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/" +#~ "expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" +#~ msgstr "" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." -#~ msgstr "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." +#~ msgstr "" +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." -#~ msgid "Due to type inference the `i32` is optional. We will gradually show the types less and less as the course progresses." -#~ msgstr "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و کمتر آن را نشان خواهیم داد." +#~ msgid "" +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." +#~ msgstr "" +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic container without the code ever explicitly specifying the " -#~ "contained type, using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در یک کانتینر عمومی (generic container) خاص کپی کند، " -#~ "با استفاده از _ به عنوان یک جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " #~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) relies on [`FromIterator`](https://doc." -#~ "rust-lang.org/std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.org/std/collections/struct.HashSet." -#~ "html#impl-FromIterator%3CT%3E-for-HashSet%3CT,+S%3E) implements." +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." +#~ "[`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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse memory locations when shadowing an immutable variable in a " -#~ "scope, even if the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی " -#~ "که یک متغییر غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" -#~ "This page offers an enum type `CoinFlip` with two variants `Heads` and `Tails`. You might note the namespace when using variants." +#~ "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`ها، به این اینگونه نام‌ها توجه " -#~ "کنید." +#~ "در این صفحه نوع`Enum`به اسم `CoinFlip` که دارای `Heads` و `Tails` می‌باشد. " +#~ "هنگام استفاده از `Enum`ها، به این اینگونه نام‌ها توجه کنید." #~ msgid "In both, associated functions are defined within an `impl` block." #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از " -#~ "هر فیلد استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده " +#~ "باشند. سپس می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" -#~ 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++` طبیق الگو به صورت از بالا به پایین نمی‌باشد." +#~ 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++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." -#~ msgid "The match expression has a value. The value is the last expression in the match arm which was executed." -#~ msgstr "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی `match` ای است که اجرا شده است." +#~ msgid "" +#~ "The match expression has a value. The value is the last expression in the " +#~ "match arm which was executed." +#~ msgstr "" +#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " +#~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته " +#~ "باشد، سپس کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه " +#~ "توی match اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." -#~ msgstr "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را بررسی می کند." +#~ msgstr "" +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." -#~ msgid "It is possible to retrieve the discriminant by calling `std::mem::discriminant()`" -#~ msgstr "می توان با فراخوانی `std::mem::discriminant()` فیلد تشخیصی پنهان را دریافت کرد." +#~ msgid "" +#~ "It is possible to retrieve the discriminant by calling `std::mem::" +#~ "discriminant()`" +#~ msgstr "" +#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " +#~ "تشخیصی پنهان را دریافت کرد." -#~ msgid "This is useful, for example, if implementing `PartialEq` for structs where comparing field values doesn't affect equality." -#~ msgstr "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ msgid "" +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." +#~ msgstr "" +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top level `struct Click { ... }`. The " -#~ "inlined version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." #~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct " -#~ "Click { ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را پیاده‌سازی کند." +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." -#~ msgid "Rust enums are packed tightly, taking constraints due to alignment into account:" -#~ msgstr "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های ناشی از هم ترازی:" +#~ msgid "" +#~ "Rust enums are packed tightly, taking constraints due to alignment into " +#~ "account:" +#~ msgstr "" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" -#~ msgid "Internally Rust is using a field (discriminant) to keep track of the enum variant." -#~ msgstr "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای `enum` استفاده می کند." +#~ msgid "" +#~ "Internally Rust is using a field (discriminant) to keep track of the enum " +#~ "variant." +#~ msgstr "" +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," -#~ msgid "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, see below)," +#~ msgid "" +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز " -#~ "1 بایت است (بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت " -#~ "است (روی ماشین ۶۴ بیتی)" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" -#~ msgid "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer optimization, see below)." +#~ msgid "" +#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " +#~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ " -#~ "بایت است (بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" -#~ msgid "Niche optimization: Rust will merge unused bit patterns for the enum discriminant." -#~ msgstr "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` ادغام می‌کند." +#~ msgid "" +#~ "Niche optimization: Rust will merge unused bit patterns for the enum " +#~ "discriminant." +#~ msgstr "" +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." -#~ msgid "More complex example if you want to discuss what happens when we chain more than 256 `Option`s together." +#~ msgid "" +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring assignment, or if it fails, execute a block which is required to abort normal control flow (with `panic`/`return`/" -#~ "`break`/`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-" +#~ "lang.org/rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک " +#~ "انتساب به صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا " +#~ "کند که برای خاتمه دادن به جریان کنترل عادی (با panic/return/break/" +#~ "continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-" +#~ "expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از " +#~ "این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." +#~ msgstr "" +#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." #~ msgid "Remove `.as_deref()` and explain the error." -#~ msgstr ".as_deref() را حذف کنید و خطا را توضیح دهید." +#~ msgstr "" +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." -#~ msgid "`std::env::args().next()` returns an `Option`, but we cannot match against `String`." +#~ msgid "" +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا " -#~ "نمی توانیم به عنوان `String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our case, this turns `Option` into `Option<&str>`." +#~ "`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>` " -#~ "تبدیل می‌کند." +#~ "as_deref() یک `Option` را به `Option<&T::Target>` تبدیل می‌کند. در مورد ما، این `Option` " +#~ "را به `Option<&str>` تبدیل می‌کند." -#~ msgid "We can now use pattern matching to match against the `&str` inside `Option`." -#~ msgstr "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل `Option` استفاده کنیم." +#~ msgid "" +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." +#~ msgstr "" +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "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`، به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." -#~ msgid "This might be a good time to bring up the concept of irrefutable patterns, as the term can show up in error messages." +#~ 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) باشد، زیرا این اصطلاح می تواند در پیام " -#~ "های خطا ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار " +#~ "(irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" -#~ msgid "Destructuring of slices of unknown length also works with patterns of fixed length." -#~ msgstr "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می کند." +#~ msgid "" +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." +#~ msgstr "" +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "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_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "You can use the variables defined in the pattern in your if expression." -#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -20466,29 +22381,42 @@ msgstr "" #~ msgstr "تمرینی درباره تطبیق الگو" #~ 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." +#~ "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`ها پیاده‌سازی کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " +#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " +#~ "کنید." -#~ msgid "Memory management: stack vs heap, manual memory management, scope-based memory management, and garbage collection." -#~ msgstr "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ msgid "" +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." +#~ msgstr "" +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." -#~ msgid "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` and `Arc`." -#~ msgstr "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و `Arc`." +#~ msgid "" +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." +#~ msgstr "" +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -20499,57 +22427,91 @@ msgstr "" #~ msgid "You allocate and deallocate heap memory yourself." #~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." -#~ msgid "If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory leaks." -#~ msgstr "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی و نشتی حافظه شود." +#~ msgid "" +#~ "If not done with care, this can lead to crashes, bugs, security " +#~ "vulnerabilities, and memory leaks." +#~ msgstr "" +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" +#~ msgstr "" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and `free`: the pointer is lost and we cannot deallocate the " -#~ "memory. Worse, freeing the pointer twice, or accessing a freed pointer can lead to exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را " -#~ "تخصیص‌زدایی کنیم. بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر به آسیب‌پذیری‌های " -#~ "امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "" +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object is destroyed. The compiler guarantees that this happens, " -#~ "even if an exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق " -#~ "می‌افتد، حتی اگر یک exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." -#~ msgid "This is often called _resource acquisition is initialization_ (RAII) and gives you smart pointers." -#~ msgstr "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده می‌شود و به شما اشاره گرهای هوشمند می‌دهد." +#~ msgid "" +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." +#~ msgstr "" +#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " +#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." -#~ msgid "The `std::unique_ptr` object is allocated on the stack, and points to memory allocated on the heap." +#~ msgid "" +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا می‌شود." +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "" +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "Special move constructors are used when passing ownership to a function:" -#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" -#~ msgid "An alternative to manual and scope-based memory management is automatic memory management:" -#~ msgstr "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" +#~ msgid "" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" +#~ msgstr "" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." -#~ msgid "A garbage collector finds unused memory and deallocates it for the programmer." -#~ msgstr "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس تخصیص‌زدایی (آزاد) می‌کند." +#~ msgid "" +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." +#~ msgstr "" +#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " +#~ "تخصیص‌زدایی (آزاد) می‌کند." #~ msgid "Java Example" #~ msgstr "مثالی در Java" @@ -20567,31 +22529,43 @@ msgstr "" #~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." #~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت می‌کند." +#~ msgstr "" +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." -#~ msgid "A Rust user can choose the right abstraction for the situation, some even have no cost at runtime like C." -#~ msgstr "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ msgid "" +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." +#~ msgstr "" +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." #~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually handled by RAII wrapper types such as [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), or [Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate ownership and memory " -#~ "allocation via various means, and prevent the potential errors in C." +#~ "If asked how at this point, you can mention that in Rust this is usually " +#~ "handled by RAII wrapper types such as [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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید " +#~ "به این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) " -#~ "هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی " +#~ "[Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -20602,15 +22576,18 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a way to generate code in Rust at compile time. In this case " -#~ "the default implementations of `Copy` and `Clone` traits are generated." +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای " +#~ "تولید کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض " +#~ "صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" @@ -20678,7 +22655,7 @@ msgstr "" #, fuzzy #~ msgid "trait:" -#~ msgstr "صفت‌ها" +#~ msgstr "trait:" #, fuzzy #~ msgid "union:" From db95f6485610e475491270b899b028a2cdb3f654 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 14 Aug 2024 15:02:43 +0330 Subject: [PATCH 16/92] reset ro stable po fa --- po/fa.po | 1008 ++++++++++++++++-------------------------------------- 1 file changed, 288 insertions(+), 720 deletions(-) diff --git a/po/fa.po b/po/fa.po index 319e3445dbb..59f07a13981 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" -"PO-Revision-Date: 2024-08-11 22:49+0330\n" +"PO-Revision-Date: 2024-07-24 10:12+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.4.4\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🦀" @@ -243,7 +243,7 @@ msgstr "ساختار‌ تاپل‌ها" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md:1 #: src/pattern-matching/destructuring-enums.md:1 msgid "Enums" -msgstr "Enums" +msgstr "" #: src/SUMMARY.md src/user-defined-types.md msgid "Static" @@ -264,7 +264,7 @@ msgstr "تمرین: رویدادهای آسانسور" #: src/SUMMARY.md msgid "Day 2: Morning" -msgstr "روز ۲: صبح" +msgstr "روز دوم: صبح" #: src/SUMMARY.md src/running-the-course/course-structure.md:35 #: src/welcome-day-2.md src/pattern-matching.md @@ -304,28 +304,28 @@ msgstr "متدها" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md:1 msgid "Traits" -msgstr "Traits" +msgstr "صفت‌ها" #: src/SUMMARY.md src/methods-and-traits/traits/implementing.md:1 msgid "Implementing Traits" -msgstr "پیاده سازی Traits" +msgstr "پیاده سازی صفات (Traits)" #: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md:1 msgid "Supertraits" -msgstr "Supertraits" +msgstr "" #: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md:1 msgid "Associated Types" -msgstr "تایپ‌های وابسته" +msgstr "" #: src/SUMMARY.md src/methods-and-traits.md #: src/methods-and-traits/deriving.md:1 msgid "Deriving" -msgstr "Deriving" +msgstr "" #: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" -msgstr "تمرین: توابع Generic" +msgstr "تمرین: توابع جنریک" #: src/SUMMARY.md msgid "Day 2: Afternoon" @@ -334,40 +334,42 @@ msgstr "روز دوم: عصر" #: src/SUMMARY.md src/running-the-course/course-structure.md:43 #: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" -msgstr "Generics" +msgstr "جنریک‌ها" #: src/SUMMARY.md src/generics.md src/generics/generic-functions.md:1 msgid "Generic Functions" -msgstr "توابع Generic" +msgstr "" #: src/SUMMARY.md src/generics.md src/generics/generic-data.md:1 msgid "Generic Data Types" -msgstr "دیتا تایپ‌های Generic" +msgstr "انواع داده‌ها جنریک (Generic Data Types)" #: src/SUMMARY.md src/generics/generic-traits.md:1 +#, fuzzy msgid "Generic Traits" -msgstr "Generic Traits" +msgstr "صفت‌های جنریک‌ها" #: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md:1 msgid "Trait Bounds" -msgstr "Trait Bounds" +msgstr "صفات مرزی (Trait Bounds)" #: src/SUMMARY.md src/generics/impl-trait.md:1 msgid "`impl Trait`" -msgstr "`impl Trait`" +msgstr "" #: src/SUMMARY.md src/generics/dyn-trait.md:1 +#, fuzzy msgid "`dyn Trait`" -msgstr "`dyn Trait`" +msgstr "صفات Async" #: src/SUMMARY.md src/generics/exercise.md:1 msgid "Exercise: Generic `min`" -msgstr "تمرین: Generic `min`" +msgstr "" #: src/SUMMARY.md src/running-the-course/course-structure.md:44 #: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" -msgstr "کتابخانه‌ استاندارد تایپ‌ها" +msgstr "کتابخانه‌ استاندارد انواع داده" #: src/SUMMARY.md src/std-types.md src/std-types/std.md:1 msgid "Standard Library" @@ -379,24 +381,24 @@ msgstr "مستندات" #: src/SUMMARY.md msgid "`Option`" -msgstr "`Option`" +msgstr "" #: src/SUMMARY.md src/error-handling/result.md:1 msgid "`Result`" -msgstr "`Result`" +msgstr "" #: src/SUMMARY.md src/android/aidl/types/primitives.md:14 #: src/android/interoperability/cpp/type-mapping.md:5 msgid "`String`" -msgstr "`String`" +msgstr "" #: src/SUMMARY.md src/std-types/vec.md:1 msgid "`Vec`" -msgstr "`Vec`" +msgstr "" #: src/SUMMARY.md src/std-types/hashmap.md:1 src/bare-metal/no_std.md msgid "`HashMap`" -msgstr "`HashMap`" +msgstr "" #: src/SUMMARY.md src/std-types.md src/std-types/exercise.md:1 msgid "Exercise: Counter" @@ -405,7 +407,7 @@ msgstr "تمرین: شمارنده" #: src/SUMMARY.md src/running-the-course/course-structure.md:45 #: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" -msgstr "کتابخانه استاندارد Traits" +msgstr "کتابخانه استاندارد برای تریت‌ها" #: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md:1 #: src/concurrency/welcome-async.md @@ -418,27 +420,27 @@ msgstr "اپراتورها" #: src/SUMMARY.md src/std-traits/from-and-into.md:1 msgid "`From` and `Into`" -msgstr "`From` and `Into`" +msgstr "" #: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md:1 msgid "Casting" -msgstr "Casting" +msgstr "" #: src/SUMMARY.md src/std-traits/read-and-write.md:1 msgid "`Read` and `Write`" -msgstr "`Read` and `Write`" +msgstr "" #: src/SUMMARY.md msgid "`Default`, struct update syntax" -msgstr "`Default`, struct update syntax" +msgstr "" #: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md:1 msgid "Closures" -msgstr "Closures" +msgstr "" #: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md:1 msgid "Exercise: ROT13" -msgstr "تمرین: ROT13" +msgstr "" #: src/SUMMARY.md msgid "Day 3: Morning" @@ -1213,15 +1215,15 @@ msgstr "" #: src/concurrency/send-sync/marker-traits.md:1 #, fuzzy msgid "Marker Traits" -msgstr "Marker هایTraits" +msgstr "صفت‌های بیشتر" #: src/SUMMARY.md src/concurrency/send-sync/send.md:1 msgid "`Send`" -msgstr "`Send`" +msgstr "" #: src/SUMMARY.md src/concurrency/send-sync/sync.md:1 msgid "`Sync`" -msgstr "`Sync`" +msgstr "" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/examples.md:1 @@ -1235,11 +1237,11 @@ msgstr "ناحیه‌های مشترک" #: src/SUMMARY.md src/concurrency/shared-state/arc.md:1 msgid "`Arc`" -msgstr "`Arc`" +msgstr "" #: src/SUMMARY.md src/concurrency/shared-state/mutex.md:1 msgid "`Mutex`" -msgstr "`Mutex`" +msgstr "" #: src/SUMMARY.md src/memory-management/review.md:16 #: src/error-handling/try-conversions.md:23 src/concurrency/shared-state.md @@ -1252,12 +1254,12 @@ msgstr "مثال" #: src/concurrency/sync-exercises/solutions.md:3 #: src/concurrency/async-exercises.md msgid "Dining Philosophers" -msgstr "Dining فلسفه" +msgstr "فلسفه Dining" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/link-checker.md:1 msgid "Multi-threaded Link Checker" -msgstr "بررسی‌کننده لینک چند تِردی" +msgstr "جستجوگر پیوند چند تِردی" #: src/SUMMARY.md msgid "Concurrency: Afternoon" @@ -1270,7 +1272,7 @@ msgstr "مبانی Async" #: src/SUMMARY.md src/concurrency/async/async-await.md:1 msgid "`async`/`await`" -msgstr "`async`/`await`" +msgstr "" #: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md:1 msgid "Futures" @@ -1299,7 +1301,7 @@ msgstr "کنترل جریان پیشرفته" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/channels.md:1 msgid "Async Channels" -msgstr "Async کانال‌های" +msgstr "کانال‌های Async" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/join.md:1 @@ -1314,20 +1316,20 @@ msgstr "Select" #: src/SUMMARY.md src/running-the-course/course-structure.md:164 #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" -msgstr "‏Pitfallها" +msgstr "مشکل‌ها" #: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" -msgstr "Executor مسدود کردن" +msgstr "مسدود کردن Executor" #: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md:1 msgid "`Pin`" -msgstr "`Pin`" +msgstr "" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/async-traits.md:1 msgid "Async Traits" -msgstr "Async هایTrait" +msgstr "صفات Async" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/cancellation.md:1 @@ -1338,7 +1340,7 @@ msgstr "لغو" #: src/concurrency/async-exercises/chat-app.md:1 #: src/concurrency/async-exercises/solutions.md:102 msgid "Broadcast Chat Application" -msgstr "پخش‌کننده برنامه چت" +msgstr "پخش برنامه چت" #: src/SUMMARY.md msgid "Final Words" @@ -1346,7 +1348,7 @@ msgstr "کلمات آخر" #: src/SUMMARY.md src/thanks.md msgid "Thanks!" -msgstr "!سپاس" +msgstr "سپاس!" #. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md @@ -1475,10 +1477,10 @@ msgid "" "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"‏[Concurrency](concurrency.md): ما تمام روز را به بررسی در زبان Rust " -"می‌پردازیم ما هر دو مبحث concurrency کلاسیک (زمان‌بندی پیشگیرانه با استفاده " -"از threadها و mutexeها) و ‏async / await در concurrency (چند وظیفه‌ای مشترک " -"با استفاده از futures) را پوشش می‌دهیم می دهیم." +"[Concurrency](concurrency.md): یک کلاس تمام روز درباره همزمانی در Rust. ما " +"هر همزمانی کلاسیک (برنامه ریزی پیشگیرانه با استفاده از موضوعات و mutexes) و " +"async / await concurrency (چند وظیفه ای تعاونی با استفاده از اینده) را پوشش " +"می دهیم." #: src/index.md msgid "Non-Goals" @@ -1509,8 +1511,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and C" -"++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1569,8 +1571,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker Notes" -"\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -1821,27 +1823,27 @@ msgstr "۴۵ دقیقه" #: src/welcome-day-2-afternoon.md src/concurrency/welcome.md #: src/concurrency/welcome-async.md msgid "1 hour and 10 minutes" -msgstr "‏۱ ساعت و ۱۰ دقیقه" +msgstr "۱ ساعت و ۱۰ دقیفه" #: src/running-the-course/course-structure.md:48 msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" -msgstr "روز سوم - صبح (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" +msgstr "روز ۳ صبح (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:57 msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" -msgstr "روز سوم - بعدازظهر(۱ ساعت و ۵۵ دقیقه، شامل وقت استراحت)" +msgstr "روز ۳ بعدازظهر(۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" #: src/running-the-course/course-structure.md:65 msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" -msgstr "روز چهارم - صبح (۲ ساعت و ۴۰ دقیقه، شامل وقت استراحت)" +msgstr "روز ۴ صبح (۲ ساعت و ۴۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:75 msgid "Day 4 Afternoon (2 hours and 15 minutes, including breaks)" -msgstr "روز چهارم - بعدازظهر (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" +msgstr "روز ۴ بعدازظهر (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md:80 src/welcome-day-4-afternoon.md msgid "1 hour and 5 minutes" -msgstr "‏۱ ساعت و ۵ دقیقه" +msgstr "ساعت و ۵ دقیقه" #: src/running-the-course/course-structure.md:85 msgid "Deep Dives" @@ -1956,8 +1958,8 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " -"شامل همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی " +"کلاسیک و همچنین همزمانی `async`/`await` است." #: src/running-the-course/course-structure.md:135 msgid "" @@ -2651,7 +2653,7 @@ msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرای #: src/welcome-day-4.md src/concurrency/welcome.md #: src/concurrency/welcome-async.md msgid "Schedule" -msgstr "زمان‌بند (Schedule)" +msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" @@ -3796,7 +3798,7 @@ msgid "" "panic." msgstr "" "`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " -"panic می کند. " +"panic می کند." #: src/control-flow-basics/macros.md:14 msgid "" @@ -4133,7 +4135,7 @@ msgstr "" #: src/references.md src/smart-pointers.md src/borrowing.md #: src/concurrency/async-pitfalls.md msgid "This segment should take about 55 minutes. It contains:" -msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. که شامل:" +msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن شامل:" #: src/references.md msgid "Slices: &\\[T\\]" @@ -4199,8 +4201,8 @@ msgstr "" #: src/references/shared.md:51 msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" -"++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4400,8 +4402,8 @@ msgstr "" #: src/references/strings.md:33 msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello" -"\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals " +"(`\"Hello\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4471,9 +4473,9 @@ msgstr "" #: src/references/strings.md:67 msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" -"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " -"`#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4532,7 +4534,7 @@ msgstr "" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md msgid "This segment should take about 50 minutes. It contains:" -msgstr "این بخش حدود ۵۰ دقیقه طول خواهد کشید. شامل موارد زیر است:" +msgstr "" #: src/user-defined-types/named-structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" @@ -4627,7 +4629,7 @@ msgstr "" #: src/concurrency/async-pitfalls/cancellation.md:99 #: src/concurrency/async-pitfalls/cancellation.md:103 msgid "// ...\n" -msgstr "// ...\n" +msgstr "" #: src/user-defined-types/tuple-structs.md:41 msgid "" @@ -4743,9 +4745,9 @@ msgstr "" #: src/user-defined-types/enums.md:45 msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche optimization" -"\"). For example, `Option<&u8>` stores either a pointer to an integer or " -"`NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md:49 @@ -5040,62 +5042,64 @@ msgstr "" #: src/welcome-day-2.md msgid "Welcome to Day 2" -msgstr "به روز ۲ خوش آمدید" +msgstr "به روز دوم خوش آمدید" #: src/welcome-day-2.md +#, fuzzy msgid "" "Now that we have seen a fair amount of Rust, today will focus on Rust's type " "system:" msgstr "" -"اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز " -"خواهیم کرد:" +"حالا که از زبان راست به اندازه کافی چیز های مختلفی دیده ایم وقت ادامه با " +"توجه به موارد زیر " #: src/welcome-day-2.md +#, fuzzy msgid "Pattern matching: extracting data from structures." -msgstr "تطبیق الگو: استخراج داده از ساختارها." +msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-2.md msgid "Methods: associating functions with types." -msgstr "متد‌ها: ارتباط توابع با تایپ ها." +msgstr "" #: src/welcome-day-2.md msgid "Traits: behaviors shared by multiple types." -msgstr "Traits: رفتارهایی که توسط چندین تایپ مشترک هستند." +msgstr "" #: src/welcome-day-2.md msgid "Generics: parameterizing types on other types." -msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." +msgstr "" #: src/welcome-day-2.md msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" -"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " -"این شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md msgid "This segment should take about 1 hour. It contains:" -msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شامل:" +msgstr "" #: src/pattern-matching/match.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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " -"دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." +"کلمه کلیدی `match` به شما امکان می دهد یک مقدار را در برابر _یک یا چند الگو_ " +"مطابقت دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطبیق انتخاب " +"می‌شود." #: src/pattern-matching/match.md:6 msgid "The patterns can be simple values, similarly to `switch` in C and C++:" -msgstr "الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و ++C:" +msgstr "" +"الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و C++:" #: src/pattern-matching/match.md:11 msgid "'x'" @@ -5164,33 +5168,27 @@ msgid "" "expressions _must_ be exhaustive, meaning that it covers every possibility, " "so `_` is often used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " -"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " -"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md:26 +#, fuzzy msgid "" "Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " -"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " -"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." +"مثل دستور `if let`، باید همه شاخه تطبیق باید از نوع یکسانی را داشته باشند. " +"نوع عبارت در آخر بلوک تعیین می‌شود، البته اگر وجود داشته باشد. در مثال بالا، " +"نوع `()` است." #: src/pattern-matching/match.md:30 msgid "" "A variable in the pattern (`key` in this example) will create a binding that " "can be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " -"بخش مطابقت استفاده کرد." #: src/pattern-matching/match.md:33 msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " -"باشد که شرط برقرار باشد." #: src/pattern-matching/match.md:40 msgid "" @@ -5210,11 +5208,12 @@ msgstr "`..` برای تعیین همه محدوده یا تا جایی که م #: src/pattern-matching/match.md:44 msgid "`1..=5` represents an inclusive range" msgstr "" -"1..=5 نمایانگر یک محدوده خاص است" +"1..=5 نمایانگر یک محدوده خاص " +"است." #: src/pattern-matching/match.md:45 msgid "`_` is a wild card" -msgstr "`_` نمایانگر هر حالتی است" +msgstr "`_` یک wildcard (هر حالتی) است." #: src/pattern-matching/match.md:47 msgid "" @@ -5222,7 +5221,7 @@ msgid "" "we wish to concisely express more complex ideas than patterns alone would " "allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"گارد های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " "و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md:49 @@ -5234,7 +5233,7 @@ msgid "" msgstr "" "آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " "عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " -"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " "عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md:53 @@ -5249,7 +5248,7 @@ msgstr "ساختارها" #: src/pattern-matching/destructuring-structs.md:3 msgid "Like tuples, Struct can also be destructured by matching:" -msgstr "مانند tuple ها، ساختار را نیز می توان با تطبیق تخریب کرد:" +msgstr "" #: src/pattern-matching/destructuring-structs.md:15 msgid "\"x.0 = 1, b = {b}, y = {y}\"" @@ -5277,13 +5276,13 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md:3 msgid "Like tuples, enums can also be destructured by matching:" -msgstr "مانند tuple ها، enum ها را نیز می توان با تطبیق تخریب کرد:" +msgstr "" #: src/pattern-matching/destructuring-enums.md:5 msgid "" @@ -5291,9 +5290,9 @@ msgid "" "how you inspect the structure of your types. Let us start with a simple " "`enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " -"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " -"بیایید با یک نوع ساده `enum` شروع کنیم:" +"الگوها همچنین می توانند برای انتساب متغیرها استفاده شوند.به این ترتیب ساختار " +"انواع (Types) خود را بررسی می‌کنید. اجازه دهید با یک نوع `enum` ساده شروع " +"کنیم:" #: src/pattern-matching/destructuring-enums.md:18 msgid "\"cannot divide {n} into two equal parts\"" @@ -5313,17 +5312,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 "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " -"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " -"`msg` به پیام خطا متصل شده است." +"در اینجا ما از شاخه‌ها برای `destructure` کردن مقدار `Result` استفاده " +"کرده‌ایم. در شاخه اول، `half` به مقداری داخل نوع `Ok` متصل می شود. در شاخه " +"دوم، `msg` به نوع`Err` متصل می‌شود." #: src/pattern-matching/destructuring-enums.md:38 msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " -"هم باز می‌شود." +"عبارت `if`/`else` یک `enum` را برمی گرداند که بعداً با `match` باز می شود." #: src/pattern-matching/destructuring-enums.md:40 msgid "" @@ -5336,19 +5334,23 @@ msgstr "" "نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md:43 +#, fuzzy msgid "" "The values in the enum variants can only be accessed after being pattern " "matched." -msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." +msgstr "" +"مقادیر در`Enum` فقط پس از طییق الگوی قابل دسترسی هستند. الگو ارجاعی را به " +"فیلدهای موجود با استفاده بازوی `match` پس از `=>` " +"متصل می کند." #: src/pattern-matching/destructuring-enums.md:45 +#, fuzzy 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 فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " -"شده‌اند." +"این اتفاق را زمانی که الگوهای جستجو کامل نیستند نشان دهید. به مزیت کامپایلر " +"Rust که با تایید زمانی که همه موارد رسیدگی می‌شوند، اشاره کنید." #: src/pattern-matching/destructuring-enums.md:47 msgid "" @@ -5359,22 +5361,12 @@ msgid "" "io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " "support older Rust, replace `msg` with `ref msg` in the pattern." msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " -"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " -"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " -"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " -"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" -"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " -"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " -"msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md:3 msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " -"ساختارها برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md:6 #: src/pattern-matching/let-control-flow.md:10 @@ -5383,8 +5375,9 @@ msgstr "عبارت `if let`" #: src/pattern-matching/let-control-flow.md:7 #: src/pattern-matching/let-control-flow.md:32 +#, fuzzy msgid "`let else` expressions" -msgstr "عبارت `let else`" +msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md:8 msgid "`while let` expressions" @@ -5411,10 +5404,6 @@ msgid "" "let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " "- anything but falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" -"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " -"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " -"- به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md:44 #: src/pattern-matching/let-control-flow.md:107 @@ -5454,20 +5443,23 @@ msgstr "" "مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md:81 +#, fuzzy msgid "" "Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) returns `Some(c)` until the string is empty, after " "which it will return `None`. The `while let` lets us keep iterating through " "all items." msgstr "" -"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " -"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " -"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." +"در اینجا، پیماینده (iterator) توسط `v.into_iter()` یک " +"مقدار را برمیگرداند, یک `Option` را در هر فراخوانی " +"به `next()` برمی گرداند. تا زمانی که محتوایی وجود داشته " +"باشد این کار ادامه پیدا میکند و وقتی که تمام شد `Some(x)` را برمی گرداند و پس از آن None را برمی گرداند. `while let` به ما امکان " +"می دهد همه مارد را به صورت کامل پیمایش کنیم." #: src/pattern-matching/let-control-flow.md:89 msgid "if-let" -msgstr "if-let" +msgstr "" #: src/pattern-matching/let-control-flow.md:91 msgid "" @@ -5493,7 +5485,7 @@ msgstr "" #: src/pattern-matching/let-control-flow.md:96 msgid "let-else" -msgstr "let-else" +msgstr "" #: src/pattern-matching/let-control-flow.md:98 msgid "" @@ -5501,18 +5493,15 @@ msgid "" "flattening this nested code. Rewrite the awkward version for students, so " "they can see the transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " -"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " -"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " -"مشاهده کنند." #: src/pattern-matching/let-control-flow.md:102 msgid "The rewritten version is:" -msgstr "نسخه‌ی بازنویسی شده به صورت زیر است:" +msgstr "" #: src/pattern-matching/let-control-flow.md:122 +#, fuzzy msgid "while-let" -msgstr "while-let" +msgstr "حلقه `while let`" #: src/pattern-matching/let-control-flow.md:124 msgid "" @@ -5523,33 +5512,38 @@ msgstr "" "داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md:126 +#, fuzzy msgid "" "You could rewrite the `while let` loop as an infinite loop with an if " "statement that breaks when there is no value to unwrap for `name.pop()`. The " "`while let` provides syntactic sugar for the above scenario." msgstr "" -"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." -"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " -"می‌دهد." +"می‌توانید حلقه `while let` را به عنوان یک حلقه بی‌پایان با یک عبارت `if` " +"بازنویسی کنید که زمانی که مقداری برای باز کردن `iter.next()` وجود ندارد، قطع می‌شود. `while let` مثل آب خوردن سناریو بالا رو برای " +"شما فراهم می‌کند." #: src/pattern-matching/exercise.md:3 +#, fuzzy msgid "Let's write a simple recursive evaluator for arithmetic expressions." -msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبارات حسابی بنویسیم." +msgstr "بیایید یک ارزیاب بازگشتی ساده برای عبارات حسابی بنویسیم." #: src/pattern-matching/exercise.md:5 +#, fuzzy msgid "" "The `Box` type here is a smart pointer, and will be covered in detail later " "in the course. An expression can be \"boxed\" with `Box::new` as seen in the " "tests. To evaluate a boxed expression, use the deref operator (`*`) to " "\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " -"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " -"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " -"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بحث قرار خواهد گرفت. یک عبارت را می‌توان با `Box::new` " +"مانند آنچه در تست‌ها دیده می‌شود، «جعبه‌ای» کرد. برای ارزیابی یک عبارت جعبه‌ای، " +"از عملگر `deref` برای «خارج کردن» آن استفاده کنید: `eval(*boxed_expr)`" #: src/pattern-matching/exercise.md:10 +#, fuzzy msgid "" "Some expressions cannot be evaluated and will return an error. The standard " "[`Result`](https://doc.rust-lang.org/std/result/enum.Result." @@ -5557,31 +5551,31 @@ msgid "" "(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " "later." msgstr "" -"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " -"(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." +"برخی از عبارات قابل ارزیابی نیستند و خطایی را برمی‌گردانند. نوع `Res` " +"نشان‌دهنده یک مقدار موفقیت‌آمیز یا یک خطا با پیام است. این بسیار شبیه به " +"`Result` کتابخانه استاندارد است که بعداً خواهیم دید." #: src/pattern-matching/exercise.md:15 +#, fuzzy msgid "" "Copy and paste the code into the Rust playground, and begin implementing " "`eval`. The final product should pass the tests. It may be helpful to use " "`todo!()` and get the tests to pass one-by-one. You can also skip a test " "temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " -"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " -"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " -"را با استفاده از `[ignore]#` نادیده بگیرید:" +"کد را کپی و در زمین بازی Rust پیست کنید و شروع به پیاده‌سازی `eval` کنید. " +"محصول نهایی باید تست‌ها را پشت سر بگذارد. ممکن است مفید باشد از `todo!()` استفاده کنید و تست‌ها را یکی یکی پاس دهید." #: src/pattern-matching/exercise.md:26 +#, fuzzy msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " -"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " -"panic مدیریت کنید؟" +"اگر زود تموم شد، سعی کنید تست‌ای بنویسید که منجر به سرریز عدد صحیح (integer " +"overflow) شود. چگونه می توانید این مشکل را با `Res::Err` به جای `panic` برطرف کنید؟" #: src/pattern-matching/exercise.md:30 src/pattern-matching/solution.md:4 msgid "/// An operation to perform on two subexpressions.\n" @@ -5613,8 +5607,6 @@ msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " -"کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md:14 msgid "// No receiver, a static method\n" @@ -5657,25 +5649,18 @@ msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " -"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md:54 msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " -"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md:56 msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " -"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " -"به پایان برسد." #: src/methods-and-traits/methods.md:58 msgid "" @@ -5684,33 +5669,26 @@ msgid "" "(deallocated) when the method returns, unless its ownership is explicitly " "transmitted. Complete ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " -"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " -"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md:62 msgid "`mut self`: same as above, but the method can mutate the object." -msgstr "`mut self`: مشابه مورد بالا، اما متد می‌تواند شیء را تغییر دهد." +msgstr "" #: src/methods-and-traits/methods.md:63 msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." msgstr "" -"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " -"سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." #: src/methods-and-traits/methods.md:71 msgid "It can be helpful to introduce methods by comparing them to functions." -msgstr "مفید است که متدها را با مقایسه آنها با توابع معرفی کنیم." +msgstr "" #: src/methods-and-traits/methods.md:72 msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " -"پارامتر اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md:74 msgid "" @@ -5718,47 +5696,34 @@ msgid "" "syntax and to help keep them more organized. By using methods we can keep " "all the implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " -"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " -"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md:77 msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" -"استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." #: src/methods-and-traits/methods.md:78 msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " -"دهید که چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md:80 msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " -"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md:82 -#, fuzzy msgid "" "Note how `self` is used like other structs and dot notation can be used to " "refer to individual fields." msgstr "" -"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " -"می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md:84 msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " -"تلاش برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md:86 msgid "" @@ -5766,16 +5731,11 @@ msgid "" "doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " "receiver types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " -"به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " "redundant?" msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point { .. }`." -msgstr "این امکان وجود دارد که `{ .. }`, but methods in this " "block will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." msgstr "" -"پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " -"باشد، مانند ` = foo.collect()` or with the turbofish, `foo.collect::" ">()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " -"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " -"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " -"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " -"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " -"یا با استفاده از ()`." #: src/generics/impl-trait.md:47 msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " -"ببینید پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md:3 msgid "" "In addition to using traits for static dispatch via generics, Rust also " "supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " -"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " -"اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md:27 src/smart-pointers/trait-objects.md:28 msgid "\"Miau!\"" @@ -6374,11 +6230,6 @@ msgid "" "full type information and can resolve which type's trait implementation to " "use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " -"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " -"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " -"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " -"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md:62 msgid "" @@ -6387,11 +6238,6 @@ msgid "" "This means that there's a single version of `fn dynamic` that is used " "regardless of what type of `Pet` is passed in." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " -"یک [virtual method table](https://en.wikipedia.org/wiki/" -"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " -"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " -"استفاده می‌شود." #: src/generics/dyn-trait.md:67 msgid "" @@ -6399,10 +6245,6 @@ msgid "" "indirection. In this case it's a reference, though smart pointer types like " "`Box` can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " -"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " -"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " -"سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md:71 msgid "" @@ -6415,21 +6257,12 @@ msgid "" "compiler doesn't need to know the concrete type of the `Pet` in order to do " "this." msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " -"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " -"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " -"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " -"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " -"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " -"`Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md:79 msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " -"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md:3 msgid "" @@ -6437,9 +6270,6 @@ msgid "" "determines the minimum of two values, using the [`Ord`](https://doc.rust-" "lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " -"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." -"rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md:8 msgid "// TODO: implement the `min` function used in `main`.\n" @@ -6477,17 +6307,15 @@ msgid "" "html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." "Ordering.html) enum." msgstr "" -"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " -"enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md:1 +#, fuzzy msgid "Option" -msgstr "Option" +msgstr "استثناها" #: src/std-types.md src/std-types/result.md:1 src/error-handling.md msgid "Result" -msgstr "Result" +msgstr "" #: src/std-types.md src/std-types/string.md:1 msgid "String" @@ -6506,8 +6334,6 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " -"از متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md:3 msgid "" @@ -6515,61 +6341,48 @@ msgid "" "types used by Rust libraries and programs. This way, two libraries can work " "together smoothly because they both use the same `String` type." msgstr "" -"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " -"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " -"استفاده می‌کنند." #: src/std-types/std.md:7 msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " -"`std`." #: src/std-types/std.md:10 msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " -"حتی وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md:12 msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." msgstr "" -"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند " -"`Vec`، `Box` و `Arc`." #: src/std-types/std.md:14 msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" -"برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " -"می‌کنند." #: src/std-types/docs.md:3 msgid "Rust comes with extensive documentation. For example:" -msgstr "Rust دارای مستندات گسترده‌ای است. به عنوان مثال:" +msgstr "" #: src/std-types/docs.md:5 +#, fuzzy msgid "" "All of the details about [loops](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." msgstr "" -"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/" -"expressions/loop-expr.html)." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," #: src/std-types/docs.md:7 msgid "" "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." #: src/std-types/docs.md:9 msgid "" @@ -6577,13 +6390,10 @@ msgid "" "option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" "std/collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" -"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" -"stable/std/collections/struct.BinaryHeap.html)." #: src/std-types/docs.md:13 msgid "In fact, you can document your own code:" -msgstr "در واقع، شما می‌توانید کد خود را مستند کنید:" +msgstr "" #: src/std-types/docs.md:16 msgid "" @@ -6594,25 +6404,25 @@ msgid "" msgstr "" #: src/std-types/docs.md:27 +#, fuzzy msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" "(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " "idiomatic to document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " -"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " -"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " -"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " -"رایج مرسوم است." +"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی " +"(Crate) که در راست منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc]" +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`]" +"(https://docs.rs) مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در " +"یک API با استفاده از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه " +"استفاده را مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." #: src/std-types/docs.md:32 msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " -"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md:36 msgid "" @@ -6621,12 +6431,13 @@ msgid "" msgstr "" #: src/std-types/docs.md:42 +#, fuzzy msgid "" "Show students the generated docs for the `rand` crate at ." msgstr "" -"مستندات تولیدشده برای `rand` crate را در به " -"دانش‌آموزان نشان دهید." +"دانشجویان را با مستندات تولید شده برای جعبه `rand` در [`docs.rs/rand`]" +"(https://docs.rs/rand) آشنا کنید." #: src/std-types/option.md:3 msgid "" @@ -6634,10 +6445,6 @@ msgid "" "type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" "stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in " "memory as `T`." msgstr "" -"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، " -"هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/" -"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " -"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md:30 msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " -"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md:32 msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " -"طول آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md:34 msgid "" @@ -6821,73 +6597,57 @@ msgid "" "to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر" -"\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/" -"unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." #: src/std-types/string.md:37 msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " -"باشد." #: src/std-types/string.md:39 msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it " "access to `str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/" -"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " -"متدهای برش را بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md:38 msgid "" @@ -6951,9 +6701,6 @@ msgid "" "it contains is stored on the heap. This means the amount of data doesn't " "need to be known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " -"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " -"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md:41 msgid "" @@ -6961,17 +6708,12 @@ msgid "" "explicitly. As always with Rust type inference, the `T` was established " "during the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" -"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " -"easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" -"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " -"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md:65 msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " -"تولید می‌کند، ساخته شود." #: src/std-types/hashmap.md:67 msgid "" @@ -7089,17 +6817,12 @@ msgid "" "examples easier. Using references in collections can, of course, be done, " "but it can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." msgstr "" -"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " -"ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md:49 msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." msgstr "" -"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md:54 msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" msgstr "" -"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " -"بازتابی است:" #: src/std-traits/comparisons.md:69 msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " -"آن‌ها به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md:3 msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." "rust-lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." -"org/std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md:23 msgid "\"{:?} + {:?} = {:?}\"" -msgstr "\"{:?} + {:?} = {:?}\"" +msgstr "" #: src/std-traits/operators.md:30 src/memory-management/drop.md:48 msgid "Discussion points:" -msgstr "نکات بحث:" +msgstr "" #: src/std-traits/operators.md:32 msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " -"مفید است؟" #: src/std-traits/operators.md:33 msgid "" @@ -7303,17 +6991,12 @@ msgid "" "the operator is not `Copy`, you should consider overloading the operator for " "`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" -"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " -"بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " -"بگیرید. این کار از ایجاد کپی‌های غیرضروری در محل فراخوانی جلوگیری می‌کند." #: src/std-traits/operators.md:36 msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " -"متد تعریف کرد؟" #: src/std-traits/operators.md:38 msgid "" @@ -7321,16 +7004,12 @@ msgid "" "associated types (like `Output`) are controlled by the implementer of a " "trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " -"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md:41 msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." msgstr "" -"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " -"Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." #: src/std-traits/from-and-into.md:3 msgid "" @@ -7338,13 +7017,10 @@ msgid "" "html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " "facilitate type conversions:" msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " -"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md:11 src/std-traits/from-and-into.md:23 msgid "\"{s}, {addr}, {one}, {bigger}\"" -msgstr "\"{s}, {addr}, {one}, {bigger}\"" +msgstr "" #: src/std-traits/from-and-into.md:15 msgid "" @@ -7352,17 +7028,12 @@ msgid "" "automatically implemented when [`From`](https://doc.rust-lang.org/std/" "convert/trait.From.html) is implemented:" msgstr "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" -"trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md:30 msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." msgstr "" -"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " -"پیاده‌سازی `Into` را نیز دریافت می‌کند." #: src/std-traits/from-and-into.md:32 msgid "" @@ -7371,30 +7042,24 @@ msgid "" "Your function will accept types that implement `From` and those that _only_ " "implement `Into`." msgstr "" -"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " -"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " -"پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md:3 msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." msgstr "" -"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " -"می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." #: src/std-traits/casting.md:9 msgid "\"as u16: {}\"" -msgstr "\"as u16: {}\"" +msgstr "" #: src/std-traits/casting.md:10 msgid "\"as i16: {}\"" -msgstr "\"as i16: {}\"" +msgstr "" #: src/std-traits/casting.md:11 msgid "\"as u8: {}\"" -msgstr "\"as u8: {}\"" +msgstr "" #: src/std-traits/casting.md:15 msgid "" @@ -7402,9 +7067,6 @@ msgid "" "platforms. This might not match your intuition for changing sign or casting " "to a smaller type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " -"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " -"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md:19 msgid "" @@ -7415,12 +7077,6 @@ msgid "" "selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " "was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " -"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " -"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " -"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " -"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " -"بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md:25 msgid "" @@ -7429,15 +7085,10 @@ msgid "" "casts, `TryFrom` and `TryInto` are available when you want to handle casts " "that fit differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " -"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " -"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " -"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " -"کنید." #: src/std-traits/casting.md:33 msgid "Consider taking a break after this slide." -msgstr "در نظر داشته باشید که پس از این اسلاید استراحت کنید." +msgstr "" #: src/std-traits/casting.md:35 msgid "" @@ -7445,15 +7096,10 @@ msgid "" "be lost is generally discouraged, or at least deserves an explanatory " "comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " -"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " -"دارد." #: src/std-traits/casting.md:38 msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " -"است." #: src/std-traits/read-and-write.md:3 msgid "" @@ -7461,111 +7107,94 @@ msgid "" "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " "abstract over `u8` sources:" msgstr "" -"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " -"بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md:14 msgid "b\"foo\\nbar\\nbaz\\n\"" -msgstr "b\"foo\\nbar\\nbaz\\n\"" +msgstr "" #: src/std-traits/read-and-write.md:15 msgid "\"lines in slice: {}\"" -msgstr "\"lines in slice: {}\"" +msgstr "" #: src/std-traits/read-and-write.md:18 msgid "\"lines in file: {}\"" -msgstr "\"lines in file: {}\"" +msgstr "" #: src/std-traits/read-and-write.md:23 msgid "" "Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " "you abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " -"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md:30 msgid "\"\\n\"" -msgstr "\"\\n\"" +msgstr "" #: src/std-traits/read-and-write.md:37 msgid "\"Logged: {:?}\"" -msgstr "\"Logged: {:?}\"" +msgstr "" #: src/std-traits/default.md:1 msgid "The `Default` Trait" -msgstr "The `Default` Trait" +msgstr "" #: src/std-traits/default.md:3 msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md:18 msgid "\"John Smith\"" -msgstr "\"John Smith\"" +msgstr "" #: src/std-traits/default.md:24 msgid "\"{default_struct:#?}\"" -msgstr "\"{default_struct:#?}\"" +msgstr "" #: src/std-traits/default.md:27 msgid "\"Y is set!\"" -msgstr "\"Y is set!\"" +msgstr "" #: src/std-traits/default.md:28 msgid "\"{almost_default_struct:#?}\"" -msgstr "\"{almost_default_struct:#?}\"" +msgstr "" #: src/std-traits/default.md:31 src/lifetimes/exercise.md:197 #: src/lifetimes/solution.md:196 msgid "\"{:#?}\"" -msgstr "\"{:#?}\"" +msgstr "" #: src/std-traits/default.md:38 msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" -"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق " -"`[derive(Default)]#` به صورت خودکار تولید شود." #: src/std-traits/default.md:39 msgid "" "A derived implementation will produce a value where all fields are set to " "their default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " -"پیش‌فرض خود تنظیم شده‌اند." #: src/std-traits/default.md:41 msgid "This means all types in the struct must implement `Default` too." msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " -"پیاده‌سازی کنند." #: src/std-traits/default.md:42 msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " -"(مثل `0`، `\"\"` و غیره)." #: src/std-traits/default.md:44 msgid "The partial struct initialization works nicely with default." -msgstr "مقداردهی جزئی ساختارها با `Default` به خوبی کار می‌کند." +msgstr "" #: src/std-traits/default.md:45 msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " -"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md:47 msgid "" @@ -7573,9 +7202,6 @@ msgid "" "book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" "with-struct-update-syntax)." msgstr "" -"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" -"struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md:3 msgid "" @@ -7584,27 +7210,23 @@ msgid "" "html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " "[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " -"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" -"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." -"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " -"هستند:" #: src/std-traits/closures.md:10 +#, fuzzy msgid "\"Calling function on {input}\"" -msgstr "\"Calling function on {input}\"" +msgstr "فراخوانی متدهای ناامن" #: src/std-traits/closures.md:16 src/std-traits/closures.md:17 msgid "\"add_3: {}\"" -msgstr "\"add_3: {}\"" +msgstr "" #: src/std-traits/closures.md:24 src/std-traits/closures.md:25 msgid "\"accumulate: {}\"" -msgstr "\"accumulate: {}\"" +msgstr "" #: src/std-traits/closures.md:28 msgid "\"multiply_sum: {}\"" -msgstr "\"multiply_sum: {}\"" +msgstr "" #: src/std-traits/closures.md:35 msgid "" @@ -7612,25 +7234,18 @@ msgid "" "perhaps captures nothing at all. It can be called multiple times " "concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " -"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " -"چندین بار فراخوانی شود." #: src/std-traits/closures.md:38 msgid "" "An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " "multiple times, but not concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " -"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md:41 msgid "" "If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " "might consume captured values." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " -"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md:44 msgid "" @@ -7638,10 +7253,6 @@ msgid "" "I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " "use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " -"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " -"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " -"کنید." #: src/std-traits/closures.md:48 msgid "" @@ -7649,49 +7260,37 @@ msgid "" "you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " "the most flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " -"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " -"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " -"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md:52 msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " "(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " -"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " -"`FnOnce`." #: src/std-traits/closures.md:55 msgid "" "The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " "`multiply_sum`), depending on what the closure captures." msgstr "" -"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال " -"`multiply_sum`) را بر اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." #: src/std-traits/closures.md:58 msgid "" "By default, closures will capture by reference if they can. The `move` " "keyword makes them capture by value." msgstr "" -"به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " -"می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " -"value) بگیرند." #: src/std-traits/closures.md:63 src/smart-pointers/trait-objects.md:93 #: src/smart-pointers/trait-objects.md:94 msgid "\"{} {}\"" -msgstr "\"{} {}\"" +msgstr "" #: src/std-traits/closures.md:67 msgid "\"Hi\"" -msgstr "\"Hi\"" +msgstr "" #: src/std-traits/closures.md:68 msgid "\"Greg\"" -msgstr "\"Greg\"" +msgstr "" #: src/std-traits/exercise.md:3 msgid "" @@ -7700,35 +7299,29 @@ msgid "" "implement the missing bits. Only rotate ASCII alphabetic characters, to " "ensure the result is still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." -"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " -"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " -"تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md:15 msgid "// Implement the `Read` trait for `RotDecoder`.\n" -msgstr "// Implement the `Read` trait for `RotDecoder`.\n" +msgstr "" #: src/std-traits/exercise.md:20 src/std-traits/exercise.md:33 #: src/std-traits/solution.md:26 src/std-traits/solution.md:39 msgid "\"Gb trg gb gur bgure fvqr!\"" -msgstr "\"Gb trg gb gur bgure fvqr!\"" +msgstr "" #: src/std-traits/exercise.md:36 src/std-traits/solution.md:42 msgid "\"To get to the other side!\"" -msgstr "\"To get to the other side!\"" +msgstr "" #: src/std-traits/exercise.md:55 msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " -"۱۳ کاراکتر را بچرخانند؟" #: src/std-traits/solution.md:16 msgid "'A'" -msgstr "'A'" +msgstr "" #: src/welcome-day-3.md msgid "Welcome to Day 3" @@ -8353,7 +7946,7 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md:85 #: src/concurrency/sync-exercises/solutions.md:121 msgid "\"a\"" -msgstr "\"a\"" +msgstr "" #: src/memory-management/drop.md:20 src/android/testing/googletest.md:12 msgid "\"b\"" @@ -8701,9 +8294,6 @@ msgid "" "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " "context." msgstr "" -"اگر شما علاقه‌مند به موضوع multi-thread هستید بهتر است\n" -" مباحث [`Arc`](../concurrency/shared-state/arc.md) و [`Mutex`](https://" -"doc.rust-lang.org/std/sync/struct.Mutex.html) را ببینید." #: src/smart-pointers/rc.md:19 msgid "" @@ -8774,8 +8364,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:\"Dog" -"\"| :\n" +": : | : | data:" +"\"Dog\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8797,16 +8387,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk" -"\" | :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk" -"\" | :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -9134,8 +8724,8 @@ msgstr "" #: src/borrowing/exercise.md:45 msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor" -"\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "" #: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 @@ -9773,8 +9363,9 @@ msgstr "" #: src/modules/filesystem.md:18 msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments" -"\". These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md:22 @@ -12747,11 +12338,11 @@ msgstr "" #: src/android/testing/googletest.md:44 msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust applications" -"\"](https://github.com/mainmatter/rust-advanced-testing-workshop), a self-" -"guided Rust course: it provides a guided introduction to the library, with " -"exercises to help you get comfortable with `googletest` macros, its matchers " -"and its overall philosophy." +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://github.com/mainmatter/rust-advanced-testing-" +"workshop), a self-guided Rust course: it provides a guided introduction to " +"the library, with exercises to help you get comfortable with `googletest` " +"macros, its matchers and its overall philosophy." msgstr "" #: src/android/testing/googletest.md:51 @@ -13483,11 +13074,11 @@ msgstr "" #: src/android/interoperability/cpp/type-mapping.md:9 msgid "`rust::Box`" -msgstr "`rust::Box`" +msgstr "" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`UniquePtr`" -msgstr "`UniquePtr`" +msgstr "" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`std::unique_ptr`" @@ -15035,8 +14626,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" -"\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md:29 @@ -15515,8 +15106,8 @@ msgstr "" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" -"\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" @@ -16438,7 +16029,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:4 msgid "\"Real-Time Interrupt-driven Concurrency\"" -msgstr "همزمانی وقفه‌گرا و بلادرنگ" +msgstr "" #: src/bare-metal/microcontrollers/other-projects.md:5 msgid "" @@ -17391,7 +16982,7 @@ msgstr "" #: src/bare-metal/aps/better-uart/using.md:36 #: src/concurrency/async-pitfalls/cancellation.md:27 msgid "b'\\n'" -msgstr "b'\\n'" +msgstr "" #: src/bare-metal/aps/better-uart/using.md:38 msgid "b'q'" @@ -17487,13 +17078,6 @@ msgid "" "rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " "it in something like a `Mutex` and put it in a static." msgstr "" -"ما می‌توانیم در مورد exception handlers و execution context اصلی تا حدودی " -"مثل thread‌های مختلف فکر کنیم.‏ [`Send` و `Sync`](../../concurrency/send-sync." -"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم را کنترل خواهند کرد، درست " -"مانند threadها.برای مثال، اگر می‌خواهیم مقداری را بین exception handlers و " -"بقیه برنامه به اشتراک بگذاریم، این کار به کمک `Send` است اما با `Sync` ممکن " -"نیست،پس در نتیجه باید آن را در چیزی مانند `Mutex` بپیچیم و در یک حالت " -"static قرار دهیم." #: src/bare-metal/aps/other-projects.md:3 msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -18042,15 +17626,13 @@ msgstr "" #: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" -msgstr "به مبحث Concurrency در Rust خوش‌آمدید " +msgstr "" #: src/concurrency/welcome.md msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." msgstr "" -"زبان Rust به طور کامل از concurrency با استفاده از threadهای سیستم‌عامل به " -"همراه mutexeها و channelها استفاده می‌کند." #: src/concurrency/welcome.md msgid "" @@ -18058,32 +17640,22 @@ msgid "" "compile time bugs. This is often referred to as _fearless concurrency_ since " "you can rely on the compiler to ensure correctness at runtime." msgstr "" -"تایپ سیستم Rustنقش مهمی در تولید بسیاری از concurrency باگ‌ها در زمان کامپایل " -"ایجاد می‌کند.این مورد اغلب به عنوان _fearless concurrency_ شناخته می‌شود؛ زیرا " -"می‌توانید به کامپایلر به عنوان تصحیح‌کننده خطاهای زمان اجرا (runtime) حساب " -"کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. و " -"شامل موارد زیر است:" #: src/concurrency/welcome.md msgid "" "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏Rust به ما این امکان را می‌دهد به concurrency toolkit سیستم‌عامل دسترسی پیدا " -"کنیم: threadها، sync، primitives و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." msgstr "" -"این سیستم تایپ بدون هیچ ویژگی خاص دیگر، دسترسی امن به concurrency برای ما به " -"ارمغان می‌آورد." #: src/concurrency/welcome.md msgid "" @@ -18091,10 +17663,6 @@ msgid "" "g., a called function that might mutate an argument or save references to it " "to read later) save us from multi-threading issues." msgstr "" -"همان ابزارهایی که به دسترسی \"concurrent\" در یک thread تنها کمک می‌کنند (به " -"عنوان مثال، یک تابع فراخوانی که ممکن است یک آرگومان را تغییر دهدیا ارجاعات " -"به آن را ذخیره کند تا در آینده آن را بخوانید) ما را از مشکلات استفاده از " -"حالت چندین thread ای نجات می‌دهد." #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -18646,11 +18214,11 @@ msgstr "" #: src/concurrency/shared-state/mutex.md:43 msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" -"\" to signal that the data it protected might be in an inconsistent state. " -"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" -"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " -"`into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." msgstr "" #: src/concurrency/shared-state/example.md:3 @@ -18855,8 +18423,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" -"\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -19886,8 +19454,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" -"\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -20081,8 +19649,8 @@ msgstr "" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " -"it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" #: src/thanks.md @@ -22655,7 +22223,7 @@ msgstr "" #, fuzzy #~ msgid "trait:" -#~ msgstr "trait:" +#~ msgstr "صفت‌ها" #, fuzzy #~ msgid "union:" @@ -22671,4 +22239,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" +#~ msgstr "تطبیق الگو" \ No newline at end of file From 6f5c0110de288dad773c5f572e9f5ec535899350 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 14 Aug 2024 15:09:40 +0330 Subject: [PATCH 17/92] reset fa to stable state --- po/fa.po | 798 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 603 insertions(+), 195 deletions(-) diff --git a/po/fa.po b/po/fa.po index 59f07a13981..2e62ed00172 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" -"PO-Revision-Date: 2024-07-24 10:12+0330\n" +"PO-Revision-Date: 2024-08-07 22:37+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -243,7 +243,7 @@ msgstr "ساختار‌ تاپل‌ها" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md:1 #: src/pattern-matching/destructuring-enums.md:1 msgid "Enums" -msgstr "" +msgstr "Enums" #: src/SUMMARY.md src/user-defined-types.md msgid "Static" @@ -264,7 +264,7 @@ msgstr "تمرین: رویدادهای آسانسور" #: src/SUMMARY.md msgid "Day 2: Morning" -msgstr "روز دوم: صبح" +msgstr "روز ۲: صبح" #: src/SUMMARY.md src/running-the-course/course-structure.md:35 #: src/welcome-day-2.md src/pattern-matching.md @@ -304,28 +304,28 @@ msgstr "متدها" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md:1 msgid "Traits" -msgstr "صفت‌ها" +msgstr "Traits" #: src/SUMMARY.md src/methods-and-traits/traits/implementing.md:1 msgid "Implementing Traits" -msgstr "پیاده سازی صفات (Traits)" +msgstr "پیاده سازی Traits" #: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md:1 msgid "Supertraits" -msgstr "" +msgstr "Supertraits" #: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md:1 msgid "Associated Types" -msgstr "" +msgstr "تایپ‌های وابسته" #: src/SUMMARY.md src/methods-and-traits.md #: src/methods-and-traits/deriving.md:1 msgid "Deriving" -msgstr "" +msgstr "Deriving" #: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" -msgstr "تمرین: توابع جنریک" +msgstr "تمرین: توابع Generic" #: src/SUMMARY.md msgid "Day 2: Afternoon" @@ -334,42 +334,40 @@ msgstr "روز دوم: عصر" #: src/SUMMARY.md src/running-the-course/course-structure.md:43 #: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" -msgstr "جنریک‌ها" +msgstr "Generics" #: src/SUMMARY.md src/generics.md src/generics/generic-functions.md:1 msgid "Generic Functions" -msgstr "" +msgstr "توابع Generic" #: src/SUMMARY.md src/generics.md src/generics/generic-data.md:1 msgid "Generic Data Types" -msgstr "انواع داده‌ها جنریک (Generic Data Types)" +msgstr "دیتا تایپ‌های Generic" #: src/SUMMARY.md src/generics/generic-traits.md:1 -#, fuzzy msgid "Generic Traits" -msgstr "صفت‌های جنریک‌ها" +msgstr "Generic Traits" #: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md:1 msgid "Trait Bounds" -msgstr "صفات مرزی (Trait Bounds)" +msgstr "Trait Bounds" #: src/SUMMARY.md src/generics/impl-trait.md:1 msgid "`impl Trait`" -msgstr "" +msgstr "`impl Trait`" #: src/SUMMARY.md src/generics/dyn-trait.md:1 -#, fuzzy msgid "`dyn Trait`" -msgstr "صفات Async" +msgstr "`dyn Trait`" #: src/SUMMARY.md src/generics/exercise.md:1 msgid "Exercise: Generic `min`" -msgstr "" +msgstr "تمرین: Generic `min`" #: src/SUMMARY.md src/running-the-course/course-structure.md:44 #: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" -msgstr "کتابخانه‌ استاندارد انواع داده" +msgstr "کتابخانه‌ استاندارد تایپ‌ها" #: src/SUMMARY.md src/std-types.md src/std-types/std.md:1 msgid "Standard Library" @@ -381,24 +379,24 @@ msgstr "مستندات" #: src/SUMMARY.md msgid "`Option`" -msgstr "" +msgstr "`Option`" #: src/SUMMARY.md src/error-handling/result.md:1 msgid "`Result`" -msgstr "" +msgstr "`Result`" #: src/SUMMARY.md src/android/aidl/types/primitives.md:14 #: src/android/interoperability/cpp/type-mapping.md:5 msgid "`String`" -msgstr "" +msgstr "`String`" #: src/SUMMARY.md src/std-types/vec.md:1 msgid "`Vec`" -msgstr "" +msgstr "`Vec`" #: src/SUMMARY.md src/std-types/hashmap.md:1 src/bare-metal/no_std.md msgid "`HashMap`" -msgstr "" +msgstr "`HashMap`" #: src/SUMMARY.md src/std-types.md src/std-types/exercise.md:1 msgid "Exercise: Counter" @@ -407,7 +405,7 @@ msgstr "تمرین: شمارنده" #: src/SUMMARY.md src/running-the-course/course-structure.md:45 #: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" -msgstr "کتابخانه استاندارد برای تریت‌ها" +msgstr "کتابخانه استاندارد Traits" #: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md:1 #: src/concurrency/welcome-async.md @@ -420,27 +418,27 @@ msgstr "اپراتورها" #: src/SUMMARY.md src/std-traits/from-and-into.md:1 msgid "`From` and `Into`" -msgstr "" +msgstr "`From` and `Into`" #: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md:1 msgid "Casting" -msgstr "" +msgstr "Casting" #: src/SUMMARY.md src/std-traits/read-and-write.md:1 msgid "`Read` and `Write`" -msgstr "" +msgstr "`Read` and `Write`" #: src/SUMMARY.md msgid "`Default`, struct update syntax" -msgstr "" +msgstr "`Default`, struct update syntax" #: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md:1 msgid "Closures" -msgstr "" +msgstr "Closures" #: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md:1 msgid "Exercise: ROT13" -msgstr "" +msgstr "تمرین: ROT13" #: src/SUMMARY.md msgid "Day 3: Morning" @@ -4534,7 +4532,7 @@ msgstr "" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md msgid "This segment should take about 50 minutes. It contains:" -msgstr "" +msgstr "این بخش حدود ۵۰ دقیقه طول خواهد کشید. شامل موارد زیر است:" #: src/user-defined-types/named-structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" @@ -5042,64 +5040,62 @@ msgstr "" #: src/welcome-day-2.md msgid "Welcome to Day 2" -msgstr "به روز دوم خوش آمدید" +msgstr "به روز ۲ خوش آمدید" #: src/welcome-day-2.md -#, fuzzy msgid "" "Now that we have seen a fair amount of Rust, today will focus on Rust's type " "system:" msgstr "" -"حالا که از زبان راست به اندازه کافی چیز های مختلفی دیده ایم وقت ادامه با " -"توجه به موارد زیر " +"اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز " +"خواهیم کرد:" #: src/welcome-day-2.md -#, fuzzy msgid "Pattern matching: extracting data from structures." -msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." +msgstr "تطبیق الگو: استخراج داده از ساختارها." #: src/welcome-day-2.md msgid "Methods: associating functions with types." -msgstr "" +msgstr "متد‌ها: ارتباط توابع با تایپ ها." #: src/welcome-day-2.md msgid "Traits: behaviors shared by multiple types." -msgstr "" +msgstr "Traits: رفتارهایی که توسط چندین تایپ مشترک هستند." #: src/welcome-day-2.md msgid "Generics: parameterizing types on other types." -msgstr "" +msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" +"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " +"این شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md msgid "This segment should take about 1 hour. It contains:" -msgstr "" +msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شامل:" #: src/pattern-matching/match.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` به شما امکان می دهد یک مقدار را در برابر _یک یا چند الگو_ " -"مطابقت دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطبیق انتخاب " -"می‌شود." +"کلمه کلیدی `match` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " +"دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." #: src/pattern-matching/match.md:6 msgid "The patterns can be simple values, similarly to `switch` in C and C++:" -msgstr "" -"الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و C++:" +msgstr "الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و ++C:" #: src/pattern-matching/match.md:11 msgid "'x'" @@ -5168,27 +5164,33 @@ msgid "" "expressions _must_ be exhaustive, meaning that it covers every possibility, " "so `_` is often used as the final catch-all case." msgstr "" +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " +"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " +"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md:26 -#, fuzzy msgid "" "Match can be used as an expression. Just like `if`, 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`، باید همه شاخه تطبیق باید از نوع یکسانی را داشته باشند. " -"نوع عبارت در آخر بلوک تعیین می‌شود، البته اگر وجود داشته باشد. در مثال بالا، " -"نوع `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " +"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " +"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md:30 msgid "" "A variable in the pattern (`key` in this example) will create a binding that " "can be used within the match arm." msgstr "" +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " +"بخش مطابقت استفاده کرد." #: src/pattern-matching/match.md:33 msgid "A match guard causes the arm to match only if the condition is true." msgstr "" +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " +"باشد که شرط برقرار باشد." #: src/pattern-matching/match.md:40 msgid "" @@ -5208,12 +5210,11 @@ msgstr "`..` برای تعیین همه محدوده یا تا جایی که م #: src/pattern-matching/match.md:44 msgid "`1..=5` represents an inclusive range" msgstr "" -"1..=5 نمایانگر یک محدوده خاص " -"است." +"1..=5 نمایانگر یک محدوده خاص است" #: src/pattern-matching/match.md:45 msgid "`_` is a wild card" -msgstr "`_` یک wildcard (هر حالتی) است." +msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md:47 msgid "" @@ -5221,7 +5222,7 @@ msgid "" "we wish to concisely express more complex ideas than patterns alone would " "allow." msgstr "" -"گارد های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " "و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md:49 @@ -5233,7 +5234,7 @@ msgid "" msgstr "" "آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " "عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " -"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " "عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md:53 @@ -5248,7 +5249,7 @@ msgstr "ساختارها" #: src/pattern-matching/destructuring-structs.md:3 msgid "Like tuples, Struct can also be destructured by matching:" -msgstr "" +msgstr "مانند tuple ها، ساختار را نیز می توان با تطبیق تخریب کرد:" #: src/pattern-matching/destructuring-structs.md:15 msgid "\"x.0 = 1, b = {b}, y = {y}\"" @@ -5282,7 +5283,7 @@ msgstr "" #: src/pattern-matching/destructuring-enums.md:3 msgid "Like tuples, enums can also be destructured by matching:" -msgstr "" +msgstr "مانند tuple ها، enum ها را نیز می توان با تطبیق تخریب کرد:" #: src/pattern-matching/destructuring-enums.md:5 msgid "" @@ -5290,9 +5291,9 @@ msgid "" "how you inspect the structure of your types. Let us start with a simple " "`enum` type:" msgstr "" -"الگوها همچنین می توانند برای انتساب متغیرها استفاده شوند.به این ترتیب ساختار " -"انواع (Types) خود را بررسی می‌کنید. اجازه دهید با یک نوع `enum` ساده شروع " -"کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " +"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " +"بیایید با یک نوع ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md:18 msgid "\"cannot divide {n} into two equal parts\"" @@ -5312,16 +5313,17 @@ 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` متصل می‌شود." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " +"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " +"`msg` به پیام خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md:38 msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" -"عبارت `if`/`else` یک `enum` را برمی گرداند که بعداً با `match` باز می شود." +"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " +"هم باز می‌شود." #: src/pattern-matching/destructuring-enums.md:40 msgid "" @@ -5334,23 +5336,19 @@ msgstr "" "نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md:43 -#, fuzzy msgid "" "The values in the enum variants can only be accessed after being pattern " "matched." -msgstr "" -"مقادیر در`Enum` فقط پس از طییق الگوی قابل دسترسی هستند. الگو ارجاعی را به " -"فیلدهای موجود با استفاده بازوی `match` پس از `=>` " -"متصل می کند." +msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md:45 -#, fuzzy 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 که با تایید زمانی که همه موارد رسیدگی می‌شوند، اشاره کنید." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " +"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " +"شده‌اند." #: src/pattern-matching/destructuring-enums.md:47 msgid "" @@ -5361,12 +5359,22 @@ msgid "" "io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " "support older Rust, replace `msg` with `ref msg` in the pattern." msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " +"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " +"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " +"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " +"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" +"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " +"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " +"msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md:3 msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" msgstr "" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " +"ساختارها برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md:6 #: src/pattern-matching/let-control-flow.md:10 @@ -5375,9 +5383,8 @@ msgstr "عبارت `if let`" #: src/pattern-matching/let-control-flow.md:7 #: src/pattern-matching/let-control-flow.md:32 -#, fuzzy msgid "`let else` expressions" -msgstr "عبارت `while let`" +msgstr "عبارت `let else`" #: src/pattern-matching/let-control-flow.md:8 msgid "`while let` expressions" @@ -5404,6 +5411,10 @@ msgid "" "let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " "- anything but falling off the end of the block)." msgstr "" +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" +"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " +"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " +"- به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md:44 #: src/pattern-matching/let-control-flow.md:107 @@ -5443,23 +5454,20 @@ msgstr "" "مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md:81 -#, fuzzy msgid "" "Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) returns `Some(c)` until the string is empty, after " "which 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` به ما امکان " -"می دهد همه مارد را به صورت کامل پیمایش کنیم." +"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " +"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " +"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md:89 msgid "if-let" -msgstr "" +msgstr "if-let" #: src/pattern-matching/let-control-flow.md:91 msgid "" @@ -5485,7 +5493,7 @@ msgstr "" #: src/pattern-matching/let-control-flow.md:96 msgid "let-else" -msgstr "" +msgstr "let-else" #: src/pattern-matching/let-control-flow.md:98 msgid "" @@ -5493,15 +5501,18 @@ msgid "" "flattening this nested code. Rewrite the awkward version for students, so " "they can see the transformation." msgstr "" +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " +"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " +"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " +"مشاهده کنند." #: src/pattern-matching/let-control-flow.md:102 msgid "The rewritten version is:" -msgstr "" +msgstr "نسخه‌ی بازنویسی شده به صورت زیر است:" #: src/pattern-matching/let-control-flow.md:122 -#, fuzzy msgid "while-let" -msgstr "حلقه `while let`" +msgstr "while-let" #: src/pattern-matching/let-control-flow.md:124 msgid "" @@ -5512,38 +5523,33 @@ msgstr "" "داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md:126 -#, fuzzy msgid "" "You could rewrite the `while let` loop as an infinite loop with an if " "statement that breaks when there is no value to unwrap for `name.pop()`. The " "`while let` provides syntactic sugar for the above scenario." msgstr "" -"می‌توانید حلقه `while let` را به عنوان یک حلقه بی‌پایان با یک عبارت `if` " -"بازنویسی کنید که زمانی که مقداری برای باز کردن `iter.next()` وجود ندارد، قطع می‌شود. `while let` مثل آب خوردن سناریو بالا رو برای " -"شما فراهم می‌کند." +"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." +"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " +"می‌دهد." #: src/pattern-matching/exercise.md:3 -#, fuzzy msgid "Let's write a simple recursive evaluator for arithmetic expressions." -msgstr "بیایید یک ارزیاب بازگشتی ساده برای عبارات حسابی بنویسیم." +msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبارات حسابی بنویسیم." #: src/pattern-matching/exercise.md:5 -#, fuzzy msgid "" "The `Box` type here is a smart pointer, and will be covered in detail later " "in the course. An expression can be \"boxed\" with `Box::new` as seen in the " "tests. To evaluate a boxed expression, use the deref operator (`*`) to " "\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره گر هوشمند است و در ادامه دوره به طور مفصل مورد " -"بحث قرار خواهد گرفت. یک عبارت را می‌توان با `Box::new` " -"مانند آنچه در تست‌ها دیده می‌شود، «جعبه‌ای» کرد. برای ارزیابی یک عبارت جعبه‌ای، " -"از عملگر `deref` برای «خارج کردن» آن استفاده کنید: `eval(*boxed_expr)`" +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " +"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " +"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md:10 -#, fuzzy msgid "" "Some expressions cannot be evaluated and will return an error. The standard " "[`Result`](https://doc.rust-lang.org/std/result/enum.Result." @@ -5551,31 +5557,31 @@ msgid "" "(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " "later." msgstr "" -"برخی از عبارات قابل ارزیابی نیستند و خطایی را برمی‌گردانند. نوع `Res` " -"نشان‌دهنده یک مقدار موفقیت‌آمیز یا یک خطا با پیام است. این بسیار شبیه به " -"`Result` کتابخانه استاندارد است که بعداً خواهیم دید." +"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md:15 -#, fuzzy msgid "" "Copy and paste the code into the Rust playground, and begin implementing " "`eval`. The final product should pass the tests. It may be helpful to use " "`todo!()` and get the tests to pass one-by-one. You can also skip a test " "temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در زمین بازی Rust پیست کنید و شروع به پیاده‌سازی `eval` کنید. " -"محصول نهایی باید تست‌ها را پشت سر بگذارد. ممکن است مفید باشد از `todo!()` استفاده کنید و تست‌ها را یکی یکی پاس دهید." +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " +"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " +"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " +"را با استفاده از `[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md:26 -#, fuzzy msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زود تموم شد، سعی کنید تست‌ای بنویسید که منجر به سرریز عدد صحیح (integer " -"overflow) شود. چگونه می توانید این مشکل را با `Res::Err` به جای `panic` برطرف کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " +"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " +"panic مدیریت کنید؟" #: src/pattern-matching/exercise.md:30 src/pattern-matching/solution.md:4 msgid "/// An operation to perform on two subexpressions.\n" @@ -5607,6 +5613,8 @@ msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" msgstr "" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " +"کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md:14 msgid "// No receiver, a static method\n" @@ -5649,18 +5657,25 @@ msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" msgstr "" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " +"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md:54 msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " +"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md:56 msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " +"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " +"به پایان برسد." #: src/methods-and-traits/methods.md:58 msgid "" @@ -5669,26 +5684,33 @@ msgid "" "(deallocated) when the method returns, unless its ownership is explicitly " "transmitted. Complete ownership does not automatically mean mutability." msgstr "" +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " +"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " +"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md:62 msgid "`mut self`: same as above, but the method can mutate the object." -msgstr "" +msgstr "`mut self`: مشابه مورد بالا، اما متد می‌تواند شیء را تغییر دهد." #: src/methods-and-traits/methods.md:63 msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." msgstr "" +"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " +"سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." #: src/methods-and-traits/methods.md:71 msgid "It can be helpful to introduce methods by comparing them to functions." -msgstr "" +msgstr "مفید است که متدها را با مقایسه آنها با توابع معرفی کنیم." #: src/methods-and-traits/methods.md:72 msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." msgstr "" +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " +"پارامتر اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md:74 msgid "" @@ -5696,34 +5718,47 @@ msgid "" "syntax and to help keep them more organized. By using methods we can keep " "all the implementation code in one predictable place." msgstr "" +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " +"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " +"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md:77 msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" +"استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." #: src/methods-and-traits/methods.md:78 msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." msgstr "" +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " +"دهید که چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md:80 msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." msgstr "" +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " +"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md:82 +#, fuzzy msgid "" "Note how `self` is used like other structs and dot notation can be used to " "refer to individual fields." msgstr "" +"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " +"می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md:84 msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." msgstr "" +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " +"تلاش برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md:86 msgid "" @@ -5731,11 +5766,16 @@ msgid "" "doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " "receiver types, such as `Box`." msgstr "" +"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc." +"rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " +"به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " "redundant?" msgstr "" +"_سوال:_ چرا `T` در عبارت `{} Point { .. }`." -msgstr "" +msgstr "این امکان وجود دارد که `{ .. }`, but methods in this " "block will only be available for `Point`." msgstr "" +"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." msgstr "" +"پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " +"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." msgstr "" +"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " +"باشد، مانند ` = foo.collect()` or with the turbofish, `foo.collect::" ">()`." msgstr "" +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " +"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " +"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " +"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " +"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " +"یا با استفاده از ()`." #: src/generics/impl-trait.md:47 msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." msgstr "" +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " +"ببینید پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md:3 msgid "" "In addition to using traits for static dispatch via generics, Rust also " "supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " +"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " +"اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md:27 src/smart-pointers/trait-objects.md:28 msgid "\"Miau!\"" @@ -6230,6 +6374,11 @@ msgid "" "full type information and can resolve which type's trait implementation to " "use." msgstr "" +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " +"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " +"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " +"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " +"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md:62 msgid "" @@ -6238,6 +6387,11 @@ msgid "" "This means that there's a single version of `fn dynamic` that is used " "regardless of what type of `Pet` is passed in." msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " +"یک [virtual method table](https://en.wikipedia.org/wiki/" +"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " +"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " +"استفاده می‌شود." #: src/generics/dyn-trait.md:67 msgid "" @@ -6245,6 +6399,10 @@ msgid "" "indirection. In this case it's a reference, though smart pointer types like " "`Box` can also be used (this will be demonstrated on day 3)." msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " +"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " +"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " +"سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md:71 msgid "" @@ -6257,12 +6415,21 @@ msgid "" "compiler doesn't need to know the concrete type of the `Pet` in order to do " "this." msgstr "" +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " +"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " +"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " +"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " +"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " +"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " +"`Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md:79 msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " +"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md:3 msgid "" @@ -6270,6 +6437,9 @@ msgid "" "determines the minimum of two values, using the [`Ord`](https://doc.rust-" "lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " +"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." +"rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md:8 msgid "// TODO: implement the `min` function used in `main`.\n" @@ -6307,15 +6477,17 @@ msgid "" "html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." "Ordering.html) enum." msgstr "" +"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " +"enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md:1 -#, fuzzy msgid "Option" -msgstr "استثناها" +msgstr "Option" #: src/std-types.md src/std-types/result.md:1 src/error-handling.md msgid "Result" -msgstr "" +msgstr "Result" #: src/std-types.md src/std-types/string.md:1 msgid "String" @@ -6334,6 +6506,8 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " +"از متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md:3 msgid "" @@ -6341,48 +6515,61 @@ msgid "" "types used by Rust libraries and programs. This way, two libraries can work " "together smoothly because they both use the same `String` type." msgstr "" +"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " +"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " +"استفاده می‌کنند." #: src/std-types/std.md:7 msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." msgstr "" +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " +"`std`." #: src/std-types/std.md:10 msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." msgstr "" +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " +"حتی وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md:12 msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." msgstr "" +"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند " +"`Vec`، `Box` و `Arc`." #: src/std-types/std.md:14 msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" +"برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " +"می‌کنند." #: src/std-types/docs.md:3 msgid "Rust comes with extensive documentation. For example:" -msgstr "" +msgstr "Rust دارای مستندات گسترده‌ای است. به عنوان مثال:" #: src/std-types/docs.md:5 -#, fuzzy msgid "" "All of the details about [loops](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید," +"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/" +"expressions/loop-expr.html)." #: src/std-types/docs.md:7 msgid "" "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." msgstr "" +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." #: src/std-types/docs.md:9 msgid "" @@ -6390,10 +6577,13 @@ msgid "" "option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" "std/collections/struct.BinaryHeap.html)." msgstr "" +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" +"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" +"stable/std/collections/struct.BinaryHeap.html)." #: src/std-types/docs.md:13 msgid "In fact, you can document your own code:" -msgstr "" +msgstr "در واقع، شما می‌توانید کد خود را مستند کنید:" #: src/std-types/docs.md:16 msgid "" @@ -6404,25 +6594,25 @@ msgid "" msgstr "" #: src/std-types/docs.md:27 -#, fuzzy msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" "(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " "idiomatic to document all public items in an API using this pattern." msgstr "" -"محتوا کامنت شده به عنوان `Markdown` در نظر گرفته می‌شود. تمام جعبه‌هایی " -"(Crate) که در راست منتشر می‌شوند به‌طور خودکار با استفاده از ابزار [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) در [`docs.rs`]" -"(https://docs.rs) مستند می‌شوند. این یک سبک رایج است که تمام آیتم‌های عمومی در " -"یک API با استفاده از این الگو مستند شود. همچنین میتوان قطعه کدهایی شامل نحوه " -"استفاده را مستند کرد و به عنوان تست‌های واحد (unit tests) استفاده خواهند شد." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " +"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " +"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " +"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " +"رایج مرسوم است." #: src/std-types/docs.md:32 msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" msgstr "" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " +"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md:36 msgid "" @@ -6431,13 +6621,12 @@ msgid "" msgstr "" #: src/std-types/docs.md:42 -#, fuzzy msgid "" "Show students the generated docs for the `rand` crate at ." msgstr "" -"دانشجویان را با مستندات تولید شده برای جعبه `rand` در [`docs.rs/rand`]" -"(https://docs.rs/rand) آشنا کنید." +"مستندات تولیدشده برای `rand` crate را در به " +"دانش‌آموزان نشان دهید." #: src/std-types/option.md:3 msgid "" @@ -6445,6 +6634,10 @@ msgid "" "type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" "stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" +"ما قبلاً برخی استفاده‌ها از `` often has the same size in " "memory as `T`." msgstr "" +"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" +"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، " +"هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/" +"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " +"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md:30 msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." msgstr "" +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " +"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md:32 msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." msgstr "" +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " +"طول آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md:34 msgid "" @@ -6597,57 +6821,74 @@ msgid "" "to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " +"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." +"html)." #: src/std-types/string.md:37 msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " +"باشد." #: src/std-types/string.md:39 msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" +"زمانی که یک تایپ، `` which transparently gives it " "access to `str`'s methods." msgstr "" +"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/" +"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " +"متدهای برش را بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md:38 msgid "" @@ -6701,6 +6952,9 @@ msgid "" "it contains is stored on the heap. This means the amount of data doesn't " "need to be known at compile time. It can grow or shrink at runtime." msgstr "" +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " +"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " +"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md:41 msgid "" @@ -6708,12 +6962,17 @@ msgid "" "explicitly. As always with Rust type inference, the `T` was established " "during the first `push` call." msgstr "" +"توجه داشته باشید که ``]" +"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " +"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md:65 msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." msgstr "" +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " +"تولید می‌کند، ساخته شود." #: src/std-types/hashmap.md:67 msgid "" @@ -6817,12 +7090,17 @@ msgid "" "examples easier. Using references in collections can, of course, be done, " "but it can lead into complications with the borrow checker." msgstr "" +"ما `=`, and `>` operators." msgstr "" +"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " +"ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md:49 msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." msgstr "" +"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md:54 msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" msgstr "" +"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " +"بازتابی است:" #: src/std-traits/comparisons.md:69 msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." msgstr "" +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " +"آن‌ها به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md:3 msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." "rust-lang.org/std/ops/index.html):" msgstr "" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." +"org/std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md:23 msgid "\"{:?} + {:?} = {:?}\"" -msgstr "" +msgstr "\"{:?} + {:?} = {:?}\"" #: src/std-traits/operators.md:30 src/memory-management/drop.md:48 msgid "Discussion points:" -msgstr "" +msgstr "نکات بحث:" #: src/std-traits/operators.md:32 msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " +"مفید است؟" #: src/std-traits/operators.md:33 msgid "" @@ -6991,12 +7304,17 @@ msgid "" "the operator is not `Copy`, you should consider overloading the operator for " "`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" +"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " +"بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " +"بگیرید. این کار از ایجاد کپی‌های غیرضروری در محل فراخوانی جلوگیری می‌کند." #: src/std-traits/operators.md:36 msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " +"متد تعریف کرد؟" #: src/std-traits/operators.md:38 msgid "" @@ -7004,12 +7322,16 @@ msgid "" "associated types (like `Output`) are controlled by the implementer of a " "trait." msgstr "" +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " +"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md:41 msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." msgstr "" +"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " +"Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." #: src/std-traits/from-and-into.md:3 msgid "" @@ -7017,10 +7339,13 @@ msgid "" "html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " "facilitate type conversions:" msgstr "" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " +"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md:11 src/std-traits/from-and-into.md:23 msgid "\"{s}, {addr}, {one}, {bigger}\"" -msgstr "" +msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md:15 msgid "" @@ -7028,12 +7353,17 @@ msgid "" "automatically implemented when [`From`](https://doc.rust-lang.org/std/" "convert/trait.From.html) is implemented:" msgstr "" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" +"trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md:30 msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." msgstr "" +"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " +"پیاده‌سازی `Into` را نیز دریافت می‌کند." #: src/std-traits/from-and-into.md:32 msgid "" @@ -7042,24 +7372,30 @@ msgid "" "Your function will accept types that implement `From` and those that _only_ " "implement `Into`." msgstr "" +"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " +"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " +"پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md:3 msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." msgstr "" +"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " +"می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." #: src/std-traits/casting.md:9 msgid "\"as u16: {}\"" -msgstr "" +msgstr "\"as u16: {}\"" #: src/std-traits/casting.md:10 msgid "\"as i16: {}\"" -msgstr "" +msgstr "\"as i16: {}\"" #: src/std-traits/casting.md:11 msgid "\"as u8: {}\"" -msgstr "" +msgstr "\"as u8: {}\"" #: src/std-traits/casting.md:15 msgid "" @@ -7067,6 +7403,9 @@ msgid "" "platforms. This might not match your intuition for changing sign or casting " "to a smaller type -- check the docs, and comment for clarity." msgstr "" +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " +"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " +"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md:19 msgid "" @@ -7077,6 +7416,12 @@ msgid "" "selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " "was in the high bits)." msgstr "" +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " +"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " +"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " +"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " +"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " +"بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md:25 msgid "" @@ -7085,10 +7430,15 @@ msgid "" "casts, `TryFrom` and `TryInto` are available when you want to handle casts " "that fit differently from those that don't." msgstr "" +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " +"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " +"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " +"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " +"کنید." #: src/std-traits/casting.md:33 msgid "Consider taking a break after this slide." -msgstr "" +msgstr "در نظر داشته باشید که پس از این اسلاید استراحت کنید." #: src/std-traits/casting.md:35 msgid "" @@ -7096,10 +7446,15 @@ msgid "" "be lost is generally discouraged, or at least deserves an explanatory " "comment." msgstr "" +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " +"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " +"دارد." #: src/std-traits/casting.md:38 msgid "This is common in casting integers to `usize` for use as an index." msgstr "" +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " +"است." #: src/std-traits/read-and-write.md:3 msgid "" @@ -7107,94 +7462,111 @@ msgid "" "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " "abstract over `u8` sources:" msgstr "" +"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " +"بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md:14 msgid "b\"foo\\nbar\\nbaz\\n\"" -msgstr "" +msgstr "b\"foo\\nbar\\nbaz\\n\"" #: src/std-traits/read-and-write.md:15 msgid "\"lines in slice: {}\"" -msgstr "" +msgstr "\"lines in slice: {}\"" #: src/std-traits/read-and-write.md:18 msgid "\"lines in file: {}\"" -msgstr "" +msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md:23 msgid "" "Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " "you abstract over `u8` sinks:" msgstr "" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " +"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md:30 msgid "\"\\n\"" -msgstr "" +msgstr "\"\\n\"" #: src/std-traits/read-and-write.md:37 msgid "\"Logged: {:?}\"" -msgstr "" +msgstr "\"Logged: {:?}\"" #: src/std-traits/default.md:1 msgid "The `Default` Trait" -msgstr "" +msgstr "The `Default` Trait" #: src/std-traits/default.md:3 msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md:18 msgid "\"John Smith\"" -msgstr "" +msgstr "\"John Smith\"" #: src/std-traits/default.md:24 msgid "\"{default_struct:#?}\"" -msgstr "" +msgstr "\"{default_struct:#?}\"" #: src/std-traits/default.md:27 msgid "\"Y is set!\"" -msgstr "" +msgstr "\"Y is set!\"" #: src/std-traits/default.md:28 msgid "\"{almost_default_struct:#?}\"" -msgstr "" +msgstr "\"{almost_default_struct:#?}\"" #: src/std-traits/default.md:31 src/lifetimes/exercise.md:197 #: src/lifetimes/solution.md:196 msgid "\"{:#?}\"" -msgstr "" +msgstr "\"{:#?}\"" #: src/std-traits/default.md:38 msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" +"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق " +"`[derive(Default)]#` به صورت خودکار تولید شود." #: src/std-traits/default.md:39 msgid "" "A derived implementation will produce a value where all fields are set to " "their default values." msgstr "" +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " +"پیش‌فرض خود تنظیم شده‌اند." #: src/std-traits/default.md:41 msgid "This means all types in the struct must implement `Default` too." msgstr "" +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " +"پیاده‌سازی کنند." #: src/std-traits/default.md:42 msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." msgstr "" +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " +"(مثل `0`، `\"\"` و غیره)." #: src/std-traits/default.md:44 msgid "The partial struct initialization works nicely with default." -msgstr "" +msgstr "مقداردهی جزئی ساختارها با `Default` به خوبی کار می‌کند." #: src/std-traits/default.md:45 msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " +"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md:47 msgid "" @@ -7202,6 +7574,9 @@ msgid "" "book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" "with-struct-update-syntax)." msgstr "" +"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" +"struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md:3 msgid "" @@ -7210,23 +7585,27 @@ msgid "" "html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " "[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " +"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" +"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." +"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " +"هستند:" #: src/std-traits/closures.md:10 -#, fuzzy msgid "\"Calling function on {input}\"" -msgstr "فراخوانی متدهای ناامن" +msgstr "\"Calling function on {input}\"" #: src/std-traits/closures.md:16 src/std-traits/closures.md:17 msgid "\"add_3: {}\"" -msgstr "" +msgstr "\"add_3: {}\"" #: src/std-traits/closures.md:24 src/std-traits/closures.md:25 msgid "\"accumulate: {}\"" -msgstr "" +msgstr "\"accumulate: {}\"" #: src/std-traits/closures.md:28 msgid "\"multiply_sum: {}\"" -msgstr "" +msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md:35 msgid "" @@ -7234,18 +7613,25 @@ msgid "" "perhaps captures nothing at all. It can be called multiple times " "concurrently." msgstr "" +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " +"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " +"چندین بار فراخوانی شود." #: src/std-traits/closures.md:38 msgid "" "An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " "multiple times, but not concurrently." msgstr "" +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " +"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md:41 msgid "" "If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " "might consume captured values." msgstr "" +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " +"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md:44 msgid "" @@ -7253,6 +7639,10 @@ msgid "" "I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " "use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " +"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " +"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " +"کنید." #: src/std-traits/closures.md:48 msgid "" @@ -7260,37 +7650,49 @@ msgid "" "you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " "the most flexibility for the caller." msgstr "" +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " +"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " +"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " +"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md:52 msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " "(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." msgstr "" +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " +"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " +"`FnOnce`." #: src/std-traits/closures.md:55 msgid "" "The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " "`multiply_sum`), depending on what the closure captures." msgstr "" +"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال " +"`multiply_sum`) را بر اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." #: src/std-traits/closures.md:58 msgid "" "By default, closures will capture by reference if they can. The `move` " "keyword makes them capture by value." msgstr "" +"به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " +"می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " +"value) بگیرند." #: src/std-traits/closures.md:63 src/smart-pointers/trait-objects.md:93 #: src/smart-pointers/trait-objects.md:94 msgid "\"{} {}\"" -msgstr "" +msgstr "\"{} {}\"" #: src/std-traits/closures.md:67 msgid "\"Hi\"" -msgstr "" +msgstr "\"Hi\"" #: src/std-traits/closures.md:68 msgid "\"Greg\"" -msgstr "" +msgstr "\"Greg\"" #: src/std-traits/exercise.md:3 msgid "" @@ -7299,29 +7701,35 @@ msgid "" "implement the missing bits. Only rotate ASCII alphabetic characters, to " "ensure the result is still valid UTF-8." msgstr "" +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." +"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " +"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " +"تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md:15 msgid "// Implement the `Read` trait for `RotDecoder`.\n" -msgstr "" +msgstr "// Implement the `Read` trait for `RotDecoder`.\n" #: src/std-traits/exercise.md:20 src/std-traits/exercise.md:33 #: src/std-traits/solution.md:26 src/std-traits/solution.md:39 msgid "\"Gb trg gb gur bgure fvqr!\"" -msgstr "" +msgstr "\"Gb trg gb gur bgure fvqr!\"" #: src/std-traits/exercise.md:36 src/std-traits/solution.md:42 msgid "\"To get to the other side!\"" -msgstr "" +msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md:55 msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" msgstr "" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " +"۱۳ کاراکتر را بچرخانند؟" #: src/std-traits/solution.md:16 msgid "'A'" -msgstr "" +msgstr "'A'" #: src/welcome-day-3.md msgid "Welcome to Day 3" From c0ce30d59713c3635ef4b2226a4d230f1f0f6a14 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 14 Aug 2024 15:19:29 +0330 Subject: [PATCH 18/92] add extra space to po.fa --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 2e62ed00172..9730163e826 100644 --- a/po/fa.po +++ b/po/fa.po @@ -22647,4 +22647,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" \ No newline at end of file +#~ msgstr "تطبیق الگو" From 809b58fa39aa4bf0c7f2485d8c24d50c42d407b6 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Sun, 18 Aug 2024 00:16:50 +0330 Subject: [PATCH 19/92] Update fa.po check for action pass --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 9730163e826..579030c243e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -22631,7 +22631,7 @@ msgstr "" #, fuzzy #~ msgid "trait:" -#~ msgstr "صفت‌ها" +#~ msgstr "trait:" #, fuzzy #~ msgid "union:" From d6124ab1a7246d59e9b2411b812f02d3a282a6ec Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Mon, 19 Aug 2024 21:29:45 +0000 Subject: [PATCH 20/92] update concurrency fa --- po/fa.po | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/po/fa.po b/po/fa.po index 579030c243e..50868026185 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1314,7 +1314,7 @@ msgstr "Select" #: src/SUMMARY.md src/running-the-course/course-structure.md:164 #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" -msgstr "مشکل‌ها" +msgstr "Pitfallها" #: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" @@ -1475,10 +1475,10 @@ msgid "" "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"[Concurrency](concurrency.md): یک کلاس تمام روز درباره همزمانی در Rust. ما " -"هر همزمانی کلاسیک (برنامه ریزی پیشگیرانه با استفاده از موضوعات و mutexes) و " -"async / await concurrency (چند وظیفه ای تعاونی با استفاده از اینده) را پوشش " -"می دهیم." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " +"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " +"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " +"استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1956,8 +1956,8 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی " -"کلاسیک و همچنین همزمانی `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " +"شامل همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md:135 msgid "" @@ -1994,7 +1994,7 @@ msgstr "۲۰ دقیقه" #: src/running-the-course/course-structure.md:153 src/concurrency/welcome.md msgid "Send and Sync" -msgstr "ارسال و همگام سازی" +msgstr "ارسال و همگام‌سازی" #: src/running-the-course/course-structure.md:158 msgid "Afternoon (3 hours and 20 minutes, including breaks)" @@ -18034,13 +18034,14 @@ msgstr "" #: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" -msgstr "" +msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." -msgstr "" +"زبان Rust به طور کامل از concurrency در سطح threadهای سیستم‌عامل با استفاده " +"از mutexها و channelها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" @@ -18048,22 +18049,31 @@ msgid "" "compile time bugs. This is often referred to as _fearless concurrency_ since " "you can rely on the compiler to ensure correctness at runtime." msgstr "" +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " +"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " +"زمان اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " +"بکشد. شامل موارد زیر است:" #: src/concurrency/welcome.md msgid "" "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " +"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." msgstr "" +"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" @@ -18071,6 +18081,10 @@ msgid "" "g., a called function that might mutate an argument or save references to it " "to read later) save us from multi-threading issues." msgstr "" +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " +"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " +"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " +"می‌دهند. " #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -20156,6 +20170,7 @@ msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." msgstr "" +"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -22647,4 +22662,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" +#~ msgstr "تطبیق الگو" \ No newline at end of file From 55dade92835eae385d65a986203cdc6ca3dcbc3d Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Tue, 20 Aug 2024 01:13:20 +0330 Subject: [PATCH 21/92] concurrency fa bug fixed --- po/fa.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 50868026185..d19a17c50dd 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18040,8 +18040,9 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." -"زبان Rust به طور کامل از concurrency در سطح threadهای سیستم‌عامل با استفاده " -"از mutexها و channelها پشتیبانی می‌کند." +msgstr "" +"‏ Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل " +" با استفاده از mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" From ab46d0b56dbd6fa07a04152cbf5d8c8c2983871b Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Tue, 20 Aug 2024 01:18:24 +0330 Subject: [PATCH 22/92] fixed typo on fa concurrency --- po/fa.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index d19a17c50dd..b534f9013aa 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18040,9 +18040,9 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." -msgstr "" -"‏ Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل " -" با استفاده از mutex ها و channel ها پشتیبانی می‌کند." +msgid "" +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " +"از mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" From 32fee8930a6bf277598680bd77af9d2a04be821d Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Tue, 20 Aug 2024 01:21:30 +0330 Subject: [PATCH 23/92] concurrency typo --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index b534f9013aa..66c5c27d7de 100644 --- a/po/fa.po +++ b/po/fa.po @@ -22663,4 +22663,4 @@ msgstr "" #, fuzzy #~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" \ No newline at end of file +#~ msgstr "تطبیق الگو" From 4e3b0946f51356d3537a63ee549dd3d08ee1688d Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Tue, 20 Aug 2024 01:24:24 +0330 Subject: [PATCH 24/92] concurrency fa error fixed --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 66c5c27d7de..b9fe935223a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18040,7 +18040,7 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." -msgid "" +msgstr "" "زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " "از mutex ها و channel ها پشتیبانی می‌کند." From babc8e06f81de41153a9f832496700e705933e00 Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 21 Aug 2024 00:03:17 +0330 Subject: [PATCH 25/92] concurrency threads fa --- po/fa.po | 91 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/po/fa.po b/po/fa.po index b9fe935223a..f54e1009ce5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -6766,7 +6766,7 @@ msgstr "" #: src/testing/unit-tests.md:32 src/testing/unit-tests.md:37 #: src/concurrency/threads/scoped.md:9 src/concurrency/threads/scoped.md:26 msgid "\"Hello\"" -msgstr "" +msgstr "\"سلام\"" #: src/std-types/string.md:9 msgid "\"s1: len = {}, capacity = {}\"" @@ -18090,177 +18090,215 @@ msgstr "" #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md msgid "This segment should take about 30 minutes. It contains:" -msgstr "" +msgstr "این بخش باید حدود ۳۰ دقیقه طول بکشد و شامل موارد زیر است:" #: src/concurrency/threads/plain.md:3 msgid "Rust threads work similarly to threads in other languages:" -msgstr "" +msgstr " threadهای Rust مانند threadها در زبان‌های دیگر کار می‌کنند:" #: src/concurrency/threads/plain.md:12 msgid "\"Count in thread: {i}!\"" -msgstr "" +msgstr "\"شمارنده thread: {i}!\"" #: src/concurrency/threads/plain.md:18 msgid "\"Main thread: {i}\"" -msgstr "" +msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md:24 msgid "Threads are all daemon threads, the main thread does not wait for them." -msgstr "" +msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #: src/concurrency/threads/plain.md:25 msgid "Thread panics are independent of each other." -msgstr "" +msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md:26 msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " +"کرد." #: src/concurrency/threads/plain.md:31 msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " +"آن‌ها است." #: src/concurrency/threads/plain.md:33 msgid "Run the example." -msgstr "" +msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md:34 msgid "" "5ms timing is loose enough that main and spawned threads stay mostly in " "lockstep." msgstr "" +"زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " +"عمدتاً همگام می‌مانند." #: src/concurrency/threads/plain.md:36 msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " +"پایان می‌رسد!" #: src/concurrency/threads/plain.md:37 msgid "" "This is because main ends the program and spawned threads do not make it " "persist." msgstr "" +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " +"تداوم آن نمی‌شوند." #: src/concurrency/threads/plain.md:39 msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." -msgstr "" +msgstr "در مقابسه با pthreads/C++ std::thread/boost::thread اگر مطلوب باشد." #: src/concurrency/threads/plain.md:41 msgid "How do we wait around for the spawned thread to complete?" -msgstr "" +msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل شود؟" #: src/concurrency/threads/plain.md:42 msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. Look at the docs." msgstr "" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md:43 msgid "" "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) method that blocks." msgstr "" +"`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) متد آن بلاک‌ها." #: src/concurrency/threads/plain.md:45 msgid "" "Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " "the thread to finish and have the program count all the way to 10." msgstr "" +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " +"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md:48 msgid "Now what if we want to return a value?" -msgstr "" +msgstr "حالا اگر بخواهیم مقداری را برگردانیم چه؟" #: src/concurrency/threads/plain.md:49 msgid "Look at docs again:" -msgstr "" +msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md:50 msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" msgstr "" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" #: src/concurrency/threads/plain.md:51 msgid "" "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) returns `thread::Result`" msgstr "" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md:53 msgid "" "Use the `Result` return value from `handle.join()` to get access to the " "returned value." msgstr "" +"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md:56 msgid "Ok, what about the other case?" -msgstr "" +msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md:57 msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" +"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md:58 msgid "" "Access the panic payload. This is a good time to talk about [`Any`](https://" "doc.rust-lang.org/std/any/index.html)." msgstr "" +"دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" +"(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md:60 msgid "Now we can return values from threads! What about taking inputs?" msgstr "" +"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md:61 msgid "Capture something by reference in the thread closure." -msgstr "" +msgstr "چیزی را از طریق reference در بسته‌بندی thread ثبت کنید." #: src/concurrency/threads/plain.md:62 msgid "An error message indicates we must move it." -msgstr "" +msgstr "یک پیغام خطا نشان می‌دهد که باید آن را جابجا کنیم." #: src/concurrency/threads/plain.md:63 msgid "Move it in, see we can compute and then return a derived value." msgstr "" +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " +"مشتق شده را برگردانیم." #: src/concurrency/threads/plain.md:65 msgid "If we want to borrow?" -msgstr "" +msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md:66 msgid "" "Main kills child threads when it returns, but another function would just " "return and leave them running." msgstr "" +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " +"return می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md:68 msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " +"نقض می‌کند!" #: src/concurrency/threads/plain.md:69 msgid "How do we avoid this? see next slide." -msgstr "" +msgstr "چگونه از آن جلوگیری کنیم؟ صفحه بعدی را ببینید." #: src/concurrency/threads/scoped.md:3 msgid "Normal threads cannot borrow from their environment:" -msgstr "" +msgstr "‏thread‌های معمولی نمی‌توانند از محیط خود قرض (borrow) بگیرند:" #: src/concurrency/threads/scoped.md:20 msgid "" "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" "fn.scope.html) for this:" msgstr "" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" +"std/thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md:41 msgid "" "The reason for that is that when the `thread::scope` function completes, all " "the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " +"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md:43 msgid "" "Normal Rust borrowing rules apply: you can either borrow mutably by one " "thread, or immutably by any number of threads." msgstr "" +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " +"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " +"بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -18969,6 +19007,12 @@ msgid "" "per-task overhead is typically very low and operating systems provide " "primitives for efficiently identifying I/O that is able to proceed." msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " +"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " +"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " +"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " +"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " +"ادامه هستند فراهم می‌کنند." #: src/concurrency/welcome-async.md msgid "" @@ -18976,12 +19020,17 @@ msgid "" "that may be completed in the future. Futures are \"polled\" until they " "signal that they are complete." msgstr "" +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " +"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " +"ندهند، «polled» می‌شوند." #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " +"دسترس هستند." #: src/concurrency/welcome-async.md msgid "" @@ -18989,6 +19038,9 @@ msgid "" "callback-based, and not polled. Async Python programs require a \"loop\", " "similar to a runtime in Rust." msgstr "" +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " +"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " +"runtime در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" @@ -18996,6 +19048,9 @@ msgid "" "runtime implements the event loop, so many of the details of Promise " "resolution are hidden." msgstr "" +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " +"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " +"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" From 6129d59898eb61d8def8fa277978fb5c2f287523 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 22 Aug 2024 00:30:06 +0330 Subject: [PATCH 26/92] concurrency send-sync translate to fa --- po/fa.po | 145 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 114 insertions(+), 31 deletions(-) diff --git a/po/fa.po b/po/fa.po index f54e1009ce5..74fcb4405fb 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18390,18 +18390,25 @@ msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ " +"در دو ویژگی است:" #: src/concurrency/send-sync/marker-traits.md:6 msgid "" "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " "is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" +"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " +"جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md:8 msgid "" "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " "is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" +"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " +"`Sync` است." #: src/concurrency/send-sync/marker-traits.md:11 msgid "" @@ -18410,22 +18417,31 @@ msgid "" "only contain `Send` and `Sync` types. You can also implement them manually " "when you know it is valid." msgstr "" +"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits." +"md). کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که " +"فقط دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت " +"دستی پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md:22 msgid "" "One can think of these traits as markers that the type has certain thread-" "safety properties." msgstr "" +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" +"safety خاصی را دارد." + #: src/concurrency/send-sync/marker-traits.md:24 msgid "They can be used in the generic constraints as normal traits." -msgstr "" +msgstr "آنها را می‌توان در محدودیت‌های generic به عنوان trait عادی استفاده کرد." #: src/concurrency/send-sync/send.md:3 msgid "" "A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " "if it is safe to move a `T` value to another thread." msgstr "" +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" +"doc.rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md:5 msgid "" @@ -18433,26 +18449,35 @@ msgid "" "run in that thread. So the question is when you can allocate a value in one " "thread and deallocate it in another." msgstr "" +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " +"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " +"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " +"thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md:14 msgid "" "As an example, a connection to the SQLite library must only be accessed from " "a single thread." msgstr "" +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " +"باشد." #: src/concurrency/send-sync/sync.md:3 msgid "" "A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " "if it is safe to access a `T` value from multiple threads at the same time." msgstr "" +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." +"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " +"همزمان امن باشد." #: src/concurrency/send-sync/sync.md:6 msgid "More precisely, the definition is:" -msgstr "" +msgstr "به طور دقیق‌تر، تعریف این طور است:" #: src/concurrency/send-sync/sync.md:8 msgid "`T` is `Sync` if and only if `&T` is `Send`" -msgstr "" +msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد." #: src/concurrency/send-sync/sync.md:15 msgid "" @@ -18460,6 +18485,9 @@ msgid "" "thread-safe for shared use, it is also thread-safe to pass references of it " "across threads." msgstr "" +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " +"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " +"امن است." #: src/concurrency/send-sync/sync.md:19 msgid "" @@ -18469,109 +18497,128 @@ msgid "" "is also safe to move to another thread, because the data it references can " "be accessed from any thread safely." msgstr "" +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " +"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " +"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " +"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " +"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md:3 msgid "`Send + Sync`" -msgstr "" +msgstr "`Send + Sync`" #: src/concurrency/send-sync/examples.md:5 msgid "Most types you come across are `Send + Sync`:" -msgstr "" +msgstr "اکثر انواعی که با آنها روبرو می شوید `Send + Sync` هستند:" #: src/concurrency/send-sync/examples.md:7 msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..." -msgstr "" +msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." #: src/concurrency/send-sync/examples.md:8 msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." -msgstr "" +msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." #: src/concurrency/send-sync/examples.md:9 msgid "`String`, `Option`, `Vec`, `Box`, ..." -msgstr "" +msgstr "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." #: src/concurrency/send-sync/examples.md:10 msgid "`Arc`: Explicitly thread-safe via atomic reference count." -msgstr "" +msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md:11 msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "" +"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md:12 msgid "`mpsc::Sender`: As of 1.72.0." -msgstr "" +msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md:13 msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "" +msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md:15 msgid "" "The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." msgstr "" +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." +"`Send + Sync`." #: src/concurrency/send-sync/examples.md:18 msgid "`Send + !Sync`" -msgstr "" +msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md:20 msgid "" "These types can be moved to other threads, but they're not thread-safe. " "Typically because of interior mutability:" msgstr "" +"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " +"معمول به دلیل تغییرپذیری داخلی(interior mutability):" #: src/concurrency/send-sync/examples.md:23 msgid "`mpsc::Receiver`" -msgstr "" +msgstr "`mpsc::Receiver`" #: src/concurrency/send-sync/examples.md:24 msgid "`Cell`" -msgstr "" +msgstr "`Cell`" #: src/concurrency/send-sync/examples.md:25 msgid "`RefCell`" -msgstr "" +msgstr "`RefCell`" #: src/concurrency/send-sync/examples.md:27 msgid "`!Send + Sync`" -msgstr "" +msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md:29 msgid "" "These types are thread-safe, but they cannot be moved to another thread:" msgstr "" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md:31 msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " "the thread which created them." msgstr "" +"‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " +"threadای که آنها را ایجاد کرده است، توزیع شوند." #: src/concurrency/send-sync/examples.md:34 msgid "`!Send + !Sync`" -msgstr "" +msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md:36 msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md:38 msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " +"مراجع غیر atomic است." #: src/concurrency/send-sync/examples.md:40 msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " +"است ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" -msgstr "Shared State" +msgstr "Arc" #: src/concurrency/shared-state.md msgid "Mutex" @@ -18582,44 +18629,55 @@ msgid "" "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " "read-only access via `Arc::clone`:" msgstr "" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " +"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md:16 msgid "\"{thread_id:?}: {v:?}\"" -msgstr "" +msgstr "\"{thread_id:?}: {v:?}\"" #: src/concurrency/shared-state/arc.md:21 #: src/concurrency/shared-state/example.md:17 #: src/concurrency/shared-state/example.md:46 msgid "\"v: {v:?}\"" -msgstr "" +msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md:30 msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " +"عملیات atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md:32 msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." msgstr "" +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " +"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " +"آنها را پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md:34 msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" +"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن " +"استفاده از `T` آزاد است." #: src/concurrency/shared-state/arc.md:36 msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" +"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " +"استفاده نمی‌کند." #: src/concurrency/shared-state/arc.md:38 msgid "`std::sync::Weak` can help." -msgstr "" +msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md:3 msgid "" @@ -18628,11 +18686,15 @@ msgid "" "interface (another form of [interior mutability](../../borrowing/interior-" "mutability.md)):" msgstr "" +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " +"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " +"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" +"borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md:12 #: src/concurrency/shared-state/mutex.md:19 msgid "\"v: {:?}\"" -msgstr "" +msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md:23 msgid "" @@ -18640,38 +18702,49 @@ msgid "" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " "implementation." msgstr "" +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " +"کامل آن داریم." #: src/concurrency/shared-state/mutex.md:33 msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." msgstr "" +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " +"(protected) به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md:35 msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." msgstr "" +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " +"فراموش کرد." #: src/concurrency/shared-state/mutex.md:37 msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " +"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md:39 msgid "" "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " "implements `Send`." msgstr "" +"‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " +"استفاده‌ می‌کنند." #: src/concurrency/shared-state/mutex.md:41 msgid "A read-write lock counterpart: `RwLock`." -msgstr "" +msgstr "‏ همتای قفل خواندن و نوشتن: `RwLock`." #: src/concurrency/shared-state/mutex.md:42 msgid "Why does `lock()` return a `Result`?" -msgstr "" +msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md:43 msgid "" @@ -18681,46 +18754,56 @@ msgid "" "[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " "You can call `into_inner()` on the error to recover the data regardless." msgstr "" +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" +"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " +"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " +"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " +"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " +"فراخوانی کنید." #: src/concurrency/shared-state/example.md:3 msgid "Let us see `Arc` and `Mutex` in action:" -msgstr "" +msgstr "اجازه دهید `Arc` و `Mutex` را در عمل ببینیم:" #: src/concurrency/shared-state/example.md:6 msgid "// use std::sync::{Arc, Mutex};\n" -msgstr "" +msgstr "// use std::sync::{Arc, Mutex};\n" #: src/concurrency/shared-state/example.md:24 msgid "Possible solution:" -msgstr "" +msgstr "راه‌حل ممکن:" #: src/concurrency/shared-state/example.md:50 msgid "Notable parts:" -msgstr "" +msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md:52 msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." -msgstr "" +msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md:54 msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " +"قابل تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md:56 msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " +"منتقل کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md:58 msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." -msgstr "" +msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md:3 msgid "The dining philosophers problem is a classic problem in concurrency:" From 5fc9daf5dc046107146a9ad754f94a658c3ae3bb Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 22 Aug 2024 00:35:18 +0330 Subject: [PATCH 27/92] bug fixed on concurrency/send-sync to fa --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 74fcb4405fb..07497d38797 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18529,7 +18529,7 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md:11 msgid "`Mutex`: Explicitly thread-safe via internal locking." -"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md:12 msgid "`mpsc::Sender`: As of 1.72.0." From 9db83cc7dc44607788f430332af9207d36ed0118 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 22 Aug 2024 00:44:05 +0330 Subject: [PATCH 28/92] typo fixed --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 07497d38797..4710d046a97 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18391,7 +18391,7 @@ msgid "" "two traits:" msgstr "" "‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ " -"در دو ویژگی است:" +"در دو trait است:" #: src/concurrency/send-sync/marker-traits.md:6 msgid "" From ddbbe079411b0298aa526a782fec1a32ce43537e Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 22 Aug 2024 00:52:31 +0330 Subject: [PATCH 29/92] dprint fixed ro for concurrency/send-sync --- po/fa.po | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/po/fa.po b/po/fa.po index 4710d046a97..d32319be2ac 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18390,8 +18390,8 @@ msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ " -"در دو trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " +"دو trait است:" #: src/concurrency/send-sync/marker-traits.md:6 msgid "" @@ -18417,10 +18417,10 @@ msgid "" "only contain `Send` and `Sync` types. You can also implement them manually " "when you know it is valid." msgstr "" -"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits." -"md). کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که " -"فقط دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت " -"دستی پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " +"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " +"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md:22 msgid "" @@ -18430,7 +18430,6 @@ msgstr "" "می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" "safety خاصی را دارد." - #: src/concurrency/send-sync/marker-traits.md:24 msgid "They can be used in the generic constraints as normal traits." msgstr "آنها را می‌توان در محدودیت‌های generic به عنوان trait عادی استفاده کرد." @@ -18529,7 +18528,8 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md:11 msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "" +"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md:12 msgid "`mpsc::Sender`: As of 1.72.0." @@ -18537,7 +18537,8 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md:13 msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "" +"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md:15 msgid "" From 1310689e3f19229e061942825b4ce27c40fd7d41 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 22 Aug 2024 00:55:20 +0330 Subject: [PATCH 30/92] dprint fixed for concurrency/send-sync --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index d32319be2ac..71817d4bf40 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18545,8 +18545,8 @@ msgid "" "The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." -"`Send + Sync`." +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " +"هستند.`Send + Sync`." #: src/concurrency/send-sync/examples.md:18 msgid "`Send + !Sync`" From 3223eacafbc494c25e1c9e56b400c62f4e2a6d22 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 23 Aug 2024 00:16:35 +0330 Subject: [PATCH 31/92] concurrency/sync-exercises translated to Fa --- po/fa.po | 131 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 101 insertions(+), 30 deletions(-) diff --git a/po/fa.po b/po/fa.po index 71817d4bf40..a8a72c9c74e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -18808,7 +18808,7 @@ msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا #: src/concurrency/sync-exercises/dining-philosophers.md:3 msgid "The dining philosophers problem is a classic problem in concurrency:" -msgstr "" +msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک مسئله کلاسیک concurrency است:" #: src/concurrency/sync-exercises/dining-philosophers.md:5 msgid "" @@ -18821,6 +18821,14 @@ msgid "" "not eating. After an individual philosopher finishes eating, they will put " "down both forks." msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " +"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " +"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " +"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " +"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " +"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " +"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " +"پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md:13 msgid "" @@ -18828,6 +18836,9 @@ msgid "" "for this exercise. Copy the code below to a file called `src/main.rs`, fill " "out the blanks, and test that `cargo run` does not deadlock:" msgstr "" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " +"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " +"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md:28 #: src/concurrency/async-exercises/dining-philosophers.md:23 @@ -18836,86 +18847,92 @@ msgid "" " // right_fork: ...\n" " // thoughts: ...\n" msgstr "" +"// left_fork: ...\n" +" // right_fork: ...\n" +" // thoughts: ...\n" #: src/concurrency/sync-exercises/dining-philosophers.md:36 #: src/concurrency/sync-exercises/solutions.md:22 #: src/concurrency/async-exercises/dining-philosophers.md:31 #: src/concurrency/async-exercises/solutions.md:23 msgid "\"Eureka! {} has a new idea!\"" -msgstr "" +msgstr "\"ایول! {} یک ایده جدید!\"" #: src/concurrency/sync-exercises/dining-philosophers.md:41 #: src/concurrency/async-exercises/solutions.md:31 +#, fuzzy msgid "// Pick up forks...\n" -msgstr "" +msgstr "// Pick up forks...\n" #: src/concurrency/sync-exercises/dining-philosophers.md:42 #: src/concurrency/sync-exercises/solutions.md:31 #: src/concurrency/async-exercises/dining-philosophers.md:38 #: src/concurrency/async-exercises/solutions.md:51 msgid "\"{} is eating...\"" -msgstr "" +msgstr "\"{} is eating...\"" #: src/concurrency/sync-exercises/dining-philosophers.md:48 #: src/concurrency/sync-exercises/solutions.md:37 #: src/concurrency/async-exercises/dining-philosophers.md:44 #: src/concurrency/async-exercises/solutions.md:59 msgid "\"Socrates\"" -msgstr "" +msgstr "\"Socrates\"" #: src/concurrency/sync-exercises/dining-philosophers.md:48 #: src/concurrency/sync-exercises/solutions.md:37 #: src/concurrency/async-exercises/dining-philosophers.md:44 #: src/concurrency/async-exercises/solutions.md:59 msgid "\"Hypatia\"" -msgstr "" +msgstr "\"Hypatia\"" #: src/concurrency/sync-exercises/dining-philosophers.md:48 #: src/concurrency/sync-exercises/solutions.md:37 #: src/concurrency/async-exercises/dining-philosophers.md:44 #: src/concurrency/async-exercises/solutions.md:59 msgid "\"Plato\"" -msgstr "" +msgstr "\"Plato\"" #: src/concurrency/sync-exercises/dining-philosophers.md:48 #: src/concurrency/sync-exercises/solutions.md:37 #: src/concurrency/async-exercises/dining-philosophers.md:44 #: src/concurrency/async-exercises/solutions.md:59 +#, fuzzy msgid "\"Aristotle\"" -msgstr "" +msgstr "\"Aristotle\"" #: src/concurrency/sync-exercises/dining-philosophers.md:48 #: src/concurrency/sync-exercises/solutions.md:37 #: src/concurrency/async-exercises/dining-philosophers.md:44 #: src/concurrency/async-exercises/solutions.md:59 msgid "\"Pythagoras\"" -msgstr "" +msgstr "\"Pythagoras\"" #: src/concurrency/sync-exercises/dining-philosophers.md:51 #: src/concurrency/async-exercises/dining-philosophers.md:48 #: src/concurrency/async-exercises/solutions.md:63 msgid "// Create forks\n" -msgstr "" +msgstr "// Create forks\n" #: src/concurrency/sync-exercises/dining-philosophers.md:53 #: src/concurrency/async-exercises/dining-philosophers.md:50 #: src/concurrency/async-exercises/solutions.md:67 msgid "// Create philosophers\n" -msgstr "" +msgstr "// Create philosophers\n" #: src/concurrency/sync-exercises/dining-philosophers.md:55 msgid "// Make each of them think and eat 100 times\n" -msgstr "" +msgstr "// Make each of them think and eat 100 times\n" #: src/concurrency/sync-exercises/dining-philosophers.md:57 #: src/concurrency/async-exercises/dining-philosophers.md:54 #: src/concurrency/async-exercises/solutions.md:95 +#, fuzzy msgid "// Output their thoughts\n" -msgstr "" +msgstr "// Output their thoughts\n" #: src/concurrency/sync-exercises/dining-philosophers.md:61 msgid "You can use the following `Cargo.toml`:" -msgstr "" +msgstr "می توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/sync-exercises/dining-philosophers.md:65 msgid "" @@ -18926,6 +18943,12 @@ msgid "" "edition = \"2021\"\n" "```" msgstr "" +"```toml\n" +"[package]\n" +"name = \"dining-philosophers\"\n" +"version = \"0.1.0\"\n" +"edition = \"2021\"\n" +"```" #: src/concurrency/sync-exercises/link-checker.md:3 msgid "" @@ -18934,6 +18957,10 @@ msgid "" "should recursively check other pages on the same domain and keep doing this " "until all pages have been validated." msgstr "" +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " +"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " +"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " +"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md:8 msgid "" @@ -18942,21 +18969,32 @@ msgid "" "(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " "we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " +"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " +"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md:12 +#, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " +"اعلام کنید:" #: src/concurrency/sync-exercises/link-checker.md:22 msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." +"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md:25 msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" +"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md:29 msgid "" @@ -18974,64 +19012,84 @@ msgid "" "thiserror = \"1.0.37\"\n" "```" msgstr "" +"```toml\n" +"[package]\n" +"name = \"link-checker\"\n" +"version = \"0.1.0\"\n" +"edition = \"2021\"\n" +"publish = false\n" +"\n" +"[dependencies]\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" +"scraper = \"0.13.0\"\n" +"thiserror = \"1.0.37\"\n" +"```" #: src/concurrency/sync-exercises/link-checker.md:42 msgid "" "You can now download the start page. Try with a small site such as `https://" "www.google.org/`." msgstr "" +"اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." +"google.org/` امتحان کنید." #: src/concurrency/sync-exercises/link-checker.md:45 msgid "Your `src/main.rs` file should look something like this:" -msgstr "" +msgstr "فایل `src/main.rs` شما باید چیزی شبیه به این باشد:" #: src/concurrency/sync-exercises/link-checker.md:57 #: src/concurrency/sync-exercises/solutions.md:93 msgid "\"request error: {0}\"" -msgstr "" +msgstr "\"request error: {0}\"" #: src/concurrency/sync-exercises/link-checker.md:59 #: src/concurrency/sync-exercises/solutions.md:95 +#, fuzzy msgid "\"bad http response: {0}\"" -msgstr "" +msgstr "\"bad http response: {0}\"" #: src/concurrency/sync-exercises/link-checker.md:70 #: src/concurrency/sync-exercises/solutions.md:106 msgid "\"Checking {:#}\"" -msgstr "" +msgstr "\"بررسی {:#}\"" #: src/concurrency/sync-exercises/link-checker.md:88 #: src/concurrency/sync-exercises/solutions.md:124 msgid "\"href\"" -msgstr "" +msgstr "\"href\"" #: src/concurrency/sync-exercises/link-checker.md:95 #: src/concurrency/sync-exercises/solutions.md:131 +#, fuzzy msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" -msgstr "" +msgstr "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" #: src/concurrency/sync-exercises/link-checker.md:104 #: src/concurrency/sync-exercises/solutions.md:241 msgid "\"https://www.google.org\"" -msgstr "" +msgstr "\"https://www.google.org\"" #: src/concurrency/sync-exercises/link-checker.md:107 msgid "\"Links: {links:#?}\"" -msgstr "" +msgstr "\"Links: {links:#?}\"" #: src/concurrency/sync-exercises/link-checker.md:108 msgid "\"Could not extract links: {err:#}\"" -msgstr "" +msgstr "\"نمی‌تواند لینک را باز کند: {err:#}\"" #: src/concurrency/sync-exercises/link-checker.md:113 msgid "Run the code in `src/main.rs` with" -msgstr "" +msgstr "این کد را در `src/main.rs` اجرا کنید" #: src/concurrency/sync-exercises/link-checker.md:121 msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " +"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " +"بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md:123 msgid "" @@ -19039,48 +19097,61 @@ msgid "" "org` domain. Put an upper limit of 100 pages or so so that you don't end up " "being blocked by the site." msgstr "" +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." +"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " +"نهایت توسط سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md:27 msgid "\"{} is trying to eat\"" -msgstr "" +msgstr "\"{} is trying to eat\"" #: src/concurrency/sync-exercises/solutions.md:51 +#, fuzzy msgid "" "// To avoid a deadlock, we have to break the symmetry\n" " // somewhere. This will swap the forks without deinitializing\n" " // either of them.\n" msgstr "" +"// To avoid a deadlock, we have to break the symmetry\n" +" // somewhere. This will swap the forks without deinitializing\n" +" // either of them.\n" #: src/concurrency/sync-exercises/solutions.md:75 msgid "\"{thought}\"" -msgstr "" +msgstr "\"{thought}\"" #: src/concurrency/sync-exercises/solutions.md:80 msgid "Link Checker" -msgstr "" +msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md:150 +#, fuzzy msgid "" "/// Determine whether links within the given page should be extracted.\n" msgstr "" +"/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md:158 +#, fuzzy msgid "" "/// Mark the given page as visited, returning false if it had already\n" " /// been visited.\n" msgstr "" +"/// Mark the given page as visited, returning false if it had already\n" +" /// been visited.\n" #: src/concurrency/sync-exercises/solutions.md:184 +#, fuzzy msgid "// The sender got dropped. No more commands coming in.\n" -msgstr "" +msgstr "// The sender got dropped. No more commands coming in.\n" #: src/concurrency/sync-exercises/solutions.md:225 msgid "\"Got crawling error: {:#}\"" -msgstr "" +msgstr "\"خطای crawling دریافت شد: {:#}\"" #: src/concurrency/sync-exercises/solutions.md:243 msgid "\"Bad URLs: {:#?}\"" -msgstr "" +msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" From 6f2e353d49006ccdf724f5194765671f7acbd7bc Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 23 Aug 2024 23:39:21 +0330 Subject: [PATCH 32/92] fa: concurrency/async/runtimes translate to Farsi --- po/fa.po | 211 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 176 insertions(+), 35 deletions(-) diff --git a/po/fa.po b/po/fa.po index a8a72c9c74e..182fa690d9a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -19212,46 +19212,60 @@ msgid "async/await" msgstr "async/await" #: src/concurrency/async/async-await.md:3 +#, fuzzy msgid "" "At a high level, async Rust code looks very much like \"normal\" sequential " "code:" msgstr "" +"در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " +"sequential code):" #: src/concurrency/async/async-await.md:10 +#, fuzzy msgid "\"Count is: {i}!\"" -msgstr "" +msgstr "\"Count is: {i}!\"" #: src/concurrency/async/async-await.md:28 msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " +"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md:31 msgid "What is the return type of an async call?" -msgstr "" +msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md:32 msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " +"کنید." #: src/concurrency/async/async-await.md:34 msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." msgstr "" +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " +"یک future جایگزین می‌کند." #: src/concurrency/async/async-await.md:37 msgid "" "You cannot make `main` async, without additional instructions to the " "compiler on how to use the returned future." msgstr "" +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " +"future بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md:40 msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." msgstr "" +"برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که " +"thread رشته فعلی را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." #: src/concurrency/async/async-await.md:43 msgid "" @@ -19264,6 +19278,8 @@ msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " +"مورد در آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md:3 msgid "" @@ -19272,6 +19288,10 @@ msgid "" "complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" "doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " +"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " +"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md:23 msgid "" @@ -19280,30 +19300,42 @@ msgid "" "`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " "joining to it." msgstr "" +"یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " +"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " +"امکان پیوستن (joining) به آن را فراهم کند." #: src/concurrency/async/futures.md:27 msgid "" "The `.await` keyword, applied to a Future, causes the current async function " "to pause until that Future is ready, and then evaluates to its output." msgstr "" +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " +"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md:33 msgid "" "The `Future` and `Poll` types are implemented exactly as shown; click the " "links to show the implementations in the docs." msgstr "" +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " +"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md:36 msgid "" "We will not get to `Pin` and `Context`, as we will focus on writing async " "code, rather than building new async primitives. Briefly:" msgstr "" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " +"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md:39 msgid "" "`Context` allows a Future to schedule itself to be polled again when an " "event occurs." msgstr "" +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " +"poll مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md:42 msgid "" @@ -19311,6 +19343,9 @@ msgid "" "that future remain valid. This is required to allow references to remain " "valid after an `.await`." msgstr "" +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " +"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " +"ماندن پس از `.await` لازم است." #: src/concurrency/async/runtimes.md:3 msgid "" @@ -19318,6 +19353,9 @@ msgid "" "_reactor_) and is responsible for executing futures (an _executor_). Rust " "does not have a \"built-in\" runtime, but several options are available:" msgstr "" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " +"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " +"اما چندین گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md:7 msgid "" @@ -19325,16 +19363,21 @@ msgid "" "functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" "github.com/hyperium/tonic) for gRPC." msgstr "" +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " +"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " +"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md:10 msgid "" "[async-std](https://async.rs/): aims to be a \"std for async\", and includes " "a basic runtime in `async::task`." msgstr "" +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " +"شامل یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md:12 msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" -msgstr "" +msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است." #: src/concurrency/async/runtimes.md:14 msgid "" @@ -19342,6 +19385,9 @@ msgid "" "(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" "async/src/lib.rs) already has one." msgstr "" +"چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " +"[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" +"fuchsia-async/src/lib.rs) اکنون یکی runtime دارد." #: src/concurrency/async/runtimes.md:21 msgid "" @@ -19349,6 +19395,9 @@ msgid "" "playground. The playground also does not permit any I/O, so most interesting " "async things can't run in the playground." msgstr "" +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " +"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " +"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md:25 msgid "" @@ -19357,46 +19406,55 @@ msgid "" "Promises, for example, which will run to completion even if they are never " "used." msgstr "" +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " +"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " +"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " +"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md:3 +#, fuzzy msgid "Tokio provides:" -msgstr "" +msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md:5 msgid "A multi-threaded runtime for executing asynchronous code." msgstr "" +"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md:6 msgid "An asynchronous version of the standard library." -msgstr "" +msgstr "یک asynchronous version کتابخانه‌ای استاندارد است." #: src/concurrency/async/runtimes/tokio.md:7 msgid "A large ecosystem of libraries." -msgstr "" +msgstr "اکوسیستم بزرگی از کتابخانه‌ها." #: src/concurrency/async/runtimes/tokio.md:14 +#, fuzzy msgid "\"Count in task: {i}!\"" -msgstr "" +msgstr "\"connection from {addr:?}\"" #: src/concurrency/async/runtimes/tokio.md:24 +#, fuzzy msgid "\"Main task: {i}\"" -msgstr "" +msgstr "\"Main task: {i}\"" #: src/concurrency/async/runtimes/tokio.md:32 msgid "With the `tokio::main` macro we can now make `main` async." -msgstr "" +msgstr "با ماکرو `tokio::main` اکنون می‌توانیم `main` را async کنیم." #: src/concurrency/async/runtimes/tokio.md:34 msgid "The `spawn` function creates a new, concurrent \"task\"." -msgstr "" +msgstr "تابع `spawn` یک \"task\" جدید و همزمان ایجاد می‌کند." #: src/concurrency/async/runtimes/tokio.md:36 msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" +"توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." #: src/concurrency/async/runtimes/tokio.md:38 msgid "**Further exploration:**" -msgstr "" +msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md:40 msgid "" @@ -19404,18 +19462,20 @@ msgid "" "cancellation. `tokio::spawn` returns a handle which can be awaited to wait " "until it finishes." msgstr "" +"چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " +"`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." #: src/concurrency/async/runtimes/tokio.md:44 msgid "Try `count_to(10).await` instead of spawning." -msgstr "" +msgstr "به جای spawn مورد `count_to(10).await`» را امتحان کنید." #: src/concurrency/async/runtimes/tokio.md:46 msgid "Try awaiting the task returned from `tokio::spawn`." -msgstr "" +msgstr "منتظر کار برگشتی از `tokio::spawn` باشید." #: src/concurrency/async/tasks.md:3 msgid "Rust has a task system, which is a form of lightweight threading." -msgstr "" +msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن است." #: src/concurrency/async/tasks.md:5 msgid "" @@ -19425,37 +19485,49 @@ msgid "" "task is possible by polling multiple child futures, such as racing a timer " "and an I/O operation." msgstr "" +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " +"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " +"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " +"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " +"یک تایمر و یک عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md:16 msgid "\"127.0.0.1:0\"" -msgstr "" +msgstr "\"127.0.0.1:0\"" #: src/concurrency/async/tasks.md:17 +#, fuzzy msgid "\"listening on port {}\"" -msgstr "" +msgstr "\"listening on port {}\"" #: src/concurrency/async/tasks.md:22 +#, fuzzy msgid "\"connection from {addr:?}\"" -msgstr "" +msgstr "\"connection from {addr:?}\"" #: src/concurrency/async/tasks.md:25 +#, fuzzy msgid "b\"Who are you?\\n\"" -msgstr "" +msgstr "b\"Who are you?\\n\"" #: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 #: src/concurrency/async/tasks.md:31 +#, fuzzy msgid "\"socket error\"" -msgstr "" +msgstr "\"socket error\"" #: src/concurrency/async/tasks.md:30 +#, fuzzy msgid "\"Thanks for dialing in, {name}!\\n\"" -msgstr "" +msgstr "\"Thanks for dialing in, {name}!\\n\"" #: src/concurrency/async/tasks.md:40 #: src/concurrency/async-control-flow/join.md:37 msgid "" "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " +"کنید." #: src/concurrency/async/tasks.md:42 msgid "" @@ -19463,64 +19535,83 @@ msgid "" "com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" "telnet/)." msgstr "" +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" +"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md:46 +#, fuzzy msgid "" "Ask students to visualize what the state of the example server would be with " "a few connected clients. What tasks exist? What are their Futures?" msgstr "" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " +"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md:49 +#, fuzzy msgid "" "This is the first time we've seen an `async` block. This is similar to a " "closure, but does not take any arguments. Its return value is a Future, " "similar to an `async fn`." msgstr "" +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " +"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md:53 msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." msgstr "" +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " +"بخشید." #: src/concurrency/async-control-flow/channels.md:3 msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" +"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md:13 +#, fuzzy msgid "\"Received {count} pings so far.\"" -msgstr "" +msgstr "\"Received {count} pings so far.\"" #: src/concurrency/async-control-flow/channels.md:16 +#, fuzzy msgid "\"ping_handler complete\"" -msgstr "" +msgstr "\"ping_handler complete\"" #: src/concurrency/async-control-flow/channels.md:24 +#, fuzzy msgid "\"Failed to send ping.\"" -msgstr "" +msgstr "\"Failed to send ping.\"" #: src/concurrency/async-control-flow/channels.md:25 +#, fuzzy msgid "\"Sent {} pings so far.\"" -msgstr "" +msgstr "\"Sent {} pings so far.\"" #: src/concurrency/async-control-flow/channels.md:29 +#, fuzzy msgid "\"Something went wrong in ping handler task.\"" -msgstr "" +msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md:36 msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" +"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md:38 msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " "[morning class](../channels.md)." msgstr "" +"به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" +"channels.md) دیده می‌شود." #: src/concurrency/async-control-flow/channels.md:41 msgid "Try removing the `std::mem::drop` call. What happens? Why?" -msgstr "" +msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می‌افتد؟ چرا؟" #: src/concurrency/async-control-flow/channels.md:43 msgid "" @@ -19528,6 +19619,9 @@ msgid "" "implement both `sync` and `async` `send` and `recv`. This can be convenient " "for complex applications with both IO and heavy CPU processing tasks." msgstr "" +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " +"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " +"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md:47 msgid "" @@ -19535,6 +19629,8 @@ msgid "" "combine them with other `future`s to combine them and create complex control " "flow." msgstr "" +"چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " +"`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md:3 msgid "" @@ -19542,22 +19638,28 @@ msgid "" "a collection of their results. This is similar to `Promise.all` in " "JavaScript or `asyncio.gather` in Python." msgstr "" +"عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " +"در JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md:21 +#, fuzzy msgid "\"https://google.com\"" -msgstr "" +msgstr "\"https://google.com\"" #: src/concurrency/async-control-flow/join.md:22 +#, fuzzy msgid "\"https://httpbin.org/ip\"" -msgstr "" +msgstr "\"https://httpbin.org/ip\"" #: src/concurrency/async-control-flow/join.md:23 +#, fuzzy msgid "\"https://play.rust-lang.org/\"" -msgstr "" +msgstr "\"https://play.rust-lang.org/\"" #: src/concurrency/async-control-flow/join.md:24 msgid "\"BAD_URL\"" -msgstr "" +msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md:39 msgid "" @@ -19565,12 +19667,18 @@ msgid "" "you must know how many futures you will have at compile time. This is " "currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " +"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " +"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " +"می‌شود." #: src/concurrency/async-control-flow/join.md:43 msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." msgstr "" +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " +"باعث می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md:46 msgid "" @@ -19580,6 +19688,11 @@ msgid "" "timeout (that requires `select!`, explained in the next chapter), but " "demonstrates `join!`." msgstr "" +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " +"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " +"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " +"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " +"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md:3 msgid "" @@ -19588,6 +19701,10 @@ msgid "" "race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " +"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " +"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)` قابل مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md:8 msgid "" @@ -19597,26 +19714,36 @@ msgid "" "run with the resulting variables. The `statement` result becomes the result " "of the `select!` macro." msgstr "" +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " +"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " +"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " +"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " +"`select!` می‌شود." #: src/concurrency/async-control-flow/select.md:40 +#, fuzzy msgid "\"Felix\"" -msgstr "" +msgstr "\"Felix\"" #: src/concurrency/async-control-flow/select.md:40 +#, fuzzy msgid "\"Failed to send cat.\"" -msgstr "" +msgstr "\"Failed to send cat.\"" #: src/concurrency/async-control-flow/select.md:44 +#, fuzzy msgid "\"Failed to send dog.\"" -msgstr "" +msgstr "\"Failed to send dog.\"" #: src/concurrency/async-control-flow/select.md:49 +#, fuzzy msgid "\"Failed to receive winner\"" -msgstr "" +msgstr "\"Failed to receive winner\"" #: src/concurrency/async-control-flow/select.md:51 +#, fuzzy msgid "\"Winner is {winner:?}\"" -msgstr "" +msgstr "\"Winner is {winner:?}\"" #: src/concurrency/async-control-flow/select.md:58 msgid "" @@ -19625,30 +19752,44 @@ msgid "" "whichever arrives first. Since the dog takes 50ms, it wins against the cat " "that take 500ms." msgstr "" +"در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به " +"هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." +"بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " +"می‌کشد تا پیروز شود." #: src/concurrency/async-control-flow/select.md:63 msgid "" "You can use `oneshot` channels in this example as the channels are supposed " "to receive only one `send`." msgstr "" +"در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " +"کانال‌ها فقط یک `send` را دریافت کنند." #: src/concurrency/async-control-flow/select.md:66 msgid "" "Try adding a deadline to the race, demonstrating selecting different sorts " "of futures." msgstr "" +"سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " +"نشان دهید." #: src/concurrency/async-control-flow/select.md:69 msgid "" "Note that `select!` drops unmatched branches, which cancels their futures. " "It is easiest to use when every execution of `select!` creates new futures." msgstr "" +"توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " +"future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " +"جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." #: src/concurrency/async-control-flow/select.md:72 msgid "" "An alternative is to pass `&mut future` instead of the future itself, but " "this can lead to issues, further discussed in the pinning slide." msgstr "" +"یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، " +"اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning " +"slide) شده بحث شده است." #: src/concurrency/async-pitfalls.md msgid "" From 79e0116183e8ca480d7a0e2af3835349f6d24480 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 25 Aug 2024 01:03:09 +0330 Subject: [PATCH 33/92] fa: oncurrency/async-exercises translated to Farsi --- po/fa.po | 320 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 272 insertions(+), 48 deletions(-) diff --git a/po/fa.po b/po/fa.po index 182fa690d9a..785d8976b6d 100644 --- a/po/fa.po +++ b/po/fa.po @@ -19798,6 +19798,10 @@ msgid "" "with its share of pitfalls and footguns. We illustrate some of them in this " "chapter." msgstr "" +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " +"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " +"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " +"می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -19805,7 +19809,7 @@ msgstr "Pin" #: src/concurrency/async-pitfalls/blocking-executor.md:1 msgid "Blocking the executor" -msgstr "" +msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md:3 msgid "" @@ -19814,20 +19818,28 @@ msgid "" "being executed. An easy workaround is to use async equivalent methods where " "possible." msgstr "" +"اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " +"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " +"است که در صورت امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md:14 +#, fuzzy msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" -msgstr "" +msgstr "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" #: src/concurrency/async-pitfalls/blocking-executor.md:19 +#, fuzzy msgid "\"current_thread\"" -msgstr "" +msgstr "\"current_thread\"" #: src/concurrency/async-pitfalls/blocking-executor.md:30 msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." msgstr "" +"کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت " +"همزمان (concurrent)." #: src/concurrency/async-pitfalls/blocking-executor.md:33 msgid "" @@ -19835,17 +19847,24 @@ msgid "" "makes the effect more obvious, but the bug is still present in the multi-" "threaded flavor." msgstr "" +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " +"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " +"دارد." #: src/concurrency/async-pitfalls/blocking-executor.md:37 msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " +"باشید." #: src/concurrency/async-pitfalls/blocking-executor.md:39 msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " +"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md:42 msgid "" @@ -19856,12 +19875,21 @@ msgid "" "OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " "situations." msgstr "" +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " +"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " +"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " +"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " +"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " +"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md:48 msgid "" "Use sync mutexes with care. Holding a mutex over an `.await` may cause " "another task to block, and that task may be running on the same thread." msgstr "" +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." +"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " +"thread در حال اجرا باشد." #: src/concurrency/async-pitfalls/pin.md:3 msgid "" @@ -19869,6 +19897,9 @@ msgid "" "type returned is the result of a compiler transformation which turns local " "variables into data stored inside the future." msgstr "" +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " +"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " +"ذخیره شده در future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md:7 msgid "" @@ -19876,6 +19907,9 @@ msgid "" "of that, the future should never be moved to a different memory location, as " "it would invalidate those pointers." msgstr "" +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " +"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " +"این pointerها را باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md:11 msgid "" @@ -19884,74 +19918,99 @@ msgid "" "operations that would move the instance it points to into a different memory " "location." msgstr "" +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " +"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " +"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " +"متفاوت منتقل کند را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md:20 +#, fuzzy msgid "" "// A work item. In this case, just sleep for the given time and respond\n" "// with a message on the `respond_on` channel.\n" msgstr "" +"// A work item. In this case, just sleep for the given time and respond\n" +"// with a message on the `respond_on` channel.\n" #: src/concurrency/async-pitfalls/pin.md:28 +#, fuzzy msgid "// A worker which listens for work on a queue and performs it.\n" -msgstr "" +msgstr "// A worker which listens for work on a queue and performs it.\n" #: src/concurrency/async-pitfalls/pin.md:35 +#, fuzzy msgid "// Pretend to work.\n" -msgstr "" +msgstr "// Pretend to work.\n" #: src/concurrency/async-pitfalls/pin.md:38 +#, fuzzy msgid "\"failed to send response\"" -msgstr "" +msgstr "\"failed to send response\"" #: src/concurrency/async-pitfalls/pin.md:41 +#, fuzzy msgid "// TODO: report number of iterations every 100ms\n" -msgstr "" +msgstr "// TODO: report number of iterations every 100ms\n" #: src/concurrency/async-pitfalls/pin.md:45 +#, fuzzy msgid "// A requester which requests work and waits for it to complete.\n" -msgstr "" +msgstr "// A requester which requests work and waits for it to complete.\n" #: src/concurrency/async-pitfalls/pin.md:52 +#, fuzzy msgid "\"failed to send on work queue\"" -msgstr "" +msgstr "\"failed to send on work queue\"" #: src/concurrency/async-pitfalls/pin.md:53 +#, fuzzy msgid "\"failed waiting for response\"" -msgstr "" +msgstr "\"failed waiting for response\"" #: src/concurrency/async-pitfalls/pin.md:62 +#, fuzzy msgid "\"work result for iteration {i}: {resp}\"" -msgstr "" +msgstr "\"Welcome to chat! Type a message\"" #: src/concurrency/async-pitfalls/pin.md:70 msgid "" "You may recognize this as an example of the actor pattern. Actors typically " "call `select!` in a loop." msgstr "" +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " +"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md:73 msgid "" "This serves as a summation of a few of the previous lessons, so take your " "time with it." msgstr "" +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " +"آن کنید." #: src/concurrency/async-pitfalls/pin.md:76 msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" msgstr "" +"به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " +"`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md:79 msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" -msgstr "" +msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md:90 +#, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " "`timeout_fut` in the `select!` to work around the move, then using `Box::" "pin`:" msgstr "" +"این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" +"pin` استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md:104 msgid "" @@ -19959,19 +20018,29 @@ msgid "" "iteration (a fused future would help with this). Update to reset " "`timeout_fut` every time it expires:" msgstr "" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " +"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " +"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md:119 +#, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " "stabilized, with older code often using `tokio::pin!`) is also an option, " "but that is difficult to use for a future that is reassigned." msgstr "" +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " +"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " +"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " +"دشوار است." #: src/concurrency/async-pitfalls/pin.md:123 msgid "" "Another alternative is to not use `pin` at all but spawn another task that " "will send to a `oneshot` channel every 100ms." msgstr "" +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " +"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md:126 msgid "" @@ -19981,6 +20050,11 @@ msgid "" "code transformation for async blocks and functions is not verified by the " "borrow checker." msgstr "" +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " +"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " +"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " +"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " +"borrow checker تأیید نمی‌شود." #: src/concurrency/async-pitfalls/pin.md:132 msgid "" @@ -19988,6 +20062,9 @@ msgid "" "place using a pinned pointer. However, it can still be moved through an " "unpinned pointer." msgstr "" +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " +"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " +"از طریق یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md:136 msgid "" @@ -19995,6 +20072,9 @@ msgid "" "`&mut Self` to refer to the instance. That's why it can only be called on a " "pinned pointer." msgstr "" +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " +"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " +"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md:3 msgid "" @@ -20003,45 +20083,64 @@ msgid "" "in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " +"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " +"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " +"Future` است." #: src/concurrency/async-pitfalls/async-traits.md:7 msgid "" "However, even with the native support today there are some pitfalls around " "`async fn` and RPIT in traits:" msgstr "" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " +"RPIT در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md:10 msgid "" "Return-position impl Trait captures all in-scope lifetimes (so some patterns " "of borrowing cannot be expressed)" msgstr "" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " +"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md:13 msgid "" "Traits whose methods use return-position `impl trait` or `async` are not " "`dyn` compatible." msgstr "" +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " +"می‌کنند با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md:16 +#, fuzzy msgid "" "If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" "trait/latest/async_trait/) provides a workaround through a macro, with some " "caveats:" msgstr "" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " +"چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md:46 +#, fuzzy msgid "\"running all sleepers..\"" -msgstr "" +msgstr "\"running all sleepers..\"" #: src/concurrency/async-pitfalls/async-traits.md:50 +#, fuzzy msgid "\"slept for {}ms\"" -msgstr "" +msgstr "\"slept for {}ms\"" #: src/concurrency/async-pitfalls/async-traits.md:68 msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " +"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " +"عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md:71 msgid "" @@ -20051,12 +20150,19 @@ msgid "" "blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " "digging deeper." msgstr "" +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " +"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " +"هستید." #: src/concurrency/async-pitfalls/async-traits.md:77 msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " "time and adding it to the Vec." msgstr "" +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " +"را به Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md:3 msgid "" @@ -20065,51 +20171,64 @@ msgid "" "ensure the system works correctly even when futures are cancelled. For " "example, it shouldn't deadlock or lose data." msgstr "" +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " +"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " +"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " +"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md:35 #: src/concurrency/async-pitfalls/cancellation.md:102 +#, fuzzy msgid "\"not UTF-8\"" -msgstr "" +msgstr "\"not UTF-8\"" #: src/concurrency/async-pitfalls/cancellation.md:51 +#, fuzzy msgid "\"hi\\nthere\\n\"" -msgstr "" +msgstr "\"hi\\nthere\\n\"" #: src/concurrency/async-pitfalls/cancellation.md:57 +#, fuzzy msgid "\"tick!\"" -msgstr "" +msgstr "\"tick!\"" #: src/concurrency/async-pitfalls/cancellation.md:73 msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " +"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md:76 msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." msgstr "" +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " +"به خطا) است." #: src/concurrency/async-pitfalls/cancellation.md:79 msgid "The example loses parts of the string." -msgstr "" +msgstr "اسن مثال بخش‌هایی از string را از دست می‌دهد." #: src/concurrency/async-pitfalls/cancellation.md:81 msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" +"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md:84 msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" -msgstr "" +msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md:98 +#, fuzzy msgid "// prefix buf and bytes with self.\n" -msgstr "" +msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md:108 msgid "" @@ -20117,6 +20236,9 @@ msgid "" "html#method.tick) is cancellation-safe because it keeps track of whether a " "tick has been 'delivered'." msgstr "" +"‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " +"tick تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md:112 msgid "" @@ -20124,6 +20246,9 @@ msgid "" "AsyncReadExt.html#method.read) is cancellation-safe because it either " "returns or doesn't read data." msgstr "" +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " +"برمی‌گرداند یا نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md:115 msgid "" @@ -20131,18 +20256,23 @@ msgid "" "AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " "cancellation-safe. See its documentation for details and alternatives." msgstr "" +"‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" +"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md:1 #: src/concurrency/async-exercises/solutions.md:3 #, fuzzy msgid "Dining Philosophers --- Async" -msgstr "فلسفه Dining" +msgstr "فلسفه Dining --- Async" #: src/concurrency/async-exercises/dining-philosophers.md:3 msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" +"philosophers.md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md:6 msgid "" @@ -20150,22 +20280,29 @@ msgid "" "locally.md) for this exercise. Copy the code below to a file called `src/" "main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." +"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " +"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md:37 #: src/concurrency/async-exercises/solutions.md:29 +#, fuzzy msgid "// Keep trying until we have both forks\n" -msgstr "" +msgstr "// Keep trying until we have both forks\n" #: src/concurrency/async-exercises/dining-philosophers.md:52 #: src/concurrency/async-exercises/solutions.md:85 +#, fuzzy msgid "// Make them think and eat\n" -msgstr "" +msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md:58 msgid "" "Since this time you are using Async Rust, you'll need a `tokio` dependency. " "You can use the following `Cargo.toml`:" msgstr "" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " +"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md:63 msgid "" @@ -20180,16 +20317,28 @@ msgid "" "\"rt-multi-thread\"] }\n" "```" msgstr "" +"```toml\n" +"[package]\n" +"name = \"dining-philosophers-async-dine\"\n" +"version = \"0.1.0\"\n" +"edition = \"2021\"\n" +"\n" +"[dependencies]\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" +"```" #: src/concurrency/async-exercises/dining-philosophers.md:73 msgid "" "Also note that this time you have to use the `Mutex` and the `mpsc` module " "from the `tokio` crate." msgstr "" +"همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " +"crate استفاده کنید." #: src/concurrency/async-exercises/dining-philosophers.md:79 msgid "Can you make your implementation single-threaded?" -msgstr "" +msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread ای کنید؟" #: src/concurrency/async-exercises/chat-app.md:3 msgid "" @@ -20199,6 +20348,11 @@ msgid "" "input, and sends them to the server. The chat server broadcasts each message " "that it receives to all the clients." msgstr "" +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " +"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " +"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " +"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " +"دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md:9 msgid "" @@ -20207,14 +20361,17 @@ msgid "" "(https://docs.rs/tokio-websockets/) for the communication between the client " "and the server." msgstr "" +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" +"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md:12 msgid "Create a new Cargo project and add the following dependencies:" -msgstr "" +msgstr "یک پروژه Cargo جدید ایجاد کنید و وابستگی‌های زیر را اضافه کنید:" #: src/concurrency/async-exercises/chat-app.md:14 msgid "_Cargo.toml_:" -msgstr "" +msgstr "_Cargo.toml_:" #: src/concurrency/async-exercises/chat-app.md:18 msgid "" @@ -20232,10 +20389,23 @@ msgid "" "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" +"```toml\n" +"[package]\n" +"name = \"chat-async\"\n" +"version = \"0.1.0\"\n" +"edition = \"2021\"\n" +"\n" +"[dependencies]\n" +"futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" +"http = \"1.1.0\"\n" +"tokio = { version = \"1.38.1\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"```" #: src/concurrency/async-exercises/chat-app.md:31 msgid "The required APIs" -msgstr "" +msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md:33 msgid "" @@ -20243,6 +20413,8 @@ msgid "" "[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " "to familiarize yourself with the API." msgstr "" +"شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" +"websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md:37 msgid "" @@ -20250,6 +20422,9 @@ msgid "" "trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " "asynchronously reading messages from a Websocket Stream." msgstr "" +"‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " +"ناهمزمان پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md:39 msgid "" @@ -20257,6 +20432,9 @@ msgid "" "trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " "asynchronously sending messages on a Websocket Stream." msgstr "" +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " +"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md:41 msgid "" @@ -20264,16 +20442,21 @@ msgid "" "html#method.next_line): for asynchronously reading user messages from the " "standard input." msgstr "" +"‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " +"استاندارد." #: src/concurrency/async-exercises/chat-app.md:43 msgid "" "[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md:45 msgid "Two binaries" -msgstr "" +msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md:47 msgid "" @@ -20285,6 +20468,13 @@ msgid "" "(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" "targets.html#binaries))." msgstr "" +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " +"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " +"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " +"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " +"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " +"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." +"html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md:54 msgid "" @@ -20292,62 +20482,70 @@ msgid "" "bin/client.rs`, respectively. Your task is to complete these files as " "described below." msgstr "" +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " +"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " +"شده است تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md:58 #: src/concurrency/async-exercises/solutions.md:104 msgid "_src/bin/server.rs_:" -msgstr "" +msgstr "_src/bin/server.rs_:" #: src/concurrency/async-exercises/chat-app.md:77 #: src/concurrency/async-exercises/chat-app.md:124 +#, fuzzy msgid "// TODO: For a hint, see the description of the task below.\n" -msgstr "" +msgstr "// TODO: For a hint, see the description of the task below.\n" #: src/concurrency/async-exercises/chat-app.md:85 #: src/concurrency/async-exercises/solutions.md:154 msgid "\"127.0.0.1:2000\"" -msgstr "" +msgstr "\"127.0.0.1:2000\"" #: src/concurrency/async-exercises/chat-app.md:86 #: src/concurrency/async-exercises/solutions.md:155 +#, fuzzy msgid "\"listening on port 2000\"" -msgstr "" +msgstr "\"listening on port 2000\"" #: src/concurrency/async-exercises/chat-app.md:90 #: src/concurrency/async-exercises/solutions.md:159 +#, fuzzy msgid "\"New connection from {addr:?}\"" -msgstr "" +msgstr "\"New connection from {addr:?}\"" #: src/concurrency/async-exercises/chat-app.md:93 #: src/concurrency/async-exercises/solutions.md:162 +#, fuzzy msgid "// Wrap the raw TCP stream into a websocket.\n" -msgstr "" +msgstr "// Wrap the raw TCP stream into a websocket.\n" #: src/concurrency/async-exercises/chat-app.md:102 #: src/concurrency/async-exercises/solutions.md:171 msgid "_src/bin/client.rs_:" -msgstr "" +msgstr "_src/bin/client.rs_:" #: src/concurrency/async-exercises/chat-app.md:116 #: src/concurrency/async-exercises/solutions.md:183 +#, fuzzy msgid "\"ws://127.0.0.1:2000\"" -msgstr "" +msgstr "\"ws://127.0.0.1:2000\"" #: src/concurrency/async-exercises/chat-app.md:129 msgid "Running the binaries" -msgstr "" +msgstr "راه‌اندازی باینری" #: src/concurrency/async-exercises/chat-app.md:131 msgid "Run the server with:" -msgstr "" +msgstr "سرور را راه‌اندازی کنید با استفاده از:" #: src/concurrency/async-exercises/chat-app.md:137 msgid "and the client with:" -msgstr "" +msgstr "و این کلاینت با:" #: src/concurrency/async-exercises/chat-app.md:145 msgid "Implement the `handle_connection` function in `src/bin/server.rs`." -msgstr "" +msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌سازی کنید." #: src/concurrency/async-exercises/chat-app.md:146 msgid "" @@ -20355,10 +20553,14 @@ msgid "" "continuous loop. One task receives messages from the client and broadcasts " "them. The other sends messages received by the server to the client." msgstr "" +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " +"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " +"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " +"می‌کند." #: src/concurrency/async-exercises/chat-app.md:149 msgid "Complete the main function in `src/bin/client.rs`." -msgstr "" +msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md:150 msgid "" @@ -20367,59 +20569,81 @@ msgid "" "sending them to the server, and (2) receiving messages from the server, and " "displaying them for the user." msgstr "" +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " +"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " +"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md:154 msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " +"جز فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md:35 +#, fuzzy msgid "" "// If we didn't get the left fork, drop the right fork if we\n" " // have it and let other tasks make progress.\n" msgstr "" +"// If we didn't get the left fork, drop the right fork if we\n" +" // have it and let other tasks make progress.\n" #: src/concurrency/async-exercises/solutions.md:42 +#, fuzzy msgid "" "// If we didn't get the right fork, drop the left fork and let\n" " // other tasks make progress.\n" msgstr "" +"// If we didn't get the right fork, drop the left fork and let\n" +" // other tasks make progress.\n" #: src/concurrency/async-exercises/solutions.md:54 +#, fuzzy msgid "// The locks are dropped here\n" -msgstr "" +msgstr "// The locks are dropped here\n" #: src/concurrency/async-exercises/solutions.md:82 +#, fuzzy msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" -msgstr "" +msgstr "// tx is dropped here, so we don't need to explicitly drop it later\n" #: src/concurrency/async-exercises/solutions.md:97 +#, fuzzy msgid "\"Here is a thought: {thought}\"" -msgstr "" +msgstr "\"Here is a thought: {thought}\"" #: src/concurrency/async-exercises/solutions.md:122 +#, fuzzy msgid "\"Welcome to chat! Type a message\"" -msgstr "" +msgstr "\"Welcome to chat! Type a message\"" #: src/concurrency/async-exercises/solutions.md:126 +#, fuzzy msgid "" "// A continuous loop for concurrently performing two tasks: (1) receiving\n" " // messages from `ws_stream` and broadcasting them, and (2) receiving\n" " // messages on `bcast_rx` and sending them to the client.\n" msgstr "" +"// A continuous loop for concurrently performing two tasks: (1) receiving\n" +" // messages from `ws_stream` and broadcasting them, and (2) receiving\n" +" // messages on `bcast_rx` and sending them to the client.\n" #: src/concurrency/async-exercises/solutions.md:135 +#, fuzzy msgid "\"From client {addr:?} {text:?}\"" -msgstr "" +msgstr "\"From client {addr:?} {text:?}\"" #: src/concurrency/async-exercises/solutions.md:190 +#, fuzzy msgid "// Continuous loop for concurrently sending and receiving messages.\n" -msgstr "" +msgstr "// Continuous loop for concurrently sending and receiving messages.\n" #: src/concurrency/async-exercises/solutions.md:197 +#, fuzzy msgid "\"From server: {}\"" -msgstr "" +msgstr "\"From server: {}\"" #: src/thanks.md msgid "" From 8ca7014f2e645ef26fff4a5d2d8daff888ed502f Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 25 Aug 2024 23:25:17 +0330 Subject: [PATCH 34/92] fa: glossary translate --- po/fa.po | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 184 insertions(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 785d8976b6d..249efefd50a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -20645,11 +20645,13 @@ msgstr "// Continuous loop for concurrently sending and receiving messages.\n" msgid "\"From server: {}\"" msgstr "\"From server: {}\"" -#: src/thanks.md +: src/thanks.md msgid "" "_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " "that it was useful." msgstr "" +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " +"برده باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" @@ -20658,6 +20660,10 @@ msgid "" "please get in [contact with us on GitHub](https://github.com/google/" "comprehensive-rust/discussions). We would love to hear from you." msgstr "" +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " +"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " +"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " +"شوید. ما دوست داریم از شما بشنویم." #: src/glossary.md msgid "" @@ -20665,6 +20671,9 @@ msgid "" "Rust terms. For translations, this also serves to connect the term back to " "the English original." msgstr "" +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " +"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " +"انگلیسی است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -20672,12 +20681,16 @@ msgid "" "allocate: \n" "Dynamic memory allocation on [the heap](memory-management/review.md)." msgstr "" +"allocate: \n" +"تخصیص حافظه پویا در [heap]‌(memory-management/review.md)." #: src/glossary.md msgid "" "argument: \n" "Information that is passed into a function or method." msgstr "" +"argument: \n" +"اطلاعاتی که به یک تابع یا متد منتقل می‌شود." #: src/glossary.md msgid "" @@ -20685,30 +20698,43 @@ msgid "" "Low-level Rust development, often deployed to a system without an operating " "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" +"Bare-metal Rust: \n" +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " +"[Bare-metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" "block: \n" "See [Blocks](control-flow-basics/blocks-and-scopes.md) and _scope_." msgstr "" +"block: \n" +"‏[Blocks]‌(control-flow-basics/blocks-and-scopes.md) و _scope_ را ببینید." #: src/glossary.md msgid "" "borrow: \n" "See [Borrowing](borrowing/shared.md)." msgstr "" +"borrow: \n" +"‏ [Borrowing](borrowing/shared.md) را ببینید." #: src/glossary.md msgid "" "borrow checker: \n" "The part of the Rust compiler which checks that all borrows are valid." msgstr "" +"borrow checker: \n" +"بخشی از کامپایلر Rust که بررسی می‌کند که همه قرض‌ها (borrows) معتبر هستند." +# recheck #: src/glossary.md +#, fuzzy msgid "" "brace: \n" "`{` and `}`. Also called _curly brace_, they delimit _blocks_." msgstr "" +"brace: \n" +"‏ `{` and `}`. نامیده می‌شوند _curly brace_, آنها delimit _blocks_." #: src/glossary.md msgid "" @@ -20716,30 +20742,41 @@ msgid "" "The process of converting source code into executable code or a usable " "program." msgstr "" +"build: \n" +"فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." #: src/glossary.md msgid "" "call: \n" "To invoke or execute a function or method." msgstr "" +"call: \n" +"برای فراخوانی یا اجرای یک تابع یا متد، کاربرد دارد." #: src/glossary.md msgid "" "channel: \n" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" +"channel: \n" +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " +"می‌شود." #: src/glossary.md msgid "" "Comprehensive Rust 🦀: \n" "The courses here are jointly called Comprehensive Rust 🦀." msgstr "" +"Comprehensive Rust 🦀: \n" +"دوره‌های اینجا Comprehensive Rust 🦀 نامیده می‌شوند." #: src/glossary.md msgid "" "concurrency: \n" "The execution of multiple tasks or processes at the same time." msgstr "" +"concurrency: \n" +"اجرای چندین task یا process به طور همزمان." #: src/glossary.md msgid "" @@ -20753,6 +20790,8 @@ msgid "" "constant: \n" "A value that does not change during the execution of a program." msgstr "" +"constant: \n" +"مقداری که در طول اجرای برنامه تغییر نمی‌کند." #: src/glossary.md msgid "" @@ -20760,12 +20799,16 @@ msgid "" "The order in which the individual statements or instructions are executed in " "a program." msgstr "" +"control flow: \n" +"ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." #: src/glossary.md msgid "" "crash: \n" "An unexpected and unhandled failure or termination of a program." msgstr "" +"crash: \n" +"یک شکست (failure) یا خاتمه غیرمنتظره و کنترل نشده یک برنامه است." #: src/glossary.md msgid "" @@ -20773,12 +20816,17 @@ msgid "" "A data type that holds one of several named constants, possibly with an " "associated tuple or struct." msgstr "" +"enumeration: \n" +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " +"ساختار مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" "error: \n" "An unexpected condition or result that deviates from the expected behavior." msgstr "" +"error: \n" +"شرایط یا نتیجه غیرمنتظره‌ای که از رفتار مورد انتظار خارج می‌شود." #: src/glossary.md msgid "" @@ -20786,18 +20834,24 @@ msgid "" "The process of managing and responding to errors that occur during program " "execution." msgstr "" +"error handling: \n" +"فرآیند مدیریت و پاسخگویی به خطاهایی که در حین اجرای برنامه رخ می‌دهد." #: src/glossary.md msgid "" "exercise: \n" "A task or problem designed to practice and test programming skills." msgstr "" +"exercise: \n" +" مشکل یا task که برای تمرین و آزمایش مهارت‌های برنامه‌نویسی طراحی شده است." #: src/glossary.md msgid "" "function: \n" "A reusable block of code that performs a specific task." msgstr "" +"function: \n" +"یک بلوک کد قابل استفاده مجدد که وظیفه خاصی را انجام می‌دهد." #: src/glossary.md msgid "" @@ -20805,6 +20859,9 @@ msgid "" "A mechanism that automatically frees up memory occupied by objects that are " "no longer in use." msgstr "" +"garbage collector: \n" +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " +"نمی‌شوند را آزاد می‌کند." #: src/glossary.md msgid "" @@ -20812,12 +20869,17 @@ msgid "" "A feature that allows writing code with placeholders for types, enabling " "code reuse with different data types." msgstr "" +"generics: \n" +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " +"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" "immutable: \n" "Unable to be changed after creation." msgstr "" +"immutable: \n" +"پس از ایجاد، دیگر قابل تغییر نیست." #: src/glossary.md msgid "" @@ -20825,6 +20887,8 @@ msgid "" "A type of test that verifies the interactions between different parts or " "components of a system." msgstr "" +"integration test: \n" +"نوعی تست که تعامل بین بخش‌ها یا اجزای مختلف یک سیستم را تأیید می‌کند." #: src/glossary.md msgid "" @@ -20832,12 +20896,18 @@ msgid "" "A reserved word in a programming language that has a specific meaning and " "cannot be used as an identifier." msgstr "" +"keyword: \n" +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " +"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" "library: \n" "A collection of precompiled routines or code that can be used by programs." msgstr "" +"library: \n" +"مجموعه‌ای از routine‌ها یا کدهای از پیش کامپایل شده که می تواند توسط برنامه‌ها " +"استفاده شود." #: src/glossary.md msgid "" @@ -20846,12 +20916,19 @@ msgid "" "normal functions are not enough. A typical example is `format!`, which takes " "a variable number of arguments, which isn't supported by Rust functions." msgstr "" +"macro: \n" +"ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " +"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" "`main` function: \n" "Rust programs start executing with the `main` function." msgstr "" +"`main` function: \n" +"\n" +"برنامه‌های Rust با تابع `main` شروع به اجرا می‌کنند." #: src/glossary.md msgid "" @@ -20859,6 +20936,9 @@ msgid "" "A control flow construct in Rust that allows for pattern matching on the " "value of an expression." msgstr "" +"match: \n" +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " +"فراهم می‌کند." #: src/glossary.md msgid "" @@ -20866,12 +20946,17 @@ msgid "" "A situation where a program fails to release memory that is no longer " "needed, leading to a gradual increase in memory usage." msgstr "" +"memory leak: \n" +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " +"منجر به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" "method: \n" "A function associated with an object or a type in Rust." msgstr "" +"method: \n" +"یک تابع مرتبط با یک object یا یک type در Rust." #: src/glossary.md msgid "" @@ -20879,12 +20964,17 @@ msgid "" "A namespace that contains definitions, such as functions, types, or traits, " "to organize code in Rust." msgstr "" +"module: \n" +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " +"Rust است." #: src/glossary.md msgid "" "move: \n" "The transfer of ownership of a value from one variable to another in Rust." msgstr "" +"move: \n" +"انتقال مالکیت (ownership) یک مقدار از یک متغیر به متغیر دیگر در Rust." #: src/glossary.md msgid "" @@ -20892,6 +20982,8 @@ msgid "" "A property in Rust that allows variables to be modified after they have been " "declared." msgstr "" +"mutable: \n" +"یک ویژگی در Rust که به متغیرها اجازه می‌دهد پس از اعلان، اصلاح شوند." #: src/glossary.md msgid "" @@ -20899,6 +20991,9 @@ msgid "" "The concept in Rust that defines which part of the code is responsible for " "managing the memory associated with a value." msgstr "" +"ownership: \n" +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " +"مقدار است." #: src/glossary.md msgid "" @@ -20906,12 +21001,16 @@ msgid "" "An unrecoverable error condition in Rust that results in the termination of " "the program." msgstr "" +"panic: \n" +"یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." #: src/glossary.md msgid "" "parameter: \n" "A value that is passed into a function or method when it is called." msgstr "" +"parameter: \n" +"مقداری که هنگام فراخوانی به یک تابع یا متد ارسال می‌شود." #: src/glossary.md msgid "" @@ -20919,12 +21018,17 @@ msgid "" "A combination of values, literals, or structures that can be matched against " "an expression in Rust." msgstr "" +"pattern: \n" +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " +"مطابقت داده شوند." #: src/glossary.md msgid "" "payload: \n" "The data or information carried by a message, event, or data structure." msgstr "" +"payload: \n" +"داده یا اطلاعاتی که توسط یک پیام، رویداد یا ساختار داده حمل می‌شود." #: src/glossary.md msgid "" @@ -20932,12 +21036,17 @@ msgid "" "A set of instructions that a computer can execute to perform a specific task " "or solve a particular problem." msgstr "" +"program: \n" +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاص اجرا کند." #: src/glossary.md msgid "" @@ -20945,6 +21054,9 @@ msgid "" "The first parameter in a Rust method that represents the instance on which " "the method is called." msgstr "" +"receiver: \n" +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " +"می‌شود." #: src/glossary.md msgid "" @@ -20952,12 +21064,18 @@ msgid "" "A memory management technique in which the number of references to an object " "is tracked, and the object is deallocated when the count reaches zero." msgstr "" +"reference counting: \n" +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " +"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" "return: \n" "A keyword in Rust used to indicate the value to be returned from a function." msgstr "" +"return: \n" +"یک کلمه کلیدی در Rust برای نشان دادن مقداری که باید از یک تابع برگردانده شود " +"استفاده می‌شود." #: src/glossary.md msgid "" @@ -20965,24 +21083,34 @@ msgid "" "A systems programming language that focuses on safety, performance, and " "concurrency." msgstr "" +"Rust: \n" +"یک زبان برنامه‌نویسی سیستمی که بر safety، کارایی و concurrency تمرکز دارد." #: src/glossary.md msgid "" "Rust Fundamentals: \n" "Days 1 to 4 of this course." msgstr "" +"Rust Fundamentals: \n" +"روزهای ۱ تا ۴ این دوره." +# check in browser again #: src/glossary.md +#, fuzzy msgid "" "Rust in Android: \n" "See [Rust in Android](android.md)." msgstr "" +"‏Rust در Android:\n" +"‏[Rust in Android](android.md) را ببینید." #: src/glossary.md msgid "" "Rust in Chromium: \n" "See [Rust in Chromium](chromium.md)." msgstr "" +"‏ Rust در Chromium: \n" +"‏ [Rust in Chromium](chromium.md) را ببینید." #: src/glossary.md msgid "" @@ -20990,18 +21118,25 @@ msgid "" "Refers to code that adheres to Rust's ownership and borrowing rules, " "preventing memory-related errors." msgstr "" +"safe: \n" +"به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " +"(borrowing) پایبند است و از خطاهای مربوط به حافظه جلوگیری می‌کند." #: src/glossary.md msgid "" "scope: \n" "The region of a program where a variable is valid and can be used." msgstr "" +"scope: \n" +"منطقه‌ای از یک برنامه که در آن یک متغیر معتبر است و می‌توان از آن استفاده کرد." #: src/glossary.md msgid "" "standard library: \n" "A collection of modules providing essential functionality in Rust." msgstr "" +"standard library: \n" +"مجموعه‌ای از ماژول‌ها که عملکردهای ضروری را در Rust ارائه می‌دهند." #: src/glossary.md msgid "" @@ -21009,6 +21144,9 @@ msgid "" "A keyword in Rust used to define static variables or items with a `'static` " "lifetime." msgstr "" +"static: \n" +"یک کلمه کلیدی در Rust برای تعریف متغیرهای ثابت یا موارد با طول عمر `'static` " +"استفاده می‌شود." #: src/glossary.md msgid "" @@ -21016,6 +21154,9 @@ msgid "" "A data type storing textual data. See [Strings](references/strings.html) for " "more." msgstr "" +"string: \n" +"نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" +"(references/strings.html) مراجعه کنید." #: src/glossary.md msgid "" @@ -21023,6 +21164,9 @@ msgid "" "A composite data type in Rust that groups together variables of different " "types under a single name." msgstr "" +"struct: \n" +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " +"می‌کند." #: src/glossary.md msgid "" @@ -21030,12 +21174,16 @@ msgid "" "A Rust module containing functions that test the correctness of other " "functions." msgstr "" +"test: \n" +"یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." #: src/glossary.md msgid "" "thread: \n" "A separate sequence of execution in a program, allowing concurrent execution." msgstr "" +"thread: \n" +"دنباله‌ای جداگانه از اجرا در یک برنامه که امکان اجرای همزمان را فراهم می‌کند." #: src/glossary.md msgid "" @@ -21043,6 +21191,8 @@ msgid "" "The property of a program that ensures correct behavior in a multithreaded " "environment." msgstr "" +"thread safety: \n" +"ویژگی برنامه‌ای که رفتار صحیح را در یک محیط multithread تضمین می‌کند." #: src/glossary.md msgid "" @@ -21050,13 +21200,20 @@ msgid "" "A collection of methods defined for an unknown type, providing a way to " "achieve polymorphism in Rust." msgstr "" +"trait: \n" +"مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " +"polymorphism در Rust ارائه می‌دهد." #: src/glossary.md +#, fuzzy msgid "" "trait bound: \n" "An abstraction where you can require types to implement some traits of your " "interest." msgstr "" +"trait bound: \n" +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " +"علاقه‌تان به typeها نیاز داشته باشید." #: src/glossary.md msgid "" @@ -21064,6 +21221,9 @@ msgid "" "A composite data type that contains variables of different types. Tuple " "fields have no names, and are accessed by their ordinal numbers." msgstr "" +"tuple: \n" +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " +"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" @@ -21071,6 +21231,9 @@ msgid "" "A classification that specifies which operations can be performed on values " "of a particular kind in Rust." msgstr "" +"type: \n" +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " +"در Rust انجام داد." #: src/glossary.md msgid "" @@ -21078,6 +21241,8 @@ msgid "" "The ability of the Rust compiler to deduce the type of a variable or " "expression." msgstr "" +"type inference: \n" +"توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." #: src/glossary.md msgid "" @@ -21085,12 +21250,18 @@ msgid "" "Actions or conditions in Rust that have no specified result, often leading " "to unpredictable program behavior." msgstr "" +"undefined behavior: \n" +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " +"غیرقابل پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" "union: \n" "A data type that can hold values of different types but only one at a time." msgstr "" +"union: \n" +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " +"یکی در یک زمان خاص." #: src/glossary.md msgid "" @@ -21098,12 +21269,18 @@ msgid "" "Rust comes with built-in support for running small unit tests and larger " "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" +"unit test: \n" +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " +"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" "unit type: \n" "Type that holds no data, written as a tuple with no members." msgstr "" +"unit type: \n" +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " +"شده است." #: src/glossary.md msgid "" @@ -21111,12 +21288,18 @@ msgid "" "The subset of Rust which allows you to trigger _undefined behavior_. See " "[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" +"unsafe: \n" +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " +"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" "variable: \n" "A memory location storing data. Variables are valid in a _scope_." msgstr "" +"variable: \n" +"یک مکان حافظه که داده‌ها را ذخیره می‌کند. متغیرها در یک _scope_ معتبر هستند." + #: src/other-resources.md msgid "Other Rust Resources" From 58032de3c16182604bc47fb9a4a12d5fdb41e9a7 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 25 Aug 2024 23:30:03 +0330 Subject: [PATCH 35/92] fa: glossary translate and fix --- po/fa.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 249efefd50a..320fb90f01d 100644 --- a/po/fa.po +++ b/po/fa.po @@ -20645,7 +20645,7 @@ msgstr "// Continuous loop for concurrently sending and receiving messages.\n" msgid "\"From server: {}\"" msgstr "\"From server: {}\"" -: src/thanks.md +#: src/thanks.md msgid "" "_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " "that it was useful." @@ -21300,7 +21300,6 @@ msgstr "" "variable: \n" "یک مکان حافظه که داده‌ها را ذخیره می‌کند. متغیرها در یک _scope_ معتبر هستند." - #: src/other-resources.md msgid "Other Rust Resources" msgstr "" From 0d18fb6610c314465ca753ca505c7d5614ca11dd Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 26 Aug 2024 23:23:01 +0330 Subject: [PATCH 36/92] fa: credits & other-resources --- po/fa.po | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 8 deletions(-) diff --git a/po/fa.po b/po/fa.po index 320fb90f01d..05a53aa8077 100644 --- a/po/fa.po +++ b/po/fa.po @@ -21302,21 +21302,24 @@ msgstr "" #: src/other-resources.md msgid "Other Rust Resources" -msgstr "" +msgstr "سایر منابع برای Rust" #: src/other-resources.md msgid "" "The Rust community has created a wealth of high-quality and free resources " "online." msgstr "" +"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" -msgstr "" +msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " +"می‌دهند:" #: src/other-resources.md msgid "" @@ -21324,6 +21327,9 @@ msgid "" "canonical free book about Rust. Covers the language in detail and includes a " "few projects for people to build." msgstr "" +"ء [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " +"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " +"پروژه برای ساخت نرم‌افزار می‌شود." #: src/other-resources.md msgid "" @@ -21332,22 +21338,30 @@ msgid "" "Sometimes includes small exercises where you are asked to expand on the code " "in the examples." msgstr "" +"ء [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد " +"Rust syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به " +"نمایش می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود " +"کد را در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" "[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " "of the standard library for Rust." msgstr "" +"ء [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " +"کتابخانه استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" "[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " "book which describes the Rust grammar and memory model." msgstr "" +"ء [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " +"گرامر و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" -msgstr "" +msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سایت رسمی Rust:" #: src/other-resources.md msgid "" @@ -21355,6 +21369,9 @@ msgid "" "including working with raw pointers and interfacing with other languages " "(FFI)." msgstr "" +"ء[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " +"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " +"(FFI) را تشریح می‌کند." #: src/other-resources.md msgid "" @@ -21362,6 +21379,9 @@ msgid "" "covers the new asynchronous programming model which was introduced after the " "Rust Book was written." msgstr "" +"ء [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " +"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " +"پس از نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" @@ -21369,20 +21389,25 @@ msgid "" "an introduction to using Rust on embedded devices without an operating " "system." msgstr "" +"ء [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " +"شامل می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" -msgstr "" +msgstr "مطالب آموزشی غیر‌رسمی" #: src/other-resources.md msgid "A small selection of other guides and tutorial for Rust:" -msgstr "" +msgstr "مجموعه کوچکی از راهنماها و آموزش‌های دیگر برای Rust:" #: src/other-resources.md msgid "" "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " "from the perspective of low-level C programmers." msgstr "" +"ء [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " +"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" @@ -21390,6 +21415,9 @@ msgid "" "rust_for_c_devs.html): covers Rust from the perspective of developers who " "write firmware in C." msgstr "" +"ء [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " +"زبان C می‌نویسند پوشش می‌دهد." #: src/other-resources.md msgid "" @@ -21397,12 +21425,17 @@ msgid "" "covers the syntax of Rust using side-by-side comparisons with other " "languages such as C, C++, Java, JavaScript, and Python." msgstr "" +"ء [Rust for Professionals](https://overexact.com/rust-for-professionals/): " +"که syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند " +"C، C++، Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" "[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " "you learn Rust." msgstr "" +"ء [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین " +"برای کمک به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" @@ -21411,6 +21444,10 @@ msgid "" "and advanced part of the Rust language. Other topics such as WebAssembly, " "and async/await are also covered." msgstr "" +"ء [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " +"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " +"پوشش داده شده است." #: src/other-resources.md msgid "" @@ -21419,6 +21456,10 @@ msgid "" "built-in testing framework. It covers `googletest`, snapshot testing, " "mocking as well as how to write your own custom test harness." msgstr "" +"ء [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" +"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " +"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " +"تست‌های سفارشی خود را پوشش می‌دهد." #: src/other-resources.md msgid "" @@ -21428,6 +21469,11 @@ msgid "" "new developers. The first is a set of 35 videos and the second is a set of " "11 modules which covers Rust syntax and basic constructs." msgstr "" +"ء [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" +"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" +"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " +"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " +"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" @@ -21435,12 +21481,17 @@ msgid "" "github.io/too-many-lists/): in-depth exploration of Rust's memory management " "rules, through implementing a few different types of list structures." msgstr "" +"ء [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." +"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " +"نوع مختلف list structure." #: src/other-resources.md msgid "" "Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " "for even more Rust books." msgstr "" +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " +"کتاب‌های بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" @@ -21448,6 +21499,8 @@ msgid "" "documentation. See the page on [other resources](other-resources.md) for a " "full list of useful resources." msgstr "" +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " +"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" @@ -21455,10 +21508,13 @@ msgid "" "2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" "rust/blob/main/LICENSE) for details." msgstr "" +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " +"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" +"LICENSE) مراجعه کنید." #: src/credits.md msgid "Rust by Example" -msgstr "" +msgstr "ء Rust به‌همراه مثال" #: src/credits.md msgid "" @@ -21467,10 +21523,13 @@ msgid "" "`third_party/rust-by-example/` directory for details, including the license " "terms." msgstr "" +"ء برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" +"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " +"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" -msgstr "" +msgstr "ء Rust در تمرین‌ها" #: src/credits.md msgid "" @@ -21478,10 +21537,13 @@ msgid "" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " +"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " +"`third_party/rust-on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" -msgstr "" +msgstr "CXX" #: src/credits.md msgid "" @@ -21489,6 +21551,9 @@ msgid "" "uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " "directory for details, including the license terms." msgstr "" +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " +"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " +"license، دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" From f288c8d0f484569ec6048343f53df332c5c002c2 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 26 Aug 2024 23:25:28 +0330 Subject: [PATCH 37/92] fa: credits and other-resources --- po/fa.po | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/po/fa.po b/po/fa.po index 05a53aa8077..d9f2fb37ff5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -21327,7 +21327,7 @@ msgid "" "canonical free book about Rust. Covers the language in detail and includes a " "few projects for people to build." msgstr "" -"ء [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " "معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " "پروژه برای ساخت نرم‌افزار می‌شود." @@ -21338,17 +21338,17 @@ msgid "" "Sometimes includes small exercises where you are asked to expand on the code " "in the examples." msgstr "" -"ء [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد " -"Rust syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به " -"نمایش می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود " -"کد را در مثال‌ها گسترش دهید." +"‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " +"syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " +"در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" "[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " "of the standard library for Rust." msgstr "" -"ء [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " "کتابخانه استاندارد برای Rust می‌باشد." #: src/other-resources.md @@ -21356,7 +21356,7 @@ msgid "" "[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " "book which describes the Rust grammar and memory model." msgstr "" -"ء [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " "گرامر و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md @@ -21369,7 +21369,7 @@ msgid "" "including working with raw pointers and interfacing with other languages " "(FFI)." msgstr "" -"ء[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " "پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " "(FFI) را تشریح می‌کند." @@ -21379,7 +21379,7 @@ msgid "" "covers the new asynchronous programming model which was introduced after the " "Rust Book was written." msgstr "" -"ء [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " "مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " "پس از نگارش کتاب Rust معرفی شده است." @@ -21389,7 +21389,7 @@ msgid "" "an introduction to using Rust on embedded devices without an operating " "system." msgstr "" -"ء [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " "مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " "شامل می‌شود." @@ -21406,7 +21406,7 @@ msgid "" "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " "from the perspective of low-level C programmers." msgstr "" -"ء [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " "Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md @@ -21415,7 +21415,7 @@ msgid "" "rust_for_c_devs.html): covers Rust from the perspective of developers who " "write firmware in C." msgstr "" -"ء [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" "rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " "زبان C می‌نویسند پوشش می‌دهد." @@ -21425,17 +21425,17 @@ msgid "" "covers the syntax of Rust using side-by-side comparisons with other " "languages such as C, C++, Java, JavaScript, and Python." msgstr "" -"ء [Rust for Professionals](https://overexact.com/rust-for-professionals/): " -"که syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند " -"C، C++، Java، JavaScript و Python پوشش می‌دهد." +"‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " +"C++، Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" "[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " "you learn Rust." msgstr "" -"ء [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین " -"برای کمک به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " +"کمک به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" @@ -21444,7 +21444,7 @@ msgid "" "and advanced part of the Rust language. Other topics such as WebAssembly, " "and async/await are also covered." msgstr "" -"ء [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" "material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " "زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " "پوشش داده شده است." @@ -21456,7 +21456,7 @@ msgid "" "built-in testing framework. It covers `googletest`, snapshot testing, " "mocking as well as how to write your own custom test harness." msgstr "" -"ء [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" "advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " "Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " "تست‌های سفارشی خود را پوشش می‌دهد." @@ -21469,7 +21469,7 @@ msgid "" "new developers. The first is a set of 35 videos and the second is a set of " "11 modules which covers Rust syntax and basic constructs." msgstr "" -"ء [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" "beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" "docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " "هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " @@ -21481,7 +21481,7 @@ msgid "" "github.io/too-many-lists/): in-depth exploration of Rust's memory management " "rules, through implementing a few different types of list structures." msgstr "" -"ء [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." "io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " "نوع مختلف list structure." @@ -21514,7 +21514,7 @@ msgstr "" #: src/credits.md msgid "Rust by Example" -msgstr "ء Rust به‌همراه مثال" +msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" @@ -21523,13 +21523,13 @@ msgid "" "`third_party/rust-by-example/` directory for details, including the license " "terms." msgstr "" -"ء برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" "rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " "license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" -msgstr "ء Rust در تمرین‌ها" +msgstr "‏ Rust در تمرین‌ها" #: src/credits.md msgid "" From 62561465f0d4687f113b977d8e6673d61118b351 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 27 Aug 2024 23:38:28 +0330 Subject: [PATCH 38/92] fa: bare-metal part 1/3 --- po/fa.po | 248 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 176 insertions(+), 72 deletions(-) diff --git a/po/fa.po b/po/fa.po index d9f2fb37ff5..1c4d309ae00 100644 --- a/po/fa.po +++ b/po/fa.po @@ -16832,7 +16832,7 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md:1 msgid "Inline assembly" -msgstr "" +msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md:3 msgid "" @@ -16840,54 +16840,63 @@ msgid "" "Rust code. For example, to make an HVC (hypervisor call) to tell the " "firmware to power off the system:" msgstr "" +"گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " +"که به firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md:20 +#, fuzzy msgid "" "// SAFETY: this only uses the declared registers and doesn't do anything\n" " // with memory.\n" msgstr "" +"// SAFETY: this only uses the declared registers and doesn't do anything\n" +" // with memory.\n" #: src/bare-metal/aps/inline-assembly.md:23 msgid "\"hvc #0\"" -msgstr "" +msgstr "\"hvc #0\"" #: src/bare-metal/aps/inline-assembly.md:24 msgid "\"w0\"" -msgstr "" +msgstr "\"w0\"" #: src/bare-metal/aps/inline-assembly.md:25 msgid "\"w1\"" -msgstr "" +msgstr "\"w1\"" #: src/bare-metal/aps/inline-assembly.md:26 msgid "\"w2\"" -msgstr "" +msgstr "\"w2\"" #: src/bare-metal/aps/inline-assembly.md:27 msgid "\"w3\"" -msgstr "" +msgstr "\"w3\"" #: src/bare-metal/aps/inline-assembly.md:28 msgid "\"w4\"" -msgstr "" +msgstr "\"w4\"" #: src/bare-metal/aps/inline-assembly.md:29 msgid "\"w5\"" -msgstr "" +msgstr "\"w5\"" #: src/bare-metal/aps/inline-assembly.md:30 msgid "\"w6\"" -msgstr "" +msgstr "\"w6\"" #: src/bare-metal/aps/inline-assembly.md:31 msgid "\"w7\"" -msgstr "" +msgstr "\"w7\"" #: src/bare-metal/aps/inline-assembly.md:40 msgid "" "(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" "smccc) crate which has wrappers for all these functions.)" msgstr "" +"(اگر واقعاُ می‌خواهید این کار را انجام دهید، از crate مربوطه [`smccc`](https://" +"crates.io/crates/smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این " +"عملکردها است.)" #: src/bare-metal/aps/inline-assembly.md:45 msgid "" @@ -16895,6 +16904,9 @@ msgid "" "functions to manage system and CPU power states, among other things. It is " "implemented by EL3 firmware and hypervisors on many systems." msgstr "" +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " +"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " +"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md:48 msgid "" @@ -16903,12 +16915,18 @@ msgid "" "`inout` rather than `in` because the call could potentially clobber the " "contents of the registers." msgstr "" +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " +"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " +"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " +"محتویات رجیسترها را مخدوش کند." #: src/bare-metal/aps/inline-assembly.md:52 msgid "" "This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " "it is called from our entry point in `entry.S`." msgstr "" +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " +"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md:54 msgid "" @@ -16919,36 +16937,50 @@ msgid "" "arguments passed to a function, so `entry.S` doesn't need to do anything " "special except make sure it doesn't change these registers." msgstr "" +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " +"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " +"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " +"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " +"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " +"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " +"نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md:60 msgid "" "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" "examples`." msgstr "" +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/mmio.md:1 msgid "Volatile memory access for MMIO" -msgstr "" +msgstr "دسترسی به حافظه فرار برای MMIO" #: src/bare-metal/aps/mmio.md:3 msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." -msgstr "" +msgstr "از `pointer::read_volatile` و `pointer::write_volatile` استفاده کنید." #: src/bare-metal/aps/mmio.md:4 msgid "Never hold a reference." -msgstr "" +msgstr "هرگز reference‌ای را نگه ندارید." #: src/bare-metal/aps/mmio.md:5 msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " +"ساختارها را دریافت کنید." #: src/bare-metal/aps/mmio.md:10 msgid "" "Volatile access: read or write operations may have side-effects, so prevent " "the compiler or hardware from reordering, duplicating or eliding them." msgstr "" +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " +"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " +"حذف آنها جلوگیری کنید." #: src/bare-metal/aps/mmio.md:12 msgid "" @@ -16956,6 +16988,9 @@ msgid "" "compiler may assume that the value read is the same as the value just " "written, and not bother actually reading memory." msgstr "" +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " +"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " +"است و در واقع خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md:15 msgid "" @@ -16963,28 +16998,37 @@ msgid "" "this is unsound. Whenever a reference exist, the compiler may choose to " "dereference it." msgstr "" +"برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " +"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md:18 msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " +"ساختار استفاده کنید." #: src/bare-metal/aps/uart.md:1 msgid "Let's write a UART driver" -msgstr "" +msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md:3 msgid "" "The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" "documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md:9 +#, fuzzy msgid "/// Minimal driver for a PL011 UART.\n" -msgstr "" +msgstr "/// Minimal driver for a PL011 UART.\n" #: src/bare-metal/aps/uart.md:17 src/bare-metal/aps/better-uart/driver.md:13 +#, fuzzy msgid "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" " /// given base address.\n" @@ -16997,28 +17041,45 @@ msgid "" "process\n" " /// as device memory and not have any other aliases.\n" msgstr "" +"/// Constructs a new instance of the UART driver for a PL011 device at the\n" +" /// given base address.\n" +" ///\n" +" /// # Safety\n" +" ///\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" +" /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md:29 src/bare-metal/aps/better-uart/driver.md:25 +#, fuzzy msgid "/// Writes a single byte to the UART.\n" -msgstr "" +msgstr "/// Writes a single byte to the UART.\n" #: src/bare-metal/aps/uart.md:31 src/bare-metal/aps/better-uart/driver.md:27 +#, fuzzy msgid "// Wait until there is room in the TX buffer.\n" -msgstr "" +msgstr "// Wait until there is room in the TX buffer.\n" #: src/bare-metal/aps/uart.md:34 src/bare-metal/aps/uart.md:46 +#, fuzzy msgid "" "// SAFETY: We know that the base address points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" +"// SAFETY: We know that the base address points to the control\n" +" // registers of a PL011 device which is appropriately mapped.\n" #: src/bare-metal/aps/uart.md:37 src/bare-metal/aps/better-uart/driver.md:33 +#, fuzzy msgid "// Write to the TX buffer.\n" -msgstr "" +msgstr "// Write to the TX buffer.\n" #: src/bare-metal/aps/uart.md:41 src/bare-metal/aps/better-uart/driver.md:37 +#, fuzzy msgid "// Wait until the UART is no longer busy.\n" -msgstr "" +msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md:55 msgid "" @@ -17029,6 +17090,12 @@ msgid "" "it is always safe to call `write_byte` later because we can assume the " "necessary preconditions." msgstr "" +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " +"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " +"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " +"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " +"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " +"را فرض کنیم." #: src/bare-metal/aps/uart.md:61 msgid "" @@ -17036,47 +17103,63 @@ msgid "" "`write_byte` unsafe), but that would be much less convenient to use as every " "place that calls `write_byte` would need to reason about the safety" msgstr "" +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " +"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " +"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " +"استدلال کند." #: src/bare-metal/aps/uart.md:64 +#, fuzzy msgid "" "This is a common pattern for writing safe wrappers of unsafe code: moving " "the burden of proof for soundness from a large number of places to a smaller " "number of places." msgstr "" +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " +"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md:1 msgid "More traits" -msgstr "" +msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md:3 msgid "" "We derived the `Debug` trait. It would be useful to implement a few more " "traits too." msgstr "" +"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md:17 +#, fuzzy msgid "" "// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" +"// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" +"// accessed from any context.\n" #: src/bare-metal/aps/uart/traits.md:25 msgid "" "Implementing `Write` lets us use the `write!` and `writeln!` macros with our " "`Uart` type." msgstr "" +"پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ " +"`Uart` خود استفاده کنیم." #: src/bare-metal/aps/uart/traits.md:27 msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/better-uart.md:1 msgid "A better UART driver" -msgstr "" +msgstr "یک درایور UART بهتر" #: src/bare-metal/aps/better-uart.md:3 +#, fuzzy msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " @@ -17084,228 +17167,249 @@ msgid "" "read. Plus, some of them are bit fields which would be nice to access in a " "structured way." msgstr "" +"‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" +"documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " +"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " +"به آنها به روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md:7 msgid "Offset" -msgstr "" +msgstr "افست" #: src/bare-metal/aps/better-uart.md:7 msgid "Register name" -msgstr "" +msgstr "نام رجیستر" #: src/bare-metal/aps/better-uart.md:7 msgid "Width" -msgstr "" +msgstr "عرض" #: src/bare-metal/aps/better-uart.md:9 msgid "0x00" -msgstr "" +msgstr "0x00" #: src/bare-metal/aps/better-uart.md:9 msgid "DR" -msgstr "" +msgstr "DR" #: src/bare-metal/aps/better-uart.md:9 msgid "12" -msgstr "" +msgstr "12" #: src/bare-metal/aps/better-uart.md:10 msgid "0x04" -msgstr "" +msgstr "0x04" #: src/bare-metal/aps/better-uart.md:10 msgid "RSR" -msgstr "" +msgstr "RSR" #: src/bare-metal/aps/better-uart.md:10 msgid "4" -msgstr "" +msgstr "4" #: src/bare-metal/aps/better-uart.md:11 msgid "0x18" -msgstr "" +msgstr "0x18" #: src/bare-metal/aps/better-uart.md:11 msgid "FR" -msgstr "" +msgstr "FR" #: src/bare-metal/aps/better-uart.md:11 msgid "9" -msgstr "" +msgstr "9" #: src/bare-metal/aps/better-uart.md:12 msgid "0x20" -msgstr "" +msgstr "0x20" #: src/bare-metal/aps/better-uart.md:12 msgid "ILPR" -msgstr "" +msgstr "ILPR" #: src/bare-metal/aps/better-uart.md:12 src/bare-metal/aps/better-uart.md:15 msgid "8" -msgstr "" +msgstr "8" #: src/bare-metal/aps/better-uart.md:13 msgid "0x24" -msgstr "" +msgstr "0x24" #: src/bare-metal/aps/better-uart.md:13 msgid "IBRD" -msgstr "" +msgstr "IBRD" #: src/bare-metal/aps/better-uart.md:13 src/bare-metal/aps/better-uart.md:16 msgid "16" -msgstr "" +msgstr "16" #: src/bare-metal/aps/better-uart.md:14 msgid "0x28" -msgstr "" +msgstr "0x28" #: src/bare-metal/aps/better-uart.md:14 msgid "FBRD" -msgstr "" +msgstr "FBRD" #: src/bare-metal/aps/better-uart.md:14 src/bare-metal/aps/better-uart.md:17 msgid "6" -msgstr "" +msgstr "6" #: src/bare-metal/aps/better-uart.md:15 msgid "0x2c" -msgstr "" +msgstr "0x2c" #: src/bare-metal/aps/better-uart.md:15 msgid "LCR_H" -msgstr "" +msgstr "LCR_H" #: src/bare-metal/aps/better-uart.md:16 msgid "0x30" -msgstr "" +msgstr "0x30" #: src/bare-metal/aps/better-uart.md:16 msgid "CR" -msgstr "" +msgstr "CR" #: src/bare-metal/aps/better-uart.md:17 msgid "0x34" -msgstr "" +msgstr "0x34" #: src/bare-metal/aps/better-uart.md:17 msgid "IFLS" -msgstr "" +msgstr "IFLS" #: src/bare-metal/aps/better-uart.md:18 msgid "0x38" -msgstr "" +msgstr "0x38" #: src/bare-metal/aps/better-uart.md:18 msgid "IMSC" -msgstr "" +msgstr "IMSC" #: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 #: src/bare-metal/aps/better-uart.md:20 src/bare-metal/aps/better-uart.md:21 msgid "11" -msgstr "" +msgstr "11" #: src/bare-metal/aps/better-uart.md:19 msgid "0x3c" -msgstr "" +msgstr "0x3c" #: src/bare-metal/aps/better-uart.md:19 msgid "RIS" -msgstr "" +msgstr "RIS" #: src/bare-metal/aps/better-uart.md:20 msgid "0x40" -msgstr "" +msgstr "0x40" #: src/bare-metal/aps/better-uart.md:20 msgid "MIS" -msgstr "" +msgstr "MIS" #: src/bare-metal/aps/better-uart.md:21 msgid "0x44" -msgstr "" +msgstr "0x44" #: src/bare-metal/aps/better-uart.md:21 msgid "ICR" -msgstr "" +msgstr "ICR" #: src/bare-metal/aps/better-uart.md:22 msgid "0x48" -msgstr "" +msgstr "0x48" #: src/bare-metal/aps/better-uart.md:22 msgid "DMACR" -msgstr "" +msgstr "DMACR" #: src/bare-metal/aps/better-uart.md:22 msgid "3" -msgstr "" +msgstr "3" #: src/bare-metal/aps/better-uart.md:26 msgid "There are also some ID registers which have been omitted for brevity." -msgstr "" +msgstr "همچنین برخی از ID register هایی وجود دارد که برای اختصار حذف شده‌اند." #: src/bare-metal/aps/better-uart/bitflags.md:3 msgid "" "The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " "working with bitflags." msgstr "" +"این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " +"bitflags مفید است." #: src/bare-metal/aps/better-uart/bitflags.md:10 +#, fuzzy msgid "/// Flags from the UART flag register.\n" -msgstr "" +msgstr "/// Flags from the UART flag register.\n" #: src/bare-metal/aps/better-uart/bitflags.md:14 +#, fuzzy msgid "/// Clear to send.\n" -msgstr "" +msgstr "/// Clear to send.\n" #: src/bare-metal/aps/better-uart/bitflags.md:16 +#, fuzzy msgid "/// Data set ready.\n" -msgstr "" +msgstr "/// Data set ready.\n" #: src/bare-metal/aps/better-uart/bitflags.md:18 +#, fuzzy msgid "/// Data carrier detect.\n" -msgstr "" +msgstr "/// Data carrier detect.\n" #: src/bare-metal/aps/better-uart/bitflags.md:20 +#, fuzzy msgid "/// UART busy transmitting data.\n" -msgstr "" +msgstr "/// UART busy transmitting data.\n" #: src/bare-metal/aps/better-uart/bitflags.md:22 +#, fuzzy msgid "/// Receive FIFO is empty.\n" -msgstr "" +msgstr "/// Receive FIFO is empty.\n" #: src/bare-metal/aps/better-uart/bitflags.md:24 +#, fuzzy msgid "/// Transmit FIFO is full.\n" -msgstr "" +msgstr "/// Transmit FIFO is full.\n" #: src/bare-metal/aps/better-uart/bitflags.md:26 +#, fuzzy msgid "/// Receive FIFO is full.\n" -msgstr "" +msgstr "/// Receive FIFO is full.\n" #: src/bare-metal/aps/better-uart/bitflags.md:28 +#, fuzzy msgid "/// Transmit FIFO is empty.\n" -msgstr "" +msgstr "/// Transmit FIFO is empty.\n" #: src/bare-metal/aps/better-uart/bitflags.md:30 +#, fuzzy msgid "/// Ring indicator.\n" -msgstr "" +msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md:38 msgid "" "The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " "with a bunch of method implementations to get and set flags." msgstr "" +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " +"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md:1 msgid "Multiple registers" -msgstr "" +msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md:3 msgid "" "We can use a struct to represent the memory layout of the UART's registers." msgstr "" +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " +"کنیم." #: src/bare-metal/aps/better-uart/registers.md:43 msgid "" From 26d30ae9bda839d6b144dcd1c668409f87f16ac0 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 29 Aug 2024 00:10:15 +0330 Subject: [PATCH 39/92] fa: src/bare-metal par 2/3 --- po/fa.po | 193 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 169 insertions(+), 24 deletions(-) diff --git a/po/fa.po b/po/fa.po index 1c4d309ae00..b163ced764a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -17419,90 +17419,116 @@ msgid "" "predictable layout, as default Rust representation allows the compiler to " "(among other things) reorder fields however it sees fit." msgstr "" +"‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " +"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " +"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " +"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " +"کند." #: src/bare-metal/aps/better-uart/driver.md:3 msgid "Now let's use the new `Registers` struct in our driver." -msgstr "" +msgstr "حال بیایید از ساختار جدید `Registers` در درایور خود استفاده کنیم." #: src/bare-metal/aps/better-uart/driver.md:6 +#, fuzzy msgid "/// Driver for a PL011 UART.\n" -msgstr "" +msgstr "/// Driver for a PL011 UART.\n" #: src/bare-metal/aps/better-uart/driver.md:30 #: src/bare-metal/aps/better-uart/driver.md:56 +#, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL011 device which is appropriately mapped.\n" msgstr "" +"// SAFETY: We know that self.registers points to the control registers\n" +" // of a PL011 device which is appropriately mapped.\n" #: src/bare-metal/aps/better-uart/driver.md:41 +#, fuzzy msgid "" "/// Reads and returns a pending byte, or `None` if nothing has been\n" " /// received.\n" msgstr "" +"/// Reads and returns a pending byte, or `None` if nothing has been\n" +" /// received.\n" +"\n" #: src/bare-metal/aps/better-uart/driver.md:47 +#, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" +"// SAFETY: We know that self.registers points to the control\n" +" // registers of a PL011 device which is appropriately mapped.\n" #: src/bare-metal/aps/better-uart/driver.md:50 +#, fuzzy msgid "// TODO: Check for error conditions in bits 8-11.\n" -msgstr "" +msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md:65 msgid "" "Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." msgstr "" +"به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " +"جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." #: src/bare-metal/aps/better-uart/using.md:1 #: src/bare-metal/aps/logging/using.md:1 msgid "Using it" -msgstr "" +msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md:3 msgid "" "Let's write a small program using our driver to write to the serial console, " "and echo incoming bytes." msgstr "" +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " +"بنویسیم و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md:19 #: src/bare-metal/aps/logging/using.md:18 #: src/exercises/bare-metal/solutions-afternoon.md:33 +#, fuzzy msgid "/// Base address of the primary PL011 UART.\n" -msgstr "" +msgstr "/// Base address of the primary PL011 UART.\n" #: src/bare-metal/aps/better-uart/using.md:25 #: src/bare-metal/aps/logging/using.md:24 #: src/exercises/bare-metal/solutions-afternoon.md:44 +#, fuzzy msgid "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" " // nothing else accesses that address range.\n" msgstr "" +"// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" +" // nothing else accesses that address range.\n" #: src/bare-metal/aps/better-uart/using.md:29 #: src/bare-metal/aps/logging/using.md:29 msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" -msgstr "" +msgstr "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" #: src/bare-metal/aps/better-uart/using.md:35 msgid "b'\\r'" -msgstr "" +msgstr "b'\\r'" #: src/bare-metal/aps/better-uart/using.md:36 #: src/concurrency/async-pitfalls/cancellation.md:27 msgid "b'\\n'" -msgstr "" +msgstr "b'\\n'" #: src/bare-metal/aps/better-uart/using.md:38 msgid "b'q'" -msgstr "" +msgstr "b'q'" #: src/bare-metal/aps/better-uart/using.md:44 msgid "\"Bye!\"" -msgstr "" +msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md:51 msgid "" @@ -17510,11 +17536,16 @@ msgid "" "function is called from our entry point code in `entry.S`. See the speaker " "notes there for details." msgstr "" +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " +"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " +"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md:54 msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/logging.md:3 msgid "" @@ -17522,39 +17553,48 @@ msgid "" "(https://crates.io/crates/log) crate. We can do this by implementing the " "`Log` trait." msgstr "" +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" +"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " +"دهیم." #: src/bare-metal/aps/logging.md:26 msgid "\"[{}] {}\"" -msgstr "" +msgstr "\"[{}] {}\"" #: src/bare-metal/aps/logging.md:35 +#, fuzzy msgid "/// Initialises UART logger.\n" -msgstr "" +msgstr "/// Initialises UART logger.\n" #: src/bare-metal/aps/logging.md:48 msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " +"مقداردهی اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md:3 msgid "We need to initialise the logger before we use it." -msgstr "" +msgstr "قبل از استفاده از لاگر باید مقداردهی اولیه کنیم." #: src/bare-metal/aps/logging/using.md:38 #: src/exercises/bare-metal/solutions-afternoon.md:115 msgid "\"{info}\"" -msgstr "" +msgstr "\"{info}\"" #: src/bare-metal/aps/logging/using.md:46 msgid "Note that our panic handler can now log details of panics." msgstr "" +"توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." #: src/bare-metal/aps/logging/using.md:47 msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/exceptions.md:3 msgid "" @@ -17564,24 +17604,35 @@ msgid "" "We implement this in assembly to save volatile registers to the stack before " "calling into Rust code:" msgstr "" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " +"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " +"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " +"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " +"فراخوانی Rust در stack ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md:67 msgid "EL is exception level; all our examples this afternoon run in EL1." msgstr "" +"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md:68 msgid "" "For simplicity we aren't distinguishing between SP0 and SPx for the current " "EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " +"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md:70 msgid "" "For this example we just log the exception and power down, as we don't " "expect any of them to actually happen." msgstr "" +"برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " +"نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." #: src/bare-metal/aps/exceptions.md:72 +#, fuzzy msgid "" "We can think of exception handlers and our main execution context more or " "less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." @@ -17590,64 +17641,87 @@ msgid "" "rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " "it in something like a `Mutex` and put it in a static." msgstr "" +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " +"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." +"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " +"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " +"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " +"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " +"قرار دهیم." #: src/bare-metal/aps/other-projects.md:3 msgid "[oreboot](https://github.com/oreboot/oreboot)" -msgstr "" +msgstr "[oreboot](https://github.com/oreboot/oreboot)" #: src/bare-metal/aps/other-projects.md:4 +#, fuzzy msgid "\"coreboot without the C\"" -msgstr "" +msgstr "\"coreboot without the C\"" #: src/bare-metal/aps/other-projects.md:5 msgid "Supports x86, aarch64 and RISC-V." -msgstr "" +msgstr "پشتیبانی از x86، aarch64 و RISC-V." #: src/bare-metal/aps/other-projects.md:6 msgid "Relies on LinuxBoot rather than having many drivers itself." -msgstr "" +msgstr "به جای اینکه خود درایورهای زیادی داشته باشد، به LinuxBoot متکی است." #: src/bare-metal/aps/other-projects.md:7 msgid "" "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" "raspberrypi-OS-tutorials)" msgstr "" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md:8 msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " "exception handling, page tables" msgstr "" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " +"exception و page tableها" #: src/bare-metal/aps/other-projects.md:10 msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " +"برای کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md:12 msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" -msgstr "" +msgstr "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" #: src/bare-metal/aps/other-projects.md:13 msgid "Static analysis to determine maximum stack usage." -msgstr "" +msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداکثر استفاده از stack." #: src/bare-metal/aps/other-projects.md:17 msgid "" "The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " "enabled. This will read and write memory (e.g. the stack). However:" msgstr "" +"آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " +"بااین‌حال:" #: src/bare-metal/aps/other-projects.md:19 +#, fuzzy msgid "" "Without the MMU and cache, unaligned accesses will fault. It builds with " "`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " "generating unaligned accesses so it should be alright, but this is not " "necessarily the case in general." msgstr "" +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " +"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " +"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " +"صحیح باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/other-projects.md:23 +#, fuzzy msgid "" "If it were running in a VM, this can lead to cache coherency issues. The " "problem is that the VM is accessing memory directly with the cache disabled, " @@ -17657,6 +17731,13 @@ msgid "" "alright in this particular case (running directly on the hardware with no " "hypervisor), but isn't a good pattern in general." msgstr "" +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " +"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " +"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " +"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " +"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " +"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " +"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" @@ -17667,6 +17748,8 @@ msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " +"را حل می‌کند." #: src/bare-metal/useful-crates/zerocopy.md:3 msgid "" @@ -17674,6 +17757,8 @@ msgid "" "traits and macros for safely converting between byte sequences and other " "types." msgstr "" +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " +"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md:42 msgid "" @@ -17681,12 +17766,18 @@ msgid "" "but can be useful for working with structures shared with hardware e.g. by " "DMA, or sent over some external interface." msgstr "" +"این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " +"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md:48 msgid "" "`FromBytes` can be implemented for types for which any byte pattern is " "valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" +"‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " +"تبدیل کرد." #: src/bare-metal/useful-crates/zerocopy.md:50 msgid "" @@ -17694,11 +17785,16 @@ msgid "" "`RequestType` doesn't use all possible u32 values as discriminants, so not " "all byte patterns are valid." msgstr "" +"تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " +"`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " +"بنابراین همه الگوهای بایت معتبر نیستند." #: src/bare-metal/useful-crates/zerocopy.md:53 +#, fuzzy msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" +"‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md:54 msgid "" @@ -17706,6 +17802,8 @@ msgid "" "zerocopy-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" +"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md:3 msgid "" @@ -17713,24 +17811,32 @@ msgid "" "you create page tables according to the AArch64 Virtual Memory System " "Architecture." msgstr "" +"این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " +"کنید." #: src/bare-metal/useful-crates/aarch64-paging.md:14 +#, fuzzy msgid "// Create a new page table with identity mapping.\n" -msgstr "" +msgstr "// Create a new page table with identity mapping.\n" #: src/bare-metal/useful-crates/aarch64-paging.md:16 +#, fuzzy msgid "// Map a 2 MiB region of memory as read-only.\n" -msgstr "" +msgstr "// Map a 2 MiB region of memory as read-only.\n" #: src/bare-metal/useful-crates/aarch64-paging.md:21 +#, fuzzy msgid "// Set `TTBR0_EL1` to activate the page table.\n" -msgstr "" +msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md:28 msgid "" "For now it only supports EL1, but support for other exception levels should " "be straightforward to add." msgstr "" +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " +"ساده باشد." #: src/bare-metal/useful-crates/aarch64-paging.md:30 msgid "" @@ -17738,12 +17844,17 @@ msgid "" "com/android/platform/superproject/+/master:packages/modules/Virtualization/" "pvmfw/)." msgstr "" +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/) استفاده می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md:31 msgid "" "There's no easy way to run this example, as it needs to run on real hardware " "or under QEMU." msgstr "" +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " +"یا تحت QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md:3 msgid "" @@ -17756,10 +17867,19 @@ msgid "" "allocating other address space. For example, we might want to allocate MMIO " "space for PCI BARs:" msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " +"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " +"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " +"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " +"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " +"اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md:29 msgid "PCI BARs always have alignment equal to their size." -msgstr "" +msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اندازه خود هستند." #: src/bare-metal/useful-crates/buddy_system_allocator.md:30 msgid "" @@ -17767,6 +17887,8 @@ msgid "" "allocator-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " +"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md:3 msgid "" @@ -17776,17 +17898,26 @@ msgid "" "allocated or on the stack, which keeps track of how many elements are used " "and panics if you try to use more than are allocated." msgstr "" +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " +"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " +"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " +"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " +"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " +"کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md:25 msgid "" "`tinyvec` requires that the element type implement `Default` for " "initialisation." msgstr "" +"‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." #: src/bare-metal/useful-crates/tinyvec.md:27 msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " +"داخلی اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md:3 msgid "" @@ -17794,22 +17925,31 @@ msgid "" "are not available in `core` or `alloc`. How can we manage synchronisation or " "interior mutability, such as for sharing state between different CPUs?" msgstr "" +"‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " +"`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " +"اشتراک‌گذاری وضعیت بین CPU‌های مختلف را مدیریت کنیم؟" #: src/bare-metal/useful-crates/spin.md:7 msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " +"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md:26 msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " +"کنید." #: src/bare-metal/useful-crates/spin.md:27 msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " +"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md:29 msgid "" @@ -17817,11 +17957,16 @@ msgid "" "useful types for late initialisation with a slightly different approach to " "`spin::once::Once`." msgstr "" +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " +"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" +"once::Once` است." #: src/bare-metal/useful-crates/spin.md:31 msgid "" "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/android.md msgid "" From f11bbc440421f9f06c82ef2be0d937e58d4d1a55 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 29 Aug 2024 23:09:30 +0330 Subject: [PATCH 40/92] fa: bare-metal part 3/3 --- po/fa.po | 172 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 135 insertions(+), 37 deletions(-) diff --git a/po/fa.po b/po/fa.po index b163ced764a..171b90ef4fb 100644 --- a/po/fa.po +++ b/po/fa.po @@ -17975,6 +17975,10 @@ msgid "" "with a linker script to produce the binary itself, and then a `raw_binary` " "to convert the ELF to a raw binary ready to be run." msgstr "" +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " +"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " +"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " +"ELF به یک raw binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md:1 msgid "vmbase" @@ -17987,22 +17991,31 @@ msgid "" "master/vmbase/) library provides a linker script and useful defaults for the " "build rules, along with an entry point, UART console logging and more." msgstr "" +"برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" +"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " +"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " +"موارد دیگر." #: src/bare-metal/android/vmbase.md:24 msgid "" "The `main!` macro marks your main function, to be called from the `vmbase` " "entry point." msgstr "" +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " +"فراخوانی شود." #: src/bare-metal/android/vmbase.md:26 msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " +"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." -msgstr "" +msgstr "ما یک درایور برای دستگاه PL031 real-time clock خواهیم نوشت." #: src/exercises/bare-metal/afternoon.md msgid "" @@ -18015,27 +18028,38 @@ msgstr "" #: src/exercises/bare-metal/rtc.md:1 #: src/exercises/bare-metal/solutions-afternoon.md:3 msgid "RTC driver" -msgstr "" +msgstr "RTC driver" #: src/exercises/bare-metal/rtc.md:3 +#, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" "documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " "you should write a driver for it." msgstr "" +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." +"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " +"برای آن بنویسید." #: src/exercises/bare-metal/rtc.md:6 msgid "" "Use it to print the current time to the serial console. You can use the " "[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " +"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md:8 +#, fuzzy msgid "" "Use the match register and raw interrupt status to busy-wait until a given " "time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" "doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" +"از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " +"بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" +"(https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" #: src/exercises/bare-metal/rtc.md:11 msgid "" @@ -18043,176 +18067,214 @@ msgid "" "the RTC match. You can use the driver provided in the [`arm-gic`](https://" "docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" +"ء _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " +"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" +"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md:14 msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." -msgstr "" +msgstr "از وقفه RTC استفاده کنید که به عنوان `IntId::spi(2)` به GIC متصل است." #: src/exercises/bare-metal/rtc.md:15 msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" +"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " +"به خواب برود." #: src/exercises/bare-metal/rtc.md:19 msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `rtc` directory for the following files." msgstr "" +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " +"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md:79 msgid "" "_src/exceptions.rs_ (you should only need to change this for the 3rd part of " "the exercise):" msgstr "" +"ء _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md:156 msgid "_src/logger.rs_ (you shouldn't need to change this):" -msgstr "" +msgstr "ء _src/logger.rs_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:216 msgid "_src/pl011.rs_ (you shouldn't need to change this):" -msgstr "" +msgstr "_src/pl011.rs_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:419 msgid "_build.rs_ (you shouldn't need to change this):" -msgstr "" +msgstr "_build.rs_ (نیازی نیست این مورد رو تغییر دهید):" #: src/exercises/bare-metal/rtc.md:456 msgid "_entry.S_ (you shouldn't need to change this):" -msgstr "" +msgstr "_entry.S_ ( نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:606 msgid "_exceptions.S_ (you shouldn't need to change this):" -msgstr "" +msgstr "_exceptions.S_ ( نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:792 msgid "_idmap.S_ (you shouldn't need to change this):" -msgstr "" +msgstr "_idmap.S_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:842 msgid "_image.ld_ (you shouldn't need to change this):" -msgstr "" +msgstr "_image.ld_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:954 msgid "_Makefile_ (you shouldn't need to change this):" -msgstr "" +msgstr "_Makefile_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:1011 msgid "Run the code in QEMU with `make qemu`." -msgstr "" +msgstr "کد را در QEMU با `make qemu` اجرا کنید." #: src/exercises/bare-metal/solutions-afternoon.md:1 msgid "Bare Metal Rust Afternoon" -msgstr "عصرانه با Bare Metal Rust" +msgstr "بعدازظهربا Bare Metal Rust" #: src/exercises/bare-metal/solutions-afternoon.md:5 +#, fuzzy msgid "([back to exercise](rtc.md))" -msgstr "" +msgstr "([back to exercise](rtc.md))" #: src/exercises/bare-metal/solutions-afternoon.md:7 msgid "_main.rs_:" -msgstr "" +msgstr "_main.rs_:" #: src/exercises/bare-metal/solutions-afternoon.md:29 +#, fuzzy msgid "/// Base addresses of the GICv3.\n" -msgstr "" +msgstr "/// Base addresses of the GICv3.\n" #: src/exercises/bare-metal/solutions-afternoon.md:36 +#, fuzzy msgid "/// Base address of the PL031 RTC.\n" -msgstr "" +msgstr "/// Base address of the PL031 RTC.\n" #: src/exercises/bare-metal/solutions-afternoon.md:38 +#, fuzzy msgid "/// The IRQ used by the PL031 RTC.\n" -msgstr "" +msgstr "/// The IRQ used by the PL031 RTC.\n" #: src/exercises/bare-metal/solutions-afternoon.md:49 +#, fuzzy msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" -msgstr "" +msgstr "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" #: src/exercises/bare-metal/solutions-afternoon.md:51 +#, fuzzy msgid "" "// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" " // addresses of a GICv3 distributor and redistributor respectively, and\n" " // nothing else accesses those address ranges.\n" msgstr "" +"// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" +" // addresses of a GICv3 distributor and redistributor respectively, and\n" +" // nothing else accesses those address ranges.\n" #: src/exercises/bare-metal/solutions-afternoon.md:57 +#, fuzzy msgid "" "// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" " // nothing else accesses that address range.\n" msgstr "" +"// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" +" // nothing else accesses that address range.\n" #: src/exercises/bare-metal/solutions-afternoon.md:62 +#, fuzzy msgid "\"RTC: {time}\"" -msgstr "" +msgstr "\"RTC: {time}\"" #: src/exercises/bare-metal/solutions-afternoon.md:70 +#, fuzzy msgid "// Wait for 3 seconds, without interrupts.\n" -msgstr "" +msgstr "// Wait for 3 seconds, without interrupts.\n" #: src/exercises/bare-metal/solutions-afternoon.md:73 #: src/exercises/bare-metal/solutions-afternoon.md:91 +#, fuzzy msgid "\"Waiting for {}\"" -msgstr "" +msgstr "\"Waiting for {}\"" #: src/exercises/bare-metal/solutions-afternoon.md:75 #: src/exercises/bare-metal/solutions-afternoon.md:83 #: src/exercises/bare-metal/solutions-afternoon.md:96 #: src/exercises/bare-metal/solutions-afternoon.md:104 +#, fuzzy msgid "\"matched={}, interrupt_pending={}\"" -msgstr "" +msgstr "\"matched={}, interrupt_pending={}\"" #: src/exercises/bare-metal/solutions-afternoon.md:87 #: src/exercises/bare-metal/solutions-afternoon.md:108 +#, fuzzy msgid "\"Finished waiting\"" -msgstr "" +msgstr "\"Finished waiting\"" #: src/exercises/bare-metal/solutions-afternoon.md:89 +#, fuzzy msgid "// Wait another 3 seconds for an interrupt.\n" -msgstr "" +msgstr "// Wait another 3 seconds for an interrupt.\n" #: src/exercises/bare-metal/solutions-afternoon.md:121 msgid "_pl031.rs_:" -msgstr "" +msgstr "_pl031.rs_:" #: src/exercises/bare-metal/solutions-afternoon.md:128 +#, fuzzy msgid "/// Data register\n" -msgstr "" +msgstr "/// Data register\n" #: src/exercises/bare-metal/solutions-afternoon.md:130 +#, fuzzy msgid "/// Match register\n" -msgstr "" +msgstr "/// Match register\n" #: src/exercises/bare-metal/solutions-afternoon.md:132 +#, fuzzy msgid "/// Load register\n" -msgstr "" +msgstr "/// Load register\n" #: src/exercises/bare-metal/solutions-afternoon.md:134 +#, fuzzy msgid "/// Control register\n" -msgstr "" +msgstr "/// Control register\n" #: src/exercises/bare-metal/solutions-afternoon.md:137 +#, fuzzy msgid "/// Interrupt Mask Set or Clear register\n" -msgstr "" +msgstr "/// Interrupt Mask Set or Clear register\n" #: src/exercises/bare-metal/solutions-afternoon.md:140 +#, fuzzy msgid "/// Raw Interrupt Status\n" -msgstr "" +msgstr "/// Raw Interrupt Status\n" #: src/exercises/bare-metal/solutions-afternoon.md:143 +#, fuzzy msgid "/// Masked Interrupt Status\n" -msgstr "" +msgstr "/// Masked Interrupt Status\n" #: src/exercises/bare-metal/solutions-afternoon.md:146 +#, fuzzy msgid "/// Interrupt Clear Register\n" -msgstr "" +msgstr "/// Interrupt Clear Register\n" #: src/exercises/bare-metal/solutions-afternoon.md:150 +#, fuzzy msgid "/// Driver for a PL031 real-time clock.\n" -msgstr "" +msgstr "/// Driver for a PL031 real-time clock.\n" #: src/exercises/bare-metal/solutions-afternoon.md:158 +#, fuzzy msgid "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" " /// given base address.\n" @@ -18225,10 +18287,21 @@ msgid "" "process\n" " /// as device memory and not have any other aliases.\n" msgstr "" +"/// Constructs a new instance of the RTC driver for a PL031 device at the\n" +" /// given base address.\n" +" ///\n" +" /// # Safety\n" +" ///\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" +" /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md:170 +#, fuzzy msgid "/// Reads the current RTC value.\n" -msgstr "" +msgstr "/// Reads the current RTC value.\n" #: src/exercises/bare-metal/solutions-afternoon.md:172 #: src/exercises/bare-metal/solutions-afternoon.md:180 @@ -18236,33 +18309,49 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md:199 #: src/exercises/bare-metal/solutions-afternoon.md:211 #: src/exercises/bare-metal/solutions-afternoon.md:218 +#, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL031 device which is appropriately mapped.\n" msgstr "" +"// SAFETY: We know that self.registers points to the control registers\n" +" // of a PL031 device which is appropriately mapped.\n" #: src/exercises/bare-metal/solutions-afternoon.md:177 +#, fuzzy msgid "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" " /// will be generated (if it is enabled).\n" msgstr "" +"/// Writes a match value. When the RTC value matches this then an interrupt\n" +" /// will be generated (if it is enabled).\n" #: src/exercises/bare-metal/solutions-afternoon.md:185 +#, fuzzy msgid "" "/// Returns whether the match register matches the RTC value, whether or " "not\n" " /// the interrupt is enabled.\n" msgstr "" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" +" /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md:194 +#, fuzzy msgid "" "/// Returns whether there is currently an interrupt pending.\n" " ///\n" " /// This should be true if and only if `matched` returns true and the\n" " /// interrupt is masked.\n" msgstr "" +"/// Returns whether there is currently an interrupt pending.\n" +" ///\n" +" /// This should be true if and only if `matched` returns true and the\n" +" /// interrupt is masked.\n" #: src/exercises/bare-metal/solutions-afternoon.md:205 +#, fuzzy msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" @@ -18270,16 +18359,25 @@ msgid "" "the\n" " /// interrupt is disabled.\n" msgstr "" +"/// Sets or clears the interrupt mask.\n" +" ///\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" +" /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md:216 +#, fuzzy msgid "/// Clears a pending interrupt, if any.\n" -msgstr "" +msgstr "/// Clears a pending interrupt, if any.\n" #: src/exercises/bare-metal/solutions-afternoon.md:223 +#, fuzzy msgid "" "// SAFETY: `Rtc` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" +"// SAFETY: `Rtc` just contains a pointer to device memory, which can be\n" +"// accessed from any context.\n" #: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" From 35ae12094b7d180a491582869e484de10bd2fce6 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 31 Aug 2024 00:07:57 +0330 Subject: [PATCH 41/92] fa: Android part 1/4 --- po/fa.po | 233 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 165 insertions(+), 68 deletions(-) diff --git a/po/fa.po b/po/fa.po index 171b90ef4fb..0c12e90e61e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -11603,7 +11603,7 @@ msgstr "" #: src/android.md msgid "Welcome to Rust in Android" -msgstr "" +msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" @@ -11611,6 +11611,9 @@ msgid "" "write new services, libraries, drivers or even firmware in Rust (or improve " "existing code as needed)." msgstr "" +"‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " +"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" @@ -11619,170 +11622,209 @@ msgid "" "to Rust. The fewer dependencies and \"exotic\" types the better. Something " "that parses some raw bytes would be ideal." msgstr "" +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " +"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " +"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " +"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md msgid "" "The speaker may mention any of the following given the increased use of Rust " "in Android:" msgstr "" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " +"زیر اشاره کند:" #: src/android.md msgid "" "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" "over-http3-in-android.html)" msgstr "" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" #: src/android.md msgid "" "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" msgstr "" +"کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" #: src/android.md msgid "" "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" "rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" "rust-in-android.html)" msgstr "" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" #: src/android/setup.md msgid "" "We will be using a Cuttlefish Android Virtual Device to test our code. Make " "sure you have access to one or create a new one with:" msgstr "" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " +"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" "Please see the [Android Developer Codelab](https://source.android.com/docs/" "setup/start) for details." msgstr "" +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" +"docs/setup/start) مراجعه کنید." #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " "desktops. MacOS support is also planned." msgstr "" +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " +"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" "The Cuttlefish system image maintains high fidelity to real devices, and is " "the ideal emulator to run many Rust use cases." msgstr "" +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " +"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" msgstr "" +"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" -msgstr "" +msgstr "Module Type" #: src/android/build-rules.md msgid "Description" -msgstr "" +msgstr "توضیحات" #: src/android/build-rules.md msgid "`rust_binary`" -msgstr "" +msgstr "`rust_binary`" #: src/android/build-rules.md msgid "Produces a Rust binary." -msgstr "" +msgstr "یک Rust binary تولید می‌کند." #: src/android/build-rules.md msgid "`rust_library`" -msgstr "" +msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." msgstr "" +"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" -msgstr "" +msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" "Produces a Rust C library usable by `cc` modules, and provides both static " "and shared variants." msgstr "" +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " +"متغیرهای static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" -msgstr "" +msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" "Produces a `proc-macro` Rust library. These are analogous to compiler " "plugins." msgstr "" +"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" -msgstr "" +msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " +"می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" -msgstr "" +msgstr "`rust_fuzz`" #: src/android/build-rules.md msgid "Produces a Rust fuzz binary leveraging `libfuzzer`." -msgstr "" +msgstr "یک `libfuzzer` باینری Rust fuzz تولید می‌کند." #: src/android/build-rules.md msgid "`rust_protobuf`" -msgstr "" +msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" "Generates source and produces a Rust library that provides an interface for " "a particular protobuf." msgstr "" +"یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " +"protobuf خاص فراهم می‌کند." #: src/android/build-rules.md msgid "`rust_bindgen`" -msgstr "" +msgstr "`rust_bindgen`" #: src/android/build-rules.md msgid "" "Generates source and produces a Rust library containing Rust bindings to C " "libraries." msgstr "" +"یک source تولید می‌کند و یک کتابخانه Rust حاوی پیوندهای Rust به کتابخانه‌های C " +"تولید می‌کند." #: src/android/build-rules.md msgid "We will look at `rust_binary` and `rust_library` next." -msgstr "" +msgstr "در ادامه به `rust_binary` و `rust_binary` نگاه خواهیم کرد." #: src/android/build-rules.md msgid "Additional items speaker may mention:" -msgstr "" +msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" "Cargo is not optimized for multi-language repos, and also downloads packages " "from the internet." msgstr "" +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " +"اینترنت دانلود می‌کند." #: src/android/build-rules.md msgid "" "For compliance and performance, Android must have crates in-tree. It must " "also interop with C/C++/Java code. Soong fills that gap." msgstr "" +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " +"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md msgid "" "Soong has many similarities to Bazel, which is the open-source variant of " "Blaze (used in google3)." msgstr "" +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " +"استفاده در google3)." #: src/android/build-rules.md msgid "" @@ -11791,57 +11833,66 @@ msgid "" "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" "build/bazel/introduction) to Bazel." msgstr "" +"برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" +"bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" +"bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" +"build/bazel/introduction) به Bazel." #: src/android/build-rules.md msgid "Learning Bazel-like build rules is useful for all Rust OS developers." -msgstr "" +msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." #: src/android/build-rules.md +#, fuzzy msgid "Fun fact: Data from Star Trek is a Soong-type Android." -msgstr "" +msgstr "واقعیت جالب: داده‌های Star Trek یک اندروید از نوع Soong است." #: src/android/build-rules/binary.md:1 msgid "Rust Binaries" -msgstr "" +msgstr "Rust Binaries" #: src/android/build-rules/binary.md:3 msgid "" "Let us start with a simple application. At the root of an AOSP checkout, " "create the following files:" msgstr "" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " +"ایجاد کنید:" #: src/android/build-rules/binary.md:6 src/android/build-rules/library.md:13 msgid "_hello_rust/Android.bp_:" -msgstr "" +msgstr "_hello_rust/Android.bp_:" #: src/android/build-rules/binary.md:10 src/android/build-rules/binary.md:11 +#, fuzzy msgid "\"hello_rust\"" -msgstr "" +msgstr "\"hello_rust\"" #: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 #: src/android/logging.md msgid "\"src/main.rs\"" -msgstr "" +msgstr "\"src/main.rs\"" #: src/android/build-rules/binary.md:16 src/android/build-rules/library.md:34 msgid "_hello_rust/src/main.rs_:" -msgstr "" +msgstr "_hello_rust/src/main.rs_:" #: src/android/build-rules/binary.md:19 src/android/build-rules/library.md:37 msgid "//! Rust demo.\n" -msgstr "" +msgstr "//! Rust demo.\n" #: src/android/build-rules/binary.md:20 src/android/build-rules/library.md:41 msgid "/// Prints a greeting to standard output.\n" -msgstr "" +msgstr "/// Prints a greeting to standard output.\n" #: src/android/build-rules/binary.md:23 src/exercises/chromium/build-rules.md:9 +#, fuzzy msgid "\"Hello from Rust!\"" -msgstr "" +msgstr "\"Hello from Rust!\"" #: src/android/build-rules/binary.md:27 msgid "You can now build, push, and run the binary:" -msgstr "" +msgstr "اکنون می‌توانید باینری را بسازید، push و اجرا کنید:" #: src/android/build-rules/binary.md:29 msgid "" @@ -11851,75 +11902,89 @@ msgid "" "adb shell /data/local/tmp/hello_rust\n" "```" msgstr "" +"```shell\n" +"m hello_rust\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust\" /data/local/tmp\n" +"adb shell /data/local/tmp/hello_rust\n" +"```" #: src/android/build-rules/library.md:1 msgid "Rust Libraries" -msgstr "" +msgstr "کتابخانه‌های Rust" #: src/android/build-rules/library.md:3 msgid "You use `rust_library` to create a new Rust library for Android." msgstr "" +"شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده " +"می‌کنید." #: src/android/build-rules/library.md:5 msgid "Here we declare a dependency on two libraries:" -msgstr "" +msgstr "در اینجا ما یک وابستگی به دو کتابخانه را اعلام می‌کنیم:" #: src/android/build-rules/library.md:7 msgid "`libgreeting`, which we define below," -msgstr "" +msgstr "‏ `libgreeting`, چیزی که در زیر تعریف می‌کنیم," #: src/android/build-rules/library.md:8 +#, fuzzy msgid "" "`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/)." msgstr "" +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/) عرضه شده است." #: src/android/build-rules/library.md:17 src/android/build-rules/library.md:18 +#, fuzzy msgid "\"hello_rust_with_dep\"" -msgstr "" +msgstr "\"hello_rust_with_dep\"" #: src/android/build-rules/library.md:21 src/android/build-rules/library.md:28 msgid "\"libgreetings\"" -msgstr "" +msgstr "\"libgreetings\"" #: src/android/build-rules/library.md:22 msgid "\"libtextwrap\"" -msgstr "" +msgstr "\"libtextwrap\"" #: src/android/build-rules/library.md:24 msgid "// Need this to avoid dynamic link error.\n" -msgstr "" +msgstr "// Need this to avoid dynamic link error.\n" #: src/android/build-rules/library.md:29 +#, fuzzy msgid "\"greetings\"" -msgstr "" +msgstr "\"greetings\"" #: src/android/build-rules/library.md:30 #: src/android/aidl/example-service/service.md:28 src/android/testing.md #: src/android/interoperability/java.md:39 msgid "\"src/lib.rs\"" -msgstr "" +msgstr "\"src/lib.rs\"" #: src/android/build-rules/library.md:48 msgid "_hello_rust/src/lib.rs_:" -msgstr "" +msgstr "_hello_rust/src/lib.rs_:" #: src/android/build-rules/library.md:51 msgid "//! Greeting library.\n" -msgstr "" +msgstr "//! Greeting library.\n" #: src/android/build-rules/library.md:52 msgid "/// Greet `name`.\n" -msgstr "" +msgstr "/// Greet `name`.\n" #: src/android/build-rules/library.md:55 +#, fuzzy msgid "\"Hello {name}, it is very nice to meet you!\"" -msgstr "" +msgstr "\"Hello {name}, it is very nice to meet you!\"" #: src/android/build-rules/library.md:59 msgid "You build, push, and run the binary like before:" -msgstr "" +msgstr "باینری را مانند قبل می سازید، push و اجرا می‌کنید:" #: src/android/build-rules/library.md:61 msgid "" @@ -11930,20 +11995,28 @@ msgid "" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" +"```shell\n" +"m hello_rust_with_dep\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/hello_rust_with_dep\n" +"```" #: src/android/aidl.md msgid "" "The [Android Interface Definition Language (AIDL)](https://developer.android." "com/guide/components/aidl) is supported in Rust:" msgstr "" +"‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" +"guide/components/aidl) در Rust پشتیبانی می‌شود:" #: src/android/aidl.md msgid "Rust code can call existing AIDL servers," -msgstr "" +msgstr "کد Rust می تواند سرورهای AIDL موجود را فراخوانی کند." #: src/android/aidl.md msgid "You can create new AIDL servers in Rust." -msgstr "" +msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجاد کنید." #: src/android/aidl/birthday-service.md:3 msgid "" @@ -11951,178 +12024,202 @@ msgid "" "process of creating a Binder interface. We're then going to both implement " "the described service and write client code that talks to that service." msgstr "" +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " +"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " +"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md:1 msgid "AIDL Interfaces" -msgstr "" +msgstr "AIDL Interfaces" #: src/android/aidl/example-service/interface.md:3 msgid "You declare the API of your service using an AIDL interface:" -msgstr "" +msgstr "شما API سرویس خود را با استفاده از یک AIDL interface اعلام می‌کنید:" #: src/android/aidl/example-service/interface.md:5 #: src/android/aidl/example-service/service-bindings.md:6 msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md:8 #: src/android/aidl/example-service/service-bindings.md:9 #: src/android/aidl/example-service/changing-definition.md:8 msgid "/** Birthday service interface. */" -msgstr "" +msgstr "/** Birthday service interface. */" #: src/android/aidl/example-service/interface.md:10 #: src/android/aidl/example-service/service-bindings.md:11 #: src/android/aidl/example-service/changing-definition.md:11 msgid "/** Generate a Happy Birthday message. */" -msgstr "" +msgstr "/** Generate a Happy Birthday message. */" #: src/android/aidl/example-service/interface.md:15 msgid "_birthday_service/aidl/Android.bp_:" -msgstr "" +msgstr "_birthday_service/aidl/Android.bp_:" #: src/android/aidl/example-service/interface.md:19 msgid "\"com.example.birthdayservice\"" -msgstr "" +msgstr "\"com.example.birthdayservice\"" #: src/android/aidl/example-service/interface.md:20 msgid "\"com/example/birthdayservice/*.aidl\"" -msgstr "" +msgstr "\"com/example/birthdayservice/*.aidl\"" #: src/android/aidl/example-service/interface.md:23 msgid "// Rust is not enabled by default\n" -msgstr "" +msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md:32 +#, fuzzy msgid "" "Note that the directory structure under the `aidl/` directory needs to match " "the package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " +"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." +"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." +"aidl` است. `." #: src/android/aidl/example-service/service-bindings.md:1 msgid "Generated Service API" -msgstr "" +msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md:3 msgid "" "Binder generates a trait corresponding to the interface definition. trait to " "talk to the service." msgstr "" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"با سرویس" #: src/android/aidl/example-service/service-bindings.md:16 -#, fuzzy msgid "_Generated trait_:" -msgstr "Rust ناایمن" +msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md:24 msgid "" "Your service will need to implement this trait, and your client will use " "this trait to talk to the service." msgstr "" +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " +"صحبت با سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md:29 msgid "" "The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" +"` یافت." #: src/android/aidl/example-service/service-bindings.md:31 msgid "" "Point out how the generated function signature, specifically the argument " "and return types, correspond the interface definition." msgstr "" +"اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " +"بازگشتی، با تعریف interface مطابقت دارد." #: src/android/aidl/example-service/service-bindings.md:33 msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " +"type برگشتی می‌شود." #: src/android/aidl/example-service/service.md:1 msgid "Service Implementation" -msgstr "" +msgstr "پیاده‌سازی سرویس‌ها" #: src/android/aidl/example-service/service.md:3 msgid "We can now implement the AIDL service:" -msgstr "" +msgstr "اکنون می‌توانیم سرویس AIDL را پیاده‌سازی کنیم:" #: src/android/aidl/example-service/service.md:5 #: src/android/aidl/example-service/changing-implementation.md:5 msgid "_birthday_service/src/lib.rs_:" -msgstr "" +msgstr "_birthday_service/src/lib.rs_:" #: src/android/aidl/example-service/service.md:10 msgid "/// The `IBirthdayService` implementation.\n" -msgstr "" +msgstr "/// The `IBirthdayService` implementation.\n" #: src/android/aidl/example-service/service.md:18 #: src/android/aidl/example-service/changing-implementation.md:16 #: src/android/aidl/types/file-descriptor.md:57 +#, fuzzy msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" -msgstr "" +msgstr "\"Happy Birthday {name}, congratulations with the {years} years!\"" #: src/android/aidl/example-service/service.md:23 #: src/android/aidl/example-service/server.md:28 #: src/android/aidl/example-service/client.md:31 msgid "_birthday_service/Android.bp_:" -msgstr "" +msgstr "_birthday_service/Android.bp_:" #: src/android/aidl/example-service/service.md:27 #: src/android/aidl/example-service/server.md:38 msgid "\"libbirthdayservice\"" -msgstr "" +msgstr "\"libbirthdayservice\"" #: src/android/aidl/example-service/service.md:29 #: src/android/aidl/example-service/server.md:13 #: src/android/aidl/example-service/client.md:11 +#, fuzzy msgid "\"birthdayservice\"" -msgstr "" +msgstr "\"birthdayservice\"" #: src/android/aidl/example-service/service.md:31 #: src/android/aidl/example-service/server.md:36 #: src/android/aidl/example-service/client.md:39 msgid "\"com.example.birthdayservice-rust\"" -msgstr "" +msgstr "\"com.example.birthdayservice-rust\"" #: src/android/aidl/example-service/service.md:32 #: src/android/aidl/example-service/server.md:37 #: src/android/aidl/example-service/client.md:40 msgid "\"libbinder_rs\"" -msgstr "" +msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md:39 msgid "" "Point out the path to the generated `IBirthdayService` trait, and explain " "why each of the segments is necessary." msgstr "" +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " +"از بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md:41 msgid "" "TODO: What does the `binder::Interface` trait do? Are there methods to " "override? Where source?" msgstr "" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " +"برای override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md:1 msgid "AIDL Server" -msgstr "" +msgstr "AIDL Server" #: src/android/aidl/example-service/server.md:3 msgid "Finally, we can create a server which exposes the service:" -msgstr "" +msgstr "در نهایت، می توانیم سروری ایجاد کنیم که سرویس را expose می‌کند:" #: src/android/aidl/example-service/server.md:5 msgid "_birthday_service/src/server.rs_:" -msgstr "" +msgstr "_birthday_service/src/server.rs_:" #: src/android/aidl/example-service/server.md:8 msgid "//! Birthday service.\n" -msgstr "" +msgstr "//! Birthday service.\n" #: src/android/aidl/example-service/server.md:14 msgid "/// Entry point for birthday service.\n" -msgstr "" +msgstr "/// Entry point for birthday service.\n" #: src/android/aidl/example-service/server.md:23 msgid "\"Failed to register service\"" From a4a7c044cde7b2739b213a6d01f1078011735449 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 1 Sep 2024 00:10:03 +0330 Subject: [PATCH 42/92] fa: android part 2/4 --- po/fa.po | 186 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 128 insertions(+), 58 deletions(-) diff --git a/po/fa.po b/po/fa.po index 0c12e90e61e..0f9380c9c4e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12222,13 +12222,15 @@ msgid "/// Entry point for birthday service.\n" msgstr "/// Entry point for birthday service.\n" #: src/android/aidl/example-service/server.md:23 +#, fuzzy msgid "\"Failed to register service\"" -msgstr "" +msgstr "\"Failed to register service\"" #: src/android/aidl/example-service/server.md:32 #: src/android/aidl/example-service/server.md:33 +#, fuzzy msgid "\"birthday_server\"" -msgstr "" +msgstr "\"birthday_server\"" #: src/android/aidl/example-service/server.md:34 #, fuzzy @@ -12238,7 +12240,7 @@ msgstr "سرورها" #: src/android/aidl/example-service/server.md:40 #: src/android/aidl/example-service/client.md:42 msgid "// To avoid dynamic link error.\n" -msgstr "" +msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md:46 msgid "" @@ -12248,10 +12250,15 @@ msgid "" "complicated than students are used to if they've used Binder from C++ or " "another language. Explain to students why each step is necessary." msgstr "" +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " +"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " +"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " +"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " +"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md:52 msgid "Create an instance of your service type (`BirthdayService`)." -msgstr "" +msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ایجاد کنید." #: src/android/aidl/example-service/server.md:53 msgid "" @@ -12261,22 +12268,31 @@ msgid "" "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" +"این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " +"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " +"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md:58 msgid "" "Call `add_service`, giving it a service identifier and your service object " "(the `BnBirthdayService` object in the example)." msgstr "" +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود " +"بدهید (شی‏ «BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md:60 msgid "" "Call `join_thread_pool` to add the current thread to Binder's thread pool " "and start listening for connections." msgstr "" +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " +"اضافه کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md:3 msgid "We can now build, push, and start the service:" -msgstr "" +msgstr "اکنون می‌توانیم سرویس را بسازیم، push کنیم و شروع کنیم:" #: src/android/aidl/example-service/deploy.md:5 msgid "" @@ -12288,63 +12304,73 @@ msgid "" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" +"```shell\n" +"m birthday_server\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" +"adb root\n" +"adb shell /data/local/tmp/birthday_server\n" +"```" #: src/android/aidl/example-service/deploy.md:12 msgid "In another terminal, check that the service runs:" -msgstr "" +msgstr "در ترمینال دیگر، بررسی کنید که آیا سرویسی اجرا شود:" #: src/android/aidl/example-service/deploy.md:22 msgid "You can also call the service with `service call`:" -msgstr "" +msgstr "همچنین می‌توانید با `service call` با سرویس تماس بگیرید:" #: src/android/aidl/example-service/client.md:1 msgid "AIDL Client" -msgstr "" +msgstr "AIDL Client" #: src/android/aidl/example-service/client.md:3 msgid "Finally, we can create a Rust client for our new service." -msgstr "" +msgstr "در‌نهایت، ما می‌توانیم یک Rust client برای سرویس جدید خود ایجاد کنیم." #: src/android/aidl/example-service/client.md:5 #: src/android/aidl/example-service/changing-implementation.md:29 msgid "_birthday_service/src/client.rs_:" -msgstr "" +msgstr "_birthday_service/src/client.rs_:" #: src/android/aidl/example-service/client.md:12 msgid "/// Call the birthday service.\n" -msgstr "" +msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md:23 #: src/android/aidl/types/objects.md:54 #: src/android/aidl/types/parcelables.md:32 #: src/android/aidl/types/file-descriptor.md:20 +#, fuzzy msgid "\"Failed to connect to BirthdayService\"" -msgstr "" +msgstr "\"Failed to connect to BirthdayService\"" #: src/android/aidl/example-service/client.md:25 msgid "// Call the service.\n" -msgstr "" +msgstr "// Call the service.\n" #: src/android/aidl/example-service/client.md:27 msgid "\"{msg}\"" -msgstr "" +msgstr "\"{msg}\"" #: src/android/aidl/example-service/client.md:35 #: src/android/aidl/example-service/client.md:36 +#, fuzzy msgid "\"birthday_client\"" -msgstr "" +msgstr "\"birthday_client\"" #: src/android/aidl/example-service/client.md:37 +#, fuzzy msgid "\"src/client.rs\"" -msgstr "" +msgstr "\"src/client.rs\"" #: src/android/aidl/example-service/client.md:46 msgid "Notice that the client does not depend on `libbirthdayservice`." -msgstr "" +msgstr "توجه داشته باشید که client به `libbirthdayservice` وابسته نیست." #: src/android/aidl/example-service/client.md:48 msgid "Build, push, and run the client on your device:" -msgstr "" +msgstr "کلاینت را در دستگاه خود بسازید، push کرده و اجرا کنید:" #: src/android/aidl/example-service/client.md:50 msgid "" @@ -12355,12 +12381,20 @@ msgid "" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" +"```shell\n" +"m birthday_client\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/birthday_client Charlie 60\n" +"```" #: src/android/aidl/example-service/client.md:62 msgid "" "`Strong` is the trait object representing the service " "that the client has connected to." msgstr "" +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " +"که کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md:64 msgid "" @@ -12368,14 +12402,23 @@ msgid "" "process ref count for the service trait object, and the global Binder ref " "count that tracks how many processes have a reference to the object." msgstr "" +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " +"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " +"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " +"ردیابی می‌کند." #: src/android/aidl/example-service/client.md:67 +#, fuzzy msgid "" "Note that the trait object that the client uses to talk to the service uses " "the exact same trait that the server implements. For a given Binder " "interface, there is a single Rust trait generated that both client and " "server use." msgstr "" +"توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " +"دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " +"از آن استفاده می کنند." #: src/android/aidl/example-service/client.md:71 msgid "" @@ -12383,16 +12426,21 @@ msgid "" "should ideally be defined in a common crate that both the client and server " "can depend on." msgstr "" +"از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " +"آن وابسته باشند." #: src/android/aidl/example-service/changing-definition.md:3 msgid "" "Let us extend the API with more functionality: we want to let clients " "specify a list of lines for the birthday card:" msgstr "" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " +"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md:16 msgid "This results in an updated trait definition for `IBirthdayService`:" -msgstr "" +msgstr "این منجر به یک تعریف ویژگی به روز شده برای `IBirthdayService` می‌شود:" #: src/android/aidl/example-service/changing-definition.md:31 msgid "" @@ -12400,73 +12448,86 @@ msgid "" "`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " "generated bindings wherever possible:" msgstr "" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " +"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " +"شده تا جایی که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md:34 msgid "`in` array arguments are translated to slices." -msgstr "" +msgstr "آرگومان های آرایه `in` به sliceها ترجمه می‌شوند." #: src/android/aidl/example-service/changing-definition.md:35 msgid "`out` and `inout` args are translated to `&mut Vec`." -msgstr "" +msgstr "آرگومان‌های`out` و `inout` به `&mut Vec` ترجمه می‌شوند." #: src/android/aidl/example-service/changing-definition.md:36 msgid "Return values are translated to returning a `Vec`." -msgstr "" +msgstr "مقادیر بازگشتی به بازگرداندن `Vec` ترجمه می‌شوند." #: src/android/aidl/example-service/changing-implementation.md:1 msgid "Updating Client and Service" -msgstr "" +msgstr "به‌روزرسانی کلاینت و سرویس‌ها" #: src/android/aidl/example-service/changing-implementation.md:3 msgid "Update the client and server code to account for the new API." -msgstr "" +msgstr "کد سرویس کلاینت و سرور را برای حساب کردن API جدید به‌روز کنید." #: src/android/aidl/example-service/changing-implementation.md:20 msgid "'\\n'" -msgstr "" +msgstr "'\\n'" #: src/android/aidl/example-service/changing-implementation.md:36 +#, fuzzy msgid "\"Habby birfday to yuuuuu\"" -msgstr "" +msgstr "\"Habby birfday to yuuuuu\"" #: src/android/aidl/example-service/changing-implementation.md:37 +#, fuzzy msgid "\"And also: many more\"" -msgstr "" +msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md:44 +#, fuzzy msgid "" "TODO: Move code snippets into project files where they'll actually be built?" msgstr "" +"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md:1 msgid "Working With AIDL Types" -msgstr "" +msgstr "کار با انواع AIDL" #: src/android/aidl/types.md:3 msgid "AIDL types translate into the appropriate idiomatic Rust type:" -msgstr "" +msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه می‌شوند:" #: src/android/aidl/types.md:5 msgid "Primitive types map (mostly) to idiomatic Rust types." msgstr "" +"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md:6 msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" +"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md:7 msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " +"کرد." #: src/android/aidl/types.md:9 msgid "File handles and parcelables are fully supported." -msgstr "" +msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور کامل پشتیبانی می‌شوند." #: src/android/aidl/types/primitives.md:3 +#, fuzzy msgid "Primitive types map (mostly) idiomatically:" msgstr "" +"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md:5 #, fuzzy @@ -12481,12 +12542,11 @@ msgstr "انواع داده‌های بازگشتی" #: src/android/aidl/types/primitives.md:5 msgid "Note" -msgstr "" +msgstr "نکته" #: src/android/aidl/types/primitives.md:7 -#, fuzzy msgid "`boolean`" -msgstr "بولین‌ها" +msgstr "بولین‌ها`boolean`" #: src/android/aidl/types/primitives.md:8 msgid "`byte`" @@ -12494,51 +12554,51 @@ msgstr "" #: src/android/aidl/types/primitives.md:8 msgid "`i8`" -msgstr "" +msgstr "`i8`" #: src/android/aidl/types/primitives.md:8 msgid "Note that bytes are signed." -msgstr "" +msgstr "توجه داشته باشید که بایت‌ها امضا شده‌اند." #: src/android/aidl/types/primitives.md:9 msgid "`u16`" -msgstr "" +msgstr "`u16`" #: src/android/aidl/types/primitives.md:9 msgid "Note the usage of `u16`, NOT `u32`." -msgstr "" +msgstr "به استفاده از `u16` توجه کنید، نه `u32`." #: src/android/aidl/types/primitives.md:10 msgid "`int`" -msgstr "" +msgstr "`int`" #: src/android/aidl/types/primitives.md:10 msgid "`i32`" -msgstr "" +msgstr "`i32`" #: src/android/aidl/types/primitives.md:11 msgid "`long`" -msgstr "" +msgstr "`long`" #: src/android/aidl/types/primitives.md:11 msgid "`i64`" -msgstr "" +msgstr "`i64`" #: src/android/aidl/types/primitives.md:12 msgid "`float`" -msgstr "" +msgstr "`float`" #: src/android/aidl/types/primitives.md:12 msgid "`f32`" -msgstr "" +msgstr "`f32`" #: src/android/aidl/types/primitives.md:13 msgid "`double`" -msgstr "" +msgstr "`double`" #: src/android/aidl/types/primitives.md:13 msgid "`f64`" -msgstr "" +msgstr "`f64`" #: src/android/aidl/types/arrays.md:3 msgid "" @@ -12546,6 +12606,8 @@ msgid "" "appropriate Rust array type depending on how they are used in the function " "signature:" msgstr "" +"انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در " +"function signature، به Rust array type مناسب ترجمه می‌شوند:" #: src/android/aidl/types/arrays.md:7 #, fuzzy @@ -12554,29 +12616,28 @@ msgstr "راه حل" #: src/android/aidl/types/arrays.md:9 msgid "`in` argument" -msgstr "" +msgstr "`in` argument" #: src/android/aidl/types/arrays.md:9 -#, fuzzy msgid "`&[T]`" -msgstr "برش ها: `&[T]`" +msgstr "`&[T]`" #: src/android/aidl/types/arrays.md:10 msgid "`out`/`inout` argument" -msgstr "" +msgstr "`out`/`inout` argument" #: src/android/aidl/types/arrays.md:10 msgid "`&mut Vec`" -msgstr "" +msgstr "`&mut Vec`" #: src/android/aidl/types/arrays.md:11 msgid "Return" -msgstr "" +msgstr "Return" #: src/android/aidl/types/arrays.md:11 #: src/android/interoperability/cpp/type-mapping.md:11 msgid "`Vec`" -msgstr "" +msgstr "`Vec`" #: src/android/aidl/types/arrays.md:15 msgid "" @@ -12585,22 +12646,30 @@ msgid "" "`int[3][4]`). In the Java backend, fixed-size arrays are represented as " "array types." msgstr "" +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " +"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " +"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " +"type نمایش داده می‌شوند." #: src/android/aidl/types/arrays.md:18 msgid "Arrays in parcelable fields always get translated to `Vec`." -msgstr "" +msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه به `Vec` ترجمه می‌شوند." #: src/android/aidl/types/objects.md:3 msgid "" "AIDL objects can be sent either as a concrete AIDL type or as the type-" "erased `IBinder` interface:" msgstr "" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " +"interface پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md:6 msgid "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." "aidl**:" msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" #: src/android/aidl/types/objects.md:17 #: src/android/aidl/types/parcelables.md:16 @@ -12608,28 +12677,29 @@ msgstr "" msgid "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" #: src/android/aidl/types/objects.md:23 msgid "/** The same thing, but using a binder object. */" -msgstr "" +msgstr "/** The same thing, but using a binder object. */" #: src/android/aidl/types/objects.md:26 msgid "/** The same thing, but using `IBinder`. */" -msgstr "" +msgstr "/** The same thing, but using `IBinder`. */" #: src/android/aidl/types/objects.md:31 #: src/android/aidl/types/parcelables.md:27 #: src/android/aidl/types/file-descriptor.md:15 msgid "**birthday_service/src/client.rs**:" -msgstr "" +msgstr "**birthday_service/src/client.rs**:" #: src/android/aidl/types/objects.md:34 msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" -msgstr "" +msgstr "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" #: src/android/aidl/types/objects.md:56 msgid "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" -msgstr "" +msgstr "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" #: src/android/aidl/types/objects.md:62 msgid "// Send the binder object to the service.\n" From 56f15ad2894341c81d603804db36fdaa0ebb70a5 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 1 Sep 2024 00:14:49 +0330 Subject: [PATCH 43/92] fa: android part 2/4 translated --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 0f9380c9c4e..611dd017cb7 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12279,8 +12279,8 @@ msgid "" "Call `add_service`, giving it a service identifier and your service object " "(the `BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود " -"بدهید (شی‏ «BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " +"(شی‏ «BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md:60 msgid "" From 89a56a00bddfec44e35a45db8f1e1a9225a378bf Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 2 Sep 2024 13:19:44 +0330 Subject: [PATCH 44/92] fa : android 3/4 --- po/fa.po | 253 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 189 insertions(+), 64 deletions(-) diff --git a/po/fa.po b/po/fa.po index 611dd017cb7..40ee71e2a2c 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12702,78 +12702,97 @@ msgid "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" msgstr "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" #: src/android/aidl/types/objects.md:62 +#, fuzzy msgid "// Send the binder object to the service.\n" -msgstr "" +msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md:65 +#, fuzzy msgid "" "// Perform the same operation but passing the provider as an `SpIBinder`.\n" msgstr "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md:72 msgid "" "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " "`BnBirthdayService` that we saw previously." msgstr "" +"به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف " +"`BnBirthdayService` است که قبلاً دیدیم." #: src/android/aidl/types/parcelables.md:3 +#, fuzzy msgid "Binder for Rust supports sending parcelables directly:" -msgstr "" +msgstr "ء Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md:5 msgid "" "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md:22 +#, fuzzy msgid "/** The same thing, but with a parcelable. */" -msgstr "" +msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md:3 msgid "" "Files can be sent between Binder clients/servers using the " "`ParcelFileDescriptor` type:" msgstr "" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" +"سرورهای Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md:10 +#, fuzzy msgid "/** The same thing, but loads info from a file. */" -msgstr "" +msgstr "/** The same thing, but loads info from a file. */" #: src/android/aidl/types/file-descriptor.md:22 +#, fuzzy msgid "// Open a file and put the birthday info in it.\n" -msgstr "" +msgstr "// Open a file and put the birthday info in it.\n" #: src/android/aidl/types/file-descriptor.md:23 msgid "\"/data/local/tmp/birthday.info\"" -msgstr "" +msgstr "\"/data/local/tmp/birthday.info\"" #: src/android/aidl/types/file-descriptor.md:24 msgid "\"{name}\"" -msgstr "" +msgstr "\"{name}\"" #: src/android/aidl/types/file-descriptor.md:25 msgid "\"{years}\"" -msgstr "" +msgstr "\"{years}\"" #: src/android/aidl/types/file-descriptor.md:27 +#, fuzzy msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" -msgstr "" +msgstr "// Create a `ParcelFileDescriptor` from the file and send it.\n" #: src/android/aidl/types/file-descriptor.md:33 msgid "**birthday_service/src/lib.rs**:" -msgstr "" +msgstr "**birthday_service/src/lib.rs**:" #: src/android/aidl/types/file-descriptor.md:41 +#, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" " // an `OwnedFd`, which can be cloned and then used to create a " "`File`\n" " // object.\n" msgstr "" +"// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" +" // object.\n" #: src/android/aidl/types/file-descriptor.md:48 +#, fuzzy msgid "\"Invalid file handle\"" -msgstr "" +msgstr "\"Invalid file handle\"" #: src/android/aidl/types/file-descriptor.md:64 msgid "" @@ -12781,80 +12800,89 @@ msgid "" "`File` (or any other type that wraps an `OwnedFd`), and can be used to " "create a new `File` handle on the other side." msgstr "" +"ء `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از " +"یک `File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و " +"می‌تواند برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md:67 msgid "" "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " "UNIX sockets." msgstr "" +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " +"سوکت های TCP، UDP و UNIX." #: src/android/testing.md -#, fuzzy msgid "Testing in Android" -msgstr "Rust در اندروید" +msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" "Building on [Testing](../testing.md), we will now look at how unit tests " "work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " +"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md -#, fuzzy msgid "_testing/Android.bp_:" -msgstr "Rust در اندروید" +msgstr "_testing/Android.bp_:" #: src/android/testing.md msgid "\"libleftpad\"" -msgstr "" +msgstr "\"libleftpad\"" #: src/android/testing.md +#, fuzzy msgid "\"leftpad\"" -msgstr "" +msgstr "leftpad\"" #: src/android/testing.md msgid "\"libleftpad_test\"" -msgstr "" +msgstr "\"libleftpad_test\"" #: src/android/testing.md +#, fuzzy msgid "\"leftpad_test\"" -msgstr "" +msgstr "\"leftpad_test\"" #: src/android/testing.md src/android/interoperability/with-c/bindgen.md:116 msgid "\"general-tests\"" -msgstr "" +msgstr "\"general-tests\"" #: src/android/testing.md msgid "_testing/src/lib.rs_:" -msgstr "" +msgstr "_testing/src/lib.rs_:" #: src/android/testing.md +#, fuzzy msgid "//! Left-padding library.\n" -msgstr "" +msgstr "//! Left-padding library.\n" #: src/android/testing.md +#, fuzzy msgid "/// Left-pad `s` to `width`.\n" -msgstr "" +msgstr "/// Left-pad `s` to `width`.\n" #: src/android/testing.md msgid "\"{s:>width$}\"" -msgstr "" +msgstr "\"{s:>width$}\"" #: src/android/testing.md msgid "\" foo\"" -msgstr "" +msgstr "\" foo\"" #: src/android/testing.md msgid "\"foobar\"" -msgstr "" +msgstr "\"foobar\"" #: src/android/testing.md msgid "You can now run the test with" -msgstr "" +msgstr "اکنون می توانید تست را با" #: src/android/testing.md msgid "The output looks like this:" -msgstr "" +msgstr "خروجی به شکل زیر است:" #: src/android/testing.md msgid "" @@ -12869,32 +12897,48 @@ msgid "" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" "```" msgstr "" +"```text\n" +"INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" +"INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" +"INFO: Build completed successfully, 3 total actions\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" +" PASSED libleftpad_test.tests::long_string (0.0s)\n" +" PASSED libleftpad_test.tests::short_string (0.0s)\n" +"Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" +"```" #: src/android/testing.md msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " +"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md:3 msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " +"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md:11 msgid "\"baz\"" -msgstr "" +msgstr "\"baz\"" #: src/android/testing/googletest.md:12 msgid "\"xyz\"" -msgstr "" +msgstr "\"xyz\"" #: src/android/testing/googletest.md:16 msgid "" "If we change the last element to `\"!\"`, the test fails with a structured " "error message pin-pointing the error:" msgstr "" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " +"که خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md:37 msgid "" @@ -12902,6 +12946,9 @@ msgid "" "example in a local environment. Use `cargo add googletest` to quickly add it " "to an existing Cargo project." msgstr "" +"ء GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " +"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " +"add googletest` استفاده کنید." #: src/android/testing/googletest.md:41 msgid "" @@ -12909,6 +12956,9 @@ msgid "" "macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." "html)." msgstr "" +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" +"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " +"می‌کند." #: src/android/testing/googletest.md:44 msgid "" @@ -12919,12 +12969,19 @@ msgid "" "the library, with exercises to help you get comfortable with `googletest` " "macros, its matchers and its overall philosophy." msgstr "" +"این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" +"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " +"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " +"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md:51 msgid "" "A particularly nice feature is that mismatches in multi-line strings are " "shown as a diff:" msgstr "" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " +"نشان داده می شود:" #: src/android/testing/googletest.md:57 msgid "" @@ -12932,6 +12989,9 @@ msgid "" " Rust's strong typing guides the way,\\n\\\n" " Secure code you'll write.\"" msgstr "" +"\"Memory safety found,\\n\\\n" +" Rust's strong typing guides the way,\\n\\\n" +" Secure code you'll write.\"" #: src/android/testing/googletest.md:62 msgid "" @@ -12939,16 +12999,21 @@ msgid "" " Rust's silly humor guides the way,\\n\\\n" " Secure code you'll write.\"" msgstr "" +"\"Memory safety found,\\n\\\n" +" Rust's silly humor guides the way,\\n\\\n" +" Secure code you'll write.\"" #: src/android/testing/googletest.md:69 msgid "shows a color-coded diff (colors not shown here):" -msgstr "" +msgstr "تفاوت رنگی را نشان می‌دهد (رنگ ها در اینجا نشان‌داده نمی‌شوند):" #: src/android/testing/googletest.md:86 msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " +"در Rust است." #: src/android/testing/mocking.md:3 msgid "" @@ -12956,6 +13021,9 @@ msgid "" "You need to refactor your code to use traits, which you can then quickly " "mock:" msgstr "" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " +"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " +"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md:27 msgid "" @@ -12965,6 +13033,11 @@ msgid "" "libraries work in a similar fashion as Mockall, meaning that they make it " "easy to get a mock implementation of a given trait." msgstr "" +"ء Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " +"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " +"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " +"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " +"را آسان می‌کنند." #: src/android/testing/mocking.md:33 msgid "" @@ -12973,14 +13046,25 @@ msgid "" "more stable test execution. On the other hand, the mocks can be configured " "wrongly and return output different from what the real dependencies would do." msgstr "" +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " +"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " +"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " +"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " +"برگرداند." #: src/android/testing/mocking.md:38 +#, fuzzy msgid "" "If at all possible, it is recommended that you use the real dependencies. As " "an example, many databases allow you to configure an in-memory backend. This " "means that you get the correct behavior in your tests, plus they are fast " "and will automatically clean up after themselves." msgstr "" +"در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " +"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " +"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " +"مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md:43 msgid "" @@ -12988,6 +13072,10 @@ msgid "" "binds to a random port on `localhost`. Always prefer this over mocking away " "the framework since it helps you test your code in the real environment." msgstr "" +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " +"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " +"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " +"را در محیط واقعی آزمایش کنید." #: src/android/testing/mocking.md:47 msgid "" @@ -12995,6 +13083,9 @@ msgid "" "in a local environment. Use `cargo add mockall` to quickly add Mockall to an " "existing Cargo project." msgstr "" +"ء Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " +"پروژه Cargo موجود استفاده کنید." #: src/android/testing/mocking.md:51 msgid "" @@ -13002,6 +13093,10 @@ msgid "" "expectations which depend on the arguments passed. Here we use this to mock " "a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" +"ء Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم " +"کنید که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock " +"کردن عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده " +"شده گرسنه می‌شود:" #: src/android/testing/mocking.md:69 msgid "" @@ -13009,61 +13104,71 @@ msgid "" "called to `n` --- the mock will automatically panic when dropped if this " "isn't satisfied." msgstr "" +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " +"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " +"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" "You should use the `log` crate to automatically log to `logcat` (on-device) " "or `stdout` (on-host):" msgstr "" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " +"(روی host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" -msgstr "" +msgstr "_hello_rust_logs/Android.bp_:" #: src/android/logging.md msgid "\"hello_rust_logs\"" -msgstr "" +msgstr "\"hello_rust_logs\"" #: src/android/logging.md msgid "\"liblog_rust\"" -msgstr "" +msgstr "\"liblog_rust\"" #: src/android/logging.md msgid "\"liblogger\"" -msgstr "" +msgstr "\"liblogger\"" #: src/android/logging.md msgid "_hello_rust_logs/src/main.rs_:" -msgstr "" +msgstr "_hello_rust_logs/src/main.rs_:" #: src/android/logging.md +#, fuzzy msgid "//! Rust logging demo.\n" -msgstr "" +msgstr "//! Rust logging demo.\n" #: src/android/logging.md +#, fuzzy msgid "/// Logs a greeting.\n" -msgstr "" +msgstr "/// Logs a greeting.\n" #: src/android/logging.md msgid "\"rust\"" -msgstr "" +msgstr "\"rust\"" #: src/android/logging.md +#, fuzzy msgid "\"Starting program.\"" -msgstr "" +msgstr "\"Starting program.\"" #: src/android/logging.md +#, fuzzy msgid "\"Things are going fine.\"" -msgstr "" +msgstr "\"Things are going fine.\"" #: src/android/logging.md +#, fuzzy msgid "\"Something went wrong!\"" -msgstr "" +msgstr "\"Something went wrong!\"" #: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 #: src/android/interoperability/with-c/rust.md:72 msgid "Build, push, and run the binary on your device:" -msgstr "" +msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین." #: src/android/logging.md msgid "" @@ -13074,132 +13179,152 @@ msgid "" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" +"```shell\n" +"m hello_rust_logs\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/hello_rust_logs\n" +"```" #: src/android/logging.md msgid "The logs show up in `adb logcat`:" -msgstr "" +msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" "Rust has excellent support for interoperability with other languages. This " "means that you can:" msgstr "" +"ء‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " +"شما می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." -msgstr "" +msgstr "توابع Rust را از زبان های دیگر فراخوانی کنید." #: src/android/interoperability.md msgid "Call functions written in other languages from Rust." -msgstr "" +msgstr "فراخوانی توابع نوشته شده به زبان های دیگر از Rust." #: src/android/interoperability.md msgid "" "When you call functions in a foreign language we say that you're using a " "_foreign function interface_, also known as FFI." msgstr "" +"وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " +"خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " +"می‌کنید." #: src/android/interoperability/with-c.md:1 msgid "Interoperability with C" -msgstr "" +msgstr "قابلیت همکاری با C" #: src/android/interoperability/with-c.md:3 msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" +"ء Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " +"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " +"کنید." #: src/android/interoperability/with-c.md:6 msgid "You can do it by hand if you want:" -msgstr "" +msgstr "در صورت تمایل می‌توانید این کار را دستی انجام دهید:" #: src/android/interoperability/with-c.md:15 +#, fuzzy msgid "// SAFETY: `abs` doesn't have any safety requirements.\n" -msgstr "" +msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/interoperability/with-c.md:17 msgid "\"{x}, {abs_x}\"" -msgstr "" +msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md:21 msgid "" "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" "exercise.md)." msgstr "" +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " +"دیدیم." #: src/android/interoperability/with-c.md:24 msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." msgstr "" +"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md:27 msgid "We will look at better options next." -msgstr "" +msgstr "در ادامه گزینه‌های بهتر را بررسی خواهیم کرد." #: src/android/interoperability/with-c/bindgen.md:1 msgid "Using Bindgen" -msgstr "" +msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md:3 msgid "" "The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "tool can auto-generate bindings from a C header file." msgstr "" +"ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." #: src/android/interoperability/with-c/bindgen.md:6 msgid "First create a small C library:" -msgstr "" +msgstr "ابتدا یک کتابخانه کوچک C ایجاد کنید:" #: src/android/interoperability/with-c/bindgen.md:8 msgid "_interoperability/bindgen/libbirthday.h_:" -msgstr "" +msgstr "_interoperability/bindgen/libbirthday.h_:" #: src/android/interoperability/with-c/bindgen.md:19 msgid "_interoperability/bindgen/libbirthday.c_:" -msgstr "" +msgstr "_interoperability/bindgen/libbirthday.c_:" #: src/android/interoperability/with-c/bindgen.md:22 msgid "" -msgstr "" +msgstr "" #: src/android/interoperability/with-c/bindgen.md:23 #: src/android/interoperability/with-c/bindgen.md:50 msgid "\"libbirthday.h\"" -msgstr "" +msgstr "\"libbirthday.h\"" #: src/android/interoperability/with-c/bindgen.md:26 #: src/android/interoperability/with-c/bindgen.md:29 msgid "\"+--------------\\n\"" -msgstr "" +msgstr "\"+--------------\\n\"" #: src/android/interoperability/with-c/bindgen.md:27 msgid "\"| Happy Birthday %s!\\n\"" -msgstr "" +msgstr "\"| Happy Birthday %s!\\n\"" #: src/android/interoperability/with-c/bindgen.md:28 msgid "\"| Congratulations with the %i years!\\n\"" -msgstr "" +msgstr "\"| Congratulations with the %i years!\\n\"" #: src/android/interoperability/with-c/bindgen.md:33 msgid "Add this to your `Android.bp` file:" -msgstr "" +msgstr "این را به فایل `Android.bp` خود اضافه کنید:" #: src/android/interoperability/with-c/bindgen.md:35 #: src/android/interoperability/with-c/bindgen.md:55 #: src/android/interoperability/with-c/bindgen.md:69 #: src/android/interoperability/with-c/bindgen.md:109 msgid "_interoperability/bindgen/Android.bp_:" -msgstr "" +msgstr "_interoperability/bindgen/Android.bp_:" #: src/android/interoperability/with-c/bindgen.md:39 #: src/android/interoperability/with-c/bindgen.md:63 msgid "\"libbirthday\"" -msgstr "" +msgstr "\"libbirthday\"" #: src/android/interoperability/with-c/bindgen.md:40 msgid "\"libbirthday.c\"" -msgstr "" +msgstr "\"libbirthday.c\"" #: src/android/interoperability/with-c/bindgen.md:44 msgid "" From 338fac15b24c00dcdba0961ea1fe7f531a1bcdd7 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 2 Sep 2024 13:26:00 +0330 Subject: [PATCH 45/92] fa: android fa 3/4 translated --- po/fa.po | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/po/fa.po b/po/fa.po index 40ee71e2a2c..d67c042c251 100644 --- a/po/fa.po +++ b/po/fa.po @@ -12724,7 +12724,7 @@ msgstr "" #: src/android/aidl/types/parcelables.md:3 #, fuzzy msgid "Binder for Rust supports sending parcelables directly:" -msgstr "ء Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" +msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md:5 msgid "" @@ -12800,9 +12800,9 @@ msgid "" "`File` (or any other type that wraps an `OwnedFd`), and can be used to " "create a new `File` handle on the other side." msgstr "" -"ء `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از " -"یک `File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و " -"می‌تواند برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " +"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md:67 msgid "" @@ -12946,7 +12946,7 @@ msgid "" "example in a local environment. Use `cargo add googletest` to quickly add it " "to an existing Cargo project." msgstr "" -"ء GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " "محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " "add googletest` استفاده کنید." @@ -13033,7 +13033,7 @@ msgid "" "libraries work in a similar fashion as Mockall, meaning that they make it " "easy to get a mock implementation of a given trait." msgstr "" -"ء Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " "mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " "به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " "مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " @@ -13083,7 +13083,7 @@ msgid "" "in a local environment. Use `cargo add mockall` to quickly add Mockall to an " "existing Cargo project." msgstr "" -"ء Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " "local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " "پروژه Cargo موجود استفاده کنید." @@ -13093,10 +13093,10 @@ msgid "" "expectations which depend on the arguments passed. Here we use this to mock " "a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -"ء Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم " -"کنید که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock " -"کردن عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده " -"شده گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " +"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " +"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " +"گرسنه می‌شود:" #: src/android/testing/mocking.md:69 msgid "" @@ -13195,7 +13195,7 @@ msgid "" "Rust has excellent support for interoperability with other languages. This " "means that you can:" msgstr "" -"ء‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " "شما می‌توانید:" #: src/android/interoperability.md @@ -13224,7 +13224,7 @@ msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -"ء Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " "به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " "کنید." @@ -18359,7 +18359,7 @@ msgid "" "the RTC match. You can use the driver provided in the [`arm-gic`](https://" "docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"ء _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " "را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" "docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " "کنید." @@ -18390,11 +18390,11 @@ msgid "" "_src/exceptions.rs_ (you should only need to change this for the 3rd part of " "the exercise):" msgstr "" -"ء _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md:156 msgid "_src/logger.rs_ (you shouldn't need to change this):" -msgstr "ء _src/logger.rs_ (نیازی نیست این مورد را تغییر دهید):" +msgstr "‏ _src/logger.rs_ (نیازی نیست این مورد را تغییر دهید):" #: src/exercises/bare-metal/rtc.md:216 msgid "_src/pl011.rs_ (you shouldn't need to change this):" From e071d5ee279beb2d0f873b0fd783e59c12e59a6d Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 3 Sep 2024 23:15:27 +0330 Subject: [PATCH 46/92] fa: android near to complete --- po/fa.po | 205 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 137 insertions(+), 68 deletions(-) diff --git a/po/fa.po b/po/fa.po index d67c042c251..e5d4a68d62b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -13331,51 +13331,54 @@ msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " +"نیست):" #: src/android/interoperability/with-c/bindgen.md:47 msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" -msgstr "" +msgstr "_interoperability/bindgen/libbirthday_wrapper.h_:" #: src/android/interoperability/with-c/bindgen.md:53 msgid "You can now auto-generate the bindings:" -msgstr "" +msgstr "اکنون می توانید اتصالات (bindings) را به طور خودکار ایجاد کنید:" #: src/android/interoperability/with-c/bindgen.md:59 #: src/android/interoperability/with-c/bindgen.md:75 msgid "\"libbirthday_bindgen\"" -msgstr "" +msgstr "\"libbirthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md:60 msgid "\"birthday_bindgen\"" -msgstr "" +msgstr "\"birthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md:61 msgid "\"libbirthday_wrapper.h\"" -msgstr "" +msgstr "\"libbirthday_wrapper.h\"" #: src/android/interoperability/with-c/bindgen.md:62 msgid "\"bindings\"" -msgstr "" +msgstr "\"bindings\"" #: src/android/interoperability/with-c/bindgen.md:67 msgid "Finally, we can use the bindings in our Rust program:" -msgstr "" +msgstr "در نهایت، می‌توانیم از bindingها در برنامه Rust خود استفاده کنیم:" #: src/android/interoperability/with-c/bindgen.md:73 +#, fuzzy msgid "\"print_birthday_card\"" -msgstr "" +msgstr "\"print_birthday_card\"" #: src/android/interoperability/with-c/bindgen.md:74 msgid "\"main.rs\"" -msgstr "" +msgstr "\"main.rs\"" #: src/android/interoperability/with-c/bindgen.md:79 msgid "_interoperability/bindgen/main.rs_:" -msgstr "" +msgstr "_interoperability/bindgen/main.rs_:" #: src/android/interoperability/with-c/bindgen.md:82 msgid "//! Bindgen demo.\n" -msgstr "" +msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md:89 msgid "" @@ -13386,6 +13389,12 @@ msgid "" "later\n" " // after it returns.\n" msgstr "" +"// SAFETY: The pointer we pass is valid because it came from a Rust\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" +" // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md:101 msgid "" @@ -13396,101 +13405,111 @@ msgid "" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" +"```shell\n" +"m print_birthday_card\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/print_birthday_card\n" +"```" #: src/android/interoperability/with-c/bindgen.md:107 msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " +"اتصالات (bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md:113 #: src/android/interoperability/with-c/bindgen.md:115 msgid "\"libbirthday_bindgen_test\"" -msgstr "" +msgstr "\"libbirthday_bindgen_test\"" #: src/android/interoperability/with-c/bindgen.md:114 msgid "\":libbirthday_bindgen\"" -msgstr "" +msgstr "\":libbirthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md:118 #: src/android/interoperability/with-c/bindgen.md:119 msgid "\"none\"" -msgstr "" +msgstr "\"none\"" #: src/android/interoperability/with-c/bindgen.md:118 msgid "// Generated file, skip linting\n" -msgstr "" +msgstr "// Generated file, skip linting\n" #: src/android/interoperability/with-c/rust.md:1 msgid "Calling Rust" -msgstr "" +msgstr "فراخوانی Rust" #: src/android/interoperability/with-c/rust.md:3 msgid "Exporting Rust functions and types to C is easy:" -msgstr "" +msgstr "صدور یا Exporting توابع و تایپ‌ها از Rust به C آسان است:" #: src/android/interoperability/with-c/rust.md:5 msgid "_interoperability/rust/libanalyze/analyze.rs_" -msgstr "" +msgstr "_interoperability/rust/libanalyze/analyze.rs_" #: src/android/interoperability/with-c/rust.md:8 msgid "//! Rust FFI demo.\n" -msgstr "" +msgstr "//! Rust FFI demo.\n" #: src/android/interoperability/with-c/rust.md:12 msgid "/// Analyze the numbers.\n" -msgstr "" +msgstr "/// Analyze the numbers.\n" #: src/android/interoperability/with-c/rust.md:17 +#, fuzzy msgid "\"x ({x}) is smallest!\"" -msgstr "" +msgstr "\"x ({x}) is smallest!\"" #: src/android/interoperability/with-c/rust.md:19 +#, fuzzy msgid "\"y ({y}) is probably larger than x ({x})\"" -msgstr "" +msgstr "\"y ({y}) is probably larger than x ({x})\"" #: src/android/interoperability/with-c/rust.md:24 msgid "_interoperability/rust/libanalyze/analyze.h_" -msgstr "" +msgstr "_interoperability/rust/libanalyze/analyze.h_" #: src/android/interoperability/with-c/rust.md:37 msgid "_interoperability/rust/libanalyze/Android.bp_" -msgstr "" +msgstr "_interoperability/rust/libanalyze/Android.bp_" #: src/android/interoperability/with-c/rust.md:41 #: src/android/interoperability/with-c/rust.md:68 msgid "\"libanalyze_ffi\"" -msgstr "" +msgstr "\"libanalyze_ffi\"" #: src/android/interoperability/with-c/rust.md:42 msgid "\"analyze_ffi\"" -msgstr "" +msgstr "\"analyze_ffi\"" #: src/android/interoperability/with-c/rust.md:43 msgid "\"analyze.rs\"" -msgstr "" +msgstr "\"analyze.rs\"" #: src/android/interoperability/with-c/rust.md:48 msgid "We can now call this from a C binary:" -msgstr "" +msgstr "اکنون می توانیم این را از یک باینری C فراخوانی کنیم:" #: src/android/interoperability/with-c/rust.md:50 msgid "_interoperability/rust/analyze/main.c_" -msgstr "" +msgstr "_interoperability/rust/analyze/Android.bp_" #: src/android/interoperability/with-c/rust.md:53 msgid "\"analyze.h\"" -msgstr "" +msgstr "\"analyze.h\"" #: src/android/interoperability/with-c/rust.md:62 msgid "_interoperability/rust/analyze/Android.bp_" -msgstr "" +msgstr "_interoperability/rust/analyze/Android.bp_" #: src/android/interoperability/with-c/rust.md:66 msgid "\"analyze_numbers\"" -msgstr "" +msgstr "\"analyze_numbers\"" #: src/android/interoperability/with-c/rust.md:67 msgid "\"main.c\"" -msgstr "" +msgstr "\"main.c\"" #: src/android/interoperability/with-c/rust.md:74 msgid "" @@ -13501,6 +13520,12 @@ msgid "" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" +"```shell\n" +"m analyze_numbers\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/analyze_numbers\n" +"```" #: src/android/interoperability/with-c/rust.md:82 msgid "" @@ -13508,16 +13533,21 @@ msgid "" "will just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " +"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " +"برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md:3 msgid "" "The [CXX crate](https://cxx.rs/) makes it possible to do safe " "interoperability between Rust and C++." msgstr "" +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " +"می‌کند." #: src/android/interoperability/cpp.md:6 msgid "The overall approach looks like this:" -msgstr "" +msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md:3 msgid "" @@ -13525,19 +13555,23 @@ msgid "" "from each language to the other. You provide this description using extern " "blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " +"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " +"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " +"شده است." #: src/android/interoperability/cpp/bridge.md:9 msgid "\"org::blobstore\"" -msgstr "" +msgstr "\"org::blobstore\"" #: src/android/interoperability/cpp/bridge.md:11 msgid "// Shared structs with fields visible to both languages.\n" -msgstr "" +msgstr "// Shared structs with fields visible to both languages.\n" #: src/android/interoperability/cpp/bridge.md:17 #: src/android/interoperability/cpp/generated-cpp.md:6 msgid "// Rust types and signatures exposed to C++.\n" -msgstr "" +msgstr "// Rust types and signatures exposed to C++.\n" #: src/android/interoperability/cpp/bridge.md:18 #: src/android/interoperability/cpp/rust-bridge.md:6 @@ -13546,9 +13580,8 @@ msgstr "" #: src/chromium/interoperability-with-cpp/example-bindings.md:9 #: src/chromium/interoperability-with-cpp/error-handling-qr.md:10 #: src/chromium/interoperability-with-cpp/error-handling-png.md:9 -#, fuzzy msgid "\"Rust\"" -msgstr "Rustdoc" +msgstr "\"Rust\"" #: src/android/interoperability/cpp/bridge.md:24 #: src/android/interoperability/cpp/cpp-bridge.md:6 @@ -13560,16 +13593,16 @@ msgstr "" #: src/android/interoperability/cpp/cpp-exception.md:6 #: src/chromium/interoperability-with-cpp/example-bindings.md:15 msgid "\"C++\"" -msgstr "" +msgstr "\"C++\"" #: src/android/interoperability/cpp/bridge.md:26 #: src/android/interoperability/cpp/cpp-bridge.md:8 msgid "\"include/blobstore.h\"" -msgstr "" +msgstr "\"include/blobstore.h\"" #: src/android/interoperability/cpp/bridge.md:40 msgid "The bridge is generally declared in an `ffi` module within your crate." -msgstr "" +msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اعلام می‌شود." #: src/android/interoperability/cpp/bridge.md:41 msgid "" @@ -13577,6 +13610,9 @@ msgid "" "Rust and C++ type/function definitions in order to expose those items to " "both languages." msgstr "" +"از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " +"دهد." #: src/android/interoperability/cpp/bridge.md:44 msgid "" @@ -13585,22 +13621,26 @@ msgid "" "examples you would use `cargo expand ::ffi` to expand just the `ffi` module " "(though this doesn't apply for Android projects)." msgstr "" +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " +"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " +"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md:47 msgid "To view the generated C++ code, look in `target/cxxbridge`." -msgstr "" +msgstr "برای مشاهده کد ++C تولید شده به `target/cxxbridge` نگاه کنید." #: src/android/interoperability/cpp/rust-bridge.md:1 msgid "Rust Bridge Declarations" -msgstr "" +msgstr "تعریف پل در Rust" #: src/android/interoperability/cpp/rust-bridge.md:7 msgid "// Opaque type\n" -msgstr "" +msgstr "// Opaque type\n" #: src/android/interoperability/cpp/rust-bridge.md:8 msgid "// Method on `MyType`\n" -msgstr "" +msgstr "// Method on `MyType`\n" #: src/android/interoperability/cpp/rust-bridge.md:9 #, fuzzy @@ -13612,6 +13652,8 @@ msgid "" "Items declared in the `extern \"Rust\"` reference items that are in scope in " "the parent module." msgstr "" +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " +"والد قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md:30 msgid "" @@ -13620,26 +13662,31 @@ msgid "" "header has the same path as the Rust source file containing the bridge, " "except with a .rs.h file extension." msgstr "" +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" +"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " +"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." +"h." #: src/android/interoperability/cpp/generated-cpp.md:15 msgid "Results in (roughly) the following C++:" -msgstr "" +msgstr "نتیجه (تقریبی) ++C در زیر است:" #: src/android/interoperability/cpp/cpp-bridge.md:1 +#, fuzzy msgid "C++ Bridge Declarations" -msgstr "" +msgstr "C++ Bridge Declarations" #: src/android/interoperability/cpp/cpp-bridge.md:20 msgid "Results in (roughly) the following Rust:" -msgstr "" +msgstr "نتیجه (تقریبی) Rust در زیر است:" #: src/android/interoperability/cpp/cpp-bridge.md:30 msgid "\"org$blobstore$cxxbridge1$new_blobstore_client\"" -msgstr "" +msgstr "\"org$blobstore$cxxbridge1$new_blobstore_client\"" #: src/android/interoperability/cpp/cpp-bridge.md:39 msgid "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" -msgstr "" +msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md:56 msgid "" @@ -13647,20 +13694,25 @@ msgid "" "in are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" +"برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " +"ندارد. CXX اظهارات ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C " +"اعلام شده مطابقت دارند." #: src/android/interoperability/cpp/cpp-bridge.md:59 msgid "" "`unsafe extern` blocks allow you to declare C++ functions that are safe to " "call from Rust." msgstr "" +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " +"Rust امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md:9 msgid "// A=1, J=11, Q=12, K=13\n" -msgstr "" +msgstr "// A=1, J=11, Q=12, K=13\n" #: src/android/interoperability/cpp/shared-types.md:23 msgid "Only C-like (unit) enums are supported." -msgstr "" +msgstr "فقط C-like (unit) enums پشتیبانی می‌شود." #: src/android/interoperability/cpp/shared-types.md:24 msgid "" @@ -13669,37 +13721,45 @@ msgid "" "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " +"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " +"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md:15 -#, fuzzy msgid "Generated Rust:" -msgstr "Rust ناایمن" +msgstr "Generated Rust:" #: src/android/interoperability/cpp/shared-enums.md:33 msgid "Generated C++:" -msgstr "" +msgstr "Generated C++:" #: src/android/interoperability/cpp/shared-enums.md:46 +#, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " "wrapping a numeric value. This is because it is not UB in C++ for an enum " "class to hold a value different from all of the listed variants, and our " "Rust representation needs to have the same behavior." msgstr "" +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " +"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " +"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " +"رفتار مشابهی داشته باشد." #: src/android/interoperability/cpp/rust-result.md:13 msgid "\"fallible1 requires depth > 0\"" -msgstr "" +msgstr "\"fallible1 requires depth > 0\"" #: src/android/interoperability/cpp/rust-result.md:16 msgid "\"Success!\"" -msgstr "" +msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md:22 msgid "" "Rust functions that return `Result` are translated to exceptions on the C++ " "side." msgstr "" +"توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md:24 msgid "" @@ -13707,26 +13767,34 @@ msgid "" "exposes a way to get the error message string. The error message will come " "from the error type's `Display` impl." msgstr "" +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " +"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " +"خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md:27 msgid "" "A panic unwinding from Rust to C++ will always cause the process to " "immediately terminate." msgstr "" +"باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." #: src/android/interoperability/cpp/cpp-exception.md:7 msgid "\"example/include/example.h\"" -msgstr "" +msgstr "\"example/include/example.h\"" #: src/android/interoperability/cpp/cpp-exception.md:14 msgid "\"Error: {}\"" -msgstr "" +msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md:22 +#, fuzzy msgid "" "C++ functions declared to return a `Result` will catch any thrown exception " "on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " +"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " +"برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md:24 msgid "" @@ -13735,29 +13803,30 @@ msgid "" "terminate`. The behavior is equivalent to the same exception being thrown " "through a `noexcept` C++ function." msgstr "" +"اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " +"C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md:3 -#, fuzzy msgid "C++ Type" -msgstr "مثالی در C++" +msgstr "C++ Type" #: src/android/interoperability/cpp/type-mapping.md:5 -#, fuzzy msgid "`rust::String`" -msgstr "String" +msgstr "`rust::String`" #: src/android/interoperability/cpp/type-mapping.md:6 msgid "`&str`" -msgstr "&str" +msgstr "`&str`" #: src/android/interoperability/cpp/type-mapping.md:6 msgid "`rust::Str`" -msgstr "" +msgstr "`rust::Str`" #: src/android/interoperability/cpp/type-mapping.md:7 -#, fuzzy msgid "`CxxString`" -msgstr "String" +msgstr "`CxxString`" #: src/android/interoperability/cpp/type-mapping.md:7 #, fuzzy From 1680e9fc6446e905cc8d782fc52571d8a80292b3 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 5 Sep 2024 01:05:15 +0330 Subject: [PATCH 47/92] fa: android complete --- po/fa.po | 135 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 47 deletions(-) diff --git a/po/fa.po b/po/fa.po index e5d4a68d62b..9138824fc5f 100644 --- a/po/fa.po +++ b/po/fa.po @@ -13829,106 +13829,116 @@ msgid "`CxxString`" msgstr "`CxxString`" #: src/android/interoperability/cpp/type-mapping.md:7 -#, fuzzy msgid "`std::string`" -msgstr "String" +msgstr "`std::string`" #: src/android/interoperability/cpp/type-mapping.md:8 msgid "`&[T]`/`&mut [T]`" -msgstr "" +msgstr "`&[T]`/`&mut [T]`" #: src/android/interoperability/cpp/type-mapping.md:8 msgid "`rust::Slice`" -msgstr "" +msgstr "`rust::Slice`" #: src/android/interoperability/cpp/type-mapping.md:9 msgid "`rust::Box`" -msgstr "" +msgstr "`rust::Box`" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`UniquePtr`" -msgstr "" +msgstr "`UniquePtr`" #: src/android/interoperability/cpp/type-mapping.md:10 msgid "`std::unique_ptr`" -msgstr "" +msgstr "`std::unique_ptr`" #: src/android/interoperability/cpp/type-mapping.md:11 msgid "`rust::Vec`" -msgstr "" +msgstr "`rust::Vec`" #: src/android/interoperability/cpp/type-mapping.md:12 msgid "`CxxVector`" -msgstr "" +msgstr "`CxxVector`" #: src/android/interoperability/cpp/type-mapping.md:12 msgid "`std::vector`" -msgstr "" +msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md:16 msgid "" "These types can be used in the fields of shared structs and the arguments " "and returns of extern functions." msgstr "" +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " +"functionها استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md:18 msgid "" "Note that Rust's `String` does not map directly to `std::string`. There are " "a few reasons for this:" msgstr "" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " +"چند دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md:20 msgid "" "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" +"‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md:21 msgid "" "The two types have different layouts in memory and so can't be passed " "directly between languages." msgstr "" +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " +"مستقیماً بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md:23 +#, fuzzy msgid "" "`std::string` requires move constructors that don't match Rust's move " "semantics, so a `std::string` can't be passed by value to Rust." msgstr "" +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " +"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md:1 #: src/android/interoperability/cpp/android-cpp-genrules.md:1 #: src/android/interoperability/cpp/android-build-rust.md:1 -#, fuzzy msgid "Building in Android" -msgstr "Rust در اندروید" +msgstr "ساخت در اندروید" #: src/android/interoperability/cpp/android-build-cpp.md:3 msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " +"شده CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md:8 #: src/android/interoperability/cpp/android-build-rust.md:10 msgid "\"libcxx_test_cpp\"" -msgstr "" +msgstr "\"libcxx_test_cpp\"" #: src/android/interoperability/cpp/android-build-cpp.md:9 msgid "\"cxx_test.cpp\"" -msgstr "" +msgstr "\"cxx_test.cpp\"" #: src/android/interoperability/cpp/android-build-cpp.md:11 msgid "\"cxx-bridge-header\"" -msgstr "" +msgstr "\"cxx-bridge-header\"" #: src/android/interoperability/cpp/android-build-cpp.md:12 #: src/android/interoperability/cpp/android-cpp-genrules.md:10 msgid "\"libcxx_test_bridge_header\"" -msgstr "" +msgstr "\"libcxx_test_bridge_header\"" #: src/android/interoperability/cpp/android-build-cpp.md:14 #: src/android/interoperability/cpp/android-cpp-genrules.md:19 msgid "\"libcxx_test_bridge_code\"" -msgstr "" +msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md:20 msgid "" @@ -13936,12 +13946,17 @@ msgid "" "the dependencies for the CXX-generated C++ bindings. We'll show how these " "are setup on the next slide." msgstr "" +"به این نکته اشاره کنید که `libcxx_test_bridge_header` و " +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" +"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md:23 msgid "" "Note that you also need to depend on the `cxx-bridge-header` library in " "order to pull in common CXX definitions." msgstr "" +"توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" +"header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md:25 msgid "" @@ -13951,55 +13966,68 @@ msgid "" "that link with the class so that students know where they can find these " "instructions again in the future." msgstr "" +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " +"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" +"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " +"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " +"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md:3 msgid "" "Create two genrules: One to generate the CXX header, and one to generate the " "CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " +"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md:7 +#, fuzzy msgid "" "// Generate a C++ header containing the C++ bindings\n" "// to the Rust exported functions in lib.rs.\n" msgstr "" +"// Generate a C++ header containing the C++ bindings\n" +"// to the Rust exported functions in lib.rs.\n" #: src/android/interoperability/cpp/android-cpp-genrules.md:11 #: src/android/interoperability/cpp/android-cpp-genrules.md:20 msgid "\"cxxbridge\"" -msgstr "" +msgstr "\"cxxbridge\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:12 msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" -msgstr "" +msgstr "\"$(location cxxbridge) $(in) --header > $(out)\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:13 #: src/android/interoperability/cpp/android-cpp-genrules.md:22 #: src/android/interoperability/cpp/android-build-rust.md:8 msgid "\"lib.rs\"" -msgstr "" +msgstr "\"lib.rs\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:14 msgid "\"lib.rs.h\"" -msgstr "" +msgstr "\"lib.rs.h\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:16 +#, fuzzy msgid "// Generate the C++ code that Rust calls into.\n" -msgstr "" +msgstr "// Generate the C++ code that Rust calls into.\n" #: src/android/interoperability/cpp/android-cpp-genrules.md:21 msgid "\"$(location cxxbridge) $(in) > $(out)\"" -msgstr "" +msgstr "\"$(location cxxbridge) $(in) > $(out)\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:23 msgid "\"lib.rs.cc\"" -msgstr "" +msgstr "\"lib.rs.cc\"" #: src/android/interoperability/cpp/android-cpp-genrules.md:29 msgid "" "The `cxxbridge` tool is a standalone tool that generates the C++ side of the " "bridge module. It is included in Android and available as a Soong tool." msgstr "" +"ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در " +"Android گنجانده شده و به عنوان ابزار Soong در دسترس است." #: src/android/interoperability/cpp/android-cpp-genrules.md:31 msgid "" @@ -14007,23 +14035,28 @@ msgid "" "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." +"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " +"اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md:3 msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " +"دارد." #: src/android/interoperability/cpp/android-build-rust.md:7 msgid "\"cxx_test\"" -msgstr "" +msgstr "\"cxx_test\"" #: src/android/interoperability/cpp/android-build-rust.md:9 msgid "\"libcxx\"" -msgstr "" +msgstr "\"libcxx\"" #: src/android/interoperability/java.md:1 msgid "Interoperability with Java" -msgstr "" +msgstr "قابلیت همکاری با جاوا" #: src/android/interoperability/java.md:3 msgid "" @@ -14031,95 +14064,103 @@ msgid "" "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " +"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " +"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " +"کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md:8 msgid "First, we create a Rust function to export to Java:" -msgstr "" +msgstr "ابتدا یک تابع Rust برای export به Java ایجاد می‌کنیم:" #: src/android/interoperability/java.md:10 msgid "_interoperability/java/src/lib.rs_:" -msgstr "" +msgstr "_interoperability/java/src/lib.rs_:" #: src/android/interoperability/java.md:13 +#, fuzzy msgid "//! Rust <-> Java FFI demo.\n" -msgstr "" +msgstr "//! Rust <-> Java FFI demo.\n" #: src/android/interoperability/java.md:18 +#, fuzzy msgid "/// HelloWorld::hello method implementation.\n" -msgstr "" +msgstr "/// HelloWorld::hello method implementation.\n" #: src/android/interoperability/java.md:21 msgid "\"system\"" -msgstr "" +msgstr "\"system\"" #: src/android/interoperability/java.md:27 msgid "\"Hello, {input}!\"" -msgstr "" +msgstr "\"Hello, {input}!\"" #: src/android/interoperability/java.md:33 #: src/android/interoperability/java.md:63 msgid "_interoperability/java/Android.bp_:" -msgstr "" +msgstr "_interoperability/java/Android.bp_:" #: src/android/interoperability/java.md:37 #: src/android/interoperability/java.md:70 msgid "\"libhello_jni\"" -msgstr "" +msgstr "\"libhello_jni\"" #: src/android/interoperability/java.md:38 #: src/android/interoperability/java.md:53 msgid "\"hello_jni\"" -msgstr "" +msgstr "\"hello_jni\"" #: src/android/interoperability/java.md:40 msgid "\"libjni\"" -msgstr "" +msgstr "\"libjni\"" #: src/android/interoperability/java.md:44 msgid "We then call this function from Java:" -msgstr "" +msgstr "سپس این تابع را از جاوا فراخوانی می کنیم:" #: src/android/interoperability/java.md:46 msgid "_interoperability/java/HelloWorld.java_:" -msgstr "" +msgstr "_interoperability/java/HelloWorld.java_:" #: src/android/interoperability/java.md:67 msgid "\"helloworld_jni\"" -msgstr "" +msgstr "\"helloworld_jni\"" #: src/android/interoperability/java.md:68 -#, fuzzy msgid "\"HelloWorld.java\"" -msgstr "سلام دنیا" +msgstr "سلام دنیا\"HelloWorld.java\"" #: src/android/interoperability/java.md:69 -#, fuzzy msgid "\"HelloWorld\"" -msgstr "سلام دنیا" +msgstr "\"HelloWorld\"" #: src/android/interoperability/java.md:74 msgid "Finally, you can build, sync, and run the binary:" -msgstr "" +msgstr "در نهایت، می‌توانید باینری را بسازید، همگام‌سازی کنید و اجرا کنید:" #: src/exercises/android/morning.md msgid "" "This is a group exercise: We will look at one of the projects you work with " "and try to integrate some Rust into it. Some suggestions:" msgstr "" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " +"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." -msgstr "" +msgstr "با سرویس AIDL خود با کلاینت که در Rust نوشته شده است تماس بگیرید." #: src/exercises/android/morning.md msgid "Move a function from your project to Rust and call it." -msgstr "" +msgstr "یک تابع را از پروژه خود به Rust منتقل کنید و آن را فراخوانی کنید." #: src/exercises/android/morning.md msgid "" "No solution is provided here since this is open-ended: it relies on someone " "in the class having a piece of code which you can turn in to Rust on the fly." msgstr "" +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " +"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" From 0d5607fc6f49951cf009c261b42520754bbc30f3 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:44:06 +0000 Subject: [PATCH 48/92] fa: review til tuples-and-arrays/destructuring --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 9138824fc5f..503d93ae09b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4036,7 +4036,7 @@ msgstr "" #: src/tuples-and-arrays/destructuring.md:11 #: src/tuples-and-arrays/destructuring.md:21 msgid "\"left: {left}, right: {right}\"" -msgstr "" +msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md:15 msgid "" From 734e4a49c088be5699ce8f89ef2a5999a56461ea Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:07:20 +0000 Subject: [PATCH 49/92] fa: review tuples-and-arrays/exercise --- po/fa.po | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/po/fa.po b/po/fa.po index 503d93ae09b..9b40efbb790 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4095,10 +4095,9 @@ msgid "" "Use an array such as the above to write a function `transpose` which will " "transpose a matrix (turn rows into columns):" msgstr "" -"از کد بالا برای نوشتن تابع `pretty_print` که یک ماتریس " -"را به صورت `pretty-print` چاپ می‌کند و تابع `transpose` که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها " -"تبدیل می‌کند) استفاده کنید: " +"از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` " +"استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل " +"می‌کند):" #: src/tuples-and-arrays/exercise.md:22 msgid "" @@ -4111,24 +4110,24 @@ msgstr "" #: src/tuples-and-arrays/exercise.md:26 src/borrowing/exercise.md:14 #: src/unsafe-rust/exercise.md:51 msgid "// TODO: remove this when you're done with your implementation.\n" -msgstr "" +msgstr "// TODO: این را زمانی که پیاده‌سازی‌تان تمام شد حذف کنید.\n" #: src/tuples-and-arrays/exercise.md:36 src/tuples-and-arrays/exercise.md:44 #: src/tuples-and-arrays/solution.md:17 src/tuples-and-arrays/solution.md:25 msgid "//\n" -msgstr "" +msgstr "//\n" #: src/tuples-and-arrays/exercise.md:53 src/tuples-and-arrays/solution.md:34 msgid "// <-- the comment makes rustfmt add a newline\n" -msgstr "" +msgstr "‏// <-- این کامنت باعث می‌شود rustfmt یک خط جدید اضافه کند.\n" #: src/tuples-and-arrays/exercise.md:58 src/tuples-and-arrays/solution.md:39 msgid "\"matrix: {:#?}\"" -msgstr "" +msgstr "\"matrix: {:#?}\"" #: src/tuples-and-arrays/exercise.md:60 src/tuples-and-arrays/solution.md:41 msgid "\"transposed: {:#?}\"" -msgstr "" +msgstr "\"transposed: {:#?}\"" #: src/references.md src/smart-pointers.md src/borrowing.md #: src/concurrency/async-pitfalls.md From b166f856482185b9e36a516189008f4f8122b3df Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:11:31 +0000 Subject: [PATCH 50/92] fa: review tuples-and-arrays/exercise --- po/fa.po | 1450 +----------------------------------------------------- 1 file changed, 2 insertions(+), 1448 deletions(-) diff --git a/po/fa.po b/po/fa.po index 9b40efbb790..aa62fc1fbe4 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4096,8 +4096,7 @@ msgid "" "transpose a matrix (turn rows into columns):" msgstr "" "از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` " -"استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل " -"می‌کند):" +"استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" #: src/tuples-and-arrays/exercise.md:22 msgid "" @@ -22788,1449 +22787,4 @@ msgstr "" #~ "slides):" #~ msgstr "" #~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" - -#~ msgid "Morning: 9:00 to 12:00," -#~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" - -#~ msgid "Afternoon: 13:00 to 16:00." -#~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" - -#~ msgid "" -#~ "You can of course adjust this as necessary. Please make sure to include " -#~ "breaks, we recommend a break every hour!" -#~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" - -#~ msgid "Here is a small example program in Rust:" -#~ msgstr "یک برنامه کوچیک در Rust:" - -#~ msgid "" -#~ "```rust,editable\n" -#~ "fn main() { // Program entry point\n" -#~ " let mut x: i32 = 6; // Mutable variable binding\n" -#~ " print!(\"{x}\"); // Macro for printing, like printf\n" -#~ " while x != 1 { // No parenthesis around expression\n" -#~ " if x % 2 == 0 { // Math like in other languages\n" -#~ " x = x / 2;\n" -#~ " } else {\n" -#~ " x = 3 * x + 1;\n" -#~ " }\n" -#~ " print!(\" -> {x}\");\n" -#~ " }\n" -#~ " println!();\n" -#~ "}\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" -#~ "```" - -#~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." -#~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." - -#~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." -#~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." - -#~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." - -#~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." -#~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." - -#~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." - -#~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." - -#~ 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` را توی مرورگر باز کند." - -#~ msgid "Compile time memory safety." -#~ msgstr "ایمنی حافظه در زمان کامپایل." - -#~ msgid "Lack of undefined runtime behavior." -#~ msgstr "عدم وجود رفتار نامشخص در زمان اجرا." - -#~ msgid "Modern language features." -#~ msgstr "ویژگی‌های زبانی مدرن." - -#~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" - -#~ msgid "How many bugs do you spot?" -#~ msgstr "چند باگ پیدا می کنید؟" - -#~ msgid "" -#~ "Despite just 29 lines of code, this C example contains serious bugs in at " -#~ "least 11:" -#~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " - -#~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" -#~ msgstr "تخصیص `=` به جای مقایسه برابری `==` (خط ۲۸)" - -#~ msgid "Excess argument to `printf` (line 23)" -#~ msgstr "ارگمان اضافی به `printf` (خط ۲۳)" - -#~ msgid "File descriptor leak (after line 26)" -#~ msgstr "نشت توصیفگر فایل (`File descriptor`) (پس از خط ۲۶)" - -#~ msgid "Forgotten braces in multi-line `if` (line 22)" -#~ msgstr "فراموشی پرانتز در `if` چند خطی (خط ۲۲)" - -#~ msgid "Forgotten `break` in a `switch` statement (line 32)" -#~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" - -#~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" -#~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " - -#~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" -#~ msgstr "نشت حافظه با آزاد نکردن بافر اختصاص داده شده توسط `malloc` (خط ۲۱)" - -#~ msgid "Out-of-bounds access (line 17)" -#~ msgstr "دسترسی خارج از محدوده (خط ۱۷)" - -#~ msgid "Unchecked cases in the `switch` statement (line 11)" -#~ msgstr "حالات بررسی نشده در `switch` (خط ۱۱)" - -#~ msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" -#~ msgstr "مقادیر برگشتی از `stat` و `fopen` بررسی نشده (خطوط ۱۸ و ۲۶)" - -#~ msgid "" -#~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." - -#~ msgid "" -#~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security " -#~ "vulnerabilities in the past. Some examples:" -#~ msgstr "" -#~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" - -#~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "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)" - -#~ 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)" - -#~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(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) " - -#~ msgid "" -#~ "_How is Rust any better here?_ \n" -#~ "Safe Rust makes all of these bugs impossible:" -#~ msgstr "" -#~ "_چطوری زبان راست در اینجا بهتر عمل می‌کند?_ \n" -#~ "راست ایمن تمام این باگ‌ها را غیرممکن می‌کند:" - -#~ msgid "Assignments inside an `if` clause are not supported." -#~ msgstr "تخصیص‌ها در داخل یک شرط `if` پشتیبانی نمی‌شوند." - -#~ msgid "Format strings are checked at compile-time." -#~ msgstr "قالب‌بندی رشته‌ها در زمان کامپایل بررسی می‌شوند." - -#~ msgid "Resources are freed at the end of scope via the `Drop` trait." -#~ msgstr "منابع در پایان اسکوپ از طریق ویژگی `Drop` آزاد می‌شوند." - -#~ msgid "All `if` clauses require braces." -#~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." - -#~ 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 را " -#~ "فراموش کنید." - -#~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." - -#~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." -#~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" - -#~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." -#~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." - -#~ msgid "`match` mandates that all cases are handled." -#~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." - -#~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." - -#~ msgid "Static memory management at compile time:" -#~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" - -#~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." - -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "" -#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" - -#~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." - -#~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.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`) هرگز اجرا نمی‌شود)." - -#~ 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` ایجاد کنید." - -#~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." -#~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." - -#~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." -#~ msgstr "" -#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " -#~ "_تصادفی_» درنظر گرفته شود." - -#~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "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 خواهید داشت." - -#~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." -#~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " - -#~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." - -#~ msgid "Language Features" -#~ msgstr "ویژگی‌های زبان" - -#~ msgid "Tooling" -#~ msgstr "ابزارها" - -#~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, 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()` منجر شود." - -#~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." -#~ msgstr "" -#~ "ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " -#~ "همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " -#~ "چیزهایی مانند `Option` و `Result` را بیان کند." - -#~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to " -#~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." -#~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." - -#~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" -#~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" - -#~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." -#~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." - -#~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." -#~ msgstr "" -#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" -#~ "(https://docs.rs/rustls/) را ببینید." - -#~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." -#~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." - -#~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "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 هنوز " -#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " -#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " - -#~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." - -#~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." -#~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." - -#~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." - -#~ msgid "`\"foo\"`, `\"two\\nlines\"`" -#~ msgstr "" -#~ "\"foo\", \"two\n" -#~ "lines\"" - -#~ msgid "Like C++, Rust has references:" -#~ msgstr "مانند C++، راست دارای مراجع است:" - -#~ msgid "" -#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " -#~ "pointers." -#~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." - -#~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." -#~ msgstr "" -#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " -#~ "مختلفی ارجاع داده شوند." - -#~ msgid "A reference is said to \"borrow\" the value it refers to." -#~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." - -#~ msgid "" -#~ "Rust is tracking the lifetimes of all references to ensure they live long " -#~ "enough." -#~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." - -#~ msgid "`String` vs `str`" -#~ msgstr "`String` در مقابل `str` " - -#~ msgid "" -#~ "You can borrow `&str` slices from `String` via `&` and optionally range " -#~ "selection." -#~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." - -#~ 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):" - -#~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " -#~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " - -#~ 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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." - -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." - -#~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." -#~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." - -#~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." -#~ msgstr "" -#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " -#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." - -#~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." -#~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." - -#~ 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` یک متد، نمونه‌ای " -#~ "از نوعی است که با آن مرتبط است:" - -#~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." -#~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." - -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" -#~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" - -#~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual 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) را ببینید." - -#~ msgid "" -#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " -#~ "static methods can take arbitrary parameters." -#~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." - -#~ msgid "Function Overloading" -#~ msgstr "سربارگذاری تابع (Function Overloading)" - -#~ msgid "Overloading is not supported:" -#~ msgstr "سربارگذاری پشتیبانی نمیشود, چون:" - -#~ msgid "Always takes a fixed number of parameters." -#~ msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گیرد." - -#~ msgid "Default values are not supported:" -#~ msgstr "مقادیر پیش‌فرض پشتیبانی نمی‌شوند:" - -#~ msgid "All call sites have the same number of arguments." -#~ msgstr "تمام محل‌های فراخوانی دارای تعداد یکسانی از آرگومان هستند." - -#~ msgid "Macros are sometimes used as an alternative." -#~ msgstr "گاهی اوقات از ماکروها به عنوان جایگزین استفاده می‌شود." - -#~ msgid "However, function parameters can be generic:" -#~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" - -#~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." -#~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." - -#~ msgid "Day 1: Morning Exercises" -#~ msgstr "روز اول: تمرین‌های صبح" - -#~ msgid "In these exercises, we will explore two parts of Rust:" -#~ msgstr "در این تمرین‌ها، دو بخش از راست را بررسی خواهیم کرد:" - -#~ msgid "Implicit conversions between types." -#~ msgstr "تبدیل‌های ضمنی بین انواع" - -#~ msgid "Arrays and `for` loops." -#~ msgstr "آرایه‌ها و حلقه‌های `for`" - -#~ msgid "A few things to consider while solving the exercises:" -#~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" - -#~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." -#~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." - -#~ msgid "Alternatively, use the Rust Playground." -#~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." - -#~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." -#~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." - -#~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types " -#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)). You can see this in a program like this:" -#~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" - -#~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." - -#~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." -#~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." - -#~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " -#~ "implementation automatically." -#~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " -#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." - -#~ msgid "Execute the above program and look at the compiler error." -#~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." - -#~ msgid "Update the code above to use `into()` to do the conversion." -#~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." - -#~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " -#~ "`i128`) to see which types you can convert to which other types. Try " -#~ "converting small types to big types and the other way around. Check the " -#~ "[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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." - -#~ msgid "Arrays and `for` Loops" -#~ msgstr "آرایه‌ها و حلقه‌های `for`" - -#~ msgid "We saw that an array can be declared like this:" -#~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " - -#~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" -#~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" - -#~ msgid "" -#~ "Rust lets you iterate over things like arrays and ranges using the `for` " -#~ "keyword:" -#~ msgstr "" -#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " -#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" - -#~ msgid "Bonus Question" -#~ msgstr "سوال جایزه‌دار" - -#~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" -#~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" - -#~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." -#~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." - -#~ 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) موجود است." - -#~ 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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." - -#~ msgid "Without the `&`..." -#~ msgstr "بدون استفاده از `&` ..." - -#~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change " -#~ "[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)" - -#~ 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]` نیز یک نوع کپی است." - -#~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." -#~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." - -#~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" -#~ msgstr "" -#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " -#~ "برگشتی است: " - -#~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " -#~ msgstr "" -#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " -#~ "هستند. " - -#~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely 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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" - -#~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." - -#~ msgid "Index iteration is not a special syntax in Rust for just that case." -#~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." - -#~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " -#~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." - -#~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " -#~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." - -#~ 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()` تغییر دهید." - -#~ msgid "`loop` expressions" -#~ msgstr "عبارات `loop`" - -#~ 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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." - -#~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" - -#~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." -#~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." - -#~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." -#~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." - -#~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" -#~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " - -#~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.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) آن را پیاده‌سازی می‌کند." - -#~ msgid "Static and Constant Variables" -#~ msgstr "متغیر‌های ایستا و ثابت" - -#~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." -#~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." - -#~ 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`ها، به این اینگونه نام‌ها توجه کنید." - -#~ msgid "In both, associated functions are defined within an `impl` block." -#~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." - -#~ 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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" - -#~ 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++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." - -#~ msgid "" -#~ "The match expression has a value. The value is the last expression in the " -#~ "match arm which was executed." -#~ msgstr "" -#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " -#~ "`match` ای است که اجرا شده است." - -#~ 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 اولین طبیق الگو انجام شد جستجو متوقف میشود." - -#~ msgid "`match` inspects a hidden discriminant field in the `enum`." -#~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." - -#~ msgid "" -#~ "It is possible to retrieve the discriminant by calling `std::mem::" -#~ "discriminant()`" -#~ msgstr "" -#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " -#~ "تشخیصی پنهان را دریافت کرد." - -#~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." -#~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." - -#~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." -#~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." - -#~ msgid "" -#~ "Rust enums are packed tightly, taking constraints due to alignment into " -#~ "account:" -#~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" - -#~ msgid "" -#~ "Internally Rust is using a field (discriminant) to keep track of the enum " -#~ "variant." -#~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." - -#~ msgid "Try out other types such as" -#~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" - -#~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," -#~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," - -#~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," -#~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" - -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," -#~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" - -#~ msgid "" -#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " -#~ "optimization, see below)." -#~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" - -#~ msgid "" -#~ "Niche optimization: Rust will merge unused bit patterns for the enum " -#~ "discriminant." -#~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." - -#~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." -#~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." - -#~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring 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) ضروری است:" - -#~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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` عمل می‌کند:" - -#~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "" -#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." - -#~ msgid "Remove `.as_deref()` and explain the error." -#~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." - -#~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." -#~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" - -#~ 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>` تبدیل می‌کند." - -#~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." -#~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." - -#~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." - -#~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." - -#~ msgid "You can demonstrate matching on a reference." -#~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." - -#~ 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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." - -#~ msgid "You can also destructure `structs`:" -#~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" - -#~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." -#~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." - -#~ 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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." - -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." - -#~ msgid "Day 1: Afternoon Exercises" -#~ msgstr "روز ۱: تمرین‌های عصر" - -#~ msgid "We will look at two things:" -#~ msgstr "ما روی ۲ تا چیز نگاهی می‌اندازیم:" - -#~ msgid "The Luhn algorithm," -#~ msgstr "الگوریتم Luhn" - -#~ msgid "An exercise on pattern matching." -#~ msgstr "تمرینی درباره تطبیق الگو" - -#~ 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`ها پیاده‌سازی " -#~ "کنید." - -#~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." -#~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " - -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." - -#~ msgid "Structs and methods." -#~ msgstr "ساختارها و متدها." - -#~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." -#~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." - -#~ msgid "Modules: visibility, paths, and filesystem hierarchy." -#~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" - -#~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." - -#~ msgid "The Stack vs The Heap" -#~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" - -#~ msgid "Stack and Heap Example" -#~ msgstr "یک مثال از پشته و انباشت" - -#~ msgid "You allocate and deallocate heap memory yourself." -#~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." - -#~ msgid "" -#~ "If not done with care, this can lead to crashes, bugs, security " -#~ "vulnerabilities, and memory leaks." -#~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." - -#~ msgid "C Example" -#~ msgstr "مثالی در زبان C" - -#~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" - -#~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." -#~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." - -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." - -#~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." -#~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." - -#~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." -#~ msgstr "" -#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " -#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." - -#~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." -#~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." - -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." - -#~ msgid "The destructor frees the `Person` object it points to." -#~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." - -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" - -#~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" -#~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" - -#~ msgid "The programmer never allocates or deallocates memory explicitly." -#~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." - -#~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." -#~ msgstr "" -#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " -#~ "تخصیص‌زدایی (آزاد) می‌کند." - -#~ msgid "Java Example" -#~ msgstr "مثالی در Java" - -#~ msgid "The `person` object is not deallocated after `sayHello` returns:" -#~ msgstr "شیء `person` پس از بازگشت `sayHello` تخصیص‌زدایی نمی‌شود:" - -#~ msgid "Memory Management in Rust" -#~ msgstr "مدیریت حافظه در Rust" - -#~ msgid "Memory management in Rust is a mix:" -#~ msgstr "مدیریت حافظه در Rust ترکیبی از موارد زیر است:" - -#~ msgid "Safe and correct like Java, but without a garbage collector." -#~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." - -#~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." - -#~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." -#~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." - -#~ msgid "Rust achieves this by modeling _ownership_ explicitly." -#~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." - -#~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually " -#~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "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 جلوگیری می‌کنند." - -#~ 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) هستند." - -#~ msgid "A destructor can run here to free up resources." -#~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." - -#~ msgid "There is always _exactly_ one variable binding which owns a value." -#~ msgstr "همیشه مالکیت یک مقدار را یک متغییر که بهش انتساب میدیم دارد" - -#~ msgid "The heap data from `s1` is reused for `s2`." -#~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." - -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." -#~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." - -#~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way 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` تولید می‌شوند." - -#, fuzzy -#~ msgid "Drawing A Simple GUI" -#~ msgstr "یک کتابخانه GUI ساده" - -#, fuzzy -#~ msgid "concurrency:" -#~ msgstr "همزمانی" - -#, fuzzy -#~ msgid "control flow:" -#~ msgstr "کنترل جریان" - -#, fuzzy -#~ msgid "error handling:" -#~ msgstr "مدیریت خطا (Error Handling)" - -#, fuzzy -#~ msgid "garbage collector:" -#~ msgstr "Garbage Collection" - -#, fuzzy -#~ msgid "generics:" -#~ msgstr "Generics" - -#, fuzzy -#~ msgid "integration test:" -#~ msgstr "Integration Tests" - -#, fuzzy -#~ msgid "main function:" -#~ msgstr "فراخوانی متدهای ناامن" - -#, fuzzy -#~ msgid "method:" -#~ msgstr "متدها" - -#, fuzzy -#~ msgid "module:" -#~ msgstr "ماژول‌ها" - -#, fuzzy -#~ msgid "ownership:" -#~ msgstr "مالکیت" - -#, fuzzy -#~ msgid "panic:" -#~ msgstr "Panics" - -#, fuzzy -#~ msgid "receiver:" -#~ msgstr "درایور" - -#, fuzzy -#~ msgid "standard library:" -#~ msgstr "کتابخانه‌های استاندارد" - -#, fuzzy -#~ msgid "struct:" -#~ msgstr "ساختارها" - -#, fuzzy -#~ msgid "thread:" -#~ msgstr "تردها" - -#, fuzzy -#~ msgid "trait:" -#~ msgstr "trait:" - -#, fuzzy -#~ msgid "union:" -#~ msgstr "Unions" - -#, fuzzy -#~ msgid "unit test:" -#~ msgstr "تست‌های واحد (Unit Tests)" - -#, fuzzy -#~ msgid "variable:\\" -#~ msgstr "متغیرها" - -#, fuzzy -#~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" +#~ "کلاس درس می دهیدما پیشنهاد \ No newline at end of file From f0c9a54b691ccfa0639c4d104af04ef70d817ee7 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:11:59 +0000 Subject: [PATCH 51/92] fa: review tuples-and-arrays/exercise --- po/fa.po | 1447 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1446 insertions(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index aa62fc1fbe4..cbe022e59d1 100644 --- a/po/fa.po +++ b/po/fa.po @@ -22787,4 +22787,1449 @@ msgstr "" #~ "slides):" #~ msgstr "" #~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد \ No newline at end of file +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" + +#~ msgid "Morning: 9:00 to 12:00," +#~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" + +#~ msgid "Afternoon: 13:00 to 16:00." +#~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" + +#~ msgid "" +#~ "You can of course adjust this as necessary. Please make sure to include " +#~ "breaks, we recommend a break every hour!" +#~ msgstr "" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" + +#~ msgid "Here is a small example program in Rust:" +#~ msgstr "یک برنامه کوچیک در Rust:" + +#~ msgid "" +#~ "```rust,editable\n" +#~ "fn main() { // Program entry point\n" +#~ " let mut x: i32 = 6; // Mutable variable binding\n" +#~ " print!(\"{x}\"); // Macro for printing, like printf\n" +#~ " while x != 1 { // No parenthesis around expression\n" +#~ " if x % 2 == 0 { // Math like in other languages\n" +#~ " x = x / 2;\n" +#~ " } else {\n" +#~ " x = 3 * x + 1;\n" +#~ " }\n" +#~ " print!(\" -> {x}\");\n" +#~ " }\n" +#~ " println!();\n" +#~ "}\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" +#~ "```" + +#~ msgid "" +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." +#~ msgstr "" +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." + +#~ msgid "" +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." +#~ msgstr "" +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." + +#~ msgid "Change `let mut x` to `let x`, discuss the compiler error." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." + +#~ msgid "" +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." +#~ msgstr "" +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." + +#~ 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 "" +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." + +#~ msgid "" +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." + +#~ 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` را توی مرورگر باز کند." + +#~ msgid "Compile time memory safety." +#~ msgstr "ایمنی حافظه در زمان کامپایل." + +#~ msgid "Lack of undefined runtime behavior." +#~ msgstr "عدم وجود رفتار نامشخص در زمان اجرا." + +#~ msgid "Modern language features." +#~ msgstr "ویژگی‌های زبانی مدرن." + +#~ msgid "Let's consider the following \"minimum wrong example\" program in C:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" + +#~ msgid "How many bugs do you spot?" +#~ msgstr "چند باگ پیدا می کنید؟" + +#~ msgid "" +#~ "Despite just 29 lines of code, this C example contains serious bugs in at " +#~ "least 11:" +#~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " + +#~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" +#~ msgstr "تخصیص `=` به جای مقایسه برابری `==` (خط ۲۸)" + +#~ msgid "Excess argument to `printf` (line 23)" +#~ msgstr "ارگمان اضافی به `printf` (خط ۲۳)" + +#~ msgid "File descriptor leak (after line 26)" +#~ msgstr "نشت توصیفگر فایل (`File descriptor`) (پس از خط ۲۶)" + +#~ msgid "Forgotten braces in multi-line `if` (line 22)" +#~ msgstr "فراموشی پرانتز در `if` چند خطی (خط ۲۲)" + +#~ msgid "Forgotten `break` in a `switch` statement (line 32)" +#~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" + +#~ msgid "" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" +#~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " + +#~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" +#~ msgstr "نشت حافظه با آزاد نکردن بافر اختصاص داده شده توسط `malloc` (خط ۲۱)" + +#~ msgid "Out-of-bounds access (line 17)" +#~ msgstr "دسترسی خارج از محدوده (خط ۱۷)" + +#~ msgid "Unchecked cases in the `switch` statement (line 11)" +#~ msgstr "حالات بررسی نشده در `switch` (خط ۱۱)" + +#~ msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" +#~ msgstr "مقادیر برگشتی از `stat` و `fopen` بررسی نشده (خطوط ۱۸ و ۲۶)" + +#~ msgid "" +#~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." + +#~ msgid "" +#~ "_Isn't this a highly unrealistic example?_ \n" +#~ "Absolutely not, these kind of bugs have lead to serious security " +#~ "vulnerabilities in the past. Some examples:" +#~ msgstr "" +#~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" + +#~ msgid "" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " +#~ "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)" + +#~ 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)" + +#~ msgid "" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " + +#~ msgid "" +#~ "_How is Rust any better here?_ \n" +#~ "Safe Rust makes all of these bugs impossible:" +#~ msgstr "" +#~ "_چطوری زبان راست در اینجا بهتر عمل می‌کند?_ \n" +#~ "راست ایمن تمام این باگ‌ها را غیرممکن می‌کند:" + +#~ msgid "Assignments inside an `if` clause are not supported." +#~ msgstr "تخصیص‌ها در داخل یک شرط `if` پشتیبانی نمی‌شوند." + +#~ msgid "Format strings are checked at compile-time." +#~ msgstr "قالب‌بندی رشته‌ها در زمان کامپایل بررسی می‌شوند." + +#~ msgid "Resources are freed at the end of scope via the `Drop` trait." +#~ msgstr "منابع در پایان اسکوپ از طریق ویژگی `Drop` آزاد می‌شوند." + +#~ msgid "All `if` clauses require braces." +#~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." + +#~ 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 را " +#~ "فراموش کنید." + +#~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." + +#~ msgid "" +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." +#~ msgstr "" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" + +#~ msgid "" +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." +#~ msgstr "" +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." + +#~ msgid "`match` mandates that all cases are handled." +#~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." + +#~ msgid "" +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." + +#~ msgid "Static memory management at compile time:" +#~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" + +#~ msgid "No memory leaks (_mostly_, see notes)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." + +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "" +#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" + +#~ msgid "" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." +#~ "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) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." + +#~ msgid "" +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." + +#~ 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` ایجاد کنید." + +#~ msgid "" +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." +#~ msgstr "" +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." + +#~ msgid "" +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ msgstr "" +#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " +#~ "_تصادفی_» درنظر گرفته شود." + +#~ msgid "" +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." + +#~ msgid "" +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." +#~ msgstr "" +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " + +#~ msgid "Rust is built with all the experience gained in the last decades." +#~ msgstr "" +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." + +#~ msgid "Language Features" +#~ msgstr "ویژگی‌های زبان" + +#~ msgid "Tooling" +#~ msgstr "ابزارها" + +#~ msgid "" +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." + +#~ msgid "" +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also known as 'sum types', which allow the type system to express things " +#~ "like `Option` and `Result`." +#~ msgstr "" +#~ "ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " +#~ "همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " +#~ "چیزهایی مانند `Option` و `Result` را بیان کند." + +#~ msgid "" +#~ "Remind people to read the errors --- many developers have gotten used to " +#~ "ignore lengthy compiler output. The Rust compiler is significantly more " +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ msgstr "" +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." + +#~ msgid "" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" +#~ msgstr "" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" + +#~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." +#~ msgstr "" +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." + +#~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." +#~ msgstr "" +#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" +#~ "(https://docs.rs/rustls/) را ببینید." + +#~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." +#~ msgstr "" +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." + +#~ msgid "" +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " + +#~ msgid "" +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." + +#~ msgid "" +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." +#~ msgstr "" +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." + +#~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." + +#~ msgid "`\"foo\"`, `\"two\\nlines\"`" +#~ msgstr "" +#~ "\"foo\", \"two\n" +#~ "lines\"" + +#~ msgid "Like C++, Rust has references:" +#~ msgstr "مانند C++، راست دارای مراجع است:" + +#~ msgid "" +#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " +#~ "pointers." +#~ msgstr "" +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." + +#~ msgid "" +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." +#~ msgstr "" +#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +#~ "مختلفی ارجاع داده شوند." + +#~ msgid "A reference is said to \"borrow\" the value it refers to." +#~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." + +#~ msgid "" +#~ "Rust is tracking the lifetimes of all references to ensure they live long " +#~ "enough." +#~ msgstr "" +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." + +#~ msgid "`String` vs `str`" +#~ msgstr "`String` در مقابل `str` " + +#~ msgid "" +#~ "You can borrow `&str` slices from `String` via `&` and optionally range " +#~ "selection." +#~ msgstr "" +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." + +#~ 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):" + +#~ msgid "" +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " +#~ msgstr "" +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " + +#~ 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` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." + +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "" +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." + +#~ msgid "" +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." +#~ msgstr "" +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." + +#~ msgid "" +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." +#~ msgstr "" +#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " +#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." + +#~ msgid "" +#~ "Rustdoc comments can contain code snippets that we can run and test using " +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." +#~ msgstr "" +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." + +#~ 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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" + +#~ msgid "" +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." +#~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." + +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgstr "" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" + +#~ msgid "" +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." + +#~ msgid "" +#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " +#~ "static methods can take arbitrary parameters." +#~ msgstr "" +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." + +#~ msgid "Function Overloading" +#~ msgstr "سربارگذاری تابع (Function Overloading)" + +#~ msgid "Overloading is not supported:" +#~ msgstr "سربارگذاری پشتیبانی نمیشود, چون:" + +#~ msgid "Always takes a fixed number of parameters." +#~ msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گیرد." + +#~ msgid "Default values are not supported:" +#~ msgstr "مقادیر پیش‌فرض پشتیبانی نمی‌شوند:" + +#~ msgid "All call sites have the same number of arguments." +#~ msgstr "تمام محل‌های فراخوانی دارای تعداد یکسانی از آرگومان هستند." + +#~ msgid "Macros are sometimes used as an alternative." +#~ msgstr "گاهی اوقات از ماکروها به عنوان جایگزین استفاده می‌شود." + +#~ msgid "However, function parameters can be generic:" +#~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" + +#~ msgid "" +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." +#~ msgstr "" +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." + +#~ msgid "Day 1: Morning Exercises" +#~ msgstr "روز اول: تمرین‌های صبح" + +#~ msgid "In these exercises, we will explore two parts of Rust:" +#~ msgstr "در این تمرین‌ها، دو بخش از راست را بررسی خواهیم کرد:" + +#~ msgid "Implicit conversions between types." +#~ msgstr "تبدیل‌های ضمنی بین انواع" + +#~ msgid "Arrays and `for` loops." +#~ msgstr "آرایه‌ها و حلقه‌های `for`" + +#~ msgid "A few things to consider while solving the exercises:" +#~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" + +#~ msgid "" +#~ "Use a local Rust installation, if possible. This way you can get auto-" +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." +#~ msgstr "" +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." + +#~ msgid "Alternatively, use the Rust Playground." +#~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." + +#~ msgid "" +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." +#~ msgstr "" +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." + +#~ msgid "" +#~ "Rust will not automatically apply _implicit conversions_ between types " +#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)). You can see this in a program like this:" +#~ msgstr "" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" + +#~ msgid "" +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." + +#~ msgid "" +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." +#~ msgstr "" +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." + +#~ msgid "" +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "implementation automatically." +#~ msgstr "" +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " +#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." + +#~ msgid "Execute the above program and look at the compiler error." +#~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." + +#~ msgid "Update the code above to use `into()` to do the conversion." +#~ msgstr "" +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." + +#~ msgid "" +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " +#~ "`i128`) to see which types you can convert to which other types. Try " +#~ "converting small types to big types and the other way around. Check the " +#~ "[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` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." + +#~ msgid "Arrays and `for` Loops" +#~ msgstr "آرایه‌ها و حلقه‌های `for`" + +#~ msgid "We saw that an array can be declared like this:" +#~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " + +#~ msgid "" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" +#~ msgstr "" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" + +#~ msgid "" +#~ "Rust lets you iterate over things like arrays and ranges using the `for` " +#~ "keyword:" +#~ msgstr "" +#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " +#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" + +#~ msgid "Bonus Question" +#~ msgstr "سوال جایزه‌دار" + +#~ msgid "" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" +#~ msgstr "" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" + +#~ msgid "" +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." +#~ msgstr "" +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." + +#~ 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) موجود است." + +#~ 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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." + +#~ msgid "Without the `&`..." +#~ msgstr "بدون استفاده از `&` ..." + +#~ msgid "" +#~ "The loop would have been one that consumes the array. This is a change " +#~ "[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)" + +#~ 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]` نیز یک نوع کپی است." + +#~ msgid "" +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." +#~ msgstr "" +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." + +#~ msgid "" +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" +#~ msgstr "" +#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " +#~ "برگشتی است: " + +#~ msgid "" +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " +#~ msgstr "" +#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +#~ "هستند. " + +#~ msgid "" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" + +#~ msgid "You can use `break` and `continue` here as usual." +#~ msgstr "" +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." + +#~ msgid "Index iteration is not a special syntax in Rust for just that case." +#~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." + +#~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " +#~ msgstr "" +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." + +#~ msgid "" +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " +#~ msgstr "" +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." + +#~ 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()` تغییر دهید." + +#~ msgid "`loop` expressions" +#~ msgstr "عبارات `loop`" + +#~ 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) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." + +#~ msgid "Here you must either `break` or `return` to stop the loop:" +#~ msgstr "" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" + +#~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." +#~ msgstr "" +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." + +#~ msgid "" +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." +#~ msgstr "" +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." + +#~ msgid "" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" +#~ msgstr "" +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " + +#~ msgid "" +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." + +#~ msgid "Static and Constant Variables" +#~ msgstr "متغیر‌های ایستا و ثابت" + +#~ msgid "" +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." +#~ msgstr "" +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." + +#~ 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`ها، به این اینگونه نام‌ها توجه کنید." + +#~ msgid "In both, associated functions are defined within an `impl` block." +#~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." + +#~ 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` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" + +#~ 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++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." + +#~ msgid "" +#~ "The match expression has a value. The value is the last expression in the " +#~ "match arm which was executed." +#~ msgstr "" +#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " +#~ "`match` ای است که اجرا شده است." + +#~ 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 اولین طبیق الگو انجام شد جستجو متوقف میشود." + +#~ msgid "`match` inspects a hidden discriminant field in the `enum`." +#~ msgstr "" +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." + +#~ msgid "" +#~ "It is possible to retrieve the discriminant by calling `std::mem::" +#~ "discriminant()`" +#~ msgstr "" +#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " +#~ "تشخیصی پنهان را دریافت کرد." + +#~ msgid "" +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." +#~ msgstr "" +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." + +#~ msgid "" +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." +#~ msgstr "" +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." + +#~ msgid "" +#~ "Rust enums are packed tightly, taking constraints due to alignment into " +#~ "account:" +#~ msgstr "" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" + +#~ msgid "" +#~ "Internally Rust is using a field (discriminant) to keep track of the enum " +#~ "variant." +#~ msgstr "" +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." + +#~ msgid "Try out other types such as" +#~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" + +#~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," +#~ msgstr "" +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," + +#~ msgid "" +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," +#~ msgstr "" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" + +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgstr "" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" + +#~ msgid "" +#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " +#~ "optimization, see below)." +#~ msgstr "" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" + +#~ msgid "" +#~ "Niche optimization: Rust will merge unused bit patterns for the enum " +#~ "discriminant." +#~ msgstr "" +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." + +#~ msgid "" +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." +#~ msgstr "" +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." + +#~ msgid "" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" + +#~ msgid "" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" + +#~ msgid "Save the match expression to a variable and print it out." +#~ msgstr "" +#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." + +#~ msgid "Remove `.as_deref()` and explain the error." +#~ msgstr "" +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." + +#~ msgid "" +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." +#~ msgstr "" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" + +#~ 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>` تبدیل می‌کند." + +#~ msgid "" +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." +#~ msgstr "" +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." + +#~ msgid "The `_` pattern is a wildcard pattern which matches any value." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." + +#~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." + +#~ msgid "You can demonstrate matching on a reference." +#~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." + +#~ 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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." + +#~ msgid "You can also destructure `structs`:" +#~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" + +#~ msgid "" +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." +#~ msgstr "" +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." + +#~ 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_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." + +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." + +#~ msgid "Day 1: Afternoon Exercises" +#~ msgstr "روز ۱: تمرین‌های عصر" + +#~ msgid "We will look at two things:" +#~ msgstr "ما روی ۲ تا چیز نگاهی می‌اندازیم:" + +#~ msgid "The Luhn algorithm," +#~ msgstr "الگوریتم Luhn" + +#~ msgid "An exercise on pattern matching." +#~ msgstr "تمرینی درباره تطبیق الگو" + +#~ 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`ها پیاده‌سازی " +#~ "کنید." + +#~ msgid "" +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." +#~ msgstr "" +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " + +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." + +#~ msgid "Structs and methods." +#~ msgstr "ساختارها و متدها." + +#~ msgid "" +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." +#~ msgstr "" +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." + +#~ msgid "Modules: visibility, paths, and filesystem hierarchy." +#~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" + +#~ msgid "First, let's refresh how memory management works." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." + +#~ msgid "The Stack vs The Heap" +#~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" + +#~ msgid "Stack and Heap Example" +#~ msgstr "یک مثال از پشته و انباشت" + +#~ msgid "You allocate and deallocate heap memory yourself." +#~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." + +#~ msgid "" +#~ "If not done with care, this can lead to crashes, bugs, security " +#~ "vulnerabilities, and memory leaks." +#~ msgstr "" +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." + +#~ msgid "C Example" +#~ msgstr "مثالی در زبان C" + +#~ msgid "You must call `free` on every pointer you allocate with `malloc`:" +#~ msgstr "" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" + +#~ msgid "" +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." +#~ msgstr "" +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." + +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "" +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." + +#~ msgid "" +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." +#~ msgstr "" +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." + +#~ msgid "" +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." +#~ msgstr "" +#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " +#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." + +#~ msgid "" +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." +#~ msgstr "" +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." + +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "" +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." + +#~ msgid "The destructor frees the `Person` object it points to." +#~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." + +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" + +#~ msgid "" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" +#~ msgstr "" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" + +#~ msgid "The programmer never allocates or deallocates memory explicitly." +#~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." + +#~ msgid "" +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." +#~ msgstr "" +#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " +#~ "تخصیص‌زدایی (آزاد) می‌کند." + +#~ msgid "Java Example" +#~ msgstr "مثالی در Java" + +#~ msgid "The `person` object is not deallocated after `sayHello` returns:" +#~ msgstr "شیء `person` پس از بازگشت `sayHello` تخصیص‌زدایی نمی‌شود:" + +#~ msgid "Memory Management in Rust" +#~ msgstr "مدیریت حافظه در Rust" + +#~ msgid "Memory management in Rust is a mix:" +#~ msgstr "مدیریت حافظه در Rust ترکیبی از موارد زیر است:" + +#~ msgid "Safe and correct like Java, but without a garbage collector." +#~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." + +#~ msgid "Scope-based like C++, but the compiler enforces full adherence." +#~ msgstr "" +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." + +#~ msgid "" +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." +#~ msgstr "" +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." + +#~ msgid "Rust achieves this by modeling _ownership_ explicitly." +#~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." + +#~ msgid "" +#~ "If asked how at this point, you can mention that in Rust this is usually " +#~ "handled by RAII wrapper types such as [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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." + +#~ 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) هستند." + +#~ msgid "A destructor can run here to free up resources." +#~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." + +#~ msgid "There is always _exactly_ one variable binding which owns a value." +#~ msgstr "همیشه مالکیت یک مقدار را یک متغییر که بهش انتساب میدیم دارد" + +#~ msgid "The heap data from `s1` is reused for `s2`." +#~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." + +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." + +#~ msgid "" +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." + +#, fuzzy +#~ msgid "Drawing A Simple GUI" +#~ msgstr "یک کتابخانه GUI ساده" + +#, fuzzy +#~ msgid "concurrency:" +#~ msgstr "همزمانی" + +#, fuzzy +#~ msgid "control flow:" +#~ msgstr "کنترل جریان" + +#, fuzzy +#~ msgid "error handling:" +#~ msgstr "مدیریت خطا (Error Handling)" + +#, fuzzy +#~ msgid "garbage collector:" +#~ msgstr "Garbage Collection" + +#, fuzzy +#~ msgid "generics:" +#~ msgstr "Generics" + +#, fuzzy +#~ msgid "integration test:" +#~ msgstr "Integration Tests" + +#, fuzzy +#~ msgid "main function:" +#~ msgstr "فراخوانی متدهای ناامن" + +#, fuzzy +#~ msgid "method:" +#~ msgstr "متدها" + +#, fuzzy +#~ msgid "module:" +#~ msgstr "ماژول‌ها" + +#, fuzzy +#~ msgid "ownership:" +#~ msgstr "مالکیت" + +#, fuzzy +#~ msgid "panic:" +#~ msgstr "Panics" + +#, fuzzy +#~ msgid "receiver:" +#~ msgstr "درایور" + +#, fuzzy +#~ msgid "standard library:" +#~ msgstr "کتابخانه‌های استاندارد" + +#, fuzzy +#~ msgid "struct:" +#~ msgstr "ساختارها" + +#, fuzzy +#~ msgid "thread:" +#~ msgstr "تردها" + +#, fuzzy +#~ msgid "trait:" +#~ msgstr "trait:" + +#, fuzzy +#~ msgid "union:" +#~ msgstr "Unions" + +#, fuzzy +#~ msgid "unit test:" +#~ msgstr "تست‌های واحد (Unit Tests)" + +#, fuzzy +#~ msgid "variable:\\" +#~ msgstr "متغیرها" + +#, fuzzy +#~ msgid "Pattern matching" +#~ msgstr "تطبیق الگو" From f44b0669bf90cf2289aa05c2f919656f0ca0a7d1 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:31:30 +0000 Subject: [PATCH 52/92] fa: review references/strings --- po/fa.po | 1457 +----------------------------------------------------- 1 file changed, 6 insertions(+), 1451 deletions(-) diff --git a/po/fa.po b/po/fa.po index cbe022e59d1..4719f567210 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4376,24 +4376,24 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md:17 src/std-traits/read-and-write.md:36 msgid "\"World\"" -msgstr "" +msgstr "\"World\"" #: src/references/strings.md:18 msgid "\"s1: {s1}\"" -msgstr "" +msgstr "\"s1: {s1}\"" #: src/references/strings.md:20 msgid "\"Hello \"" -msgstr "" +msgstr "\"Hello \"" #: src/references/strings.md:21 src/references/strings.md:23 #: src/memory-management/move.md:9 msgid "\"s2: {s2}\"" -msgstr "" +msgstr "\"s2: {s2}\"" #: src/references/strings.md:26 msgid "\"s3: {s3}\"" -msgstr "" +msgstr "\"s3: {s3}\"" #: src/references/strings.md:33 msgid "" @@ -22787,1449 +22787,4 @@ msgstr "" #~ "slides):" #~ msgstr "" #~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" - -#~ msgid "Morning: 9:00 to 12:00," -#~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" - -#~ msgid "Afternoon: 13:00 to 16:00." -#~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" - -#~ msgid "" -#~ "You can of course adjust this as necessary. Please make sure to include " -#~ "breaks, we recommend a break every hour!" -#~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" - -#~ msgid "Here is a small example program in Rust:" -#~ msgstr "یک برنامه کوچیک در Rust:" - -#~ msgid "" -#~ "```rust,editable\n" -#~ "fn main() { // Program entry point\n" -#~ " let mut x: i32 = 6; // Mutable variable binding\n" -#~ " print!(\"{x}\"); // Macro for printing, like printf\n" -#~ " while x != 1 { // No parenthesis around expression\n" -#~ " if x % 2 == 0 { // Math like in other languages\n" -#~ " x = x / 2;\n" -#~ " } else {\n" -#~ " x = 3 * x + 1;\n" -#~ " }\n" -#~ " print!(\" -> {x}\");\n" -#~ " }\n" -#~ " println!();\n" -#~ "}\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" -#~ "```" - -#~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." -#~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." - -#~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." -#~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." - -#~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." - -#~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." -#~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." - -#~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." - -#~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." - -#~ 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` را توی مرورگر باز کند." - -#~ msgid "Compile time memory safety." -#~ msgstr "ایمنی حافظه در زمان کامپایل." - -#~ msgid "Lack of undefined runtime behavior." -#~ msgstr "عدم وجود رفتار نامشخص در زمان اجرا." - -#~ msgid "Modern language features." -#~ msgstr "ویژگی‌های زبانی مدرن." - -#~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" - -#~ msgid "How many bugs do you spot?" -#~ msgstr "چند باگ پیدا می کنید؟" - -#~ msgid "" -#~ "Despite just 29 lines of code, this C example contains serious bugs in at " -#~ "least 11:" -#~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " - -#~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" -#~ msgstr "تخصیص `=` به جای مقایسه برابری `==` (خط ۲۸)" - -#~ msgid "Excess argument to `printf` (line 23)" -#~ msgstr "ارگمان اضافی به `printf` (خط ۲۳)" - -#~ msgid "File descriptor leak (after line 26)" -#~ msgstr "نشت توصیفگر فایل (`File descriptor`) (پس از خط ۲۶)" - -#~ msgid "Forgotten braces in multi-line `if` (line 22)" -#~ msgstr "فراموشی پرانتز در `if` چند خطی (خط ۲۲)" - -#~ msgid "Forgotten `break` in a `switch` statement (line 32)" -#~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" - -#~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" -#~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " - -#~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" -#~ msgstr "نشت حافظه با آزاد نکردن بافر اختصاص داده شده توسط `malloc` (خط ۲۱)" - -#~ msgid "Out-of-bounds access (line 17)" -#~ msgstr "دسترسی خارج از محدوده (خط ۱۷)" - -#~ msgid "Unchecked cases in the `switch` statement (line 11)" -#~ msgstr "حالات بررسی نشده در `switch` (خط ۱۱)" - -#~ msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" -#~ msgstr "مقادیر برگشتی از `stat` و `fopen` بررسی نشده (خطوط ۱۸ و ۲۶)" - -#~ msgid "" -#~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." - -#~ msgid "" -#~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security " -#~ "vulnerabilities in the past. Some examples:" -#~ msgstr "" -#~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" - -#~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "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)" - -#~ 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)" - -#~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(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) " - -#~ msgid "" -#~ "_How is Rust any better here?_ \n" -#~ "Safe Rust makes all of these bugs impossible:" -#~ msgstr "" -#~ "_چطوری زبان راست در اینجا بهتر عمل می‌کند?_ \n" -#~ "راست ایمن تمام این باگ‌ها را غیرممکن می‌کند:" - -#~ msgid "Assignments inside an `if` clause are not supported." -#~ msgstr "تخصیص‌ها در داخل یک شرط `if` پشتیبانی نمی‌شوند." - -#~ msgid "Format strings are checked at compile-time." -#~ msgstr "قالب‌بندی رشته‌ها در زمان کامپایل بررسی می‌شوند." - -#~ msgid "Resources are freed at the end of scope via the `Drop` trait." -#~ msgstr "منابع در پایان اسکوپ از طریق ویژگی `Drop` آزاد می‌شوند." - -#~ msgid "All `if` clauses require braces." -#~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." - -#~ 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 را " -#~ "فراموش کنید." - -#~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." - -#~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." -#~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" - -#~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." -#~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." - -#~ msgid "`match` mandates that all cases are handled." -#~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." - -#~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." - -#~ msgid "Static memory management at compile time:" -#~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" - -#~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." - -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "" -#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" - -#~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." - -#~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.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`) هرگز اجرا نمی‌شود)." - -#~ 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` ایجاد کنید." - -#~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." -#~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." - -#~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." -#~ msgstr "" -#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " -#~ "_تصادفی_» درنظر گرفته شود." - -#~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "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 خواهید داشت." - -#~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." -#~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " - -#~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." - -#~ msgid "Language Features" -#~ msgstr "ویژگی‌های زبان" - -#~ msgid "Tooling" -#~ msgstr "ابزارها" - -#~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, 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()` منجر شود." - -#~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." -#~ msgstr "" -#~ "ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " -#~ "همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " -#~ "چیزهایی مانند `Option` و `Result` را بیان کند." - -#~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to " -#~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." -#~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." - -#~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" -#~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" - -#~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." -#~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." - -#~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." -#~ msgstr "" -#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" -#~ "(https://docs.rs/rustls/) را ببینید." - -#~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." -#~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." - -#~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "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 هنوز " -#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " -#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " - -#~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." - -#~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." -#~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." - -#~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." - -#~ msgid "`\"foo\"`, `\"two\\nlines\"`" -#~ msgstr "" -#~ "\"foo\", \"two\n" -#~ "lines\"" - -#~ msgid "Like C++, Rust has references:" -#~ msgstr "مانند C++، راست دارای مراجع است:" - -#~ msgid "" -#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " -#~ "pointers." -#~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." - -#~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." -#~ msgstr "" -#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " -#~ "مختلفی ارجاع داده شوند." - -#~ msgid "A reference is said to \"borrow\" the value it refers to." -#~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." - -#~ msgid "" -#~ "Rust is tracking the lifetimes of all references to ensure they live long " -#~ "enough." -#~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." - -#~ msgid "`String` vs `str`" -#~ msgstr "`String` در مقابل `str` " - -#~ msgid "" -#~ "You can borrow `&str` slices from `String` via `&` and optionally range " -#~ "selection." -#~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." - -#~ 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):" - -#~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " -#~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " - -#~ 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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." - -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." - -#~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." -#~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." - -#~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." -#~ msgstr "" -#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " -#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." - -#~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." -#~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." - -#~ 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` یک متد، نمونه‌ای " -#~ "از نوعی است که با آن مرتبط است:" - -#~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." -#~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." - -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" -#~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" - -#~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual 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) را ببینید." - -#~ msgid "" -#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " -#~ "static methods can take arbitrary parameters." -#~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." - -#~ msgid "Function Overloading" -#~ msgstr "سربارگذاری تابع (Function Overloading)" - -#~ msgid "Overloading is not supported:" -#~ msgstr "سربارگذاری پشتیبانی نمیشود, چون:" - -#~ msgid "Always takes a fixed number of parameters." -#~ msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گیرد." - -#~ msgid "Default values are not supported:" -#~ msgstr "مقادیر پیش‌فرض پشتیبانی نمی‌شوند:" - -#~ msgid "All call sites have the same number of arguments." -#~ msgstr "تمام محل‌های فراخوانی دارای تعداد یکسانی از آرگومان هستند." - -#~ msgid "Macros are sometimes used as an alternative." -#~ msgstr "گاهی اوقات از ماکروها به عنوان جایگزین استفاده می‌شود." - -#~ msgid "However, function parameters can be generic:" -#~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" - -#~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." -#~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." - -#~ msgid "Day 1: Morning Exercises" -#~ msgstr "روز اول: تمرین‌های صبح" - -#~ msgid "In these exercises, we will explore two parts of Rust:" -#~ msgstr "در این تمرین‌ها، دو بخش از راست را بررسی خواهیم کرد:" - -#~ msgid "Implicit conversions between types." -#~ msgstr "تبدیل‌های ضمنی بین انواع" - -#~ msgid "Arrays and `for` loops." -#~ msgstr "آرایه‌ها و حلقه‌های `for`" - -#~ msgid "A few things to consider while solving the exercises:" -#~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" - -#~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." -#~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." - -#~ msgid "Alternatively, use the Rust Playground." -#~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." - -#~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." -#~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." - -#~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types " -#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)). You can see this in a program like this:" -#~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" - -#~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." - -#~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." -#~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." - -#~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " -#~ "implementation automatically." -#~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " -#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." - -#~ msgid "Execute the above program and look at the compiler error." -#~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." - -#~ msgid "Update the code above to use `into()` to do the conversion." -#~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." - -#~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " -#~ "`i128`) to see which types you can convert to which other types. Try " -#~ "converting small types to big types and the other way around. Check the " -#~ "[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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." - -#~ msgid "Arrays and `for` Loops" -#~ msgstr "آرایه‌ها و حلقه‌های `for`" - -#~ msgid "We saw that an array can be declared like this:" -#~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " - -#~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" -#~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" - -#~ msgid "" -#~ "Rust lets you iterate over things like arrays and ranges using the `for` " -#~ "keyword:" -#~ msgstr "" -#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " -#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" - -#~ msgid "Bonus Question" -#~ msgstr "سوال جایزه‌دار" - -#~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" -#~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" - -#~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." -#~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." - -#~ 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) موجود است." - -#~ 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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." - -#~ msgid "Without the `&`..." -#~ msgstr "بدون استفاده از `&` ..." - -#~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change " -#~ "[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)" - -#~ 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]` نیز یک نوع کپی است." - -#~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." -#~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." - -#~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" -#~ msgstr "" -#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " -#~ "برگشتی است: " - -#~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " -#~ msgstr "" -#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " -#~ "هستند. " - -#~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely 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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" - -#~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." - -#~ msgid "Index iteration is not a special syntax in Rust for just that case." -#~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." - -#~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " -#~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." - -#~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " -#~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." - -#~ 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()` تغییر دهید." - -#~ msgid "`loop` expressions" -#~ msgstr "عبارات `loop`" - -#~ 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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." - -#~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" - -#~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." -#~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." - -#~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." -#~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." - -#~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" -#~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " - -#~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.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) آن را پیاده‌سازی می‌کند." - -#~ msgid "Static and Constant Variables" -#~ msgstr "متغیر‌های ایستا و ثابت" - -#~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." -#~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." - -#~ 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`ها، به این اینگونه نام‌ها توجه کنید." - -#~ msgid "In both, associated functions are defined within an `impl` block." -#~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." - -#~ 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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" - -#~ 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++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." - -#~ msgid "" -#~ "The match expression has a value. The value is the last expression in the " -#~ "match arm which was executed." -#~ msgstr "" -#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " -#~ "`match` ای است که اجرا شده است." - -#~ 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 اولین طبیق الگو انجام شد جستجو متوقف میشود." - -#~ msgid "`match` inspects a hidden discriminant field in the `enum`." -#~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." - -#~ msgid "" -#~ "It is possible to retrieve the discriminant by calling `std::mem::" -#~ "discriminant()`" -#~ msgstr "" -#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " -#~ "تشخیصی پنهان را دریافت کرد." - -#~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." -#~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." - -#~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." -#~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." - -#~ msgid "" -#~ "Rust enums are packed tightly, taking constraints due to alignment into " -#~ "account:" -#~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" - -#~ msgid "" -#~ "Internally Rust is using a field (discriminant) to keep track of the enum " -#~ "variant." -#~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." - -#~ msgid "Try out other types such as" -#~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" - -#~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," -#~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," - -#~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," -#~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" - -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," -#~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" - -#~ msgid "" -#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " -#~ "optimization, see below)." -#~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" - -#~ msgid "" -#~ "Niche optimization: Rust will merge unused bit patterns for the enum " -#~ "discriminant." -#~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." - -#~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." -#~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." - -#~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring 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) ضروری است:" - -#~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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` عمل می‌کند:" - -#~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "" -#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." - -#~ msgid "Remove `.as_deref()` and explain the error." -#~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." - -#~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." -#~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" - -#~ 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>` تبدیل می‌کند." - -#~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." -#~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." - -#~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." - -#~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." - -#~ msgid "You can demonstrate matching on a reference." -#~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." - -#~ 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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." - -#~ msgid "You can also destructure `structs`:" -#~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" - -#~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." -#~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." - -#~ 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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." - -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." - -#~ msgid "Day 1: Afternoon Exercises" -#~ msgstr "روز ۱: تمرین‌های عصر" - -#~ msgid "We will look at two things:" -#~ msgstr "ما روی ۲ تا چیز نگاهی می‌اندازیم:" - -#~ msgid "The Luhn algorithm," -#~ msgstr "الگوریتم Luhn" - -#~ msgid "An exercise on pattern matching." -#~ msgstr "تمرینی درباره تطبیق الگو" - -#~ 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`ها پیاده‌سازی " -#~ "کنید." - -#~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." -#~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " - -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." - -#~ msgid "Structs and methods." -#~ msgstr "ساختارها و متدها." - -#~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." -#~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." - -#~ msgid "Modules: visibility, paths, and filesystem hierarchy." -#~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" - -#~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." - -#~ msgid "The Stack vs The Heap" -#~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" - -#~ msgid "Stack and Heap Example" -#~ msgstr "یک مثال از پشته و انباشت" - -#~ msgid "You allocate and deallocate heap memory yourself." -#~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." - -#~ msgid "" -#~ "If not done with care, this can lead to crashes, bugs, security " -#~ "vulnerabilities, and memory leaks." -#~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." - -#~ msgid "C Example" -#~ msgstr "مثالی در زبان C" - -#~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" - -#~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." -#~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." - -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." - -#~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." -#~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." - -#~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." -#~ msgstr "" -#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " -#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." - -#~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." -#~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." - -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." - -#~ msgid "The destructor frees the `Person` object it points to." -#~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." - -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" - -#~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" -#~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" - -#~ msgid "The programmer never allocates or deallocates memory explicitly." -#~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." - -#~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." -#~ msgstr "" -#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " -#~ "تخصیص‌زدایی (آزاد) می‌کند." - -#~ msgid "Java Example" -#~ msgstr "مثالی در Java" - -#~ msgid "The `person` object is not deallocated after `sayHello` returns:" -#~ msgstr "شیء `person` پس از بازگشت `sayHello` تخصیص‌زدایی نمی‌شود:" - -#~ msgid "Memory Management in Rust" -#~ msgstr "مدیریت حافظه در Rust" - -#~ msgid "Memory management in Rust is a mix:" -#~ msgstr "مدیریت حافظه در Rust ترکیبی از موارد زیر است:" - -#~ msgid "Safe and correct like Java, but without a garbage collector." -#~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." - -#~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." - -#~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." -#~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." - -#~ msgid "Rust achieves this by modeling _ownership_ explicitly." -#~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." - -#~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually " -#~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "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 جلوگیری می‌کنند." - -#~ 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) هستند." - -#~ msgid "A destructor can run here to free up resources." -#~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." - -#~ msgid "There is always _exactly_ one variable binding which owns a value." -#~ msgstr "همیشه مالکیت یک مقدار را یک متغییر که بهش انتساب میدیم دارد" - -#~ msgid "The heap data from `s1` is reused for `s2`." -#~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." - -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." -#~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." - -#~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way 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` تولید می‌شوند." - -#, fuzzy -#~ msgid "Drawing A Simple GUI" -#~ msgstr "یک کتابخانه GUI ساده" - -#, fuzzy -#~ msgid "concurrency:" -#~ msgstr "همزمانی" - -#, fuzzy -#~ msgid "control flow:" -#~ msgstr "کنترل جریان" - -#, fuzzy -#~ msgid "error handling:" -#~ msgstr "مدیریت خطا (Error Handling)" - -#, fuzzy -#~ msgid "garbage collector:" -#~ msgstr "Garbage Collection" - -#, fuzzy -#~ msgid "generics:" -#~ msgstr "Generics" - -#, fuzzy -#~ msgid "integration test:" -#~ msgstr "Integration Tests" - -#, fuzzy -#~ msgid "main function:" -#~ msgstr "فراخوانی متدهای ناامن" - -#, fuzzy -#~ msgid "method:" -#~ msgstr "متدها" - -#, fuzzy -#~ msgid "module:" -#~ msgstr "ماژول‌ها" - -#, fuzzy -#~ msgid "ownership:" -#~ msgstr "مالکیت" - -#, fuzzy -#~ msgid "panic:" -#~ msgstr "Panics" - -#, fuzzy -#~ msgid "receiver:" -#~ msgstr "درایور" - -#, fuzzy -#~ msgid "standard library:" -#~ msgstr "کتابخانه‌های استاندارد" - -#, fuzzy -#~ msgid "struct:" -#~ msgstr "ساختارها" - -#, fuzzy -#~ msgid "thread:" -#~ msgstr "تردها" - -#, fuzzy -#~ msgid "trait:" -#~ msgstr "trait:" - -#, fuzzy -#~ msgid "union:" -#~ msgstr "Unions" - -#, fuzzy -#~ msgid "unit test:" -#~ msgstr "تست‌های واحد (Unit Tests)" - -#, fuzzy -#~ msgid "variable:\\" -#~ msgstr "متغیرها" - -#, fuzzy -#~ msgid "Pattern matching" -#~ msgstr "تطبیق الگو" +#~ "کلاس درس می دهیدما پیشنهاد \ No newline at end of file From 0f7c6aa50e24ade817bf7cebb8c271b0f699f846 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:35:32 +0000 Subject: [PATCH 53/92] fa:review references/string s --- po/fa.po | 1449 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1447 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 4719f567210..5888f64e4a5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4362,7 +4362,7 @@ msgstr "" #: src/references/strings.md:7 msgid "We can now understand the two string types in Rust:" -msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" +msgstr "حالا می‌توانیم دو نوع رشته‌ای را در رراست درک کنیم:" #: src/references/strings.md:9 msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." @@ -22787,4 +22787,1449 @@ msgstr "" #~ "slides):" #~ msgstr "" #~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد \ No newline at end of file +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" + +#~ msgid "Morning: 9:00 to 12:00," +#~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" + +#~ msgid "Afternoon: 13:00 to 16:00." +#~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" + +#~ msgid "" +#~ "You can of course adjust this as necessary. Please make sure to include " +#~ "breaks, we recommend a break every hour!" +#~ msgstr "" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" + +#~ msgid "Here is a small example program in Rust:" +#~ msgstr "یک برنامه کوچیک در Rust:" + +#~ msgid "" +#~ "```rust,editable\n" +#~ "fn main() { // Program entry point\n" +#~ " let mut x: i32 = 6; // Mutable variable binding\n" +#~ " print!(\"{x}\"); // Macro for printing, like printf\n" +#~ " while x != 1 { // No parenthesis around expression\n" +#~ " if x % 2 == 0 { // Math like in other languages\n" +#~ " x = x / 2;\n" +#~ " } else {\n" +#~ " x = 3 * x + 1;\n" +#~ " }\n" +#~ " print!(\" -> {x}\");\n" +#~ " }\n" +#~ " println!();\n" +#~ "}\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" +#~ "```" + +#~ msgid "" +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." +#~ msgstr "" +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." + +#~ msgid "" +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." +#~ msgstr "" +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." + +#~ msgid "Change `let mut x` to `let x`, discuss the compiler error." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." + +#~ msgid "" +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." +#~ msgstr "" +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." + +#~ 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 "" +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." + +#~ msgid "" +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." + +#~ 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` را توی مرورگر باز کند." + +#~ msgid "Compile time memory safety." +#~ msgstr "ایمنی حافظه در زمان کامپایل." + +#~ msgid "Lack of undefined runtime behavior." +#~ msgstr "عدم وجود رفتار نامشخص در زمان اجرا." + +#~ msgid "Modern language features." +#~ msgstr "ویژگی‌های زبانی مدرن." + +#~ msgid "Let's consider the following \"minimum wrong example\" program in C:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" + +#~ msgid "How many bugs do you spot?" +#~ msgstr "چند باگ پیدا می کنید؟" + +#~ msgid "" +#~ "Despite just 29 lines of code, this C example contains serious bugs in at " +#~ "least 11:" +#~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " + +#~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" +#~ msgstr "تخصیص `=` به جای مقایسه برابری `==` (خط ۲۸)" + +#~ msgid "Excess argument to `printf` (line 23)" +#~ msgstr "ارگمان اضافی به `printf` (خط ۲۳)" + +#~ msgid "File descriptor leak (after line 26)" +#~ msgstr "نشت توصیفگر فایل (`File descriptor`) (پس از خط ۲۶)" + +#~ msgid "Forgotten braces in multi-line `if` (line 22)" +#~ msgstr "فراموشی پرانتز در `if` چند خطی (خط ۲۲)" + +#~ msgid "Forgotten `break` in a `switch` statement (line 32)" +#~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" + +#~ msgid "" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" +#~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " + +#~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" +#~ msgstr "نشت حافظه با آزاد نکردن بافر اختصاص داده شده توسط `malloc` (خط ۲۱)" + +#~ msgid "Out-of-bounds access (line 17)" +#~ msgstr "دسترسی خارج از محدوده (خط ۱۷)" + +#~ msgid "Unchecked cases in the `switch` statement (line 11)" +#~ msgstr "حالات بررسی نشده در `switch` (خط ۱۱)" + +#~ msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" +#~ msgstr "مقادیر برگشتی از `stat` و `fopen` بررسی نشده (خطوط ۱۸ و ۲۶)" + +#~ msgid "" +#~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." + +#~ msgid "" +#~ "_Isn't this a highly unrealistic example?_ \n" +#~ "Absolutely not, these kind of bugs have lead to serious security " +#~ "vulnerabilities in the past. Some examples:" +#~ msgstr "" +#~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" + +#~ msgid "" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " +#~ "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)" + +#~ 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)" + +#~ msgid "" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " + +#~ msgid "" +#~ "_How is Rust any better here?_ \n" +#~ "Safe Rust makes all of these bugs impossible:" +#~ msgstr "" +#~ "_چطوری زبان راست در اینجا بهتر عمل می‌کند?_ \n" +#~ "راست ایمن تمام این باگ‌ها را غیرممکن می‌کند:" + +#~ msgid "Assignments inside an `if` clause are not supported." +#~ msgstr "تخصیص‌ها در داخل یک شرط `if` پشتیبانی نمی‌شوند." + +#~ msgid "Format strings are checked at compile-time." +#~ msgstr "قالب‌بندی رشته‌ها در زمان کامپایل بررسی می‌شوند." + +#~ msgid "Resources are freed at the end of scope via the `Drop` trait." +#~ msgstr "منابع در پایان اسکوپ از طریق ویژگی `Drop` آزاد می‌شوند." + +#~ msgid "All `if` clauses require braces." +#~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." + +#~ 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 را " +#~ "فراموش کنید." + +#~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." + +#~ msgid "" +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." +#~ msgstr "" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" + +#~ msgid "" +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." +#~ msgstr "" +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." + +#~ msgid "`match` mandates that all cases are handled." +#~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." + +#~ msgid "" +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." + +#~ msgid "Static memory management at compile time:" +#~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" + +#~ msgid "No memory leaks (_mostly_, see notes)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." + +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "" +#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" + +#~ msgid "" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." +#~ "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) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." + +#~ msgid "" +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." + +#~ 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` ایجاد کنید." + +#~ msgid "" +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." +#~ msgstr "" +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." + +#~ msgid "" +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ msgstr "" +#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " +#~ "_تصادفی_» درنظر گرفته شود." + +#~ msgid "" +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." + +#~ msgid "" +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." +#~ msgstr "" +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " + +#~ msgid "Rust is built with all the experience gained in the last decades." +#~ msgstr "" +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." + +#~ msgid "Language Features" +#~ msgstr "ویژگی‌های زبان" + +#~ msgid "Tooling" +#~ msgstr "ابزارها" + +#~ msgid "" +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." + +#~ msgid "" +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also known as 'sum types', which allow the type system to express things " +#~ "like `Option` and `Result`." +#~ msgstr "" +#~ "ارزش ذکر را دارد که Enum‌های زبان Rust از «انواع داده جبری» هستند که " +#~ "همچنین به عنوان «انواع جمع» شناخته می‌شوند، که به تایپ‌ سیستم اجازه می‌دهد " +#~ "چیزهایی مانند `Option` و `Result` را بیان کند." + +#~ msgid "" +#~ "Remind people to read the errors --- many developers have gotten used to " +#~ "ignore lengthy compiler output. The Rust compiler is significantly more " +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ msgstr "" +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." + +#~ msgid "" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" +#~ msgstr "" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" + +#~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." +#~ msgstr "" +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." + +#~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." +#~ msgstr "" +#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" +#~ "(https://docs.rs/rustls/) را ببینید." + +#~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." +#~ msgstr "" +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." + +#~ msgid "" +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " + +#~ msgid "" +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." + +#~ msgid "" +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." +#~ msgstr "" +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." + +#~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." + +#~ msgid "`\"foo\"`, `\"two\\nlines\"`" +#~ msgstr "" +#~ "\"foo\", \"two\n" +#~ "lines\"" + +#~ msgid "Like C++, Rust has references:" +#~ msgstr "مانند C++، راست دارای مراجع است:" + +#~ msgid "" +#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " +#~ "pointers." +#~ msgstr "" +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." + +#~ msgid "" +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." +#~ msgstr "" +#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +#~ "مختلفی ارجاع داده شوند." + +#~ msgid "A reference is said to \"borrow\" the value it refers to." +#~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." + +#~ msgid "" +#~ "Rust is tracking the lifetimes of all references to ensure they live long " +#~ "enough." +#~ msgstr "" +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." + +#~ msgid "`String` vs `str`" +#~ msgstr "`String` در مقابل `str` " + +#~ msgid "" +#~ "You can borrow `&str` slices from `String` via `&` and optionally range " +#~ "selection." +#~ msgstr "" +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." + +#~ 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):" + +#~ msgid "" +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " +#~ msgstr "" +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " + +#~ 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` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." + +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "" +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." + +#~ msgid "" +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." +#~ msgstr "" +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." + +#~ msgid "" +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." +#~ msgstr "" +#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " +#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." + +#~ msgid "" +#~ "Rustdoc comments can contain code snippets that we can run and test using " +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." +#~ msgstr "" +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." + +#~ 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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" + +#~ msgid "" +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." +#~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." + +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgstr "" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" + +#~ msgid "" +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." + +#~ msgid "" +#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " +#~ "static methods can take arbitrary parameters." +#~ msgstr "" +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." + +#~ msgid "Function Overloading" +#~ msgstr "سربارگذاری تابع (Function Overloading)" + +#~ msgid "Overloading is not supported:" +#~ msgstr "سربارگذاری پشتیبانی نمیشود, چون:" + +#~ msgid "Always takes a fixed number of parameters." +#~ msgstr "همیشه تعداد ثابتی از آرگومان‌ها می‌گیرد." + +#~ msgid "Default values are not supported:" +#~ msgstr "مقادیر پیش‌فرض پشتیبانی نمی‌شوند:" + +#~ msgid "All call sites have the same number of arguments." +#~ msgstr "تمام محل‌های فراخوانی دارای تعداد یکسانی از آرگومان هستند." + +#~ msgid "Macros are sometimes used as an alternative." +#~ msgstr "گاهی اوقات از ماکروها به عنوان جایگزین استفاده می‌شود." + +#~ msgid "However, function parameters can be generic:" +#~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" + +#~ msgid "" +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." +#~ msgstr "" +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." + +#~ msgid "Day 1: Morning Exercises" +#~ msgstr "روز اول: تمرین‌های صبح" + +#~ msgid "In these exercises, we will explore two parts of Rust:" +#~ msgstr "در این تمرین‌ها، دو بخش از راست را بررسی خواهیم کرد:" + +#~ msgid "Implicit conversions between types." +#~ msgstr "تبدیل‌های ضمنی بین انواع" + +#~ msgid "Arrays and `for` loops." +#~ msgstr "آرایه‌ها و حلقه‌های `for`" + +#~ msgid "A few things to consider while solving the exercises:" +#~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" + +#~ msgid "" +#~ "Use a local Rust installation, if possible. This way you can get auto-" +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." +#~ msgstr "" +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." + +#~ msgid "Alternatively, use the Rust Playground." +#~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." + +#~ msgid "" +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." +#~ msgstr "" +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." + +#~ msgid "" +#~ "Rust will not automatically apply _implicit conversions_ between types " +#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)). You can see this in a program like this:" +#~ msgstr "" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" + +#~ msgid "" +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." + +#~ msgid "" +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." +#~ msgstr "" +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." + +#~ msgid "" +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "implementation automatically." +#~ msgstr "" +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " +#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." + +#~ msgid "Execute the above program and look at the compiler error." +#~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." + +#~ msgid "Update the code above to use `into()` to do the conversion." +#~ msgstr "" +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." + +#~ msgid "" +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " +#~ "`i128`) to see which types you can convert to which other types. Try " +#~ "converting small types to big types and the other way around. Check the " +#~ "[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` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." + +#~ msgid "Arrays and `for` Loops" +#~ msgstr "آرایه‌ها و حلقه‌های `for`" + +#~ msgid "We saw that an array can be declared like this:" +#~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " + +#~ msgid "" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" +#~ msgstr "" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" + +#~ msgid "" +#~ "Rust lets you iterate over things like arrays and ranges using the `for` " +#~ "keyword:" +#~ msgstr "" +#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " +#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" + +#~ msgid "Bonus Question" +#~ msgstr "سوال جایزه‌دار" + +#~ msgid "" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" +#~ msgstr "" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" + +#~ msgid "" +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." +#~ msgstr "" +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." + +#~ 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) موجود است." + +#~ 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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." + +#~ msgid "Without the `&`..." +#~ msgstr "بدون استفاده از `&` ..." + +#~ msgid "" +#~ "The loop would have been one that consumes the array. This is a change " +#~ "[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)" + +#~ 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]` نیز یک نوع کپی است." + +#~ msgid "" +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." +#~ msgstr "" +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." + +#~ msgid "" +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" +#~ msgstr "" +#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " +#~ "برگشتی است: " + +#~ msgid "" +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " +#~ msgstr "" +#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +#~ "هستند. " + +#~ msgid "" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" + +#~ msgid "You can use `break` and `continue` here as usual." +#~ msgstr "" +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." + +#~ msgid "Index iteration is not a special syntax in Rust for just that case." +#~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." + +#~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " +#~ msgstr "" +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." + +#~ msgid "" +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " +#~ msgstr "" +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." + +#~ 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()` تغییر دهید." + +#~ msgid "`loop` expressions" +#~ msgstr "عبارات `loop`" + +#~ 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) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." + +#~ msgid "Here you must either `break` or `return` to stop the loop:" +#~ msgstr "" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" + +#~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." +#~ msgstr "" +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." + +#~ msgid "" +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." +#~ msgstr "" +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." + +#~ msgid "" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" +#~ msgstr "" +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " + +#~ msgid "" +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." + +#~ msgid "Static and Constant Variables" +#~ msgstr "متغیر‌های ایستا و ثابت" + +#~ msgid "" +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." +#~ msgstr "" +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." + +#~ 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`ها، به این اینگونه نام‌ها توجه کنید." + +#~ msgid "In both, associated functions are defined within an `impl` block." +#~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." + +#~ 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` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" + +#~ 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++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." + +#~ msgid "" +#~ "The match expression has a value. The value is the last expression in the " +#~ "match arm which was executed." +#~ msgstr "" +#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " +#~ "`match` ای است که اجرا شده است." + +#~ 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 اولین طبیق الگو انجام شد جستجو متوقف میشود." + +#~ msgid "`match` inspects a hidden discriminant field in the `enum`." +#~ msgstr "" +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." + +#~ msgid "" +#~ "It is possible to retrieve the discriminant by calling `std::mem::" +#~ "discriminant()`" +#~ msgstr "" +#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " +#~ "تشخیصی پنهان را دریافت کرد." + +#~ msgid "" +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." +#~ msgstr "" +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." + +#~ msgid "" +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." +#~ msgstr "" +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." + +#~ msgid "" +#~ "Rust enums are packed tightly, taking constraints due to alignment into " +#~ "account:" +#~ msgstr "" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" + +#~ msgid "" +#~ "Internally Rust is using a field (discriminant) to keep track of the enum " +#~ "variant." +#~ msgstr "" +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." + +#~ msgid "Try out other types such as" +#~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" + +#~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," +#~ msgstr "" +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," + +#~ msgid "" +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," +#~ msgstr "" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" + +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgstr "" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" + +#~ msgid "" +#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " +#~ "optimization, see below)." +#~ msgstr "" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" + +#~ msgid "" +#~ "Niche optimization: Rust will merge unused bit patterns for the enum " +#~ "discriminant." +#~ msgstr "" +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." + +#~ msgid "" +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." +#~ msgstr "" +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." + +#~ msgid "" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" + +#~ msgid "" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" + +#~ msgid "Save the match expression to a variable and print it out." +#~ msgstr "" +#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." + +#~ msgid "Remove `.as_deref()` and explain the error." +#~ msgstr "" +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." + +#~ msgid "" +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." +#~ msgstr "" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" + +#~ 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>` تبدیل می‌کند." + +#~ msgid "" +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." +#~ msgstr "" +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." + +#~ msgid "The `_` pattern is a wildcard pattern which matches any value." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." + +#~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." + +#~ msgid "You can demonstrate matching on a reference." +#~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." + +#~ 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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." + +#~ msgid "You can also destructure `structs`:" +#~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" + +#~ msgid "" +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." +#~ msgstr "" +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." + +#~ 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_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." + +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." + +#~ msgid "Day 1: Afternoon Exercises" +#~ msgstr "روز ۱: تمرین‌های عصر" + +#~ msgid "We will look at two things:" +#~ msgstr "ما روی ۲ تا چیز نگاهی می‌اندازیم:" + +#~ msgid "The Luhn algorithm," +#~ msgstr "الگوریتم Luhn" + +#~ msgid "An exercise on pattern matching." +#~ msgstr "تمرینی درباره تطبیق الگو" + +#~ 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`ها پیاده‌سازی " +#~ "کنید." + +#~ msgid "" +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." +#~ msgstr "" +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " + +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." + +#~ msgid "Structs and methods." +#~ msgstr "ساختارها و متدها." + +#~ msgid "" +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." +#~ msgstr "" +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." + +#~ msgid "Modules: visibility, paths, and filesystem hierarchy." +#~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" + +#~ msgid "First, let's refresh how memory management works." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." + +#~ msgid "The Stack vs The Heap" +#~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" + +#~ msgid "Stack and Heap Example" +#~ msgstr "یک مثال از پشته و انباشت" + +#~ msgid "You allocate and deallocate heap memory yourself." +#~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." + +#~ msgid "" +#~ "If not done with care, this can lead to crashes, bugs, security " +#~ "vulnerabilities, and memory leaks." +#~ msgstr "" +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." + +#~ msgid "C Example" +#~ msgstr "مثالی در زبان C" + +#~ msgid "You must call `free` on every pointer you allocate with `malloc`:" +#~ msgstr "" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" + +#~ msgid "" +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." +#~ msgstr "" +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." + +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "" +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." + +#~ msgid "" +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." +#~ msgstr "" +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." + +#~ msgid "" +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." +#~ msgstr "" +#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " +#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." + +#~ msgid "" +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." +#~ msgstr "" +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." + +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "" +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." + +#~ msgid "The destructor frees the `Person` object it points to." +#~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." + +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" + +#~ msgid "" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" +#~ msgstr "" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" + +#~ msgid "The programmer never allocates or deallocates memory explicitly." +#~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." + +#~ msgid "" +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." +#~ msgstr "" +#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " +#~ "تخصیص‌زدایی (آزاد) می‌کند." + +#~ msgid "Java Example" +#~ msgstr "مثالی در Java" + +#~ msgid "The `person` object is not deallocated after `sayHello` returns:" +#~ msgstr "شیء `person` پس از بازگشت `sayHello` تخصیص‌زدایی نمی‌شود:" + +#~ msgid "Memory Management in Rust" +#~ msgstr "مدیریت حافظه در Rust" + +#~ msgid "Memory management in Rust is a mix:" +#~ msgstr "مدیریت حافظه در Rust ترکیبی از موارد زیر است:" + +#~ msgid "Safe and correct like Java, but without a garbage collector." +#~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." + +#~ msgid "Scope-based like C++, but the compiler enforces full adherence." +#~ msgstr "" +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." + +#~ msgid "" +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." +#~ msgstr "" +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." + +#~ msgid "Rust achieves this by modeling _ownership_ explicitly." +#~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." + +#~ msgid "" +#~ "If asked how at this point, you can mention that in Rust this is usually " +#~ "handled by RAII wrapper types such as [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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." + +#~ 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) هستند." + +#~ msgid "A destructor can run here to free up resources." +#~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." + +#~ msgid "There is always _exactly_ one variable binding which owns a value." +#~ msgstr "همیشه مالکیت یک مقدار را یک متغییر که بهش انتساب میدیم دارد" + +#~ msgid "The heap data from `s1` is reused for `s2`." +#~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." + +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." + +#~ msgid "" +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." + +#, fuzzy +#~ msgid "Drawing A Simple GUI" +#~ msgstr "یک کتابخانه GUI ساده" + +#, fuzzy +#~ msgid "concurrency:" +#~ msgstr "همزمانی" + +#, fuzzy +#~ msgid "control flow:" +#~ msgstr "کنترل جریان" + +#, fuzzy +#~ msgid "error handling:" +#~ msgstr "مدیریت خطا (Error Handling)" + +#, fuzzy +#~ msgid "garbage collector:" +#~ msgstr "Garbage Collection" + +#, fuzzy +#~ msgid "generics:" +#~ msgstr "Generics" + +#, fuzzy +#~ msgid "integration test:" +#~ msgstr "Integration Tests" + +#, fuzzy +#~ msgid "main function:" +#~ msgstr "فراخوانی متدهای ناامن" + +#, fuzzy +#~ msgid "method:" +#~ msgstr "متدها" + +#, fuzzy +#~ msgid "module:" +#~ msgstr "ماژول‌ها" + +#, fuzzy +#~ msgid "ownership:" +#~ msgstr "مالکیت" + +#, fuzzy +#~ msgid "panic:" +#~ msgstr "Panics" + +#, fuzzy +#~ msgid "receiver:" +#~ msgstr "درایور" + +#, fuzzy +#~ msgid "standard library:" +#~ msgstr "کتابخانه‌های استاندارد" + +#, fuzzy +#~ msgid "struct:" +#~ msgstr "ساختارها" + +#, fuzzy +#~ msgid "thread:" +#~ msgstr "تردها" + +#, fuzzy +#~ msgid "trait:" +#~ msgstr "trait:" + +#, fuzzy +#~ msgid "union:" +#~ msgstr "Unions" + +#, fuzzy +#~ msgid "unit test:" +#~ msgstr "تست‌های واحد (Unit Tests)" + +#, fuzzy +#~ msgid "variable:\\" +#~ msgstr "متغیرها" + +#, fuzzy +#~ msgid "Pattern matching" +#~ msgstr "تطبیق الگو" From eabdd2a3c8d593b03b9f452ca1be933ccf7ce2b7 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:49:37 +0000 Subject: [PATCH 54/92] fa:review references/exercise. --- po/fa.po | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/po/fa.po b/po/fa.po index 5888f64e4a5..cb0e4032dd5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4495,28 +4495,33 @@ msgid "" "square\n" "// root, like `v.sqrt()`.\n" msgstr "" +"// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " +"`v.sqrt()`.\n" #: src/references/exercise.md:15 msgid "" "// Normalize a vector by calculating its magnitude and dividing all of its\n" "// coordinates by that magnitude.\n" msgstr "" +"// یک بردار را با محاسبه اندازه‌ی آن و تقسیم تمام مختصات آن\n" +"// بر آن اندازه، نرمال‌سازی کنید.\n" #: src/references/exercise.md:23 msgid "// Use the following `main` to test your work.\n" -msgstr "" +msgstr "// از `main` زیر برای تست کار خود استفاده کنید.\n" #: src/references/exercise.md:27 src/references/solution.md:22 msgid "\"Magnitude of a unit vector: {}\"" -msgstr "" +msgstr "\"اندازه‌ی یک بردار واحد: {}\"" #: src/references/exercise.md:30 src/references/solution.md:25 msgid "\"Magnitude of {v:?}: {}\"" -msgstr "" +msgstr "\"اندازه‌ی {v:?}: {}\"" #: src/references/exercise.md:32 src/references/solution.md:27 msgid "\"Magnitude of {v:?} after normalization: {}\"" -msgstr "" +msgstr "\"اندازه‌ی {v:?} پس از نرمال‌سازی: {}\"" #: src/references/solution.md:4 msgid "/// Calculate the magnitude of the given vector.\n" From af9b0bebd84a10714b882da16bf7c0ed85f3eff0 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:53:03 +0000 Subject: [PATCH 55/92] fa:review references/solution. --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index cb0e4032dd5..25874c4b09b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4525,13 +4525,13 @@ msgstr "\"اندازه‌ی {v:?} پس از نرمال‌سازی: {}\"" #: src/references/solution.md:4 msgid "/// Calculate the magnitude of the given vector.\n" -msgstr "" +msgstr "/// اندازه‌ی بردار داده شده را محاسبه کنید.\n" #: src/references/solution.md:12 msgid "" "/// Change the magnitude of the vector to 1.0 without changing its " "direction.\n" -msgstr "" +msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md msgid "This segment should take about 50 minutes. It contains:" From cac0d071802521ba27b2d22ed9626c9ac8945e7e Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:03:45 +0000 Subject: [PATCH 56/92] fa: add src/user-defined-types/named-structs --- po/fa.po | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/po/fa.po b/po/fa.po index 25874c4b09b..36abc373708 100644 --- a/po/fa.po +++ b/po/fa.po @@ -247,11 +247,11 @@ msgstr "Enums" #: src/SUMMARY.md src/user-defined-types.md msgid "Static" -msgstr "" +msgstr "Static" #: src/SUMMARY.md msgid "Const" -msgstr "" +msgstr "Const" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md:1 msgid "Type Aliases" @@ -4537,26 +4537,40 @@ msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بد msgid "This segment should take about 50 minutes. It contains:" msgstr "این بخش حدود ۵۰ دقیقه طول خواهد کشید. شامل موارد زیر است:" +msgid "" +msgstr "" +"Project-Id-Version: Comprehensive Rust 🦀\n" +"POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" +"PO-Revision-Date: 2024-07-24 10:12+0330\n" +"Last-Translator: alix1383 \n" +"Language-Team: Persian\n" +"Language: fa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.4.4\n" + #: src/user-defined-types/named-structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" -msgstr "" +msgstr "‏مانند C و C++، زبان Rust از ساختارهای سفارشی پشتیبانی می‌کند:" #: src/user-defined-types/named-structs.md:12 msgid "\"{} is {} years old\"" -msgstr "" +msgstr "‏\"{} {} ساله است\"" #: src/user-defined-types/named-structs.md:16 #: src/android/interoperability/with-c/bindgen.md:87 msgid "\"Peter\"" -msgstr "" +msgstr "\"پیتر\"" #: src/user-defined-types/named-structs.md:22 msgid "\"Avery\"" -msgstr "" +msgstr "\"ایوری\"" #: src/user-defined-types/named-structs.md:27 msgid "\"Jackie\"" -msgstr "" +msgstr "\"جکی\"" #: src/user-defined-types/named-structs.md:35 #: src/user-defined-types/enums.md:29 src/pattern-matching/match.md:38 @@ -4566,21 +4580,23 @@ msgstr "نکات کلیدی:" #: src/user-defined-types/named-structs.md:37 msgid "Structs work like in C or C++." -msgstr "" +msgstr "‏ساختارها (Structs) در Rust مانند C یا C++ عمل می‌کنند." #: src/user-defined-types/named-structs.md:38 msgid "Like in C++, and unlike in C, no typedef is needed to define a type." -msgstr "" +msgstr "‏مانند C++ و برخلاف C، برای تعریف یک نوع نیازی به `typedef` نیست." #: src/user-defined-types/named-structs.md:39 msgid "Unlike in C++, there is no inheritance between structs." -msgstr "" +msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری وجود ندارد." #: src/user-defined-types/named-structs.md:40 msgid "" "This may be a good time to let people know there are different types of " "structs." msgstr "" +"این زمان مناسبی است تا به مردم اطلاع دهیم که انواع مختلفی از ساختارها وجود " +"دارد." #: src/user-defined-types/named-structs.md:42 msgid "" @@ -4588,18 +4604,25 @@ msgid "" "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" +"‏ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که ‏" +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " +"که بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md:45 msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" +"اسلاید بعدی ساختارهای تاپل‏ (Tuple structs) را معرفی خواهد کرد، که زمانی " +"استفاده می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md:47 msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " +"یک روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md:49 msgid "" @@ -4607,6 +4630,8 @@ msgid "" "old struct without having to explicitly type it all out. It must always be " "the last element." msgstr "" +"‏سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " +"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md:7 msgid "If the field names are unimportant, you can use a tuple struct:" From cf4393598e4c01750d53a2f8a1f956d6f1d19b07 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:06:36 +0000 Subject: [PATCH 57/92] fa: add src/user-defined-types/named-structs s --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 36abc373708..7879848a93f 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4595,7 +4595,7 @@ msgid "" "This may be a good time to let people know there are different types of " "structs." msgstr "" -"این زمان مناسبی است تا به مردم اطلاع دهیم که انواع مختلفی از ساختارها وجود " +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " "دارد." #: src/user-defined-types/named-structs.md:42 From 5f252bee6fa097d5451b6f394c1d17285b827f52 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:27:08 +0000 Subject: [PATCH 58/92] fa: add src/user-defined-types/named-structs s --- po/fa.po | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/po/fa.po b/po/fa.po index 7879848a93f..128e2dd3ca0 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4537,20 +4537,6 @@ msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بد msgid "This segment should take about 50 minutes. It contains:" msgstr "این بخش حدود ۵۰ دقیقه طول خواهد کشید. شامل موارد زیر است:" -msgid "" -msgstr "" -"Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" -"PO-Revision-Date: 2024-07-24 10:12+0330\n" -"Last-Translator: alix1383 \n" -"Language-Team: Persian\n" -"Language: fa\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.4.4\n" - #: src/user-defined-types/named-structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" msgstr "‏مانند C و C++، زبان Rust از ساختارهای سفارشی پشتیبانی می‌کند:" From 2542ac910d3355e4ed9461060393b69fc25ce2c5 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:38:23 +0000 Subject: [PATCH 59/92] fa: add src/user-defined-types/named-structs --- po/fa.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index 128e2dd3ca0..17426961d16 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4590,7 +4590,7 @@ msgid "" "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" -"‏ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که ‏" +"ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " "می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " "که بخواهید در خود مقدار ذخیره کنید." @@ -4599,7 +4599,7 @@ msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" -"اسلاید بعدی ساختارهای تاپل‏ (Tuple structs) را معرفی خواهد کرد، که زمانی " +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " "استفاده می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md:47 @@ -4616,7 +4616,7 @@ msgid "" "old struct without having to explicitly type it all out. It must always be " "the last element." msgstr "" -"‏سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " "کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md:7 From 5f8f0821065fb75a2543dcafb997935ed713cfb8 Mon Sep 17 00:00:00 2001 From: javad-jafari <65780584+javad-jafari@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:30:28 +0330 Subject: [PATCH 60/92] fa: fix fa.po --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index 17426961d16..423e42f6d3c 100644 --- a/po/fa.po +++ b/po/fa.po @@ -4362,7 +4362,7 @@ msgstr "" #: src/references/strings.md:7 msgid "We can now understand the two string types in Rust:" -msgstr "حالا می‌توانیم دو نوع رشته‌ای را در رراست درک کنیم:" +msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" #: src/references/strings.md:9 msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." From 7e400f36406efa40023e0982703c3e32b3565f43 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 6 Sep 2024 16:07:22 +0330 Subject: [PATCH 61/92] fa: chromium part 1/5 --- po/fa.po | 193 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 174 insertions(+), 19 deletions(-) diff --git a/po/fa.po b/po/fa.po index 423e42f6d3c..f1defaff213 100644 --- a/po/fa.po +++ b/po/fa.po @@ -14178,13 +14178,15 @@ msgstr "" #: src/chromium.md msgid "Welcome to Rust in Chromium" -msgstr "" +msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" "Rust is supported for third-party libraries in Chromium, with first-party " "glue code to connect between Rust and existing Chromium C++ code." msgstr "" +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " +"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" @@ -14193,6 +14195,10 @@ msgid "" "feel free to follow this recipe in your part of the codebase instead of the " "exact part we talk about." msgstr "" +"امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " +"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " +"پایگاه کد دنبال کنید." #: src/chromium/setup.md msgid "" @@ -14200,12 +14206,18 @@ msgid "" "flags is OK, so long as your code is relatively recent (commit position " "1223636 onwards, corresponding to November 2023):" msgstr "" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " +"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " +"commit 1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md +#, fuzzy msgid "" "(A component, debug build is recommended for quickest iteration time. This " "is the default!)" msgstr "" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " +"یک حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" @@ -14213,14 +14225,17 @@ msgid "" "the-code/) if you aren't already at that point. Be warned: setting up to " "build Chromium takes time." msgstr "" +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." +"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " +"برای build Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." -msgstr "" +msgstr "همچنین توصیه می شود که Visual Studio code را نصب کرده باشید." #: src/chromium/setup.md msgid "About the exercises" -msgstr "" +msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" @@ -14229,6 +14244,10 @@ msgid "" "If you don't have time to complete a certain part, don't worry: you can " "catch up in the next slot." msgstr "" +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " +"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " +"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " +"به عقب برگردید." #: src/chromium/cargo.md msgid "" @@ -14236,10 +14255,13 @@ msgid "" "(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " "set of dependencies." msgstr "" +"جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " +"استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " +"ساخته شده است." #: src/chromium/cargo.md msgid "When writing code in Rust, your choices are:" -msgstr "" +msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عبارتند از:" #: src/chromium/cargo.md msgid "" @@ -14247,6 +14269,9 @@ msgid "" "gni` (e.g. `rust_static_library` that we'll meet later). This uses " "Chromium's audited toolchain and crates." msgstr "" +"از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " +"crateهای بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" @@ -14254,12 +14279,17 @@ msgid "" "crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" "docs/rust.md#Using-cargo)" msgstr "" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " +"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" "Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " "downloaded from the internet](https://crates.io/)" msgstr "" +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " +"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" @@ -14267,27 +14297,33 @@ msgid "" "code can be built into the Chromium browser. At the same time, Cargo is an " "important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " +"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " +"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md -#, fuzzy msgid "Mini exercise" -msgstr "تمرین‌ها" +msgstr "خرده تمرین" #: src/chromium/cargo.md msgid "Split into small groups and:" -msgstr "" +msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" "Brainstorm scenarios where `cargo` may offer an advantage and assess the " "risk profile of these scenarios." msgstr "" +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " +"ریسک‌های این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" "Discuss which tools, libraries, and groups of people need to be trusted when " "using `gn` and `ninja`, offline `cargo`, etc." msgstr "" +"در هنگام استفاده از `gn` و `ninja`و `cargo` آفلاین و غیره در مورد ابزارها، " +"کتابخانه‌ها و گروه‌هایی از افراد بحث کنید." #: src/chromium/cargo.md msgid "" @@ -14295,12 +14331,17 @@ msgid "" "exercise. Assuming folks taking the course are physically together, ask them " "to discuss in small groups of 3-4 people." msgstr "" +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " +"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " +"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" "Notes/hints related to the first part of the exercise (\"scenarios where " "Cargo may offer an advantage\"):" msgstr "" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " +"را ارائه دهد\"):" #: src/chromium/cargo.md msgid "" @@ -14310,20 +14351,30 @@ msgid "" "(`clap` for command-line parsing, `serde` for serializing/deserializing to/" "from various formats, `itertools` for working with iterators, etc.)." msgstr "" +"این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " +"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " +"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " +"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to try a library (just add a single line to `Cargo." "toml` and start writing code)" msgstr "" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " +"اضافه کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " +"مقایسه با `python` + `pip`." #: src/chromium/cargo.md +#, fuzzy msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " "using `rustup` to switch to a different `rustc` version when testing a crate " @@ -14332,15 +14383,25 @@ msgid "" "streamlining and sharing security audits; `criterion` crate gives a " "streamlined way to run benchmarks)." msgstr "" +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " +"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " +"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " +"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " +"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " +"راهی ساده برای اجرای benchmark‌ها می‌دهد)." #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " +"می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " +"باشد." #: src/chromium/cargo.md msgid "" @@ -14355,6 +14416,10 @@ msgid "" "typesystem) and running faster (as a compiled, rather than interpreted " "language)." msgstr "" +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " +"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " +"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " +"زبان کامپایل شده و نه مفسری)." #: src/chromium/cargo.md msgid "" @@ -14363,33 +14428,45 @@ msgid "" "used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " "should probably use Cargo." msgstr "" +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " +"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " +"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " +"باید از Cargo استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" -msgstr "" +msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium که مبتنی بر `cargo` هستند:" #: src/chromium/cargo.md msgid "" "`serde_json_lenient` (experimented with in other parts of Google which " "resulted in PRs with performance improvements)" msgstr "" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " +"با بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" -msgstr "" +msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" "`gnrt` tool (we will meet it later in the course) which depends on `clap` " "for command-line parsing and on `toml` for configuration files." msgstr "" +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " +"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md +#, fuzzy msgid "" "Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " "when building and bootstrapping Rust standard library when building Rust " "toolchain." msgstr "" +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " +"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " +"toolchain بود." #: src/chromium/cargo.md msgid "" @@ -14397,12 +14474,17 @@ msgid "" "third-party libraries downloaded from the internet, but `run_gnrt.py` asks " "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" +"‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." +"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " +"است.)" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" msgstr "" +"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" @@ -14410,40 +14492,49 @@ msgid "" "Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" +"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " +"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" +"rust-lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." -msgstr "" +msgstr "`cargo`, `rustfmt`, ب." #: src/chromium/cargo.md msgid "" "Various internal infrastructure (bots that build `rustc`, system for " "distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " +"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." -msgstr "" +msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md msgid "" "Rust libraries vendored into `//third_party/rust` (audited by " "security@chromium.org)" msgstr "" +"کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " +"security@chromium.org)" #: src/chromium/cargo.md msgid "Other Rust libraries (some niche, some quite popular and commonly used)" -msgstr "" +msgstr "سایر کتابخانه‌های Rust (بعضی خاص، برخی کاملاً محبوب و پرکاربرد)" #: src/chromium/policy.md msgid "Chromium Rust policy" -msgstr "" +msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" @@ -14451,6 +14542,9 @@ msgid "" "approved by Chromium's [Area Tech Leads](https://source.chromium.org/" "chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " +"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" +"ATL_OWNERS) تأیید شده است." #: src/chromium/policy.md msgid "" @@ -14460,6 +14554,10 @@ msgid "" "circumstances, including if they're the best option for performance or for " "security." msgstr "" +"رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " +"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " +"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" @@ -14467,6 +14565,9 @@ msgid "" "nearly all such libraries will require a small amount of first-party glue " "code." msgstr "" +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " +"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " +"glue code اول شخص نیاز دارند." #: src/chromium/policy.md msgid "" @@ -14494,33 +14595,61 @@ msgid "" "-'\n" "```" msgstr "" +"```bob\n" +"\"C++\" Rust\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" +": : : :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" +": \"C++\" : : \"wrapper\" " +"crate :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" +": : : :\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" +"```" #: src/chromium/policy.md msgid "" "First-party Rust glue code for a particular third-party crate should " "normally be kept in `third_party/rust///wrapper`." msgstr "" +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" +"rust///wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" -msgstr "" +msgstr "به‌همین دلیل، دوره‌ی امروز به شدت بر روی موارد زیر متمرکز خواهد شد:" #: src/chromium/policy.md msgid "Bringing in third-party Rust libraries (\"crates\")" -msgstr "" +msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "" +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " +"کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " +"مسیر مناسب ادامه یابد." #: src/chromium/build-rules.md -#, fuzzy msgid "Build rules" -msgstr "قوانین ساخت" +msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" @@ -14528,15 +14657,19 @@ msgid "" "`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " "is no exception." msgstr "" +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " +"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " +"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" -msgstr "" +msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md msgid "" "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" msgstr "" +"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -14549,12 +14682,22 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +"}\n" +"```" #: src/chromium/build-rules.md msgid "" "You can also add `deps` on other Rust targets. Later we'll use this to " "depend upon third party code." msgstr "" +"همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " +"وابستگی به کد شخص ثالث استفاده خواهیم کرد." #: src/chromium/build-rules.md msgid "" @@ -14564,12 +14707,19 @@ msgid "" "list of all source files which `ninja` needs in order to determine when " "rebuilds are necessary." msgstr "" +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " +"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " +"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " +"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " +"دارد." #: src/chromium/build-rules.md msgid "" "(There's no such thing as a Rust `source_set`, because in Rust, an entire " "crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" +"(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " +"جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" @@ -14579,10 +14729,15 @@ msgid "" "this template provides support for CXX interop, Rust features, and unit " "tests, some of which we'll use later." msgstr "" +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " +"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " +"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " +"از برخی از آنها استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md:1 msgid "Including `unsafe` Rust Code" -msgstr "" +msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md:3 msgid "" From 818bed303c316049db0f91dd861f1269d4c63d2d Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 8 Sep 2024 01:41:20 +0330 Subject: [PATCH 62/92] fa: chromium part 2/5 --- po/fa.po | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 186 insertions(+), 16 deletions(-) diff --git a/po/fa.po b/po/fa.po index f1defaff213..af6be5d9d18 100644 --- a/po/fa.po +++ b/po/fa.po @@ -14746,6 +14746,10 @@ msgid "" "the gn target. (Later in the course we'll see circumstances where this is " "necessary.)" msgstr "" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " +"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " +"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " +"است.)" #: src/chromium/build-rules/unsafe.md:7 msgid "" @@ -14762,10 +14766,22 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [\n" +" \"lib.rs\",\n" +" \"hippopotamus.rs\"\n" +" ]\n" +" allow_unsafe = true\n" +"}\n" +"```" #: src/chromium/build-rules/depending.md:3 msgid "Simply add the above target to the `deps` of some Chromium C++ target." -msgstr "" +msgstr "به سادگی هدف بالا را به `deps` برخی از اهداف Chromium C++ اضافه کنید." #: src/chromium/build-rules/depending.md:5 msgid "" @@ -14783,62 +14799,95 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +"}\n" +"\n" +"# or source_set, static_library etc.\n" +"component(\"preexisting_cpp\") {\n" +" deps = [ \":my_rust_lib\" ]\n" +"}\n" +"```" #: src/chromium/build-rules/vscode.md:3 msgid "" "Types are elided in Rust code, which makes a good IDE even more useful than " "for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " +"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " +"استفاده از آن،" #: src/chromium/build-rules/vscode.md:6 +#, fuzzy msgid "" "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " "Rust support" msgstr "" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " +"قبلی پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md:8 msgid "" "`gn gen out/Debug --export-rust-project` (or equivalent for your output " "directory)" msgstr "" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " +"شما)" #: src/chromium/build-rules/vscode.md:10 msgid "`ln -s out/Debug/rust-project.json rust-project.json`" -msgstr "" +msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md:16 msgid "" "A demo of some of the code annotation and exploration features of rust-" "analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " +"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md:19 msgid "" "The following steps may help with the demo (but feel free to instead use a " "piece of Chromium-related Rust that you are most familiar with):" msgstr "" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " +"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md:22 msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" +"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md:23 msgid "" "Place the cursor over the `QrCode::new` call (around line 26) in " "\\`qr_code_generator_ffi_glue.rs" msgstr "" +"مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در " +"\\`qr_code_generator_ffi_glue.rs قرار دهید" #: src/chromium/build-rules/vscode.md:25 msgid "" "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." msgstr "" +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" +"CoC = K)." #: src/chromium/build-rules/vscode.md:27 msgid "" "Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " "(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " +"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." +"rs` می‌رساند.)" #: src/chromium/build-rules/vscode.md:29 msgid "" @@ -14846,12 +14895,17 @@ msgid "" "164; the outline is in the file explorer pane in vscode; typical vim/CoC " "bindings = space o)" msgstr "" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " +"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " +"bindings = space o)" #: src/chromium/build-rules/vscode.md:32 msgid "" "Demo **type annotations** (there are quite a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" +"نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" +"with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md:35 msgid "" @@ -14859,17 +14913,21 @@ msgid "" "need to be rerun after editing `BUILD.gn` files (which we will do a few " "times throughout the exercises in this session)." msgstr "" +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " +"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " +"اجرا شود." #: src/exercises/chromium/build-rules.md:1 -#, fuzzy msgid "Build rules exercise" -msgstr "قوانین ساخت" +msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md:3 msgid "" "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " "containing:" msgstr "" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " +"که حاوی:" #: src/exercises/chromium/build-rules.md:13 msgid "" @@ -14877,6 +14935,9 @@ msgid "" "by the Rust compiler, so you'll need to allow unsafe code in your `gn` " "target." msgstr "" +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " +"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " +"`gn` target خود مجاز کنید." #: src/exercises/chromium/build-rules.md:16 msgid "" @@ -14884,6 +14945,9 @@ msgid "" "function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " "see how this can be automated by bindings generation tools):" msgstr "" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " +"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " +"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md:24 msgid "" @@ -14892,6 +14956,10 @@ msgid "" "and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " "times." msgstr "" +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " +"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " +"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " +"بارها چاپ می‌شود." #: src/exercises/chromium/build-rules.md:28 msgid "" @@ -14899,11 +14967,14 @@ msgid "" "in subsequent exercises. If you've succeeded, you will be able to use right-" "click \"Go to definition\" on `println!`." msgstr "" +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " +"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " +"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." #: src/exercises/chromium/build-rules.md:32 #: src/exercises/chromium/interoperability-with-cpp.md:48 msgid "Where to find help" -msgstr "" +msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md:34 msgid "" @@ -14911,30 +14982,43 @@ msgid "" "source.chromium.org/chromium/chromium/src/+/main:build/rust/" "rust_static_library.gni;l=16)" msgstr "" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" +"l=16)" #: src/exercises/chromium/build-rules.md:35 msgid "" "Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" "abi.html#the-no_mangle-attribute)" msgstr "" +"اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." +"html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md:36 msgid "" "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." "extern.html)" msgstr "" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"html)" #: src/exercises/chromium/build-rules.md:37 +#, fuzzy msgid "" "Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" "gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md:38 +#, fuzzy msgid "" "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" "languages/rust)" msgstr "" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" +"languages/rust)" #: src/exercises/chromium/build-rules.md:44 msgid "" @@ -14943,6 +15027,8 @@ msgid "" "call C ABI functions. Later in the course, we'll connect C++ directly to " "Rust." msgstr "" +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " +"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md:48 msgid "" @@ -14950,12 +15036,17 @@ msgid "" "Rust to generate two functions with the same name, and Rust can no longer " "guarantee that the right one is called." msgstr "" +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " +"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " +"کند که تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md:52 msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " +"از الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" @@ -14963,6 +15054,9 @@ msgid "" "source file as the code being tested. This was covered [earlier](../testing." "md) in the course and looks like this:" msgstr "" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " +"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " +"پوشش داده شده بود و به این صورت است:" #: src/chromium/testing.md msgid "" @@ -14971,17 +15065,22 @@ msgid "" "and helps to avoid rebuilding `.rs` files a second time (in the `test` " "configuration)." msgstr "" +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " +"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " +"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " +"`test`) جلوگیری شود." #: src/chromium/testing.md msgid "" "This results in the following options for testing Rust code in Chromium:" -msgstr "" +msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md msgid "" "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" "rust`." msgstr "" +"تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" @@ -14989,6 +15088,9 @@ msgid "" "when Rust code is just a thin FFI layer and the existing unit tests provide " "sufficient coverage for the feature." msgstr "" +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " +"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " +"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" @@ -14996,6 +15098,9 @@ msgid "" "public API (using `pub mod for_testing { ... }` if needed). This is the " "subject of the next few slides." msgstr "" +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " +"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " +"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" @@ -15003,12 +15108,17 @@ msgid "" "exercised by Chromium bots. (Such testing is needed rarely --- only after " "adding or updating third-party crates.)" msgstr "" +"ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " +"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md msgid "" "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " "used:" msgstr "" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " +"مقابل Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" @@ -15017,6 +15127,10 @@ msgid "" "both the C++ and the Rust implementation (parameterizing the tests so they " "enable or disable Rust using a `ScopedFeatureList`)." msgstr "" +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " +"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " +"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " +"`ScopedFeatureList` آن را فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" @@ -15025,35 +15139,47 @@ msgid "" "missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " "functionality may benefit from separate tests authored in Rust." msgstr "" +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " +"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " +"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " +"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " +"بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md:3 msgid "" "The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" "main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" +"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md:5 msgid "" "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " "attribute)" msgstr "" +"از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " +"`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md:7 msgid "" "Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " "panicking and not terminating the test when the assertion fails)." msgstr "" +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " +"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md:10 -#, fuzzy msgid "Example:" -msgstr "مثال" +msgstr "مثال:" #: src/chromium/testing/build-gn.md:3 msgid "" "The simplest way to build Rust `gtest` tests is to add them to an existing " "test binary that already contains tests authored in C++. For example:" msgstr "" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " +"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md:6 msgid "" @@ -15065,12 +15191,21 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"test(\"ui_base_unittests\") {\n" +" ...\n" +" sources += [ \"my_rust_lib_unittest.rs\" ]\n" +" deps += [ \":my_rust_lib\" ]\n" +"}\n" +"```" #: src/chromium/testing/build-gn.md:14 msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " +"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md:17 msgid "" @@ -15092,6 +15227,23 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"rust_static_library(\"my_rust_lib_unittests\") {\n" +" testonly = true\n" +" is_gtest_unittests = true\n" +" crate_root = \"my_rust_lib_unittest.rs\"\n" +" sources = [ \"my_rust_lib_unittest.rs\" ]\n" +" deps = [\n" +" \":my_rust_lib\",\n" +" \"//testing/rust_gtest_interop\",\n" +" ]\n" +"}\n" +"\n" +"test(\"ui_base_unittests\") {\n" +" ...\n" +" deps += [ \":my_rust_lib_unittests\" ]\n" +"}\n" +"```" #: src/chromium/testing/chromium-import-macro.md:3 msgid "" @@ -15102,14 +15254,20 @@ msgid "" "working with such an unwieldy name by using the `chromium::import!` macro " "from the automatically-imported `chromium` crate:" msgstr "" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " +"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " +"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " +"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " +"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " +"درنتیجه از کار با چنین نامی پرهیز کنیم:" #: src/chromium/testing/chromium-import-macro.md:12 msgid "\"//ui/base:my_rust_lib\"" -msgstr "" +msgstr "\"//ui/base:my_rust_lib\"" #: src/chromium/testing/chromium-import-macro.md:18 msgid "Under the covers the macro expands to something similar to:" -msgstr "" +msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر گسترش می یابد:" #: src/chromium/testing/chromium-import-macro.md:26 msgid "" @@ -15118,6 +15276,11 @@ msgid "" "chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" +"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" +"import`." #: src/chromium/testing/chromium-import-macro.md:31 msgid "" @@ -15127,19 +15290,23 @@ msgid "" "crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " "covered in a later section) use short crate names." msgstr "" +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " +"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " +"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " +"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " +"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md:1 -#, fuzzy msgid "Testing exercise" -msgstr "تمرین‌ها" +msgstr "تمرین تستی" #: src/exercises/chromium/testing.md:3 msgid "Time for another exercise!" -msgstr "" +msgstr "وقت یک تمرین دیگر است!" #: src/exercises/chromium/testing.md:5 msgid "In your Chromium build:" -msgstr "" +msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md:7 msgid "" @@ -15147,14 +15314,17 @@ msgid "" "two integers received as arguments, computing the nth Fibonacci number, " "summing integers in a slice, etc." msgstr "" +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " +"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " +"اعداد صحیح در یک برش و غیره." #: src/exercises/chromium/testing.md:10 msgid "Add a separate `..._unittest.rs` file with a test for the new function." -msgstr "" +msgstr "یک فایل`..._unittest.rs` جداگانه با یک تست برای تابع جدید اضافه کنید." #: src/exercises/chromium/testing.md:11 msgid "Add the new tests to `BUILD.gn`." -msgstr "" +msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md:12 msgid "Build the tests, run them, and verify that the new test works." From f6192bf44102a40eb34eb508be03360069de758e Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 9 Sep 2024 00:47:36 +0330 Subject: [PATCH 63/92] fa :chromium part 3/5 --- po/fa.po | 202 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 170 insertions(+), 32 deletions(-) diff --git a/po/fa.po b/po/fa.po index 406545c33ff..c2e47f62bf3 100644 --- a/po/fa.po +++ b/po/fa.po @@ -15627,6 +15627,7 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md:12 msgid "Build the tests, run them, and verify that the new test works." msgstr "" +"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15634,6 +15635,9 @@ msgid "" "tools being developed all the time. At the moment, Chromium uses a tool " "called CXX." msgstr "" +"جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " +"CXX استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15641,12 +15645,17 @@ msgid "" "language (which looks a lot like Rust) and then CXX tools generate " "declarations for functions and types in both Rust and C++." msgstr "" +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " +"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " +"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md msgid "" "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " "using this." msgstr "" +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " +"ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15654,6 +15663,9 @@ msgid "" "the same as you previously did. Point out that automating the process has " "the following benefits:" msgstr "" +"از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " +"فرآیند دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15662,6 +15674,10 @@ msgid "" "definitions, but with out-of-sync manual bindings you'd get Undefined " "Behavior)" msgstr "" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " +"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " +"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " +"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15670,10 +15686,16 @@ msgid "" "methods; manual bindings would require authoring such top-level, free " "functions manually)" msgstr "" +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " +"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " +"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " +"بالا و رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " +"کنند - به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15683,6 +15705,11 @@ msgid "" "pointer and length - this is error-prone given that each language represents " "empty slices slightly differently)" msgstr "" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " +"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " +"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " +"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " +"خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15691,6 +15718,10 @@ msgid "" "compatible raw pointers, which would increase lifetime and memory-safety " "risks." msgstr "" +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " +"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " +"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " +"طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15699,24 +15730,30 @@ msgid "" "build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" "terminate a string)." msgstr "" +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " +"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " +"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " +"string را با NUL خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md:3 msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." +"rs` اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md:16 msgid "\"example/include/blobstore.h\"" -msgstr "" +msgstr "\"example/include/blobstore.h\"" #: src/chromium/interoperability-with-cpp/example-bindings.md:24 msgid "// Definitions of Rust types and functions go here\n" -msgstr "" +msgstr "// Definitions of Rust types and functions go here\n" #: src/chromium/interoperability-with-cpp/example-bindings.md:30 msgid "Point out:" -msgstr "" +msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md:32 msgid "" @@ -15725,23 +15762,25 @@ msgid "" "bit more sophisticated - though this does still result in a `mod` called " "`ffi` in your code." msgstr "" +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" +"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " +"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md:36 msgid "Native support for C++'s `std::unique_ptr` in Rust" -msgstr "" +msgstr "پشتیبانی Native در ++C برای`std::unique_ptr`در Rust" #: src/chromium/interoperability-with-cpp/example-bindings.md:37 -#, fuzzy msgid "Native support for Rust slices in C++" -msgstr "پشتیبانی درون-ساختی از تست نویسی" +msgstr "پشتیبانی Native برای Rust Slices در ++C" #: src/chromium/interoperability-with-cpp/example-bindings.md:38 msgid "Calls from C++ to Rust, and Rust types (in the top part)" -msgstr "" +msgstr "فراخوانی از ++C به Rust و تایپ‌های Rust (در قسمت بالا)" #: src/chromium/interoperability-with-cpp/example-bindings.md:39 msgid "Calls from Rust to C++, and C++ types (in the bottom part)" -msgstr "" +msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قسمت پایین)" #: src/chromium/interoperability-with-cpp/example-bindings.md:41 msgid "" @@ -15750,34 +15789,45 @@ msgid "" "simply `#include`d in the generated C++ code for the benefit of C++ " "compilers." msgstr "" +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " +"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " +"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:3 msgid "" "By far the most useful page when using CXX is the [type reference](https://" "cxx.rs/bindings.html)." msgstr "" +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" +"(https://cxx.rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:5 msgid "CXX fundamentally suits cases where:" -msgstr "" +msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:7 msgid "" "Your Rust-C++ interface is sufficiently simple that you can declare all of " "it." msgstr "" +"اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " +"declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:8 msgid "" "You're using only the types natively supported by CXX already, for example " "`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" +"شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " +"مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:11 msgid "" "It has many limitations --- for example lack of support for Rust's `Option` " "type." msgstr "" +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " +"Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:14 msgid "" @@ -15787,47 +15837,62 @@ msgid "" "draft the CXX bindings for the language boundary to see if it appears simple " "enough." msgstr "" +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " +"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " +"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " +"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " +"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:26 msgid "" "You should also discuss some of the other sticky points with CXX, for " "example:" -msgstr "" +msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:28 msgid "" "Its error handling is based around C++ exceptions (given on the next slide)" -msgstr "" +msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:29 msgid "Function pointers are awkward to use." -msgstr "" +msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md:3 msgid "" "CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " "on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" +"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " +"جایگزین‌های آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md:6 msgid "The `T` part of `Result` can be:" -msgstr "" +msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md:7 +#, fuzzy msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " "be passed across the FFI boundary - for example `T` has to be:" msgstr "" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " +"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " +"باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md:9 msgid "A primitive type (like `u32` or `usize`)" -msgstr "" +msgstr "یک type اولیه (مانند `u32` یا `usize`)" #: src/chromium/interoperability-with-cpp/error-handling.md:10 msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " +"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " +"`Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md:12 msgid "" @@ -15835,22 +15900,29 @@ msgid "" "when `T` is a Rust type, which cannot be passed across the FFI boundary, and " "cannot be stored in `UniquePtr`." msgstr "" +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " +"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " +"کند و نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md:16 msgid "The `E` part of `Result` can be:" -msgstr "" +msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md:17 msgid "" "Returned as a boolean (e.g. `true` representing success, and `false` " "representing failure)" msgstr "" +"به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " +"نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md:19 msgid "" "Preserving error details is in theory possible, but so far hasn't been " "needed in practice." msgstr "" +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " +"است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md:1 msgid "CXX Error Handling: QR Example" @@ -15864,10 +15936,14 @@ msgid "" "used to communicate success vs failure, and where the successful result can " "be passed across the FFI boundary:" msgstr "" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" +"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " +"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:8 msgid "\"qr_code_generator\"" -msgstr "" +msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md:23 msgid "" @@ -15876,6 +15952,9 @@ msgid "" "admittedly it is a bit redundant - this is the square root of the size of " "the vector)." msgstr "" +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " +"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " +"جذر اندازه بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md:27 msgid "" @@ -15884,6 +15963,10 @@ msgid "" "points to uninitialized memory results in Undefined Behavior (unlike in C++, " "when only the act of dereferencing such memory results in UB)." msgstr "" +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " +"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " +"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " +"حافظه‌ای منجر به UB می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md:32 msgid "" @@ -15891,6 +15974,10 @@ msgid "" "references to C++ data: the answer is that C++ data can’t be moved around " "like Rust data, because it may contain self-referential pointers." msgstr "" +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " +"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " +"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " +"خودارجاعی (self-referential pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md:1 msgid "CXX Error Handling: PNG Example" @@ -15901,24 +15988,28 @@ msgid "" "A prototype of a PNG decoder illustrates what can be done when the " "successful result cannot be passed across the FFI boundary:" msgstr "" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " +"FFI عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md:7 msgid "\"gfx::rust_bindings\"" -msgstr "" +msgstr "\"gfx::rust_bindings\"" #: src/chromium/interoperability-with-cpp/error-handling-png.md:10 msgid "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" msgstr "" +"/// This returns an FFI-friendly equivalent of `Result,\n" +" /// ()>`.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md:14 msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" -msgstr "" +msgstr "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md:21 msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" -msgstr "" +msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md:32 msgid "" @@ -15927,6 +16018,10 @@ msgid "" "can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " "to store Rust objects by value." msgstr "" +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " +"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " +"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " +"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md:37 msgid "" @@ -15937,10 +16032,16 @@ msgid "" "appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " "`as_mut`)." msgstr "" +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " +"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " +"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " +"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " +"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " +"ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:1 msgid "Using cxx in Chromium" -msgstr "" +msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:3 msgid "" @@ -15948,6 +16049,9 @@ msgid "" "node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " +"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " +"یکی دارید. پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:7 msgid "" @@ -15957,20 +16061,25 @@ msgid "" "allow_unsafe = true\n" "```" msgstr "" +"```gn\n" +"cxx_bindings = [ \"my_rust_file.rs\" ]\n" +" # list of files containing #[cxx::bridge], not all source files\n" +"allow_unsafe = true\n" +"```" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:13 msgid "" "to your existing `rust_static_library` target alongside `crate_root` and " "`sources`." -msgstr "" +msgstr "به هدف `rust_static_library` موجود در کنار `crate_root` و `sources`." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:16 msgid "C++ headers will be generated at a sensible location, so you can just" -msgstr "" +msgstr "‏ headerهای ++C در یک مکان منطقی تولید می‌شوند، بنابراین شما می‌توانید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:19 msgid "\"ui/base/my_rust_file.rs.h\"" -msgstr "" +msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:22 msgid "" @@ -15979,10 +16088,15 @@ msgid "" "source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" "l=21)." msgstr "" +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " +"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." +"h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:27 msgid "Students may ask --- why do we still need `allow_unsafe = true`?" msgstr "" +"دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:29 msgid "" @@ -15994,6 +16108,13 @@ msgid "" "writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " "binary can cause unexpected behavior from Rust's perspective." msgstr "" +"پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " +"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " +"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " +"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" +"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " +"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:36 msgid "" @@ -16002,15 +16123,17 @@ msgid "" "`unsafe` and `extern \"C\"` functions just like we did manually in the " "previous section." msgstr "" +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " +"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " +"در بخش قبل به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md:1 -#, fuzzy msgid "Exercise: Interoperability with C++" -msgstr "قابلیت همکاری" +msgstr "تمرین: قابلیت همکاری با ++C" #: src/exercises/chromium/interoperability-with-cpp.md:3 msgid "Part one" -msgstr "" +msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md:5 msgid "" @@ -16018,51 +16141,61 @@ msgid "" "specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " +"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " +"بدون اینکه پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md:8 msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " "`#[no_mangle]`. This is now just a standard Rust function." msgstr "" +"تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` " +"تغییر دهید. حالا این فقط یک تابع استاندارد Rust است." #: src/exercises/chromium/interoperability-with-cpp.md:10 msgid "Modify your `gn` target to build these bindings." -msgstr "" +msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindings) تغییر دهید." #: src/exercises/chromium/interoperability-with-cpp.md:11 msgid "" "In your C++ code, remove the forward-declaration of `hello_from_rust`. " "Instead, include the generated header file." msgstr "" +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " +"عوض، فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md:13 msgid "Build and run!" -msgstr "" +msgstr "Build و run!" #: src/exercises/chromium/interoperability-with-cpp.md:15 msgid "Part two" -msgstr "" +msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md:17 msgid "" "It's a good idea to play with CXX a little. It helps you think about how " "flexible Rust in Chromium actually is." msgstr "" +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " +"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md:20 -#, fuzzy msgid "Some things to try:" -msgstr "نکته:" +msgstr "برخی از چیزهایی که باید امتحان کنید:" #: src/exercises/chromium/interoperability-with-cpp.md:22 msgid "Call back into C++ from Rust. You will need:" -msgstr "" +msgstr "از Rust دوباره به ++C فراخوانی کنید. درنهایت شما نیاز خواهید داشت:" #: src/exercises/chromium/interoperability-with-cpp.md:23 msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " +"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md:25 msgid "" @@ -16070,12 +16203,17 @@ msgid "" "`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" "extern-c++.html#functions-and-member-functions)." msgstr "" +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " +"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" +"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md:27 msgid "" "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." "h\"`" msgstr "" +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" +"cxx.h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md:29 msgid "Pass a C++ string from C++ into Rust." From 22f23ee8a953bfd45a1718b9630e076a15cde952 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 9 Sep 2024 23:03:18 +0330 Subject: [PATCH 64/92] chromium part 4/5 --- po/fa.po | 379 ------------------------------------------------------- 1 file changed, 379 deletions(-) diff --git a/po/fa.po b/po/fa.po index c2e47f62bf3..840d79599ed 100644 --- a/po/fa.po +++ b/po/fa.po @@ -16216,385 +16216,6 @@ msgstr "" "cxx.h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md:29 -msgid "Pass a C++ string from C++ into Rust." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:30 -msgid "Pass a reference to a C++ object into Rust." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:31 -msgid "" -"Intentionally get the Rust function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:33 -msgid "" -"Intentionally get the C++ function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:35 -msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " -"own some C++ object." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:37 -msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " -"need a `Box`)." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:39 -msgid "Declare some methods on a C++ type. Call them from Rust." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:40 -msgid "Declare some methods on a Rust type. Call them from C++." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:42 -msgid "Part three" -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:44 -msgid "" -"Now you understand the strengths and limitations of CXX interop, think of a " -"couple of use-cases for Rust in Chromium where the interface would be " -"sufficiently simple. Sketch how you might define that interface." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:50 -msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:51 -msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:57 -msgid "Some of the questions you may encounter:" -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:59 -msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X " -"and Y are both function types. This is because your C++ function doesn't " -"quite match the declaration in your `cxx::bridge`." -msgstr "" - -#: src/exercises/chromium/interoperability-with-cpp.md:62 -msgid "" -"I seem to be able to freely convert C++ references into Rust references. " -"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" -"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " -"CXX's design makes it quite difficult to craft such an example." -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Property" -msgstr "ویژگی" - -#: src/chromium/adding-third-party-crates.md -#, fuzzy -msgid "C++ library" -msgstr "کتابخانه" - -#: src/chromium/adding-third-party-crates.md -#, fuzzy -msgid "Rust crate" -msgstr "اکوسیستم Rust" - -#: src/chromium/adding-third-party-crates.md -#, fuzzy -msgid "Build system" -msgstr "اکوسیستم Rust" - -#: src/chromium/adding-third-party-crates.md -msgid "Lots" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Consistent: `Cargo.toml`" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Typical library size" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Large-ish" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Small" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Transitive dependencies" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "Few" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "For a Chromium engineer, this has pros and cons:" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "" -"All crates use a common build system so we can automate their inclusion into " -"Chromium..." -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "" -"... but, crates typically have transitive dependencies, so you will likely " -"have to bring in multiple libraries." -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "We'll discuss:" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "How to put a crate in the Chromium source code tree" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "How to make `gn` build rules for it" -msgstr "" - -#: src/chromium/adding-third-party-crates.md -msgid "How to audit its source code for sufficient safety." -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:1 -msgid "Configuring the `Cargo.toml` file to add crates" -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 -msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 -msgid "" -"```toml\n" -"[dependencies]\n" -"bitflags = \"1\"\n" -"cfg-if = \"1\"\n" -"cxx = \"1\"\n" -"# lots more...\n" -"```" -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 -msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 -msgid "" -"When adding a crate to Chromium, you'll often need to provide some extra " -"information in an additional file, `gnrt_config.toml`, which we'll meet next." -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 -msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml). This contains Chromium-specific extensions to crate handling." -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 -msgid "" -"If you add a new crate, you should specify at least the `group`. This is one " -"of:" -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:15 -msgid "For instance," -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 -msgid "" -"Depending on the crate source code layout, you may also need to use this " -"file to specify where its `LICENSE` file(s) can be found." -msgstr "" - -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 -msgid "" -"Later, we'll see some other things you will need to configure in this file " -"to resolve problems." -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:3 -msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD." -"gn` rules." -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:6 -msgid "To start, download the crate you want like this:" -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:13 -msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running " -"this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:17 -msgid "This `vendor` command may download:" -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:19 -#, fuzzy -msgid "Your crate" -msgstr "جعبه‌های (crates) کاربردی" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:20 -msgid "Direct and transitive dependencies" -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:21 -msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete " -"set of crates required by Chromium." -msgstr "" - -#: src/chromium/adding-third-party-crates/downloading-crates.md:24 -msgid "" -"Chromium maintains patches for some crates, kept in `//third_party/rust/" -"chromium_crates_io/patches`. These will be reapplied automatically, but if " -"patching fails you may need to take manual action." -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 -msgid "" -"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 -msgid "Now run `git status`. You should find:" -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 -msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/" -"vendor`" -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 -msgid "" -"At least one new `BUILD.gn` in `third_party/rust//v`" -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 -msgid "An appropriate `README.chromium`" -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 -#, fuzzy -msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." -msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " -"مراجعه کنید." - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 -msgid "" -"Take a close look, especially at the things generated in `third_party/rust`." -msgstr "" - -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 -msgid "" -"Talk a little about semver --- and specifically the way that in Chromium " -"it's to allow multiple incompatible versions of a crate, which is " -"discouraged but sometimes necessary in the Cargo ecosystem." -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:3 -msgid "" -"If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the " -"design of `gn` and `ninja` which aim for static, deterministic, build rules " -"to maximize parallelism and repeatability of builds." -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:8 -msgid "" -"Some `build.rs` actions are automatically supported; others require action:" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 -msgid "build script effect" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 -msgid "Supported by our gn templates" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 -msgid "Work required by you" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -msgid "Checking rustc version to configure features on and off" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 -msgid "Yes" -msgstr "بلی" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 -msgid "None" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 -msgid "Checking platform or CPU to configure features on and off" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 -#, fuzzy -msgid "Generating code" -msgstr "جنریک‌ها" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 -msgid "Yes - specify in `gnrt_config.toml`" -msgstr "" - -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 -msgid "Building C/C++" -msgstr "" - #: src/chromium/adding-third-party-crates/resolving-problems.md:15 #: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "No" From c90f1df87c2a6c1153e855577397c78e1108c783 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 10 Sep 2024 23:56:05 +0330 Subject: [PATCH 65/92] fa: chromium part 5/5 complete --- po/fa.po | 642 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 614 insertions(+), 28 deletions(-) diff --git a/po/fa.po b/po/fa.po index 840d79599ed..1b21db68a21 100644 --- a/po/fa.po +++ b/po/fa.po @@ -16215,6 +16215,456 @@ msgstr "" "همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" "cxx.h\"` را وارد کنید." +msgid "Pass a C++ string from C++ into Rust." +msgstr "یک رشته++C را از ++C به Rust منتقل کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:30 +msgid "Pass a reference to a C++ object into Rust." +msgstr "ارسال یک reference از یک C++ object به Rust ." + +#: src/exercises/chromium/interoperability-with-cpp.md:31 +msgid "" +"Intentionally get the Rust function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." +msgstr "" +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " +"و به خطاهایی که می بینید عادت کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:33 +msgid "" +"Intentionally get the C++ function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." +msgstr "" +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " +"به خطاهایی که می بینید عادت کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:35 +msgid "" +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " +"own some C++ object." +msgstr "" +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " +"بتواند دارای یک C++ object باشد." + +#: src/exercises/chromium/interoperability-with-cpp.md:37 +msgid "" +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " +"need a `Box`)." +msgstr "" +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " +"(نکته: شما به یک `Box` نیاز دارید)." + +#: src/exercises/chromium/interoperability-with-cpp.md:39 +msgid "Declare some methods on a C++ type. Call them from Rust." +msgstr "چند متد را در نوع ++C اعلام کنید. آنها را از Rust فراخوانی کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:40 +msgid "Declare some methods on a Rust type. Call them from C++." +msgstr "چند متد را در Rust type اعلام کنید. از ++C آن‌ها را فراخوانی کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:42 +msgid "Part three" +msgstr "قسمت سوم" + +#: src/exercises/chromium/interoperability-with-cpp.md:44 +msgid "" +"Now you understand the strengths and limitations of CXX interop, think of a " +"couple of use-cases for Rust in Chromium where the interface would be " +"sufficiently simple. Sketch how you might define that interface." +msgstr "" +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " +"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " +"تعریف این رابط را ترسیم کنید." + +#: src/exercises/chromium/interoperability-with-cpp.md:50 +msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" +msgstr "یک [`cxx` binding reference](https://cxx.rs/bindings.html)" + +#: src/exercises/chromium/interoperability-with-cpp.md:51 +msgid "" +"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +msgstr "" +"یک [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" + +#: src/exercises/chromium/interoperability-with-cpp.md:57 +msgid "Some of the questions you may encounter:" +msgstr "برخی از سؤالاتی که ممکن است با آن مواجه شوید:" + +#: src/exercises/chromium/interoperability-with-cpp.md:59 +msgid "" +"I'm seeing a problem initializing a variable of type X with type Y, where X " +"and Y are both function types. This is because your C++ function doesn't " +"quite match the declaration in your `cxx::bridge`." +msgstr "" +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " +"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " +"`cxx::bridge` شما مطابقت ندارد." + +#: src/exercises/chromium/interoperability-with-cpp.md:62 +msgid "" +"I seem to be able to freely convert C++ references into Rust references. " +"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" +"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " +"CXX's design makes it quite difficult to craft such an example." +msgstr "" +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " +"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " +"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " +"نمونه‌ای را بسیار دشوار می‌کند." + +#: src/chromium/adding-third-party-crates.md +msgid "" +"Rust libraries are called \"crates\" and are found at [crates.io](https://" +"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " +"they do!" +msgstr "" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." +"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " +"آنها این کار را انجام می‌دهند!" + +#: src/chromium/adding-third-party-crates.md +msgid "Property" +msgstr "ویژگی" + +#: src/chromium/adding-third-party-crates.md +msgid "C++ library" +msgstr "C++ library" + +#: src/chromium/adding-third-party-crates.md +msgid "Rust crate" +msgstr "Rust crate" + +#: src/chromium/adding-third-party-crates.md +msgid "Build system" +msgstr "Build system" + +#: src/chromium/adding-third-party-crates.md +msgid "Lots" +msgstr "تعداد زیادی" + +#: src/chromium/adding-third-party-crates.md +msgid "Consistent: `Cargo.toml`" +msgstr "یکپارچگی: `Cargo.toml`." + +#: src/chromium/adding-third-party-crates.md +msgid "Typical library size" +msgstr "اندازه کتابخانه معمولی" + +#: src/chromium/adding-third-party-crates.md +msgid "Large-ish" +msgstr "Large-ish" + +#: src/chromium/adding-third-party-crates.md +msgid "Small" +msgstr "کوچک" + +#: src/chromium/adding-third-party-crates.md +msgid "Transitive dependencies" +msgstr "وابستگی‌های گذرا" + +#: src/chromium/adding-third-party-crates.md +msgid "Few" +msgstr "Few" + +#: src/chromium/adding-third-party-crates.md +msgid "For a Chromium engineer, this has pros and cons:" +msgstr "برای یک مهندس Chromium، این مزایا و معایب دارد:" + +#: src/chromium/adding-third-party-crates.md +msgid "" +"All crates use a common build system so we can automate their inclusion into " +"Chromium..." +msgstr "" +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " +"آن‌ها در Chromium را خودکار کنیم..." + +#: src/chromium/adding-third-party-crates.md +msgid "" +"... but, crates typically have transitive dependencies, so you will likely " +"have to bring in multiple libraries." +msgstr "" +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " +"بود چندین کتابخانه را بیاورید." + +#: src/chromium/adding-third-party-crates.md +msgid "We'll discuss:" +msgstr "بحث خواهیم کرد:" + +#: src/chromium/adding-third-party-crates.md +msgid "How to put a crate in the Chromium source code tree" +msgstr "نحوه قرار دادن یک crate در درخت کد منبع Chromium" + +#: src/chromium/adding-third-party-crates.md +msgid "How to make `gn` build rules for it" +msgstr "چگونه قوانین ساخت `gn` برای آن ایجاد کنیم" + +#: src/chromium/adding-third-party-crates.md +msgid "How to audit its source code for sufficient safety." +msgstr "نحوه بررسی کد منبع آن برای ایمنی کافی" + +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:1 +msgid "Configuring the `Cargo.toml` file to add crates" +msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" + +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 +msgid "" +"Chromium has a single set of centrally-managed direct crate dependencies. " +"These are managed through a single [`Cargo.toml`](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." +"toml):" +msgstr "" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " +"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " +"می‌شوند :" + +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 +msgid "" +"```toml\n" +"[dependencies]\n" +"bitflags = \"1\"\n" +"cfg-if = \"1\"\n" +"cxx = \"1\"\n" +"# lots more...\n" +"```" +msgstr "" +"```toml\n" +"[dependencies]\n" +"bitflags = \"1\"\n" +"cfg-if = \"1\"\n" +"cxx = \"1\"\n" +"# lots more...\n" +"```" + +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 +msgid "" +"As with any other `Cargo.toml`, you can specify [more details about the " +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" +"dependencies.html) --- most commonly, you'll want to specify the `features` " +"that you wish to enable in the crate." +msgstr "" +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" +"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " +"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " +"کنید را مشخص کنید." + +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 +msgid "" +"When adding a crate to Chromium, you'll often need to provide some extra " +"information in an additional file, `gnrt_config.toml`, which we'll meet next." +msgstr "" +"هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، " +"`gnrt_config.toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." + +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 +msgid "" +"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml). This contains Chromium-specific extensions to crate handling." +msgstr "" +"در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " +"crate است." + +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 +msgid "" +"If you add a new crate, you should specify at least the `group`. This is one " +"of:" +msgstr "" +"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" + +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:15 +msgid "For instance," +msgstr "به عنوان مثال،" + +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 +msgid "" +"Depending on the crate source code layout, you may also need to use this " +"file to specify where its `LICENSE` file(s) can be found." +msgstr "" +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " +"یافتن فایل (های) مجوز آن استفاده کنید." + +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 +msgid "" +"Later, we'll see some other things you will need to configure in this file " +"to resolve problems." +msgstr "" +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " +"مشاهده خواهیم کرد." + +#: src/chromium/adding-third-party-crates/downloading-crates.md:3 +msgid "" +"A tool called `gnrt` knows how to download crates and how to generate `BUILD." +"gn` rules." +msgstr "" +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " +"`BUILD.gn` را ایجاد کند." + +#: src/chromium/adding-third-party-crates/downloading-crates.md:6 +msgid "To start, download the crate you want like this:" +msgstr "برای شروع، crate مورد نظر خود را به صورت زیر دانلود کنید:" + +#: src/chromium/adding-third-party-crates/downloading-crates.md:13 +msgid "" +"Although the `gnrt` tool is part of the Chromium source code, by running " +"this command you will be downloading and running its dependencies from " +"`crates.io`. See [the earlier section](../cargo.md) discussing this security " +"decision." +msgstr "" +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " +"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." +"md) را در مورد این تصمیم امنیتی ببینید." + +#: src/chromium/adding-third-party-crates/downloading-crates.md:17 +msgid "This `vendor` command may download:" +msgstr "این `vendor` command ممکن است بارگیری کند:" + +#: src/chromium/adding-third-party-crates/downloading-crates.md:19 +msgid "Your crate" +msgstr "جعبه‌های (crates) کاربردی شما" + +#: src/chromium/adding-third-party-crates/downloading-crates.md:20 +msgid "Direct and transitive dependencies" +msgstr "وابستگی های مستقیم و گذرا" + +#: src/chromium/adding-third-party-crates/downloading-crates.md:21 +msgid "" +"New versions of other crates, as required by `cargo` to resolve the complete " +"set of crates required by Chromium." +msgstr "" +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " +"جعبه‌های مورد نیاز Chromium لازم است." + +#: src/chromium/adding-third-party-crates/downloading-crates.md:24 +msgid "" +"Chromium maintains patches for some crates, kept in `//third_party/rust/" +"chromium_crates_io/patches`. These will be reapplied automatically, but if " +"patching fails you may need to take manual action." +msgstr "" +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" +"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " +"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 +msgid "" +"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgstr "" +"هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 +msgid "Now run `git status`. You should find:" +msgstr "اکنون `git status` را اجرا کنید. شما باید این موارد را پیدا کنید:" + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 +msgid "" +"At least one new crate source code in `third_party/rust/chromium_crates_io/" +"vendor`" +msgstr "" +"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 +msgid "" +"At least one new `BUILD.gn` in `third_party/rust//v`" +msgstr "" +"حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 +msgid "An appropriate `README.chromium`" +msgstr "یک `README.chromium` مناسب" + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 +msgid "" +"The \"major semver version\" is a [Rust \"semver\" version number](https://" +"doc.rust-lang.org/cargo/reference/semver.html)." +msgstr "" +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 +msgid "" +"Take a close look, especially at the things generated in `third_party/rust`." +msgstr "" +"نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." + +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 +msgid "" +"Talk a little about semver --- and specifically the way that in Chromium " +"it's to allow multiple incompatible versions of a crate, which is " +"discouraged but sometimes necessary in the Cargo ecosystem." +msgstr "" +"کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " +"منع می‌شود ولی گاهی اوقات ضروری است." + +#: src/chromium/adding-third-party-crates/resolving-problems.md:3 +msgid "" +"If your build fails, it may be because of a `build.rs`: programs which do " +"arbitrary things at build time. This is fundamentally at odds with the " +"design of `gn` and `ninja` which aim for static, deterministic, build rules " +"to maximize parallelism and repeatability of builds." +msgstr "" +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " +"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " +"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " +"رساندن موازی‌سازی و تکرارپذیری buildها است." + +#: src/chromium/adding-third-party-crates/resolving-problems.md:8 +msgid "" +"Some `build.rs` actions are automatically supported; others require action:" +msgstr "" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " +"اقدام دارند:" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +msgid "build script effect" +msgstr "ساخت افکت اسکریپت" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +msgid "Supported by our gn templates" +msgstr "توسط قالب‌های gn ما پشتیبانی می‌شود" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +msgid "Work required by you" +msgstr "کار مورد نیاز شما" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +msgid "Checking rustc version to configure features on and off" +msgstr "بررسی نسخه rustc برای پیکربندی ویژگی‌ها روشن و خاموش" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +msgid "Yes" +msgstr "بلی" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +msgid "None" +msgstr "None" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +msgid "Checking platform or CPU to configure features on and off" +msgstr "بررسی پلتفرم یا CPU برای پیکربندی ویژگی‌های روشن و خاموش" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +msgid "Generating code" +msgstr "تولید کردن کد" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +msgid "Yes - specify in `gnrt_config.toml`" +msgstr "بله - در `gnrt_config.toml` مشخص کنید" + +#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +msgid "Building C/C++" +msgstr "Building C/C++" + #: src/exercises/chromium/interoperability-with-cpp.md:29 #: src/chromium/adding-third-party-crates/resolving-problems.md:15 #: src/chromium/adding-third-party-crates/resolving-problems.md:16 @@ -16224,23 +16674,27 @@ msgstr "خیر" #: src/chromium/adding-third-party-crates/resolving-problems.md:15 #: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Patch around it" -msgstr "" +msgstr "اطراف آن را Patch کنید" #: src/chromium/adding-third-party-crates/resolving-problems.md:16 msgid "Arbitrary other actions" -msgstr "" +msgstr "سایر اقدامات دلخواه" #: src/chromium/adding-third-party-crates/resolving-problems.md:18 msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " +"scriptها تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:3 msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " +"ببینید که آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:6 msgid "" @@ -16250,6 +16704,11 @@ msgid "" "`allow-first-party-usage=false`. There are several examples already in that " "file:" msgstr "" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " +"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " +"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " +"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " +"فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:11 msgid "" @@ -16259,6 +16718,11 @@ msgid "" "build-script-outputs = [\"tables.rs\"]\n" "```" msgstr "" +"```toml\n" +"[crate.unicode-linebreak]\n" +"allow-first-party-usage = false\n" +"build-script-outputs = [\"tables.rs\"]\n" +"```" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:17 msgid "" @@ -16266,6 +16730,9 @@ msgid "" "`BUILD.gn` files to inform ninja that this particular output file is input " "to subsequent build steps." msgstr "" +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " +"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " +"فایل خروجی خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:3 msgid "" @@ -16275,20 +16742,27 @@ msgid "" "supported in a Chromium context --- our gn, ninja and LLVM build system is " "very specific in expressing relationships between build actions." msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " +"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " +"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " +"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " +"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " +"است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:8 msgid "So, your options are:" -msgstr "" +msgstr "بنابراین، گزینه‌های شما عبارتند از:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:10 msgid "Avoid these crates" -msgstr "" +msgstr "از این crateها اجتناب کنید" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:11 msgid "Apply a patch to the crate." -msgstr "" +msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:13 +#, fuzzy msgid "" "Patches should be kept in `third_party/rust/chromium_crates_io/patches/" "` - see for example the [patches against the `cxx` crate](https://" @@ -16296,6 +16770,11 @@ msgid "" "chromium_crates_io/patches/cxx/) - and will be applied automatically by " "`gnrt` each time it upgrades the crate." msgstr "" +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" +"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " +"خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:3 msgid "" @@ -16303,10 +16782,13 @@ msgid "" "on a crate is simple. Find your `rust_static_library` target, and add a " "`dep` on the `:lib` target within your crate." msgstr "" +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " +"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " +"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:7 msgid "Specifically," -msgstr "" +msgstr "به‌طور‌مشخص،" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:9 msgid "" @@ -16317,6 +16799,12 @@ msgid "" " +------------+ +----------------------+\n" "```" msgstr "" +"```bob\n" +" +------------+ +----------------------+\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" +" +------------+ +----------------------+\n" +"```" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:17 msgid "" @@ -16328,10 +16816,17 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +" deps = [ \"//third_party/rust/example_rust_crate/v1:lib\" ]\n" +"}\n" +"```" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:1 msgid "Auditing Third Party Crates" -msgstr "" +msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:3 msgid "" @@ -16342,17 +16837,25 @@ msgid "" "dependencies, there may be a lot of code to review. On the other hand, safe " "Rust code can have limited negative side effects. How should you review it?" msgstr "" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" +"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " +"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " +"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " +"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " +"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:9 msgid "" "Over time Chromium aims to move to a process based around [cargo vet]" "(https://mozilla.github.io/cargo-vet/)." msgstr "" +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" +"mozilla.github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md:11 msgid "" "Meanwhile, for each new crate addition, we are checking for the following:" -msgstr "" +msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:13 msgid "" @@ -16361,10 +16864,15 @@ msgid "" "macros, work out what they're for. Are they compatible with the way Chromium " "is normally built?" msgstr "" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " +"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " +"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " +"ساخته و built می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:17 +#, fuzzy msgid "Check each crate seems to be reasonably well maintained" -msgstr "" +msgstr "بررسی کنید که هر crate به نظر برسد که به خوبی نگهداری شده باشد." #: src/chromium/adding-third-party-crates/reviews-and-audits.md:18 msgid "" @@ -16373,6 +16881,10 @@ msgid "" "ironically involves downloading lots of dependencies from the internet[2](../" "cargo.md))" msgstr "" +"از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" +"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." +"md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:21 msgid "" @@ -16380,10 +16892,13 @@ msgid "" "chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." "md#unsafe-code-in-safe-languages)" msgstr "" +"مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" +"in-safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:22 msgid "Check for any use of `fs` or `net` APIs" -msgstr "" +msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررسی کنید" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:23 msgid "" @@ -16391,54 +16906,70 @@ msgid "" "that might have been maliciously inserted. (You can't realistically aim for " "100% perfection here: there's often just too much code.)" msgstr "" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " +"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " +"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md:27 msgid "" "These are just guidelines --- work with reviewers from `security@chromium." "org` to work out the right way to become confident of the crate." msgstr "" +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " +"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md:1 msgid "Checking Crates into Chromium Source Code" -msgstr "" +msgstr "بررسی Crateها در کد منبع Chromium" #: src/chromium/adding-third-party-crates/checking-in.md:3 msgid "`git status` should reveal:" -msgstr "" +msgstr "‏ `git status` باید نشان دهد:" #: src/chromium/adding-third-party-crates/checking-in.md:5 msgid "Crate code in `//third_party/rust/chromium_crates_io`" -msgstr "" +msgstr "کد Crate را در `//third_party/rust/chromium_crates_io`." #: src/chromium/adding-third-party-crates/checking-in.md:6 msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" +"`" #: src/chromium/adding-third-party-crates/checking-in.md:9 msgid "Please also add an `OWNERS` file in the latter location." -msgstr "" +msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضافه کنید." #: src/chromium/adding-third-party-crates/checking-in.md:11 msgid "" "You should land all this, along with your `Cargo.toml` and `gnrt_config." "toml` changes, into the Chromium repo." msgstr "" +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " +"مخزن Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md:14 msgid "" "**Important**: you need to use `git add -f` because otherwise `.gitignore` " "files may result in some files being skipped." msgstr "" +"**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." +"gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." #: src/chromium/adding-third-party-crates/checking-in.md:17 +#, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " "language. This is because Rust crate data tends to include names of git " "branches, and many projects still use non-inclusive terminology there. So " "you may need to run:" msgstr "" +"در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " +"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " +"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md:3 msgid "" @@ -16448,14 +16979,25 @@ msgid "" "hoped that we will soon automate this for Rust crates, but for now, it's " "still your responsibility just as it is for any other third party dependency." msgstr "" +"شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " +"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " +"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md:3 +#, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " "crate's [default features](https://doc.rust-lang.org/cargo/reference/" "features.html#the-default-feature). Assume that the crate will be used in " "shipping Chromium, but won't be used to handle untrustworthy input." msgstr "" +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " +"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " +"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " +"نمی‌شود." #: src/exercises/chromium/third-party.md:7 msgid "" @@ -16464,71 +17006,81 @@ msgid "" "[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" "+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" +"(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " +"می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" +"(https://source.chromium.org /chromium/chromium/src/+/main:build/rust/" +"rust_executable.gni) جدید ایجاد کنید که از `uwuify` استفاده می‌کند)." #: src/exercises/chromium/third-party.md:13 msgid "Students will need to download lots of transitive dependencies." -msgstr "" +msgstr "دانش‌آموزان باید تعداد زیادی وابستگی گذرا را دانلود کنند." #: src/exercises/chromium/third-party.md:15 msgid "The total crates needed are:" -msgstr "" +msgstr "کل crateهای مورد نیاز عبارتند از:" #: src/exercises/chromium/third-party.md:17 msgid "`instant`," -msgstr "" +msgstr "`instant`," #: src/exercises/chromium/third-party.md:18 msgid "`lock_api`," -msgstr "" +msgstr "`lock_api`," #: src/exercises/chromium/third-party.md:19 msgid "`parking_lot`," -msgstr "" +msgstr "`parking_lot`," #: src/exercises/chromium/third-party.md:20 msgid "`parking_lot_core`," -msgstr "" +msgstr "`parking_lot_core`," #: src/exercises/chromium/third-party.md:21 msgid "`redox_syscall`," -msgstr "" +msgstr "`redox_syscall`," #: src/exercises/chromium/third-party.md:22 msgid "`scopeguard`," -msgstr "" +msgstr "`scopeguard`," #: src/exercises/chromium/third-party.md:23 msgid "`smallvec`, and" -msgstr "" +msgstr "`smallvec`, و" #: src/exercises/chromium/third-party.md:24 msgid "`uwuify`." -msgstr "" +msgstr "`uwuify`." #: src/exercises/chromium/third-party.md:26 msgid "" "If students are downloading even more than that, they probably forgot to " "turn off the default features." msgstr "" +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " +"ویژگی‌های پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md:29 msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " +"crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" -msgstr "" +msgstr " برای جمع‌آوری آن --- تمرین کنید" #: src/exercises/chromium/bringing-it-together.md msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " +"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" -msgstr "" +msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16536,12 +17088,16 @@ msgid "" "It's important that we get Chromium for Pixies delivered to them as soon as " "possible." msgstr "" +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " +"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md msgid "" "The requirement is to translate all Chromium's UI strings into Pixie " "language." msgstr "" +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " +"شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16549,22 +17105,29 @@ msgid "" "language is very close to English, and it turns out there's a Rust crate " "which does the translation." msgstr "" +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " +"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " +"که ترجمه را انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" +"crates/uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" "(Obviously, real translations of Chrome require incredible care and " "diligence. Don't ship this!)" msgstr "" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " +"این مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" -msgstr "" +msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16572,12 +17135,17 @@ msgid "" "strings before display. In this special build of Chromium, it should always " "do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " +"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " +"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "If you've done everything right across all these exercises, congratulations, " "you should have created Chrome for pixies!" msgstr "" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " +"را برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16585,6 +17153,9 @@ msgid "" "and will probably decide that it's better to do the conversion on the C++ " "side using `base::UTF16ToUTF8` and back again." msgstr "" +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " +"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " +"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16605,6 +17176,14 @@ msgid "" "mutable references to C++ data: the answer is that C++ data can't be moved " "around like Rust data, because it may contain self-referential pointers." msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " +"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " +"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " +"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " +"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " +"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " +"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " +"نشانگرهای خودارجاعی (self-referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16612,22 +17191,29 @@ msgid "" "need to depend on a `rust_static_library` target. The student probably " "already did this." msgstr "" +"هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " +"داده است." #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " +"وابسته باشد." #: src/exercises/chromium/solutions.md msgid "" "Solutions to the Chromium exercises can be found in [this series of CLs]" "(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" -msgstr "" +msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" From ff9034de717869d12bf99566b1514f7e50021f1c Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 11 Sep 2024 22:16:51 +0000 Subject: [PATCH 66/92] fa: refreshed Translation For farsi --- po/fa.po | 7251 +++++++++++++++++++++++++++--------------------------- 1 file changed, 3611 insertions(+), 3640 deletions(-) diff --git a/po/fa.po b/po/fa.po index 1b21db68a21..f8d6037c6f4 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-07-24T09:42:45+03:30\n" +"POT-Creation-Date: 2024-09-11T22:10:46Z\n" "PO-Revision-Date: 2024-09-08 20:39+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" @@ -20,15 +20,15 @@ msgstr "به Comprehensive Rust خوش آمدید 🦀" msgid "Running the Course" msgstr "اجرای دوره" -#: src/SUMMARY.md src/running-the-course/course-structure.md:1 +#: src/SUMMARY.md src/running-the-course/course-structure.md msgid "Course Structure" msgstr "مباحث دوره" -#: src/SUMMARY.md src/running-the-course/keyboard-shortcuts.md:1 +#: src/SUMMARY.md src/running-the-course/keyboard-shortcuts.md msgid "Keyboard Shortcuts" msgstr "میان‌برهای صفحه کلید" -#: src/SUMMARY.md src/running-the-course/translations.md:1 +#: src/SUMMARY.md src/running-the-course/translations.md msgid "Translations" msgstr "ترجمه" @@ -52,72 +52,69 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md:15 -#: src/running-the-course/course-structure.md:34 -#: src/running-the-course/course-structure.md:52 -#: src/running-the-course/course-structure.md:69 src/welcome-day-1.md -#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md -#: src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md:16 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1.md src/hello-world.md src/types-and-values.md -#: src/types-and-values/hello-world.md:1 +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" -#: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md:1 +#: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md msgid "What is Rust?" msgstr "زبان Rust چیست؟" -#: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md:1 +#: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md msgid "Benefits of Rust" msgstr "مزیت‌های زبان Rust" -#: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md:1 +#: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md:17 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" -#: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md:1 +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md msgid "Variables" msgstr "متغیرها" -#: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md:1 +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md msgid "Values" msgstr "مقادیر" -#: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md:1 +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md msgid "Arithmetic" msgstr "عملگرهای ریاضی" -#: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md:1 +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md msgid "Type Inference" msgstr "تعیین تایپ ضمنی" -#: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md:1 +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md msgid "Exercise: Fibonacci" msgstr "تمرین: دنباله فیبوناچی" -#: src/SUMMARY.md src/types-and-values/solution.md:1 -#: src/control-flow-basics/solution.md:1 src/tuples-and-arrays/solution.md:1 -#: src/references/solution.md:1 src/user-defined-types/solution.md:1 -#: src/pattern-matching/solution.md:1 src/methods-and-traits/solution.md:1 -#: src/generics/solution.md:1 src/std-types/solution.md:1 -#: src/std-traits/solution.md:1 src/memory-management/solution.md:1 -#: src/smart-pointers/solution.md:1 src/borrowing/solution.md:1 -#: src/lifetimes/solution.md:1 src/iterators/solution.md:1 -#: src/modules/solution.md:1 src/testing/solution.md:1 -#: src/error-handling/solution.md:1 src/unsafe-rust/solution.md:1 +#: src/SUMMARY.md src/types-and-values/solution.md +#: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md +#: src/references/solution.md src/user-defined-types/solution.md +#: src/pattern-matching/solution.md src/methods-and-traits/solution.md +#: src/generics/solution.md src/std-types/solution.md +#: src/std-traits/solution.md src/memory-management/solution.md +#: src/smart-pointers/solution.md src/borrowing/solution.md +#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md +#: src/testing/solution.md src/error-handling/solution.md +#: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md:18 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -126,47 +123,46 @@ msgstr "مبانی پایه کنترل جریان" msgid "`if` Expressions" msgstr "عبارات `if`" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md:1 +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md msgid "Loops" msgstr "حلقه‌ها" -#: src/SUMMARY.md src/control-flow-basics/loops/for.md:1 +#: src/SUMMARY.md src/control-flow-basics/loops/for.md msgid "`for`" msgstr "`for`" -#: src/SUMMARY.md src/control-flow-basics/loops/loop.md:1 +#: src/SUMMARY.md src/control-flow-basics/loops/loop.md msgid "`loop`" msgstr "`loop`" -#: src/SUMMARY.md src/control-flow-basics/break-continue.md:1 +#: src/SUMMARY.md src/control-flow-basics/break-continue.md msgid "`break` and `continue`" msgstr "`break` و `continue`" -#: src/SUMMARY.md src/control-flow-basics/break-continue/labels.md:1 +#: src/SUMMARY.md src/control-flow-basics/break-continue/labels.md msgid "Labels" msgstr "برچسب‌ها" #: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/blocks-and-scopes.md:1 +#: src/control-flow-basics/blocks-and-scopes.md msgid "Blocks and Scopes" msgstr "بلوک‌ها و محدوده‌ها" -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md:1 +#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" #: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/functions.md:1 +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/macros.md:1 +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/macros.md msgid "Macros" msgstr "ماکروها" #: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/exercise.md:1 +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -174,91 +170,90 @@ msgstr "تمرین: دنباله Collatz" msgid "Day 1: Afternoon" msgstr "روز ۱: بعد از ظهر" -#: src/SUMMARY.md src/running-the-course/course-structure.md:25 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "تاپل ها و آرایه ها" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md:1 +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md msgid "Arrays" msgstr "آرایه‌ها" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md:1 +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md msgid "Tuples" msgstr "تاپل‌ها" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md:1 +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md msgid "Array Iteration" msgstr "تکرار ارایه" #: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md:1 +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md:1 +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md msgid "Exercise: Nested Arrays" msgstr "تمرین: آرایه‌های تو در تو" -#: src/SUMMARY.md src/running-the-course/course-structure.md:26 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "مراجع" -#: src/SUMMARY.md src/references.md src/references/shared.md:1 +#: src/SUMMARY.md src/references.md src/references/shared.md msgid "Shared References" msgstr "مراجع اشتراکی" -#: src/SUMMARY.md src/references.md src/references/exclusive.md:1 +#: src/SUMMARY.md src/references.md src/references/exclusive.md msgid "Exclusive References" msgstr "مراجع انحصاری " -#: src/SUMMARY.md -msgid "Slices: `&[T]`" -msgstr "برش ها: `&[T]`" +#: src/SUMMARY.md src/references.md src/references/slices.md +msgid "Slices" +msgstr "برش‌ها" -#: src/SUMMARY.md src/references.md src/references/strings.md:5 +#: src/SUMMARY.md src/references.md src/references/strings.md msgid "Strings" msgstr "رشته‌ها" -#: src/SUMMARY.md src/references.md src/references/exercise.md:1 +#: src/SUMMARY.md src/references.md src/references/exercise.md msgid "Exercise: Geometry" msgstr "تمرین: هندسه" -#: src/SUMMARY.md src/running-the-course/course-structure.md:27 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1-afternoon.md src/user-defined-types.md msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" #: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/named-structs.md:1 +#: src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" #: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/tuple-structs.md:5 +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md:1 -#: src/pattern-matching/destructuring-enums.md:1 +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md +#: src/pattern-matching/destructuring-enums.md msgid "Enums" msgstr "Enums" -#: src/SUMMARY.md src/user-defined-types.md -msgid "Static" -msgstr "Static" - #: src/SUMMARY.md msgid "Const" msgstr "Const" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md:1 +#: src/SUMMARY.md src/user-defined-types.md +msgid "Static" +msgstr "Static" + +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md msgid "Type Aliases" msgstr "نام‌های مستعار تایپ" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/exercise.md:1 +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/exercise.md msgid "Exercise: Elevator Events" msgstr "تمرین: رویدادهای آسانسور" @@ -266,12 +261,12 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md:35 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" -#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md:1 +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md msgid "Matching Values" msgstr "تطابق مقادیر" @@ -285,41 +280,40 @@ msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" #: src/SUMMARY.md src/pattern-matching.md -#: src/pattern-matching/let-control-flow.md:1 +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" -#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md:1 +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md:36 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" -#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md:1 +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md msgid "Methods" msgstr "متدها" -#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md:1 +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md msgid "Traits" msgstr "Traits" -#: src/SUMMARY.md src/methods-and-traits/traits/implementing.md:1 +#: src/SUMMARY.md src/methods-and-traits/traits/implementing.md msgid "Implementing Traits" msgstr "پیاده سازی Traits" -#: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md:1 +#: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md msgid "Supertraits" msgstr "Supertraits" -#: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md:1 +#: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md msgid "Associated Types" msgstr "تایپ‌های وابسته" -#: src/SUMMARY.md src/methods-and-traits.md -#: src/methods-and-traits/deriving.md:1 +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/deriving.md msgid "Deriving" msgstr "Deriving" @@ -331,49 +325,49 @@ msgstr "تمرین: توابع Generic" msgid "Day 2: Afternoon" msgstr "روز دوم: عصر" -#: src/SUMMARY.md src/running-the-course/course-structure.md:43 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" msgstr "Generics" -#: src/SUMMARY.md src/generics.md src/generics/generic-functions.md:1 +#: src/SUMMARY.md src/generics.md src/generics/generic-functions.md msgid "Generic Functions" msgstr "توابع Generic" -#: src/SUMMARY.md src/generics.md src/generics/generic-data.md:1 +#: src/SUMMARY.md src/generics.md src/generics/generic-data.md msgid "Generic Data Types" msgstr "دیتا تایپ‌های Generic" -#: src/SUMMARY.md src/generics/generic-traits.md:1 +#: src/SUMMARY.md src/generics/generic-traits.md msgid "Generic Traits" msgstr "Generic Traits" -#: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md:1 +#: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md msgid "Trait Bounds" msgstr "Trait Bounds" -#: src/SUMMARY.md src/generics/impl-trait.md:1 +#: src/SUMMARY.md src/generics/impl-trait.md msgid "`impl Trait`" msgstr "`impl Trait`" -#: src/SUMMARY.md src/generics/dyn-trait.md:1 +#: src/SUMMARY.md src/generics/dyn-trait.md msgid "`dyn Trait`" msgstr "`dyn Trait`" -#: src/SUMMARY.md src/generics/exercise.md:1 +#: src/SUMMARY.md src/generics/exercise.md msgid "Exercise: Generic `min`" msgstr "تمرین: Generic `min`" -#: src/SUMMARY.md src/running-the-course/course-structure.md:44 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" msgstr "کتابخانه‌ استاندارد تایپ‌ها" -#: src/SUMMARY.md src/std-types.md src/std-types/std.md:1 +#: src/SUMMARY.md src/std-types.md src/std-types/std.md msgid "Standard Library" msgstr "کتابخانه‌ استاندارد" -#: src/SUMMARY.md src/std-types.md src/std-types/docs.md:1 +#: src/SUMMARY.md src/std-types.md src/std-types/docs.md msgid "Documentation" msgstr "مستندات" @@ -381,50 +375,50 @@ msgstr "مستندات" msgid "`Option`" msgstr "`Option`" -#: src/SUMMARY.md src/error-handling/result.md:1 +#: src/SUMMARY.md src/error-handling/result.md msgid "`Result`" msgstr "`Result`" -#: src/SUMMARY.md src/android/aidl/types/primitives.md:14 -#: src/android/interoperability/cpp/type-mapping.md:5 +#: src/SUMMARY.md src/android/aidl/types/primitives.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`String`" msgstr "`String`" -#: src/SUMMARY.md src/std-types/vec.md:1 +#: src/SUMMARY.md src/std-types/vec.md msgid "`Vec`" msgstr "`Vec`" -#: src/SUMMARY.md src/std-types/hashmap.md:1 src/bare-metal/no_std.md +#: src/SUMMARY.md src/std-types/hashmap.md src/bare-metal/no_std.md msgid "`HashMap`" msgstr "`HashMap`" -#: src/SUMMARY.md src/std-types.md src/std-types/exercise.md:1 +#: src/SUMMARY.md src/std-types.md src/std-types/exercise.md msgid "Exercise: Counter" msgstr "تمرین: شمارنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md:45 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" msgstr "کتابخانه استاندارد Traits" -#: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md:1 +#: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md #: src/concurrency/welcome-async.md msgid "Comparisons" msgstr "مقایسه" -#: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md:1 +#: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md msgid "Operators" msgstr "اپراتورها" -#: src/SUMMARY.md src/std-traits/from-and-into.md:1 +#: src/SUMMARY.md src/std-traits/from-and-into.md msgid "`From` and `Into`" msgstr "`From` and `Into`" -#: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md:1 +#: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md msgid "Casting" msgstr "Casting" -#: src/SUMMARY.md src/std-traits/read-and-write.md:1 +#: src/SUMMARY.md src/std-traits/read-and-write.md msgid "`Read` and `Write`" msgstr "`Read` and `Write`" @@ -432,11 +426,11 @@ msgstr "`Read` and `Write`" msgid "`Default`, struct update syntax" msgstr "`Default`, struct update syntax" -#: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md:1 +#: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md msgid "Closures" msgstr "Closures" -#: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md:1 +#: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md msgid "Exercise: ROT13" msgstr "تمرین: ROT13" @@ -444,25 +438,24 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md:53 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" -#: src/SUMMARY.md src/memory-management.md src/memory-management/review.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/review.md msgid "Review of Program Memory" msgstr "بررسی حافظه برنامه" -#: src/SUMMARY.md src/memory-management.md -#: src/memory-management/approaches.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/approaches.md msgid "Approaches to Memory Management" msgstr "رویکردهای مدیریت حافظه" -#: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md msgid "Ownership" msgstr "مالکیت" -#: src/SUMMARY.md src/memory-management.md src/memory-management/move.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/move.md msgid "Move Semantics" msgstr "مفاهیم جابه‌جایی" @@ -470,8 +463,7 @@ msgstr "مفاهیم جابه‌جایی" msgid "`Clone`" msgstr "`Clone`" -#: src/SUMMARY.md src/memory-management.md -#: src/memory-management/copy-types.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/copy-types.md msgid "Copy Types" msgstr "کپی کردن تایپ‌ها" @@ -479,29 +471,29 @@ msgstr "کپی کردن تایپ‌ها" msgid "`Drop`" msgstr "`Drop`" -#: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md:1 +#: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md:54 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" -#: src/SUMMARY.md src/smart-pointers/box.md:1 -#: src/android/interoperability/cpp/type-mapping.md:9 +#: src/SUMMARY.md src/smart-pointers/box.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Box`" msgstr "`C++" -#: src/SUMMARY.md src/android/interoperability/cpp/bridge.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/bridge.md msgid "The Bridge Module" msgstr "" @@ -819,7 +810,7 @@ msgstr "" msgid "Rust Bridge" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md msgid "Generated C++" msgstr "" @@ -827,23 +818,23 @@ msgstr "" msgid "C++ Bridge" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md msgid "Shared Types" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md msgid "Shared Enums" msgstr "" -#: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md msgid "Rust Error Handling" msgstr "مدیریت خطا Rust" -#: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md msgid "C++ Error Handling" msgstr "مدیریت خطا C++" -#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md:1 +#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" msgstr "" @@ -863,8 +854,7 @@ msgstr "" msgid "With Java" msgstr "با جاوا" -#: src/SUMMARY.md src/running-the-course/course-structure.md:155 -#: src/running-the-course/course-structure.md:165 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/exercises/android/morning.md src/exercises/bare-metal/morning.md #: src/exercises/bare-metal/afternoon.md src/concurrency/welcome.md #: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md @@ -889,27 +879,27 @@ msgstr "" msgid "Unsafe Code" msgstr "Rust ناایمن" -#: src/SUMMARY.md src/chromium/build-rules/depending.md:1 +#: src/SUMMARY.md src/chromium/build-rules/depending.md msgid "Depending on Rust Code from Chromium C++" msgstr "" -#: src/SUMMARY.md src/chromium/build-rules/vscode.md:1 +#: src/SUMMARY.md src/chromium/build-rules/vscode.md msgid "Visual Studio Code" msgstr "" -#: src/SUMMARY.md src/exercises/chromium/third-party.md:1 +#: src/SUMMARY.md src/exercises/chromium/third-party.md msgid "Exercise" msgstr "تمرین‌ها" -#: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md:1 +#: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md msgid "`rust_gtest_interop` Library" msgstr "" -#: src/SUMMARY.md src/chromium/testing/build-gn.md:1 +#: src/SUMMARY.md src/chromium/testing/build-gn.md msgid "GN Rules for Rust Tests" msgstr "" -#: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md:1 +#: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md msgid "`chromium::import!` Macro" msgstr "" @@ -918,17 +908,16 @@ msgstr "" msgid "Interoperability with C++" msgstr "قابلیت همکاری" -#: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md:1 +#: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy msgid "Example Bindings" msgstr "مثال‌ها" -#: src/SUMMARY.md -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:1 +#: src/SUMMARY.md src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Limitations of CXX" msgstr "" -#: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md:1 +#: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md msgid "CXX Error Handling" msgstr "مدیریت خطا CXX" @@ -953,37 +942,35 @@ msgid "Configuring Cargo.toml" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:1 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "Configuring `gnrt_config.toml`" msgstr "" -#: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/downloading-crates.md:1 +#: src/SUMMARY.md src/chromium/adding-third-party-crates/downloading-crates.md msgid "Downloading Crates" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:1 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Generating `gn` Build Rules" msgstr "" -#: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/resolving-problems.md:1 +#: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md msgid "Resolving Problems" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:1 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "Build Scripts Which Generate Code" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:1 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "" #: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:1 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "" @@ -995,8 +982,7 @@ msgstr "" msgid "Checking into Chromium Source Code" msgstr "" -#: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/keeping-up-to-date.md:1 +#: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "Keeping Crates Up to Date" msgstr "" @@ -1021,7 +1007,7 @@ msgstr "" msgid "A Minimal Example" msgstr "یک مثال ساده" -#: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md:1 +#: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md msgid "`alloc`" msgstr "" @@ -1029,7 +1015,7 @@ msgstr "" msgid "Microcontrollers" msgstr "میکروکنترلرها" -#: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md:1 +#: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md msgid "Raw MMIO" msgstr "Raw MMIO" @@ -1049,16 +1035,16 @@ msgstr "Board Support Crates" msgid "The Type State Pattern" msgstr "انواع State Pattern" -#: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md:1 +#: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md msgid "`embedded-hal`" msgstr "" -#: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md:1 +#: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md #, fuzzy msgid "`probe-rs` and `cargo-embed`" msgstr "probe-rs, cargo-embed" -#: src/SUMMARY.md src/bare-metal/microcontrollers/debugging.md:1 +#: src/SUMMARY.md src/bare-metal/microcontrollers/debugging.md msgid "Debugging" msgstr "اشکال یابی (Debugging)" @@ -1066,15 +1052,15 @@ msgstr "اشکال یابی (Debugging)" msgid "Other Projects" msgstr "باقی پروژه‌ها" -#: src/SUMMARY.md src/exercises/bare-metal/compass.md:1 -#: src/exercises/bare-metal/solutions-morning.md:3 +#: src/SUMMARY.md src/exercises/bare-metal/compass.md +#: src/exercises/bare-metal/solutions-morning.md msgid "Compass" msgstr "قطب‌نما" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/solutions.md:1 +#: src/concurrency/sync-exercises/solutions.md #: src/concurrency/async-exercises.md -#: src/concurrency/async-exercises/solutions.md:1 +#: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "راه حل‌ها" @@ -1086,7 +1072,7 @@ msgstr "با Bare Metal: عصر" msgid "Application Processors" msgstr "پردازنده‌های برنامه" -#: src/SUMMARY.md src/bare-metal/aps/entry-point.md:1 +#: src/SUMMARY.md src/bare-metal/aps/entry-point.md msgid "Getting Ready to Rust" msgstr "آماده شدن برای Rust" @@ -1110,7 +1096,7 @@ msgstr "صفت‌های بیشتر" msgid "A Better UART Driver" msgstr "یک درایور بهتر UART" -#: src/SUMMARY.md src/bare-metal/aps/better-uart/bitflags.md:1 +#: src/SUMMARY.md src/bare-metal/aps/better-uart/bitflags.md msgid "Bitflags" msgstr "پرچم‌های بیتی (Bitflags)" @@ -1118,7 +1104,7 @@ msgstr "پرچم‌های بیتی (Bitflags)" msgid "Multiple Registers" msgstr "رجیستر‌های چندگانه" -#: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md:1 +#: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md msgid "Driver" msgstr "درایور" @@ -1126,8 +1112,7 @@ msgstr "درایور" msgid "Using It" msgstr "استفاده از آن" -#: src/SUMMARY.md src/error-handling/result.md:51 -#: src/bare-metal/aps/exceptions.md:1 +#: src/SUMMARY.md src/error-handling/result.md src/bare-metal/aps/exceptions.md msgid "Exceptions" msgstr "استثناها" @@ -1135,23 +1120,23 @@ msgstr "استثناها" msgid "Useful Crates" msgstr "جعبه‌های (Crates) کاربردی" -#: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md:1 +#: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md msgid "`zerocopy`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md:1 +#: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md msgid "`aarch64-paging`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md:1 +#: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md msgid "`buddy_system_allocator`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md:1 +#: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md msgid "`tinyvec`" msgstr "" -#: src/SUMMARY.md src/bare-metal/useful-crates/spin.md:1 +#: src/SUMMARY.md src/bare-metal/useful-crates/spin.md msgid "`spin`" msgstr "" @@ -1168,39 +1153,38 @@ msgstr "درایور RTC" msgid "Concurrency: Morning" msgstr "همزمانی: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md:151 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/threads.md msgid "Threads" msgstr "تردها" -#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md:1 +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md #, fuzzy msgid "Plain Threads" msgstr "تردها" -#: src/SUMMARY.md src/concurrency/threads.md -#: src/concurrency/threads/scoped.md:1 +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/scoped.md msgid "Scoped Threads" msgstr "محدوده تردها" -#: src/SUMMARY.md src/running-the-course/course-structure.md:152 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/channels.md msgid "Channels" msgstr "کانال‌ها" #: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/senders-receivers.md:1 +#: src/concurrency/channels/senders-receivers.md #, fuzzy msgid "Senders and Receivers" msgstr "متد دریافتی" #: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/unbounded.md:1 +#: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" #: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/bounded.md:1 +#: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1209,52 +1193,52 @@ msgid "`Send` and `Sync`" msgstr "" #: src/SUMMARY.md src/concurrency/send-sync.md -#: src/concurrency/send-sync/marker-traits.md:1 +#: src/concurrency/send-sync/marker-traits.md #, fuzzy msgid "Marker Traits" msgstr "صفت‌های بیشتر" -#: src/SUMMARY.md src/concurrency/send-sync/send.md:1 +#: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" msgstr "" -#: src/SUMMARY.md src/concurrency/send-sync/sync.md:1 +#: src/SUMMARY.md src/concurrency/send-sync/sync.md msgid "`Sync`" msgstr "" #: src/SUMMARY.md src/concurrency/send-sync.md -#: src/concurrency/send-sync/examples.md:1 +#: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "مثال‌ها" -#: src/SUMMARY.md src/running-the-course/course-structure.md:154 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/shared-state.md msgid "Shared State" msgstr "ناحیه‌های مشترک" -#: src/SUMMARY.md src/concurrency/shared-state/arc.md:1 +#: src/SUMMARY.md src/concurrency/shared-state/arc.md msgid "`Arc`" msgstr "" -#: src/SUMMARY.md src/concurrency/shared-state/mutex.md:1 +#: src/SUMMARY.md src/concurrency/shared-state/mutex.md msgid "`Mutex`" msgstr "" -#: src/SUMMARY.md src/memory-management/review.md:16 -#: src/error-handling/try-conversions.md:23 src/concurrency/shared-state.md -#: src/concurrency/shared-state/example.md:1 +#: src/SUMMARY.md src/memory-management/review.md +#: src/error-handling/try-conversions.md src/concurrency/shared-state.md +#: src/concurrency/shared-state/example.md msgid "Example" msgstr "مثال" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/dining-philosophers.md:1 -#: src/concurrency/sync-exercises/solutions.md:3 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md #: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/link-checker.md:1 +#: src/concurrency/sync-exercises/link-checker.md msgid "Multi-threaded Link Checker" msgstr "جستجوگر پیوند چند تِردی" @@ -1262,55 +1246,55 @@ msgstr "جستجوگر پیوند چند تِردی" msgid "Concurrency: Afternoon" msgstr "همزمانی: عصر" -#: src/SUMMARY.md src/running-the-course/course-structure.md:162 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" msgstr "مبانی Async" -#: src/SUMMARY.md src/concurrency/async/async-await.md:1 +#: src/SUMMARY.md src/concurrency/async/async-await.md msgid "`async`/`await`" msgstr "" -#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md:1 +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md msgid "Futures" msgstr "Futures" -#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md:1 +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md msgid "Runtimes" msgstr "Runtimes" -#: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md:1 +#: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md msgid "Tokio" msgstr "Tokio" -#: src/SUMMARY.md src/concurrency/sync-exercises/link-checker.md:119 -#: src/concurrency/async.md src/concurrency/async/tasks.md:1 -#: src/concurrency/async-exercises/chat-app.md:143 +#: src/SUMMARY.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/async.md src/concurrency/async/tasks.md +#: src/concurrency/async-exercises/chat-app.md msgid "Tasks" msgstr "Task" -#: src/SUMMARY.md src/running-the-course/course-structure.md:163 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md #, fuzzy msgid "Channels and Control Flow" msgstr "کنترل جریان پیشرفته" #: src/SUMMARY.md src/concurrency/async-control-flow.md -#: src/concurrency/async-control-flow/channels.md:1 +#: src/concurrency/async-control-flow/channels.md msgid "Async Channels" msgstr "کانال‌های Async" #: src/SUMMARY.md src/concurrency/async-control-flow.md -#: src/concurrency/async-control-flow/join.md:1 +#: src/concurrency/async-control-flow/join.md msgid "Join" msgstr "Join" #: src/SUMMARY.md src/concurrency/async-control-flow.md -#: src/concurrency/async-control-flow/select.md:1 +#: src/concurrency/async-control-flow/select.md msgid "Select" msgstr "Select" -#: src/SUMMARY.md src/running-the-course/course-structure.md:164 +#: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" msgstr "Pitfallها" @@ -1319,23 +1303,23 @@ msgstr "Pitfallها" msgid "Blocking the Executor" msgstr "مسدود کردن Executor" -#: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md:1 +#: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md msgid "`Pin`" msgstr "" #: src/SUMMARY.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-pitfalls/async-traits.md:1 +#: src/concurrency/async-pitfalls/async-traits.md msgid "Async Traits" msgstr "صفات Async" #: src/SUMMARY.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-pitfalls/cancellation.md:1 +#: src/concurrency/async-pitfalls/cancellation.md msgid "Cancellation" msgstr "لغو" #: src/SUMMARY.md src/concurrency/async-exercises.md -#: src/concurrency/async-exercises/chat-app.md:1 -#: src/concurrency/async-exercises/solutions.md:102 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "Broadcast Chat Application" msgstr "پخش برنامه چت" @@ -1508,8 +1492,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and C" +"++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1534,7 +1518,7 @@ msgstr "" "اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " "پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." -#: src/running-the-course.md src/running-the-course/course-structure.md:3 +#: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." msgstr "این صفحه برای مدرس دوره است." @@ -1568,8 +1552,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker Notes" +"\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -1663,11 +1647,11 @@ msgstr "" "شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" "github.com/google/comprehensive-rust/discussions/100) !" -#: src/running-the-course/course-structure.md:5 +#: src/running-the-course/course-structure.md msgid "Rust Fundamentals" msgstr "مبانی Rust" -#: src/running-the-course/course-structure.md:7 +#: src/running-the-course/course-structure.md msgid "" "The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " "days are fast paced and we cover a lot of ground!" @@ -1675,25 +1659,15 @@ msgstr "" "سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " "سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" -#: src/running-the-course/course-structure.md:10 -#: src/running-the-course/course-structure.md:146 +#: src/running-the-course/course-structure.md msgid "Course schedule:" msgstr "مباحث دوره:" -#: src/running-the-course/course-structure.md:11 +#: src/running-the-course/course-structure.md msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" msgstr "روز ۱ صبح (۲ ساعت و ۵ دقیقه با احتساب استراحت)" -#: src/running-the-course/course-structure.md:13 -#: src/running-the-course/course-structure.md:23 -#: src/running-the-course/course-structure.md:32 -#: src/running-the-course/course-structure.md:41 -#: src/running-the-course/course-structure.md:50 -#: src/running-the-course/course-structure.md:59 -#: src/running-the-course/course-structure.md:67 -#: src/running-the-course/course-structure.md:77 -#: src/running-the-course/course-structure.md:149 -#: src/running-the-course/course-structure.md:160 src/welcome-day-1.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/welcome-day-1-afternoon.md src/welcome-day-2.md #: src/welcome-day-2-afternoon.md src/welcome-day-3.md #: src/welcome-day-3-afternoon.md src/welcome-day-4.md @@ -1702,16 +1676,7 @@ msgstr "روز ۱ صبح (۲ ساعت و ۵ دقیقه با احتساب است msgid "Segment" msgstr "بخش" -#: src/running-the-course/course-structure.md:13 -#: src/running-the-course/course-structure.md:23 -#: src/running-the-course/course-structure.md:32 -#: src/running-the-course/course-structure.md:41 -#: src/running-the-course/course-structure.md:50 -#: src/running-the-course/course-structure.md:59 -#: src/running-the-course/course-structure.md:67 -#: src/running-the-course/course-structure.md:77 -#: src/running-the-course/course-structure.md:149 -#: src/running-the-course/course-structure.md:160 src/welcome-day-1.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md @@ -1730,7 +1695,7 @@ msgstr "بخش" msgid "Duration" msgstr "مدت زمان" -#: src/running-the-course/course-structure.md:15 src/welcome-day-1.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md #: src/memory-management.md src/smart-pointers.md src/lifetimes.md @@ -1740,8 +1705,7 @@ msgstr "مدت زمان" msgid "5 minutes" msgstr "۵ دقیقه" -#: src/running-the-course/course-structure.md:16 -#: src/running-the-course/course-structure.md:153 src/welcome-day-1.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/references.md src/user-defined-types.md src/methods-and-traits.md #: src/modules.md src/concurrency/welcome.md src/concurrency/threads.md @@ -1749,44 +1713,35 @@ msgstr "۵ دقیقه" msgid "15 minutes" msgstr "۱۵ دقیقه" -#: src/running-the-course/course-structure.md:17 -#: src/running-the-course/course-structure.md:18 -#: src/running-the-course/course-structure.md:71 src/welcome-day-1.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/welcome-day-4.md msgid "40 minutes" msgstr "۴۰ دقیقه" -#: src/running-the-course/course-structure.md:21 +#: src/running-the-course/course-structure.md msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" msgstr "روز ۱ بعد از ظهر (۲ ساعت و ۳۵ دقیقه،شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:25 src/welcome-day-1-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md msgid "35 minutes" msgstr "۳۵ دقیقه" -#: src/running-the-course/course-structure.md:26 -#: src/running-the-course/course-structure.md:54 -#: src/running-the-course/course-structure.md:61 -#: src/running-the-course/course-structure.md:164 -#: src/welcome-day-1-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-3.md src/welcome-day-3-afternoon.md +#: src/concurrency/welcome-async.md msgid "55 minutes" msgstr "۵۵ دقیقه" -#: src/running-the-course/course-structure.md:27 -#: src/running-the-course/course-structure.md:36 -#: src/running-the-course/course-structure.md:62 src/welcome-day-1-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md #: src/welcome-day-2.md src/welcome-day-3-afternoon.md msgid "50 minutes" msgstr "۵۰ دقیقه" -#: src/running-the-course/course-structure.md:30 +#: src/running-the-course/course-structure.md msgid "Day 2 Morning (2 hours and 10 minutes, including breaks)" msgstr "روز ۲ صبح (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:34 -#: src/running-the-course/course-structure.md:52 -#: src/running-the-course/course-structure.md:69 src/hello-world.md +#: src/running-the-course/course-structure.md src/hello-world.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/welcome-day-2.md src/methods-and-traits.md src/std-types.md #: src/welcome-day-3.md src/borrowing.md src/welcome-day-4.md src/modules.md @@ -1794,59 +1749,51 @@ msgstr "روز ۲ صبح (۲ ساعت و ۱۰ دقیقه، شامل وقت اس msgid "3 minutes" msgstr "۳ دقیقه" -#: src/running-the-course/course-structure.md:35 -#: src/running-the-course/course-structure.md:44 -#: src/running-the-course/course-structure.md:53 -#: src/running-the-course/course-structure.md:79 src/welcome-day-2.md +#: src/running-the-course/course-structure.md src/welcome-day-2.md #: src/welcome-day-2-afternoon.md src/welcome-day-3.md #: src/welcome-day-4-afternoon.md msgid "1 hour" msgstr "۱ ساعت" -#: src/running-the-course/course-structure.md:39 +#: src/running-the-course/course-structure.md msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" msgstr "روز ۲ بعد از ظهر (۴ ساعت و ۵ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:43 -#: src/running-the-course/course-structure.md:70 -#: src/running-the-course/course-structure.md:72 src/welcome-day-2-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md #: src/welcome-day-4.md msgid "45 minutes" msgstr "۴۵ دقیقه" -#: src/running-the-course/course-structure.md:45 -#: src/running-the-course/course-structure.md:155 -#: src/running-the-course/course-structure.md:165 -#: src/welcome-day-2-afternoon.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "1 hour and 10 minutes" msgstr "۱ ساعت و ۱۰ دقیفه" -#: src/running-the-course/course-structure.md:48 +#: src/running-the-course/course-structure.md msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" msgstr "روز ۳ صبح (۲ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:57 +#: src/running-the-course/course-structure.md msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" msgstr "روز ۳ بعدازظهر(۱ ساعت و ۵۵ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md:65 +#: src/running-the-course/course-structure.md msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" msgstr "روز ۴ صبح (۲ ساعت و ۴۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:75 +#: src/running-the-course/course-structure.md msgid "Day 4 Afternoon (2 hours and 15 minutes, including breaks)" msgstr "روز ۴ بعدازظهر (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:80 src/welcome-day-4-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-4-afternoon.md msgid "1 hour and 5 minutes" msgstr "ساعت و ۵ دقیقه" -#: src/running-the-course/course-structure.md:85 +#: src/running-the-course/course-structure.md msgid "Deep Dives" msgstr "عمیق تر شدن" -#: src/running-the-course/course-structure.md:87 +#: src/running-the-course/course-structure.md msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" @@ -1854,11 +1801,11 @@ msgstr "" "علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " "دهیم:" -#: src/running-the-course/course-structure.md:90 +#: src/running-the-course/course-structure.md msgid "Rust in Android" msgstr "Rust در اندروید" -#: src/running-the-course/course-structure.md:92 +#: src/running-the-course/course-structure.md msgid "" "The [Rust in Android](../android.md) deep dive is a half-day course on using " "Rust for Android platform development. This includes interoperability with " @@ -1868,7 +1815,7 @@ msgstr "" "استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " "با C، C++ و جاوا می‌شود." -#: src/running-the-course/course-structure.md:96 +#: src/running-the-course/course-structure.md msgid "" "You will need an [AOSP checkout](https://source.android.com/docs/setup/" "download/downloading). Make a checkout of the [course repository](https://" @@ -1882,7 +1829,7 @@ msgstr "" "android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " "اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." -#: src/running-the-course/course-structure.md:101 +#: src/running-the-course/course-structure.md msgid "" "Ensure that `adb sync` works with your emulator or real device and pre-build " "all Android examples using `src/android/build_all.sh`. Read the script to " @@ -1893,11 +1840,11 @@ msgstr "" "بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " "که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." -#: src/running-the-course/course-structure.md:108 +#: src/running-the-course/course-structure.md msgid "Rust in Chromium" msgstr "Rust در اندروید" -#: src/running-the-course/course-structure.md:110 +#: src/running-the-course/course-structure.md msgid "" "The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " "using Rust as part of the Chromium browser. It includes using Rust in " @@ -1909,7 +1856,7 @@ msgstr "" "ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" "+C است." -#: src/running-the-course/course-structure.md:115 +#: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " "[recommended](../chromium/setup.md) for speed but any build will work. " @@ -1919,11 +1866,11 @@ msgstr "" "سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " "مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." -#: src/running-the-course/course-structure.md:119 +#: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" msgstr "Rust بر روی سخت افزار بدون سیستم عامل" -#: src/running-the-course/course-structure.md:121 +#: src/running-the-course/course-structure.md msgid "" "The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " "using Rust for bare-metal (embedded) development. Both microcontrollers and " @@ -1934,7 +1881,7 @@ msgstr "" "سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " "کارایی خاص را پوشش می دهد." -#: src/running-the-course/course-structure.md:125 +#: src/running-the-course/course-structure.md msgid "" "For the microcontroller part, you will need to buy the [BBC micro:bit]" "(https://microbit.org/) v2 development board ahead of time. Everybody will " @@ -1945,11 +1892,11 @@ msgstr "" "v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" "(../bare-metal.md) توضیح داده شده نصب کنند." -#: src/running-the-course/course-structure.md:130 +#: src/running-the-course/course-structure.md msgid "Concurrency in Rust" msgstr "همزمانی در Rust" -#: src/running-the-course/course-structure.md:132 +#: src/running-the-course/course-structure.md #, fuzzy msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " @@ -1958,7 +1905,7 @@ msgstr "" "دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " "شامل همزمانی کلاسیک و `async`/`await` است." -#: src/running-the-course/course-structure.md:135 +#: src/running-the-course/course-structure.md msgid "" "You will need a fresh crate set up and the dependencies downloaded and ready " "to go. You can then copy/paste the examples into `src/main.rs` to experiment " @@ -1968,13 +1915,11 @@ msgstr "" "باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " "آزمایش کنید:" -#: src/running-the-course/course-structure.md:147 +#: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md:151 -#: src/running-the-course/course-structure.md:154 -#: src/running-the-course/course-structure.md:162 src/pattern-matching.md +#: src/running-the-course/course-structure.md src/pattern-matching.md #: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md #: src/testing.md src/error-handling.md src/unsafe-rust.md #: src/concurrency/welcome.md src/concurrency/sync-exercises.md @@ -1982,8 +1927,7 @@ msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" msgid "30 minutes" msgstr "۳۰ دقیقه" -#: src/running-the-course/course-structure.md:152 -#: src/running-the-course/course-structure.md:163 src/methods-and-traits.md +#: src/running-the-course/course-structure.md src/methods-and-traits.md #: src/std-types.md src/memory-management.md src/borrowing.md #: src/concurrency/welcome.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md @@ -1991,19 +1935,19 @@ msgstr "۳۰ دقیقه" msgid "20 minutes" msgstr "۲۰ دقیقه" -#: src/running-the-course/course-structure.md:153 src/concurrency/welcome.md +#: src/running-the-course/course-structure.md src/concurrency/welcome.md msgid "Send and Sync" msgstr "ارسال و همگام‌سازی" -#: src/running-the-course/course-structure.md:158 +#: src/running-the-course/course-structure.md msgid "Afternoon (3 hours and 20 minutes, including breaks)" msgstr "بعدازظهر (۳ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md:170 +#: src/running-the-course/course-structure.md msgid "Format" msgstr "فرمت" -#: src/running-the-course/course-structure.md:172 +#: src/running-the-course/course-structure.md msgid "" "The course is meant to be very interactive and we recommend letting the " "questions drive the exploration of Rust!" @@ -2011,31 +1955,31 @@ msgstr "" "این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " "Rust را هدایت کنند!" -#: src/running-the-course/keyboard-shortcuts.md:3 +#: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "چندین میانبر صفحه کلید مفید در mdBook وجود دارد:" -#: src/running-the-course/keyboard-shortcuts.md:5 +#: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Arrow-Left: Navigate to the previous page." msgstr "Arrow-Left: به صفحه قبلی هدایت می کند." -#: src/running-the-course/keyboard-shortcuts.md:6 +#: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Arrow-Right: Navigate to the next page." msgstr "Arrow-Right: به صفحه بعدی هدایت می کند." -#: src/running-the-course/keyboard-shortcuts.md:7 +#: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Ctrl + Enter: Execute the code sample that has focus." msgstr "Ctrl + Enter: اجرای نمونه کدی که بر روی آن تمرکز شده است." -#: src/running-the-course/keyboard-shortcuts.md:8 +#: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "s: Activate the search bar." msgstr "s: نوار جستجو را فعال می کند." -#: src/running-the-course/translations.md:3 +#: src/running-the-course/translations.md msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" @@ -2043,7 +1987,7 @@ msgstr "" "این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " "است:" -#: src/running-the-course/translations.md:6 +#: src/running-the-course/translations.md msgid "" "[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " "by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." @@ -2055,7 +1999,7 @@ msgstr "" "com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " "[@henrif75](https://github.com/henrif75)." -#: src/running-the-course/translations.md:8 +#: src/running-the-course/translations.md #, fuzzy msgid "" "[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " @@ -2071,7 +2015,7 @@ msgstr "" "superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." "com/nodmp)." -#: src/running-the-course/translations.md:10 +#: src/running-the-course/translations.md msgid "" "[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " "by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" @@ -2085,7 +2029,7 @@ msgstr "" "github.com/kuanhungchen) و [@johnathan79717](https://github.com/" "johnathan79717)." -#: src/running-the-course/translations.md:12 +#: src/running-the-course/translations.md #, fuzzy msgid "" "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" @@ -2097,7 +2041,7 @@ msgstr "" "(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" "momotaro1105)." -#: src/running-the-course/translations.md:14 +#: src/running-the-course/translations.md msgid "" "[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " @@ -2108,7 +2052,7 @@ msgstr "" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " "[@jooyunghan](https://github.com/jooyunghan)." -#: src/running-the-course/translations.md:15 +#: src/running-the-course/translations.md msgid "" "[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" "(https://github.com/deavid)." @@ -2116,7 +2060,7 @@ msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." -#: src/running-the-course/translations.md:16 +#: src/running-the-course/translations.md #, fuzzy msgid "" "[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" @@ -2126,17 +2070,17 @@ msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." -#: src/running-the-course/translations.md:18 +#: src/running-the-course/translations.md msgid "" "Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." -#: src/running-the-course/translations.md:20 +#: src/running-the-course/translations.md msgid "Incomplete Translations" msgstr "ترجمه‌های ناقص" -#: src/running-the-course/translations.md:22 +#: src/running-the-course/translations.md msgid "" "There is a large number of in-progress translations. We link to the most " "recently updated translations:" @@ -2144,7 +2088,7 @@ msgstr "" "تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " "پیوند می دهیم:" -#: src/running-the-course/translations.md:25 +#: src/running-the-course/translations.md #, fuzzy msgid "" "[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" @@ -2153,7 +2097,7 @@ msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." -#: src/running-the-course/translations.md:26 +#: src/running-the-course/translations.md msgid "" "[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" "(https://github.com/raselmandol)." @@ -2161,7 +2105,22 @@ msgstr "" "[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol]" "(https://github.com/raselmandol)." -#: src/running-the-course/translations.md:27 +#: src/running-the-course/translations.md +#, fuzzy +msgid "" +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" +"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " +"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" +"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" +"moaminsharifi)." +msgstr "" +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." + +#: src/running-the-course/translations.md msgid "" "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" "(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " @@ -2170,7 +2129,7 @@ msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." -#: src/running-the-course/translations.md:28 +#: src/running-the-course/translations.md msgid "" "[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." @@ -2178,7 +2137,7 @@ msgstr "" "[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." -#: src/running-the-course/translations.md:29 +#: src/running-the-course/translations.md msgid "" "[Italian](https://google.github.io/comprehensive-rust/it/) by " "[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" @@ -2187,7 +2146,7 @@ msgstr "" "[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." -#: src/running-the-course/translations.md:31 +#: src/running-the-course/translations.md msgid "" "The full list of translations with their current status is also available " "either [as of their last update](https://google.github.io/comprehensive-rust/" @@ -2195,7 +2154,7 @@ msgid "" "(https://google.github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" -#: src/running-the-course/translations.md:35 +#: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" "github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " @@ -2276,17 +2235,17 @@ msgid "" "Rust from the official site." msgstr "" -#: src/cargo/rust-ecosystem.md:1 +#: src/cargo/rust-ecosystem.md msgid "The Rust Ecosystem" msgstr "اکوسیستم Rust" -#: src/cargo/rust-ecosystem.md:3 +#: src/cargo/rust-ecosystem.md msgid "" "The Rust ecosystem consists of a number of tools, of which the main ones are:" msgstr "" "اکوسیستم Rust از تعدادی ابزار تشکیل شده است که مهمترین آنها عبارتند از:" -#: src/cargo/rust-ecosystem.md:5 +#: src/cargo/rust-ecosystem.md msgid "" "`rustc`: the Rust compiler which turns `.rs` files into binaries and other " "intermediate formats." @@ -2294,7 +2253,7 @@ msgstr "" "`rustc`: کامپایلر Rust که فایل‌های `.rs` را به باینری و سایر فرمت‌های میانی " "تبدیل می‌کند." -#: src/cargo/rust-ecosystem.md:8 +#: src/cargo/rust-ecosystem.md msgid "" "`cargo`: the Rust dependency manager and build tool. Cargo knows how to " "download dependencies, usually hosted on , and it will " @@ -2306,7 +2265,7 @@ msgstr "" "هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " "دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." -#: src/cargo/rust-ecosystem.md:13 +#: src/cargo/rust-ecosystem.md msgid "" "`rustup`: the Rust toolchain installer and updater. This tool is used to " "install and update `rustc` and `cargo` when new versions of Rust are " @@ -2320,14 +2279,14 @@ msgstr "" "استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " "کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." -#: src/cargo/rust-ecosystem.md:21 src/types-and-values/hello-world.md:26 -#: src/references/exclusive.md:20 src/memory-management/move.md:153 -#: src/error-handling/try.md:53 src/android/setup.md -#: src/concurrency/async/async-await.md:26 +#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md +#: src/references/exclusive.md src/memory-management/move.md +#: src/error-handling/try.md src/android/setup.md +#: src/concurrency/async/async-await.md msgid "Key points:" msgstr "نکات کلیدی:" -#: src/cargo/rust-ecosystem.md:23 +#: src/cargo/rust-ecosystem.md msgid "" "Rust has a rapid release schedule with a new release coming out every six " "weeks. New releases maintain backwards compatibility with old releases --- " @@ -2337,12 +2296,12 @@ msgstr "" "منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " "علاوه قابلیت‌های جدید را فعال می‌کنند." -#: src/cargo/rust-ecosystem.md:27 +#: src/cargo/rust-ecosystem.md msgid "" "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." -#: src/cargo/rust-ecosystem.md:29 +#: src/cargo/rust-ecosystem.md msgid "" "New features are being tested on \"nightly\", \"beta\" is what becomes " "\"stable\" every six weeks." @@ -2350,7 +2309,7 @@ msgstr "" "ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " "هفته \"stable\" می شود." -#: src/cargo/rust-ecosystem.md:32 +#: src/cargo/rust-ecosystem.md msgid "" "Dependencies can also be resolved from alternative [registries](https://doc." "rust-lang.org/cargo/reference/registries.html), git, folders, and more." @@ -2358,7 +2317,7 @@ msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." -#: src/cargo/rust-ecosystem.md:35 +#: src/cargo/rust-ecosystem.md msgid "" "Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " "current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." @@ -2366,13 +2325,13 @@ msgstr "" "Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " "نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." -#: src/cargo/rust-ecosystem.md:38 +#: src/cargo/rust-ecosystem.md msgid "" "The editions are allowed to make backwards incompatible changes to the " "language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." -#: src/cargo/rust-ecosystem.md:41 +#: src/cargo/rust-ecosystem.md msgid "" "To prevent breaking code, editions are opt-in: you select the edition for " "your crate via the `Cargo.toml` file." @@ -2380,7 +2339,7 @@ msgstr "" "برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " "مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." -#: src/cargo/rust-ecosystem.md:44 +#: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." @@ -2388,7 +2347,7 @@ msgstr "" "برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " "برای نسخه های مختلف را ترکیب کنند." -#: src/cargo/rust-ecosystem.md:47 +#: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." @@ -2396,7 +2355,7 @@ msgstr "" "لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " "`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." -#: src/cargo/rust-ecosystem.md:50 +#: src/cargo/rust-ecosystem.md msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " "comprehensive tool. It is capable of many advanced features including but " @@ -2405,20 +2364,20 @@ msgstr "" "ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " "این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" -#: src/cargo/rust-ecosystem.md:53 +#: src/cargo/rust-ecosystem.md msgid "Project/package structure" msgstr "ساختار پروژه/بسته" -#: src/cargo/rust-ecosystem.md:54 +#: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" msgstr "" "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -#: src/cargo/rust-ecosystem.md:55 +#: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" msgstr "وابستگی های Dev و وابستگی‌های Runtime Management/Caching" -#: src/cargo/rust-ecosystem.md:56 +#: src/cargo/rust-ecosystem.md msgid "" "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." "html)" @@ -2426,7 +2385,7 @@ msgstr "" "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." "html)" -#: src/cargo/rust-ecosystem.md:57 +#: src/cargo/rust-ecosystem.md msgid "" "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." "html)" @@ -2434,7 +2393,7 @@ msgstr "" "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." "html)" -#: src/cargo/rust-ecosystem.md:58 +#: src/cargo/rust-ecosystem.md msgid "" "It is also extensible with sub command plugins as well (such as [cargo " "clippy](https://github.com/rust-lang/rust-clippy))." @@ -2442,17 +2401,17 @@ msgstr "" "همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" "lang/rust-clippy)) قابل توسعه است." -#: src/cargo/rust-ecosystem.md:60 +#: src/cargo/rust-ecosystem.md msgid "" "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" msgstr "" "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." -#: src/cargo/code-samples.md:1 +#: src/cargo/code-samples.md msgid "Code Samples in This Training" msgstr "نمونه کد در این آموزش" -#: src/cargo/code-samples.md:3 +#: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " "which can be executed through your browser. This makes the setup much easier " @@ -2462,7 +2421,7 @@ msgstr "" "مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " "کند و تجربه ای ثابت را برای همه تضمین می کند." -#: src/cargo/code-samples.md:7 +#: src/cargo/code-samples.md msgid "" "Installing Cargo is still encouraged: it will make it easier for you to do " "the exercises. On the last day, we will do a larger exercise which shows you " @@ -2472,22 +2431,22 @@ msgstr "" "کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " "چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." -#: src/cargo/code-samples.md:11 +#: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" msgstr "بلوک های کد در این دوره کاملاً تعاملی(interactive) هستند:" -#: src/cargo/code-samples.md:15 src/cargo/running-locally.md:46 +#: src/cargo/code-samples.md src/cargo/running-locally.md msgid "\"Edit me!\"" msgstr "" -#: src/cargo/code-samples.md:19 +#: src/cargo/code-samples.md #, fuzzy msgid "" "You can use Ctrl + Enter to execute the code when focus is in the " "text box." msgstr "برای اجرای کد زمانی که focus در text box است." -#: src/cargo/code-samples.md:24 +#: src/cargo/code-samples.md msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" @@ -2495,7 +2454,7 @@ msgstr "" "اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " "کد به دلایل مختلف قابل ویرایش نیستند:" -#: src/cargo/code-samples.md:27 +#: src/cargo/code-samples.md msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." @@ -2503,7 +2462,7 @@ msgstr "" "همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " "کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." -#: src/cargo/code-samples.md:30 +#: src/cargo/code-samples.md msgid "" "The embedded playgrounds lose their state the moment you navigate away from " "the page! This is the reason that the students should solve the exercises " @@ -2513,11 +2472,11 @@ msgstr "" "خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " "استفاده از local Rust installation یا از طریق Playground حل کنند." -#: src/cargo/running-locally.md:1 +#: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" msgstr "اجرای کد به صورت لوکال با Cargo" -#: src/cargo/running-locally.md:3 +#: src/cargo/running-locally.md msgid "" "If you want to experiment with the code on your own system, then you will " "need to first install Rust. Do this by following the [instructions in the " @@ -2531,7 +2490,7 @@ msgstr "" "`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " "این version numberها است:" -#: src/cargo/running-locally.md:16 +#: src/cargo/running-locally.md msgid "" "You can use any later version too since Rust maintains backwards " "compatibility." @@ -2539,7 +2498,7 @@ msgstr "" "شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " "های قبلی را حفظ می‌کند." -#: src/cargo/running-locally.md:18 +#: src/cargo/running-locally.md msgid "" "With this in place, follow these steps to build a Rust binary from one of " "the examples in this training:" @@ -2547,26 +2506,26 @@ msgstr "" "با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " "باینری Rust بسازید:" -#: src/cargo/running-locally.md:21 +#: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." msgstr "" "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." -#: src/cargo/running-locally.md:23 +#: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" "از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " "استفاده کنید:" -#: src/cargo/running-locally.md:30 +#: src/cargo/running-locally.md msgid "" "Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" "به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " "کنید:" -#: src/cargo/running-locally.md:41 +#: src/cargo/running-locally.md msgid "" "Replace the boiler-plate code in `src/main.rs` with your own code. For " "example, using the example on the previous page, make `src/main.rs` look like" @@ -2574,11 +2533,11 @@ msgstr "" "کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " "استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." -#: src/cargo/running-locally.md:50 +#: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" msgstr "برای ساختن و اجرای باینری به روز شده خود از `cargo run` استفاده کنید:" -#: src/cargo/running-locally.md:60 +#: src/cargo/running-locally.md msgid "" "Use `cargo check` to quickly check your project for errors, use `cargo " "build` to compile it without running it. You will find the output in `target/" @@ -2590,7 +2549,7 @@ msgstr "" "debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " "شده در `target/release/` از `cargo build --release` استفاده کنید." -#: src/cargo/running-locally.md:65 +#: src/cargo/running-locally.md msgid "" "You can add dependencies for your project by editing `Cargo.toml`. When you " "run `cargo` commands, it will automatically download and compile missing " @@ -2600,7 +2559,7 @@ msgstr "" "هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " "نیاز را برای شما دانلود و کامپایل می‌کند." -#: src/cargo/running-locally.md:73 +#: src/cargo/running-locally.md msgid "" "Try to encourage the class participants to install Cargo and use a local " "editor. It will make their life easier since they will have a normal " @@ -2763,7 +2722,7 @@ msgstr "۱۰ دقیقه" msgid "2 minutes" msgstr "۲ دقیقه" -#: src/hello-world/what-is-rust.md:3 +#: src/hello-world/what-is-rust.md msgid "" "Rust is a new programming language which had its [1.0 release in 2015]" "(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" @@ -2771,17 +2730,17 @@ msgstr "" "‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" "(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" -#: src/hello-world/what-is-rust.md:5 +#: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" "زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." -#: src/hello-world/what-is-rust.md:6 +#: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." msgstr "`rustc` از `LLVM` به عنوان بک‌اند خود استفاده می‌کند." -#: src/hello-world/what-is-rust.md:7 +#: src/hello-world/what-is-rust.md msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" @@ -2789,68 +2748,68 @@ msgstr "" " راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" "rustc/platform-support.html) پشتیبانی می کند :" -#: src/hello-world/what-is-rust.md:9 +#: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." msgstr "x86, ARM, WebAssembly, ..." -#: src/hello-world/what-is-rust.md:10 +#: src/hello-world/what-is-rust.md msgid "Linux, Mac, Windows, ..." msgstr "Linux, Mac, Windows, ..." -#: src/hello-world/what-is-rust.md:11 +#: src/hello-world/what-is-rust.md msgid "Rust is used for a wide range of devices:" msgstr ":راست برای طیف گسترده‌ای از دستگاه‌ها استفاده می‌شود" -#: src/hello-world/what-is-rust.md:12 +#: src/hello-world/what-is-rust.md msgid "firmware and boot loaders," msgstr "میان‌افزار (firmware) و بوت‌لودرها (boot loaders)" -#: src/hello-world/what-is-rust.md:13 +#: src/hello-world/what-is-rust.md msgid "smart displays," msgstr "نمایشگر‌های هوشمند" -#: src/hello-world/what-is-rust.md:14 +#: src/hello-world/what-is-rust.md msgid "mobile phones," msgstr "تلفن‌های همراه" -#: src/hello-world/what-is-rust.md:15 +#: src/hello-world/what-is-rust.md msgid "desktops," msgstr "رایانه‌های رومیزی" -#: src/hello-world/what-is-rust.md:16 +#: src/hello-world/what-is-rust.md msgid "servers." msgstr "سرورها" -#: src/hello-world/what-is-rust.md:21 +#: src/hello-world/what-is-rust.md msgid "Rust fits in the same area as C++:" msgstr "Rust در همان حوزه C++ قرار می‌گیرد:" -#: src/hello-world/what-is-rust.md:23 +#: src/hello-world/what-is-rust.md msgid "High flexibility." msgstr "انعطاف پذیری بالا." -#: src/hello-world/what-is-rust.md:24 +#: src/hello-world/what-is-rust.md msgid "High level of control." msgstr "سطح کنترل بالا." -#: src/hello-world/what-is-rust.md:25 +#: src/hello-world/what-is-rust.md msgid "" "Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." -#: src/hello-world/what-is-rust.md:26 +#: src/hello-world/what-is-rust.md msgid "Has no runtime or garbage collection." msgstr "فاقد ران‌تایم (runtime) یا جمع‌آوری زباله (garbage collection) است." -#: src/hello-world/what-is-rust.md:27 +#: src/hello-world/what-is-rust.md msgid "Focuses on reliability and safety without sacrificing performance." msgstr "بر قابلیت اطمینان و ایمنی بدون قربانی کردن عملکرد تمرکز دارد." -#: src/hello-world/benefits.md:3 +#: src/hello-world/benefits.md msgid "Some unique selling points of Rust:" msgstr "برخی از نقاط قوت منحصر به فرد زبان Rust:" -#: src/hello-world/benefits.md:5 +#: src/hello-world/benefits.md msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" @@ -2858,35 +2817,35 @@ msgstr "" "_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " "می شود" -#: src/hello-world/benefits.md:7 +#: src/hello-world/benefits.md msgid "No uninitialized variables." msgstr "هیچ متغیر مقدار‌دهی نشده‌ای (`uninitialized`) وجود ندارد." -#: src/hello-world/benefits.md:8 +#: src/hello-world/benefits.md msgid "No double-frees." msgstr "هیچ آزادسازی دوباره‌ای وجود ندارد." -#: src/hello-world/benefits.md:9 +#: src/hello-world/benefits.md msgid "No use-after-free." msgstr "هیچ استفاده‌ای پس از آزادسازی وجود ندارد." -#: src/hello-world/benefits.md:10 +#: src/hello-world/benefits.md msgid "No `NULL` pointers." msgstr "هیچ اشاره‌گر `NULL` وجود ندارد." -#: src/hello-world/benefits.md:11 +#: src/hello-world/benefits.md msgid "No forgotten locked mutexes." msgstr "هیچ موتکس قفل شدهِ فراموش شده‌ای وجود ندارد." -#: src/hello-world/benefits.md:12 +#: src/hello-world/benefits.md msgid "No data races between threads." msgstr "هیچ وضعیت رقابتی (`data races`) بین رشته‌ها وجود ندارد." -#: src/hello-world/benefits.md:13 +#: src/hello-world/benefits.md msgid "No iterator invalidation." msgstr "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." -#: src/hello-world/benefits.md:15 +#: src/hello-world/benefits.md msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" @@ -2894,54 +2853,54 @@ msgstr "" "_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " "نامشخص باقی نمی ماند" -#: src/hello-world/benefits.md:17 +#: src/hello-world/benefits.md msgid "Array access is bounds checked." msgstr "دسترسی به آرایه با بررسی محدوده چک می‌شود." -#: src/hello-world/benefits.md:18 +#: src/hello-world/benefits.md msgid "Integer overflow is defined (panic or wrap-around)." msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wrap-around`)." -#: src/hello-world/benefits.md:20 +#: src/hello-world/benefits.md msgid "" "_Modern language features_ - as expressive and ergonomic as higher-level " "languages" msgstr "" "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" -#: src/hello-world/benefits.md:22 +#: src/hello-world/benefits.md msgid "Enums and pattern matching." msgstr "Enumها و تطابق الگوها." -#: src/hello-world/benefits.md:23 +#: src/hello-world/benefits.md msgid "Generics." msgstr "جنریک‌ها." -#: src/hello-world/benefits.md:24 +#: src/hello-world/benefits.md msgid "No overhead FFI." msgstr "FFI بدون سربار." -#: src/hello-world/benefits.md:25 +#: src/hello-world/benefits.md msgid "Zero-cost abstractions." msgstr "انتزاع‌هایی بدون هزینه." -#: src/hello-world/benefits.md:26 +#: src/hello-world/benefits.md msgid "Great compiler errors." msgstr "خطاهای کامپایل عالیست." -#: src/hello-world/benefits.md:27 +#: src/hello-world/benefits.md msgid "Built-in dependency manager." msgstr "مدیر وابستگی درون-ساختی." -#: src/hello-world/benefits.md:28 +#: src/hello-world/benefits.md msgid "Built-in support for testing." msgstr "پشتیبانی درون-ساختی از تست نویسی." -#: src/hello-world/benefits.md:29 +#: src/hello-world/benefits.md msgid "Excellent Language Server Protocol support." msgstr "پشتیبانی عالی از LSP‌." -#: src/hello-world/benefits.md:34 +#: src/hello-world/benefits.md msgid "" "Do not spend much time here. All of these points will be covered in more " "depth later." @@ -2949,7 +2908,7 @@ msgstr "" "وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " "خواهد شد." -#: src/hello-world/benefits.md:37 +#: src/hello-world/benefits.md msgid "" "Make sure to ask the class which languages they have experience with. " "Depending on the answer you can highlight different features of Rust:" @@ -2957,7 +2916,7 @@ msgstr "" "حتما از کلاس بپرسید که با چه زبان‌هایی تجربه دارند. بسته به پاسخ، می توانید " "ویژگی‌های مختلف Rust را برجسته کنید::" -#: src/hello-world/benefits.md:40 +#: src/hello-world/benefits.md msgid "" "Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " "via the borrow checker. You get performance like in C and C++, but you don't " @@ -2970,7 +2929,7 @@ msgstr "" "دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " "با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." -#: src/hello-world/benefits.md:45 +#: src/hello-world/benefits.md #, fuzzy msgid "" "Experience with Java, Go, Python, JavaScript...: You get the same memory " @@ -2984,7 +2943,7 @@ msgstr "" "جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " "می‌کنید." -#: src/hello-world/playground.md:3 +#: src/hello-world/playground.md msgid "" "The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " "run short Rust programs, and is the basis for the examples and exercises in " @@ -2996,7 +2955,7 @@ msgstr "" "برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " "مفید است:" -#: src/hello-world/playground.md:8 +#: src/hello-world/playground.md msgid "" "Under \"Tools\", use the `rustfmt` option to format your code in the " "\"standard\" way." @@ -3004,7 +2963,7 @@ msgstr "" "در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " "\"استاندارد\" استفاده کنید." -#: src/hello-world/playground.md:11 +#: src/hello-world/playground.md msgid "" "Rust has two main \"profiles\" for generating code: Debug (extra runtime " "checks, less optimization) and Release (fewer runtime checks, lots of " @@ -3014,7 +2973,7 @@ msgstr "" "اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " "زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." -#: src/hello-world/playground.md:15 +#: src/hello-world/playground.md msgid "" "If you're interested, use \"ASM\" under \"...\" to see the generated " "assembly code." @@ -3022,7 +2981,7 @@ msgstr "" "اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " "استفاده کنید." -#: src/hello-world/playground.md:21 +#: src/hello-world/playground.md msgid "" "As students head into the break, encourage them to open up the playground " "and experiment a little. Encourage them to keep the tab open and try things " @@ -3040,7 +2999,7 @@ msgstr "" msgid "This segment should take about 40 minutes. It contains:" msgstr "این بخش باید حدود ۴۰ دقیقه طول بکشد. آن شامل:" -#: src/types-and-values/hello-world.md:3 +#: src/types-and-values/hello-world.md msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" @@ -3048,41 +3007,41 @@ msgstr "" "بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " "بپردازیم:" -#: src/types-and-values/hello-world.md:8 +#: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" msgstr "\"Hello 🌍!\"" -#: src/types-and-values/hello-world.md:12 +#: src/types-and-values/hello-world.md msgid "What you see:" msgstr "آنچه شما می‌بینید:" -#: src/types-and-values/hello-world.md:14 +#: src/types-and-values/hello-world.md msgid "Functions are introduced with `fn`." msgstr "توابع با `fn` معرفی می‌شوند." -#: src/types-and-values/hello-world.md:15 +#: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" "بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " "می‌شوند." -#: src/types-and-values/hello-world.md:16 +#: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." msgstr "تابع `main` نقطه ورود برنامه است." -#: src/types-and-values/hello-world.md:17 +#: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" "زبان Rust دارای ماکروهای hygienic است، `println!` یک " "نمونه از این است." -#: src/types-and-values/hello-world.md:18 +#: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" "رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " "باشند." -#: src/types-and-values/hello-world.md:23 +#: src/types-and-values/hello-world.md msgid "" "This slide tries to make the students comfortable with Rust code. They will " "see a ton of it over the next four days so we start small with something " @@ -3091,7 +3050,7 @@ msgstr "" "این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " "آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." -#: src/types-and-values/hello-world.md:28 +#: src/types-and-values/hello-world.md 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." @@ -3100,11 +3059,11 @@ msgstr "" "span>/Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه " "کاملاً ضروری باشد، دوباره اختراع کند." -#: src/types-and-values/hello-world.md:31 +#: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل از چیزهایی مانند یونیکد است." -#: src/types-and-values/hello-world.md:33 +#: src/types-and-values/hello-world.md msgid "" "Rust uses macros for situations where you want to have a variable number of " "arguments (no function [overloading](../control-flow-basics/functions.md))." @@ -3113,7 +3072,7 @@ msgstr "" "آرگومان‌ها داشته باشید (بدون [اورلودینگ](../control-flow-basics/functions.md) " "تابع)." -#: src/types-and-values/hello-world.md:36 +#: src/types-and-values/hello-world.md #, fuzzy msgid "" "Macros being 'hygienic' means they don't accidentally capture identifiers " @@ -3126,7 +3085,7 @@ msgstr "" "واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" "minutiae/hygiene.html هستند." -#: src/types-and-values/hello-world.md:40 +#: src/types-and-values/hello-world.md msgid "" "Rust is multi-paradigm. For example, it has powerful [object-oriented " "programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " @@ -3139,7 +3098,7 @@ msgstr "" "فانکشنال](https://doc.rust-lang.org/book/ch13-00-functional-features.html) " "است." -#: src/types-and-values/variables.md:3 +#: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" @@ -3147,12 +3106,12 @@ msgstr "" "زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " "پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" -#: src/types-and-values/variables.md:9 src/control-flow-basics/loops/for.md:9 -#: src/control-flow-basics/blocks-and-scopes.md:17 +#: src/types-and-values/variables.md src/control-flow-basics/loops/for.md +#: src/control-flow-basics/blocks-and-scopes.md msgid "\"x: {x}\"" msgstr "\"x: {x}\"" -#: src/types-and-values/variables.md:10 +#: src/types-and-values/variables.md msgid "" "// x = 20;\n" " // println!(\"x: {x}\");\n" @@ -3160,7 +3119,7 @@ msgstr "" "// x = 20;\n" " // println!(\"x: {x}\");\n" -#: src/types-and-values/variables.md:18 +#: src/types-and-values/variables.md msgid "" "Uncomment the `x = 20` to demonstrate that variables are immutable by " "default. Add the `mut` keyword to allow changes." @@ -3168,7 +3127,7 @@ msgstr "" "برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " "20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." -#: src/types-and-values/variables.md:21 +#: src/types-and-values/variables.md msgid "" "The `i32` here is the type of the variable. This must be known at compile " "time, but type inference (covered later) allows the programmer to omit it in " @@ -3178,7 +3137,7 @@ msgstr "" "استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " "بسیاری از موارد آن را حذف کند." -#: src/types-and-values/values.md:3 +#: src/types-and-values/values.md msgid "" "Here are some basic built-in types, and the syntax for literal values of " "each type." @@ -3186,105 +3145,105 @@ msgstr "" "در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " "است." -#: src/types-and-values/values.md:6 src/unsafe-rust/exercise.md:16 +#: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" msgstr "انواع" -#: src/types-and-values/values.md:6 +#: src/types-and-values/values.md msgid "Literals" msgstr "مقادیر ثابت" -#: src/types-and-values/values.md:8 +#: src/types-and-values/values.md msgid "Signed integers" msgstr "اعداد صحیح علامت‌دار" -#: src/types-and-values/values.md:8 +#: src/types-and-values/values.md msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" -#: src/types-and-values/values.md:8 +#: src/types-and-values/values.md msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "" "-10, 0, 1_000, 123_i64" -#: src/types-and-values/values.md:9 +#: src/types-and-values/values.md msgid "Unsigned integers" msgstr "اعداد صحیح مثبت" -#: src/types-and-values/values.md:9 +#: src/types-and-values/values.md msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" -#: src/types-and-values/values.md:9 +#: src/types-and-values/values.md msgid "`0`, `123`, `10_u16`" msgstr "" "0, 123, 10_u16" -#: src/types-and-values/values.md:10 +#: src/types-and-values/values.md msgid "Floating point numbers" msgstr "اعداد با ممیز شناور" -#: src/types-and-values/values.md:10 +#: src/types-and-values/values.md msgid "`f32`, `f64`" msgstr "`f32`, `f64`" -#: src/types-and-values/values.md:10 +#: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" "3.14, -10.0e20, 2_f32" -#: src/types-and-values/values.md:11 +#: src/types-and-values/values.md msgid "Unicode scalar values" msgstr "مقادیر عددی یونیکد" -#: src/types-and-values/values.md:11 src/android/aidl/types/primitives.md:9 +#: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`char`" msgstr "`char`" -#: src/types-and-values/values.md:11 +#: src/types-and-values/values.md msgid "`'a'`, `'α'`, `'∞'`" msgstr "`'a'`, `'α'`, `'∞'`" -#: src/types-and-values/values.md:12 +#: src/types-and-values/values.md msgid "Booleans" msgstr "بولین‌ها" -#: src/types-and-values/values.md:12 src/android/aidl/types/primitives.md:7 +#: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`bool`" msgstr "`bool`" -#: src/types-and-values/values.md:12 +#: src/types-and-values/values.md msgid "`true`, `false`" msgstr "`true`, `false`" -#: src/types-and-values/values.md:14 +#: src/types-and-values/values.md msgid "The types have widths as follows:" msgstr "اندازه تایپ‌ها به شرح زیر است:" -#: src/types-and-values/values.md:16 +#: src/types-and-values/values.md msgid "`iN`, `uN`, and `fN` are _N_ bits wide," msgstr "`iN`, `uN`و `fN` به اندازه _N_ حافظه اشغال می‌کنند.," -#: src/types-and-values/values.md:17 +#: src/types-and-values/values.md msgid "`isize` and `usize` are the width of a pointer," msgstr "`isize` و `usize` به اندازه یک اشاره‌گر حافظه اشغال می‌کنند," -#: src/types-and-values/values.md:18 +#: src/types-and-values/values.md msgid "`char` is 32 bits wide," msgstr "`char` به اندازه 32 بیت حافظه اشغال می‌کنند.," -#: src/types-and-values/values.md:19 +#: src/types-and-values/values.md msgid "`bool` is 8 bits wide." msgstr "`bool` به اندازه 8 بیت حافظه اشغال می‌کنند." -#: src/types-and-values/values.md:24 +#: src/types-and-values/values.md msgid "There are a few syntaxes which are not shown above:" msgstr "موارد اندکی وجود دارند که در بالا نشان داده نشده است:" -#: src/types-and-values/values.md:26 +#: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " @@ -3295,11 +3254,11 @@ msgstr "" "(یا `10_00`) نوشته شود و `123_i64` " "می‌تواند به صورت `123i64` نوشته شود»." -#: src/types-and-values/arithmetic.md:9 +#: src/types-and-values/arithmetic.md msgid "\"result: {}\"" msgstr "\"result: {}\"" -#: src/types-and-values/arithmetic.md:16 +#: src/types-and-values/arithmetic.md msgid "" "This is the first time we've seen a function other than `main`, but the " "meaning should be clear: it takes three integers, and returns an integer. " @@ -3309,11 +3268,11 @@ msgstr "" "باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " "بیشتر پوشش داده خواهد شد." -#: src/types-and-values/arithmetic.md:20 +#: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." msgstr "حسابی بسیار شبیه به زبان های دیگر است، با تقدم مشابه." -#: src/types-and-values/arithmetic.md:22 +#: src/types-and-values/arithmetic.md #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " @@ -3324,7 +3283,7 @@ msgstr "" "تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " "مختلف انجام دهد. در Rust تعریف شده است." -#: src/types-and-values/arithmetic.md:26 +#: src/types-and-values/arithmetic.md msgid "" "Change the `i32`'s to `i16` to see an integer overflow, which panics " "(checked) in a debug build and wraps in a release build. There are other " @@ -3337,7 +3296,7 @@ msgstr "" "دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " "هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." -#: src/types-and-values/arithmetic.md:31 +#: src/types-and-values/arithmetic.md msgid "" "In fact, the compiler will detect overflow of constant expressions, which is " "why the example requires a separate function." @@ -3345,11 +3304,11 @@ msgstr "" "در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " "مثال به یک تابع جداگانه نیاز دارد." -#: src/types-and-values/inference.md:3 +#: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" msgstr "زبان Rust برای تعیین نوع متغیر به نحوه استفاده از آن نگاه می‌کند:" -#: src/types-and-values/inference.md:29 +#: src/types-and-values/inference.md msgid "" "This slide demonstrates how the Rust compiler infers types based on " "constraints given by variable declarations and usages." @@ -3357,7 +3316,7 @@ msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " -#: src/types-and-values/inference.md:32 +#: src/types-and-values/inference.md msgid "" "It is very important to emphasize that variables declared like this are not " "of some sort of dynamic \"any type\" that can hold any data. The machine " @@ -3371,7 +3330,7 @@ msgstr "" "اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " "تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " -#: src/types-and-values/inference.md:37 +#: src/types-and-values/inference.md msgid "" "When nothing constrains the type of an integer literal, Rust defaults to " "`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " @@ -3381,11 +3340,11 @@ msgstr "" "«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " "می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." -#: src/types-and-values/inference.md:46 +#: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" msgstr "// ERROR: no implementation for `{float} == {integer}`\n" -#: src/types-and-values/exercise.md:3 +#: src/types-and-values/exercise.md msgid "" "The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " "number is calculated recursively as the sum of the n-1'th and n-2'th " @@ -3394,7 +3353,7 @@ msgstr "" "دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " "بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." -#: src/types-and-values/exercise.md:6 +#: src/types-and-values/exercise.md msgid "" "Write a function `fib(n)` that calculates the n'th Fibonacci number. When " "will this function panic?" @@ -3402,22 +3361,20 @@ msgstr "" "یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " "panic می شود؟" -#: src/types-and-values/exercise.md:12 +#: src/types-and-values/exercise.md msgid "// The base case.\n" msgstr "//حالت پایه\n" -#: src/types-and-values/exercise.md:13 src/types-and-values/exercise.md:16 -#: src/control-flow-basics/exercise.md:27 -#: src/control-flow-basics/exercise.md:31 +#: src/types-and-values/exercise.md src/control-flow-basics/exercise.md #, fuzzy msgid "\"Implement this\"" msgstr "پیاده سازی" -#: src/types-and-values/exercise.md:15 +#: src/types-and-values/exercise.md msgid "// The recursive case.\n" msgstr "// حالت بازگشتی\n" -#: src/types-and-values/exercise.md:22 src/types-and-values/solution.md:14 +#: src/types-and-values/exercise.md src/types-and-values/solution.md msgid "\"fib({n}) = {}\"" msgstr "\"fib({n}) = {}\"" @@ -3434,11 +3391,11 @@ msgstr "۴ دقیقه" msgid "break and continue" msgstr "`break` و `continue`" -#: src/control-flow-basics/if.md:1 +#: src/control-flow-basics/if.md msgid "`if` expressions" msgstr "عبارات `if`" -#: src/control-flow-basics/if.md:3 +#: src/control-flow-basics/if.md msgid "" "You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" "if-expr.html#if-expressions) exactly like `if` statements in other languages:" @@ -3446,19 +3403,19 @@ msgstr "" "شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr." "html#if-expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" -#: src/control-flow-basics/if.md:11 +#: src/control-flow-basics/if.md msgid "\"zero!\"" msgstr "\"zero!\"" -#: src/control-flow-basics/if.md:13 +#: src/control-flow-basics/if.md msgid "\"biggish\"" msgstr "\"biggish\"" -#: src/control-flow-basics/if.md:15 +#: src/control-flow-basics/if.md msgid "\"huge\"" msgstr "\"huge\"" -#: src/control-flow-basics/if.md:20 +#: src/control-flow-basics/if.md msgid "" "In addition, you can use `if` as an expression. The last expression of each " "block becomes the value of the `if` expression:" @@ -3466,19 +3423,19 @@ msgstr "" "در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " "هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" -#: src/control-flow-basics/if.md:26 +#: src/control-flow-basics/if.md msgid "\"small\"" msgstr "\"کوچک\"" -#: src/control-flow-basics/if.md:26 +#: src/control-flow-basics/if.md msgid "\"large\"" msgstr "\"بزرگ\"" -#: src/control-flow-basics/if.md:27 +#: src/control-flow-basics/if.md msgid "\"number size: {}\"" msgstr "\"اندازه عدد: {}\"" -#: src/control-flow-basics/if.md:34 +#: src/control-flow-basics/if.md msgid "" "Because `if` is an expression and must have a particular type, both of its " "branch blocks must have the same type. Show what happens if you add `;` " @@ -3488,26 +3445,28 @@ msgstr "" "و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " "`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." -#: src/control-flow-basics/if.md:38 +#: src/control-flow-basics/if.md +#, fuzzy msgid "" -"When `if` is used in an expression, the expression must have a `;` to " -"separate it from the next statement. Remove the `;` before `println!` to see " -"the compiler error." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." msgstr "" "هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " "را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " "کامپایلر را ببینید." -#: src/control-flow-basics/loops.md:3 +#: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" msgstr "" "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" -#: src/control-flow-basics/loops.md:5 +#: src/control-flow-basics/loops.md msgid "`while`" msgstr "حلقه‌های `while`" -#: src/control-flow-basics/loops.md:7 +#: src/control-flow-basics/loops.md msgid "" "The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) works much like in other languages, executing the " @@ -3516,11 +3475,11 @@ msgstr "" "[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." -#: src/control-flow-basics/loops.md:18 +#: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" msgstr "\"خروجی x: {x}\"" -#: src/control-flow-basics/loops/for.md:3 +#: src/control-flow-basics/loops/for.md msgid "" "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " "over ranges of values or the items in a collection:" @@ -3528,11 +3487,11 @@ msgstr "" "حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " "مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" -#: src/control-flow-basics/loops/for.md:13 +#: src/control-flow-basics/loops/for.md msgid "\"elem: {elem}\"" msgstr "\"elem: {elem}\"" -#: src/control-flow-basics/loops/for.md:20 +#: src/control-flow-basics/loops/for.md msgid "" "Under the hood `for` loops use a concept called \"iterators\" to handle " "iterating over different kinds of ranges/collections. Iterators will be " @@ -3542,7 +3501,7 @@ msgstr "" "مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " "قرار خواهند گرفت." -#: src/control-flow-basics/loops/for.md:23 +#: src/control-flow-basics/loops/for.md #, fuzzy msgid "" "Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " @@ -3551,7 +3510,7 @@ msgstr "" "توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " "یک محدوده فراگیر نشان دهید." -#: src/control-flow-basics/loops/loop.md:3 +#: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." @@ -3559,11 +3518,11 @@ msgstr "" "[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " "زمانی که یک «break» ایجاد شود، حلقه می‌شود." -#: src/control-flow-basics/loops/loop.md:11 +#: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" msgstr "\"{i}\"" -#: src/control-flow-basics/break-continue.md:3 +#: src/control-flow-basics/break-continue.md msgid "" "If you want to immediately start the next iteration use [`continue`](https://" "doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." @@ -3572,27 +3531,39 @@ msgstr "" "rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " "استفاده کنید." -#: src/control-flow-basics/break-continue.md:6 +#: src/control-flow-basics/break-continue.md +#, fuzzy msgid "" "If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). For " +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " "`loop`, this can take an optional expression that becomes the value of the " "`loop` expression." msgstr "" "اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." "org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." -#: src/control-flow-basics/break-continue.md:22 src/std-traits/exercise.md:23 -#: src/std-traits/solution.md:29 src/smart-pointers/trait-objects.md:95 -#: src/smart-pointers/trait-objects.md:96 -#: src/borrowing/interior-mutability.md:47 src/modules/exercise.md:136 -#: src/modules/solution.md:78 src/android/build-rules/library.md:44 -#: src/android/interoperability/cpp/rust-bridge.md:17 -#: src/concurrency/async-pitfalls/cancellation.md:59 +#: src/control-flow-basics/break-continue.md src/std-traits/exercise.md +#: src/std-traits/solution.md src/smart-pointers/trait-objects.md +#: src/borrowing/interior-mutability.md src/modules/exercise.md +#: src/modules/solution.md src/android/build-rules/library.md +#: src/android/interoperability/cpp/rust-bridge.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"{}\"" msgstr "\"{}\"" -#: src/control-flow-basics/break-continue/labels.md:3 +#: src/control-flow-basics/break-continue.md +#, fuzzy +msgid "" +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." +msgstr "" +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " +"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " +"(برخلاف حلقه‌های `while` و `for`)." + +#: src/control-flow-basics/break-continue/labels.md msgid "" "Both `continue` and `break` can optionally take a label argument which is " "used to break out of nested loops:" @@ -3600,25 +3571,15 @@ msgstr "" "کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " "برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" -#: src/control-flow-basics/break-continue/labels.md:19 +#: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" msgstr "\"elements searched: {elements_searched}\"" -#: src/control-flow-basics/break-continue/labels.md:25 -msgid "" -"Note that `loop` is the only looping construct which returns a non-trivial " -"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/control-flow-basics/blocks-and-scopes.md:3 +#: src/control-flow-basics/blocks-and-scopes.md msgid "Blocks" msgstr "بلوک‌ها" -#: src/control-flow-basics/blocks-and-scopes.md:5 +#: src/control-flow-basics/blocks-and-scopes.md msgid "" "A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " "Each block has a value and a type, which are those of the last expression of " @@ -3627,17 +3588,17 @@ msgstr "" "یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " "است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" -#: src/control-flow-basics/blocks-and-scopes.md:14 +#: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" msgstr "\"y: {y}\"" -#: src/control-flow-basics/blocks-and-scopes.md:21 +#: src/control-flow-basics/blocks-and-scopes.md msgid "" "If the last expression ends with `;`, then the resulting value and type is " "`()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." -#: src/control-flow-basics/blocks-and-scopes.md:26 +#: src/control-flow-basics/blocks-and-scopes.md 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`." @@ -3646,11 +3607,11 @@ msgstr "" "می‌کند. به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید " "واژه `return` تغییرات را اعمال کنید." -#: src/control-flow-basics/blocks-and-scopes/scopes.md:3 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محاصره‌کننده آن است." -#: src/control-flow-basics/blocks-and-scopes/scopes.md:5 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" "You can shadow variables, both those from outer scopes and variables from " "the same scope:" @@ -3658,29 +3619,28 @@ msgstr "" "شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " "هم متغیرهایی که از اسکوپ یکسان هستند:" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:11 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" msgstr "\"before: {a}\"" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:13 -#: src/generics/exercise.md:18 src/generics/solution.md:20 -#: src/std-traits/from-and-into.md:7 src/std-traits/from-and-into.md:19 +#: src/control-flow-basics/blocks-and-scopes/scopes.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/from-and-into.md msgid "\"hello\"" msgstr "\"hello\"" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:14 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"inner scope: {a}\"" msgstr "\"inner scope: {a}\"" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:17 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"shadowed in inner scope: {a}\"" msgstr "\"shadowed in inner scope: {a}\"" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:20 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"after: {a}\"" msgstr "\"after: {a}\"" -#: src/control-flow-basics/blocks-and-scopes/scopes.md:26 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" "Show that a variable's scope is limited by adding a `b` in the inner block " "in the last example, and then trying to access it outside that block." @@ -3688,21 +3648,22 @@ msgstr "" "با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " "در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." -#: src/control-flow-basics/blocks-and-scopes/scopes.md:28 +#: src/control-flow-basics/blocks-and-scopes/scopes.md +#, fuzzy msgid "" "Shadowing is different from mutation, because after shadowing both " -"variable's memory locations exist at the same time. Both are available under " +"variables' memory locations exist at the same time. Both are available under " "the same name, depending where you use it in the code." msgstr "" "سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " "طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " "کد استفاده می کنید." -#: src/control-flow-basics/blocks-and-scopes/scopes.md:31 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." msgstr "یک متغیر سایه‌دار می تواند انواع داده‌ای متفاوتی داشته باشد." -#: src/control-flow-basics/blocks-and-scopes/scopes.md:32 +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" "Shadowing looks obscure at first, but is convenient for holding on to values " "after `.unwrap()`." @@ -3710,7 +3671,7 @@ msgstr "" "سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `.unwrap()` مناسب است." -#: src/control-flow-basics/functions.md:22 +#: src/control-flow-basics/functions.md msgid "" "Declaration parameters are followed by a type (the reverse of some " "programming languages), then a return type." @@ -3718,7 +3679,7 @@ msgstr "" "بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " "برخی از زبان‌های برنامه‌نویسی)." -#: src/control-flow-basics/functions.md:24 +#: src/control-flow-basics/functions.md msgid "" "The last expression in a function body (or any block) becomes the return " "value. Simply omit the `;` at the end of the expression. The `return` " @@ -3729,22 +3690,23 @@ msgstr "" "گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " "عبارت حذف کنید." -#: src/control-flow-basics/functions.md:28 +#: src/control-flow-basics/functions.md +#, fuzzy msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " -"compiler will infer this if the `-> ()` return type is omitted." +"compiler will infer this if the return type is omitted." msgstr "" "برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` " "را برمی‌گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " "کامپایلر این را استنتاج خواهد کرد که هیچ نوع برگشتی وجود ندارد." -#: src/control-flow-basics/functions.md:30 +#: src/control-flow-basics/functions.md msgid "" "Overloading is not supported -- each function has a single implementation." msgstr "" "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." -#: src/control-flow-basics/functions.md:31 +#: src/control-flow-basics/functions.md msgid "" "Always takes a fixed number of parameters. Default arguments are not " "supported. Macros can be used to support variadic functions." @@ -3752,13 +3714,13 @@ msgstr "" "همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " "شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." -#: src/control-flow-basics/functions.md:33 +#: src/control-flow-basics/functions.md msgid "" "Always takes a single set of parameter types. These types can be generic, " "which will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." -#: src/control-flow-basics/macros.md:3 +#: src/control-flow-basics/macros.md msgid "" "Macros are expanded into Rust code during compilation, and can take a " "variable number of arguments. They are distinguished by a `!` at the end. " @@ -3768,7 +3730,7 @@ msgstr "" "آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " "استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." -#: src/control-flow-basics/macros.md:7 +#: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." @@ -3777,7 +3739,7 @@ msgstr "" "شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " "را اعمال می کند. ." -#: src/control-flow-basics/macros.md:9 +#: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." @@ -3785,11 +3747,11 @@ msgstr "" "`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " "یک رشته برمی گرداند." -#: src/control-flow-basics/macros.md:11 +#: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن را برمی گرداند." -#: src/control-flow-basics/macros.md:12 +#: src/control-flow-basics/macros.md msgid "" "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " "panic." @@ -3797,7 +3759,7 @@ msgstr "" "`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " "panic می کند." -#: src/control-flow-basics/macros.md:14 +#: src/control-flow-basics/macros.md msgid "" "`unreachable!()` marks a bit of code as unreachable. If executed, it will " "panic." @@ -3805,11 +3767,11 @@ msgstr "" "`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " "اعدام شود وحشت می کند." -#: src/control-flow-basics/macros.md:32 +#: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" msgstr "\"{n}! = {}\"" -#: src/control-flow-basics/macros.md:39 +#: src/control-flow-basics/macros.md msgid "" "The takeaway from this section is that these common conveniences exist, and " "how to use them. Why they are defined as macros, and what they expand to, is " @@ -3819,7 +3781,7 @@ msgstr "" "دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " "یابند، بسیار مهم نیست." -#: src/control-flow-basics/macros.md:43 +#: src/control-flow-basics/macros.md msgid "" "The course does not cover defining macros, but a later section will describe " "use of derive macros." @@ -3827,7 +3789,7 @@ msgstr "" "این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " "مشتق شده توضیح داده خواهد شد." -#: src/control-flow-basics/exercise.md:3 +#: src/control-flow-basics/exercise.md #, fuzzy msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " @@ -3836,74 +3798,73 @@ msgstr "" "‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " "زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" -#: src/control-flow-basics/exercise.md:6 +#: src/control-flow-basics/exercise.md msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " "می‌یابد." -#: src/control-flow-basics/exercise.md:7 +#: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." msgstr "" "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." -#: src/control-flow-basics/exercise.md:8 +#: src/control-flow-basics/exercise.md msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" "اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " "+ ۱." -#: src/control-flow-basics/exercise.md:10 +#: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" msgstr "به عنوان مثال، با شروع از _ni_ = ۳:" -#: src/control-flow-basics/exercise.md:12 +#: src/control-flow-basics/exercise.md msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" msgstr "۳ فرد است، پس _n2_ = ۳ * ۳ + ۱ = 10;" -#: src/control-flow-basics/exercise.md:13 +#: src/control-flow-basics/exercise.md msgid "10 is even, so _n3_ = 10 / 2 = 5;" msgstr "۱۰ زوج است، پس _n3_ = ۱۰ / ۲ = ۵;" -#: src/control-flow-basics/exercise.md:14 +#: src/control-flow-basics/exercise.md msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" msgstr "۵ فرد است، پس _n4_ = ۳ * ۵ + ۱ = 16;" -#: src/control-flow-basics/exercise.md:15 +#: src/control-flow-basics/exercise.md msgid "16 is even, so _n5_ = 16 / 2 = 8;" msgstr "۱۶ زوج است، پس _n5_ = ۱۶ / ۲ = 8;" -#: src/control-flow-basics/exercise.md:16 +#: src/control-flow-basics/exercise.md msgid "8 is even, so _n6_ = 8 / 2 = 4;" msgstr "۸ زوج است، پس _n6_ = ۸ / ۲ = 4;" -#: src/control-flow-basics/exercise.md:17 +#: src/control-flow-basics/exercise.md msgid "4 is even, so _n7_ = 4 / 2 = 2;" msgstr "۴ زوج است، پس _n7_ = ۴ / ۲ = ۲;" -#: src/control-flow-basics/exercise.md:18 +#: src/control-flow-basics/exercise.md msgid "2 is even, so _n8_ = 1; and" msgstr "۲ زوج است، پس _n۸_ = ۱; و" -#: src/control-flow-basics/exercise.md:19 +#: src/control-flow-basics/exercise.md msgid "the sequence terminates." msgstr "دنباله به پایان می‌رسد." -#: src/control-flow-basics/exercise.md:21 +#: src/control-flow-basics/exercise.md msgid "" "Write a function to calculate the length of the collatz sequence for a given " "initial `n`." msgstr "" "یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." -#: src/control-flow-basics/exercise.md:25 src/control-flow-basics/solution.md:4 +#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" msgstr "/// Determine the length of the collatz sequence beginning at `n`.\n" -#: src/control-flow-basics/solution.md:20 src/concurrency/threads/scoped.md:11 -#: src/concurrency/threads/scoped.md:30 +#: src/control-flow-basics/solution.md src/concurrency/threads/scoped.md msgid "\"Length: {}\"" msgstr "" @@ -3924,7 +3885,7 @@ msgstr "" msgid "This segment should take about 35 minutes. It contains:" msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این شامل:" -#: src/tuples-and-arrays/arrays.md:16 +#: src/tuples-and-arrays/arrays.md msgid "" "A value of the array type `[T; N]` holds `N` (a compile-time constant) " "elements of the same type `T`. Note that the length of the array is _part of " @@ -3938,7 +3899,7 @@ msgstr "" "dir=ltr>`[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " "نظر گرفته می‌شوند." -#: src/tuples-and-arrays/arrays.md:22 +#: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " "runtime. Rust can usually optimize these checks away, and they can be " @@ -3948,11 +3909,11 @@ msgstr "" "آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " "ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." -#: src/tuples-and-arrays/arrays.md:26 +#: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." msgstr "ما می‌توانیم از مقادیر ثابت برای انتساب مقادیر به آرایه‌ها استفاده کنیم." -#: src/tuples-and-arrays/arrays.md:28 +#: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " "parameter: `{}` gives the default output, `{:?}` gives the debug output. " @@ -3967,7 +3928,7 @@ msgstr "" "فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " "خروجی دیباگ استفاده کنیم." -#: src/tuples-and-arrays/arrays.md:33 +#: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." @@ -3975,15 +3936,15 @@ msgstr "" "اضافه کردن `#`، مانند `{a:#?}`، یک " "فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." -#: src/tuples-and-arrays/tuples.md:16 +#: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." msgstr "مانند آرایه‌ها، تاپل‌ها نیز دارای طول ثابت هستند." -#: src/tuples-and-arrays/tuples.md:18 +#: src/tuples-and-arrays/tuples.md msgid "Tuples group together values of different types into a compound type." msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع مرکب کنار هم قرار می‌دهند." -#: src/tuples-and-arrays/tuples.md:20 +#: src/tuples-and-arrays/tuples.md msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " "e.g. `t.0`, `t.1`." @@ -3991,7 +3952,7 @@ msgstr "" "می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " "`t.0`، `t.1` دسترسی پیدا کرد." -#: src/tuples-and-arrays/tuples.md:23 +#: src/tuples-and-arrays/tuples.md msgid "" "The empty tuple `()` is referred to as the \"unit type\" and signifies " "absence of a return value, akin to `void` in other languages." @@ -3999,11 +3960,11 @@ msgstr "" "تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " "بازگشتی است، مشابه `void` در زبان‌های دیگر." -#: src/tuples-and-arrays/iteration.md:3 +#: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه تاپل ها) پشتیبانی می کند." -#: src/tuples-and-arrays/iteration.md:19 +#: src/tuples-and-arrays/iteration.md msgid "" "This functionality uses the `IntoIterator` trait, but we haven't covered " "that yet." @@ -4011,7 +3972,7 @@ msgstr "" "این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " "پرداخته‌ایم." -#: src/tuples-and-arrays/iteration.md:22 +#: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" "The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" @@ -4022,7 +3983,7 @@ msgstr "" "` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " "مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." -#: src/tuples-and-arrays/destructuring.md:3 +#: src/tuples-and-arrays/destructuring.md msgid "" "When working with tuples and other structured values it's common to want to " "extract the inner values into local variables. This can be done manually by " @@ -4032,12 +3993,11 @@ msgstr "" "داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " "دسترسی مستقیم به مقادیر داخلی انجام داد:" -#: src/tuples-and-arrays/destructuring.md:11 -#: src/tuples-and-arrays/destructuring.md:21 +#: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" msgstr "\"left: {left}, right: {right}\"" -#: src/tuples-and-arrays/destructuring.md:15 +#: src/tuples-and-arrays/destructuring.md msgid "" "However, Rust also supports using pattern matching to destructure a larger " "value into its constituent parts:" @@ -4045,7 +4005,7 @@ msgstr "" "با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " "در بخش های تشکیل دهنده آن پشتیبانی می کند:" -#: src/tuples-and-arrays/destructuring.md:28 +#: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " "statically verify that the value on the right of `=` has the same structure " @@ -4055,7 +4015,7 @@ msgstr "" "می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " "دارد." -#: src/tuples-and-arrays/destructuring.md:31 +#: src/tuples-and-arrays/destructuring.md msgid "" "A variable name is an irrefutable pattern that always matches any value, " "hence why we can also use `let` to declare a single variable." @@ -4063,7 +4023,7 @@ msgstr "" "نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " "رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." -#: src/tuples-and-arrays/destructuring.md:33 +#: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " "comparison and destructuring to happen at the same time. This form of " @@ -4073,7 +4033,7 @@ msgstr "" "برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " "بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." -#: src/tuples-and-arrays/destructuring.md:36 +#: src/tuples-and-arrays/destructuring.md msgid "" "Edit the examples above to show the compiler error when the pattern doesn't " "match the value being matched on." @@ -4081,15 +4041,15 @@ msgstr "" "مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " "مطابقت‌شده مطابقت ندارد نشان داده شود." -#: src/tuples-and-arrays/exercise.md:3 +#: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" msgstr "آرایه ها می توانند آرایه های دیگری نیز داشته باشند:" -#: src/tuples-and-arrays/exercise.md:9 +#: src/tuples-and-arrays/exercise.md msgid "What is the type of this variable?" msgstr "نوع این متغیر چیست؟" -#: src/tuples-and-arrays/exercise.md:11 +#: src/tuples-and-arrays/exercise.md msgid "" "Use an array such as the above to write a function `transpose` which will " "transpose a matrix (turn rows into columns):" @@ -4097,7 +4057,7 @@ msgstr "" "از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` " "استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" -#: src/tuples-and-arrays/exercise.md:22 +#: src/tuples-and-arrays/exercise.md msgid "" "Copy the code below to and implement the " "function. This function only operates on 3x3 matrices." @@ -4105,25 +4065,24 @@ msgstr "" "کد زیر را در کپی کرده و " "توابع را پیاده‌سازی کنید:" -#: src/tuples-and-arrays/exercise.md:26 src/borrowing/exercise.md:14 -#: src/unsafe-rust/exercise.md:51 +#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md +#: src/unsafe-rust/exercise.md msgid "// TODO: remove this when you're done with your implementation.\n" msgstr "// TODO: این را زمانی که پیاده‌سازی‌تان تمام شد حذف کنید.\n" -#: src/tuples-and-arrays/exercise.md:36 src/tuples-and-arrays/exercise.md:44 -#: src/tuples-and-arrays/solution.md:17 src/tuples-and-arrays/solution.md:25 +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "//\n" msgstr "//\n" -#: src/tuples-and-arrays/exercise.md:53 src/tuples-and-arrays/solution.md:34 +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "// <-- the comment makes rustfmt add a newline\n" msgstr "‏// <-- این کامنت باعث می‌شود rustfmt یک خط جدید اضافه کند.\n" -#: src/tuples-and-arrays/exercise.md:58 src/tuples-and-arrays/solution.md:39 +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "\"matrix: {:#?}\"" msgstr "\"matrix: {:#?}\"" -#: src/tuples-and-arrays/exercise.md:60 src/tuples-and-arrays/solution.md:41 +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "\"transposed: {:#?}\"" msgstr "\"transposed: {:#?}\"" @@ -4132,21 +4091,18 @@ msgstr "\"transposed: {:#?}\"" msgid "This segment should take about 55 minutes. It contains:" msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن شامل:" -#: src/references.md -msgid "Slices: &\\[T\\]" -msgstr "برش‌ها: `[T]&`" - -#: src/references/shared.md:3 +#: src/references/shared.md +#, fuzzy msgid "" -"A reference provides a way to access another value without taking " -"responsibility for the value, and is also called \"borrowing\". Shared " -"references are read-only, and the referenced data cannot change." +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" "یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " "آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " "نمی توانند تغییر کنند." -#: src/references/shared.md:20 +#: src/references/shared.md msgid "" "A shared reference to a type `T` has type `&T`. A reference value is made " "with the `&` operator. The `*` operator \"dereferences\" a reference, " @@ -4156,11 +4112,11 @@ msgstr "" "ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " "دست می دهد." -#: src/references/shared.md:24 +#: src/references/shared.md msgid "Rust will statically forbid dangling references:" msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) را ممنوع می‌کند:" -#: src/references/shared.md:38 +#: src/references/shared.md msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " @@ -4172,7 +4128,7 @@ msgstr "" "از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " "است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." -#: src/references/shared.md:43 +#: src/references/shared.md msgid "" "References are implemented as pointers, and a key advantage is that they can " "be much smaller than the thing they point to. Students familiar with C or C+" @@ -4186,23 +4142,23 @@ msgstr "" "دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " "استفاده از نشانگرهای خام جلوگیری می‌کند." -#: src/references/shared.md:48 +#: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." msgstr "" "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." -#: src/references/shared.md:51 +#: src/references/shared.md msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" +"++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." -#: src/references/shared.md:54 +#: src/references/shared.md msgid "" "In this example, `r` is mutable so that it can be reassigned (`r = &b`). " "Note that this re-binds `r`, so that it refers to something else. This is " @@ -4214,7 +4170,7 @@ msgstr "" "اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " "تغییر می دهد." -#: src/references/shared.md:58 +#: src/references/shared.md msgid "" "A shared reference does not allow modifying the value it refers to, even if " "that value was mutable. Try `*r = 'X'`." @@ -4222,7 +4178,7 @@ msgstr "" "یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " "اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." -#: src/references/shared.md:61 +#: src/references/shared.md msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " "enough. Dangling references cannot occur in safe Rust. `x_axis` would return " @@ -4234,13 +4190,13 @@ msgstr "" "`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " "تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." -#: src/references/shared.md:66 +#: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "" "هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " "خواهیم کرد." -#: src/references/exclusive.md:3 +#: src/references/exclusive.md msgid "" "Exclusive references, also known as mutable references, allow changing the " "value they refer to. They have type `&mut T`." @@ -4248,7 +4204,7 @@ msgstr "" "مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " "دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." -#: src/references/exclusive.md:22 +#: src/references/exclusive.md msgid "" "\"Exclusive\" means that only this reference can be used to access the " "value. No other references (shared or exclusive) can exist at the same time, " @@ -4262,7 +4218,7 @@ msgstr "" "ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " "`point.0` را تغییر دهید." -#: src/references/exclusive.md:27 +#: src/references/exclusive.md msgid "" "Be sure to note the difference between `let mut x_coord: &i32` and `let " "x_coord: &mut i32`. The first one represents a shared reference which can be " @@ -4273,25 +4229,21 @@ msgstr "" "کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " "شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." -#: src/references/slices.md:1 -msgid "Slices" -msgstr "برش‌ها" - -#: src/references/slices.md:3 +#: src/references/slices.md msgid "A slice gives you a view into a larger collection:" msgstr "یک برش به شما امکان می‌دهد نما (view) از یک مجموعه بزرگتر داشته باشید:" -#: src/references/slices.md:18 +#: src/references/slices.md msgid "Slices borrow data from the sliced type." msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض می‌گیرند." -#: src/references/slices.md:19 +#: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" "پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" -#: src/references/slices.md:24 +#: src/references/slices.md msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." @@ -4299,7 +4251,7 @@ msgstr "" "ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " "براکت‌ها، برش (slice) ایجاد می‌کنیم." -#: src/references/slices.md:27 +#: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " @@ -4309,7 +4261,7 @@ msgstr "" "کنیم (یعنی عدد صفر را ننویسیم)، به این معنی که `&a[0..a." "len()]` و `&a[..a.len()]` یکسان هستند." -#: src/references/slices.md:31 +#: src/references/slices.md msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." @@ -4317,14 +4269,14 @@ msgstr "" "در مورد شاخص آخر نیز همینطور است، بنابراین `&a[2..a.len()]` و `&a[2..]` یکسان هستند." -#: src/references/slices.md:34 +#: src/references/slices.md msgid "" "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " "استفاده کنیم." -#: src/references/slices.md:36 +#: src/references/slices.md msgid "" "`s` is a reference to a slice of `i32`s. Notice that the type of `s` " "(`&[i32]`) no longer mentions the array length. This allows us to perform " @@ -4335,7 +4287,7 @@ msgstr "" "ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " "انجام دهیم." -#: src/references/slices.md:40 +#: src/references/slices.md 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." @@ -4343,7 +4295,7 @@ msgstr "" "برش‌ها همیشه از یک شیء دیگر قرض می‌گیرند. در این مثال، `a` باید حداقل به اندازه طول‌عمر برش ما، زنده (در محدوده) باقی بماند. " -#: src/references/slices.md:43 +#: src/references/slices.md msgid "" "The question about modifying `a[3]` can spark an interesting discussion, but " "the answer is that for memory safety reasons you cannot do it through `a` at " @@ -4359,53 +4311,52 @@ msgstr "" "dir=ltr>`println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " "جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." -#: src/references/strings.md:7 +#: src/references/strings.md msgid "We can now understand the two string types in Rust:" msgstr "حالا می‌توانیم دو نوع رشته‌ای را در راست درک کنیم:" -#: src/references/strings.md:9 +#: src/references/strings.md msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." -#: src/references/strings.md:10 +#: src/references/strings.md #, fuzzy msgid "" "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." -#: src/references/strings.md:17 src/std-traits/read-and-write.md:36 +#: src/references/strings.md src/std-traits/read-and-write.md msgid "\"World\"" msgstr "\"World\"" -#: src/references/strings.md:18 +#: src/references/strings.md msgid "\"s1: {s1}\"" msgstr "\"s1: {s1}\"" -#: src/references/strings.md:20 +#: src/references/strings.md msgid "\"Hello \"" msgstr "\"Hello \"" -#: src/references/strings.md:21 src/references/strings.md:23 -#: src/memory-management/move.md:9 +#: src/references/strings.md src/memory-management/move.md msgid "\"s2: {s2}\"" msgstr "\"s2: {s2}\"" -#: src/references/strings.md:26 +#: src/references/strings.md msgid "\"s3: {s3}\"" msgstr "\"s3: {s3}\"" -#: src/references/strings.md:33 +#: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"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/references/strings.md:37 +#: src/references/strings.md msgid "" "Rust's `String` type is a wrapper around a vector of bytes. As with a " "`Vec`, it is owned." @@ -4413,7 +4364,7 @@ msgstr "" "در راست نوع ‍`String` یک wrapper بر روی یک بردار از " "بایت‌هاست. مانند `Vec`، یک نوع Owned است." -#: src/references/strings.md:40 +#: src/references/strings.md msgid "" "As with many other types `String::from()` creates a string from a string " "literal; `String::new()` creates a new empty string, to which string data " @@ -4424,7 +4375,7 @@ msgstr "" "خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." -#: src/references/strings.md:44 +#: src/references/strings.md msgid "" "The `format!()` macro is a convenient way to generate an owned string from " "dynamic values. It accepts the same format specification as `println!()`." @@ -4433,7 +4384,7 @@ msgstr "" "از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" "()` است." -#: src/references/strings.md:47 +#: src/references/strings.md msgid "" "You can borrow `&str` slices from `String` via `&` and optionally range " "selection. If you select a byte range that is not aligned to character " @@ -4445,7 +4396,7 @@ msgstr "" "وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " "درست کردن مرزهای کاراکتر ترجیح داده می شود." -#: src/references/strings.md:52 +#: src/references/strings.md msgid "" "For C++ programmers: think of `&str` as `std::string_view` from C++, but the " "one that always points to a valid string in memory. Rust `String` is a rough " @@ -4460,24 +4411,24 @@ msgstr "" "که فقط می‌تواند حاوی بایت‌های رمزشده UTF-8 باشد و هرگز از بهینه‌سازی Small-" "String استفاده نمی کند)." -#: src/references/strings.md:57 +#: src/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" "رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" -#: src/references/strings.md:67 +#: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `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/references/exercise.md:3 +#: src/references/exercise.md msgid "" "We will create a few utility functions for 3-dimensional geometry, " "representing a point as `[f64;3]`. It is up to you to determine the function " @@ -4486,7 +4437,7 @@ msgstr "" "ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " "عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." -#: src/references/exercise.md:7 +#: src/references/exercise.md msgid "" "// Calculate the magnitude of a vector by summing the squares of its " "coordinates\n" @@ -4498,7 +4449,7 @@ msgstr "" "// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " "`v.sqrt()`.\n" -#: src/references/exercise.md:15 +#: src/references/exercise.md msgid "" "// Normalize a vector by calculating its magnitude and dividing all of its\n" "// coordinates by that magnitude.\n" @@ -4506,27 +4457,27 @@ msgstr "" "// یک بردار را با محاسبه اندازه‌ی آن و تقسیم تمام مختصات آن\n" "// بر آن اندازه، نرمال‌سازی کنید.\n" -#: src/references/exercise.md:23 +#: src/references/exercise.md msgid "// Use the following `main` to test your work.\n" msgstr "// از `main` زیر برای تست کار خود استفاده کنید.\n" -#: src/references/exercise.md:27 src/references/solution.md:22 +#: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of a unit vector: {}\"" msgstr "\"اندازه‌ی یک بردار واحد: {}\"" -#: src/references/exercise.md:30 src/references/solution.md:25 +#: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?}: {}\"" msgstr "\"اندازه‌ی {v:?}: {}\"" -#: src/references/exercise.md:32 src/references/solution.md:27 +#: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?} after normalization: {}\"" msgstr "\"اندازه‌ی {v:?} پس از نرمال‌سازی: {}\"" -#: src/references/solution.md:4 +#: src/references/solution.md msgid "/// Calculate the magnitude of the given vector.\n" msgstr "/// اندازه‌ی بردار داده شده را محاسبه کنید.\n" -#: src/references/solution.md:12 +#: src/references/solution.md msgid "" "/// Change the magnitude of the vector to 1.0 without changing its " "direction.\n" @@ -4536,46 +4487,45 @@ msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بد msgid "This segment should take about 50 minutes. It contains:" msgstr "این بخش حدود ۵۰ دقیقه طول خواهد کشید. شامل موارد زیر است:" -#: src/user-defined-types/named-structs.md:3 +#: src/user-defined-types/named-structs.md msgid "Like C and C++, Rust has support for custom structs:" msgstr "‏مانند C و C++، زبان Rust از ساختارهای سفارشی پشتیبانی می‌کند:" -#: src/user-defined-types/named-structs.md:12 +#: src/user-defined-types/named-structs.md msgid "\"{} is {} years old\"" msgstr "‏\"{} {} ساله است\"" -#: src/user-defined-types/named-structs.md:16 -#: src/android/interoperability/with-c/bindgen.md:87 +#: src/user-defined-types/named-structs.md +#: src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" msgstr "\"پیتر\"" -#: src/user-defined-types/named-structs.md:22 +#: src/user-defined-types/named-structs.md msgid "\"Avery\"" msgstr "\"ایوری\"" -#: src/user-defined-types/named-structs.md:27 +#: src/user-defined-types/named-structs.md msgid "\"Jackie\"" msgstr "\"جکی\"" -#: src/user-defined-types/named-structs.md:35 -#: src/user-defined-types/enums.md:29 src/pattern-matching/match.md:38 -#: src/methods-and-traits/methods.md:69 +#: src/user-defined-types/named-structs.md src/user-defined-types/enums.md +#: src/pattern-matching/match.md src/methods-and-traits/methods.md msgid "Key Points:" msgstr "نکات کلیدی:" -#: src/user-defined-types/named-structs.md:37 +#: src/user-defined-types/named-structs.md msgid "Structs work like in C or C++." msgstr "‏ساختارها (Structs) در Rust مانند C یا C++ عمل می‌کنند." -#: src/user-defined-types/named-structs.md:38 +#: src/user-defined-types/named-structs.md msgid "Like in C++, and unlike in C, no typedef is needed to define a type." msgstr "‏مانند C++ و برخلاف C، برای تعریف یک نوع نیازی به `typedef` نیست." -#: src/user-defined-types/named-structs.md:39 +#: src/user-defined-types/named-structs.md msgid "Unlike in C++, there is no inheritance between structs." msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری وجود ندارد." -#: src/user-defined-types/named-structs.md:40 +#: src/user-defined-types/named-structs.md msgid "" "This may be a good time to let people know there are different types of " "structs." @@ -4583,7 +4533,7 @@ msgstr "" "این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " "دارد." -#: src/user-defined-types/named-structs.md:42 +#: src/user-defined-types/named-structs.md msgid "" "Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " "trait on some type but don’t have any data that you want to store in the " @@ -4593,7 +4543,7 @@ msgstr "" "می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " "که بخواهید در خود مقدار ذخیره کنید." -#: src/user-defined-types/named-structs.md:45 +#: src/user-defined-types/named-structs.md msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." @@ -4601,7 +4551,7 @@ msgstr "" "اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " "استفاده می‌شوند که نام فیلدها مهم نیستند." -#: src/user-defined-types/named-structs.md:47 +#: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." @@ -4609,7 +4559,7 @@ msgstr "" "اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " "یک روش میانبر ایجاد کنید." -#: src/user-defined-types/named-structs.md:49 +#: src/user-defined-types/named-structs.md msgid "" "The syntax `..avery` allows us to copy the majority of the fields from the " "old struct without having to explicitly type it all out. It must always be " @@ -4618,69 +4568,68 @@ msgstr "" "سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " "کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." -#: src/user-defined-types/tuple-structs.md:7 +#: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" msgstr "" -#: src/user-defined-types/tuple-structs.md:14 +#: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" msgstr "" -#: src/user-defined-types/tuple-structs.md:18 +#: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" -#: src/user-defined-types/tuple-structs.md:25 +#: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" msgstr "" -#: src/user-defined-types/tuple-structs.md:29 -#: src/android/interoperability/cpp/cpp-bridge.md:50 -#: src/bare-metal/microcontrollers/type-state.md:14 -#: src/concurrency/async-pitfalls/cancellation.md:99 -#: src/concurrency/async-pitfalls/cancellation.md:103 +#: src/user-defined-types/tuple-structs.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/bare-metal/microcontrollers/type-state.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" msgstr "" -#: src/user-defined-types/tuple-structs.md:41 +#: src/user-defined-types/tuple-structs.md msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" -#: src/user-defined-types/tuple-structs.md:43 +#: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." msgstr "" -#: src/user-defined-types/tuple-structs.md:44 +#: src/user-defined-types/tuple-structs.md msgid "" "The value passed some validation when it was created, so you no longer have " "to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" -#: src/user-defined-types/tuple-structs.md:47 +#: src/user-defined-types/tuple-structs.md msgid "" "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " "single field in the newtype." msgstr "" -#: src/user-defined-types/tuple-structs.md:49 +#: src/user-defined-types/tuple-structs.md msgid "" "Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "for instance using booleans as integers." msgstr "" -#: src/user-defined-types/tuple-structs.md:51 +#: src/user-defined-types/tuple-structs.md msgid "Operator overloading is discussed on Day 3 (generics)." msgstr "" -#: src/user-defined-types/tuple-structs.md:52 +#: src/user-defined-types/tuple-structs.md msgid "" "The example is a subtle reference to the [Mars Climate Orbiter](https://en." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" -#: src/user-defined-types/enums.md:3 +#: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" @@ -4688,46 +4637,46 @@ msgstr "" "کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " "است:" -#: src/user-defined-types/enums.md:15 +#: src/user-defined-types/enums.md msgid "// Simple variant\n" msgstr "" -#: src/user-defined-types/enums.md:16 +#: src/user-defined-types/enums.md msgid "// Tuple variant\n" msgstr "" -#: src/user-defined-types/enums.md:17 +#: src/user-defined-types/enums.md msgid "// Struct variant\n" msgstr "" -#: src/user-defined-types/enums.md:22 +#: src/user-defined-types/enums.md msgid "\"On this turn: {:?}\"" msgstr "" -#: src/user-defined-types/enums.md:31 +#: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" "`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " "تحت یک نوع جمع آوری کنید." -#: src/user-defined-types/enums.md:32 +#: src/user-defined-types/enums.md msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" -#: src/user-defined-types/enums.md:34 +#: src/user-defined-types/enums.md msgid "" "`PlayerMove` is a type with three variants. In addition to the payloads, " "Rust will store a discriminant so that it knows at runtime which variant is " "in a `PlayerMove` value." msgstr "" -#: src/user-defined-types/enums.md:37 +#: src/user-defined-types/enums.md msgid "This might be a good time to compare structs and enums:" msgstr "الان زمان خوبی برای مقایسه ساختارها و `Enum`هاست:" -#: src/user-defined-types/enums.md:38 +#: src/user-defined-types/enums.md msgid "" "In both, you can have a simple version without fields (unit struct) or one " "with different types of fields (variant payloads)." @@ -4735,7 +4684,7 @@ msgstr "" "در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " "مختلف فیلد (variant payloads) داشته باشید." -#: src/user-defined-types/enums.md:40 +#: src/user-defined-types/enums.md msgid "" "You could even implement the different variants of an enum with separate " "structs but then they wouldn’t be the same type as they would if they were " @@ -4745,30 +4694,30 @@ msgstr "" "کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " "نخواهند بود." -#: src/user-defined-types/enums.md:43 +#: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." msgstr "" -#: src/user-defined-types/enums.md:44 +#: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" msgstr "" -#: src/user-defined-types/enums.md:45 +#: src/user-defined-types/enums.md msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche optimization" +"\"). For example, `Option<&u8>` stores either a pointer to an integer or " +"`NULL` for the `None` variant." msgstr "" -#: src/user-defined-types/enums.md:49 +#: src/user-defined-types/enums.md msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" "شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " "را کنترل کنید:" -#: src/user-defined-types/enums.md:67 +#: src/user-defined-types/enums.md msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." @@ -4776,14 +4725,14 @@ msgstr "" "بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " "بایت جا می‌شود." -#: src/user-defined-types/enums.md:70 src/user-defined-types/static.md:27 -#: src/memory-management/review.md:51 src/memory-management/move.md:100 -#: src/memory-management/copy-types.md:57 src/smart-pointers/box.md:85 -#: src/borrowing/shared.md:33 src/error-handling/result.md:46 +#: src/user-defined-types/enums.md src/user-defined-types/static.md +#: src/memory-management/review.md src/memory-management/move.md +#: src/memory-management/copy-types.md src/smart-pointers/box.md +#: src/borrowing/shared.md src/error-handling/result.md msgid "More to Explore" msgstr "برای کاوش بیشتر" -#: src/user-defined-types/enums.md:72 +#: src/user-defined-types/enums.md msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." @@ -4791,7 +4740,7 @@ msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." -#: src/user-defined-types/enums.md:74 +#: src/user-defined-types/enums.md msgid "" "Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" "option/#representation), Rust guarantees that `size_of::()` equals " @@ -4801,7 +4750,7 @@ msgstr "" "dir=ltr>`size_of::()` برابر با `size_of::" ">()` است." -#: src/user-defined-types/enums.md:78 +#: src/user-defined-types/enums.md msgid "" "Example code if you want to show how the bitwise representation _may_ look " "like in practice. It's important to note that the compiler provides no " @@ -4811,11 +4760,57 @@ msgstr "" "به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " "نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." -#: src/user-defined-types/static.md:1 +#: src/user-defined-types/const.md +msgid "`const`" +msgstr "" + +#: src/user-defined-types/const.md +#, fuzzy +msgid "" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" +msgstr "" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" + +#: src/user-defined-types/const.md +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/user-defined-types/const.md +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/user-defined-types/const.md +#, fuzzy +msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" +msgstr "" +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." + +#: src/user-defined-types/const.md +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/user-defined-types/static.md msgid "`static`" msgstr "" -#: src/user-defined-types/static.md:3 +#: src/user-defined-types/static.md msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" @@ -4823,16 +4818,16 @@ msgstr "" "متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " "نمی‌شوند:" -#: src/user-defined-types/static.md:7 +#: src/user-defined-types/static.md #, fuzzy msgid "\"Welcome to RustOS 3.14\"" msgstr "به روز ۱ خوش آمدید" -#: src/user-defined-types/static.md:10 +#: src/user-defined-types/static.md msgid "\"{BANNER}\"" msgstr "" -#: src/user-defined-types/static.md:14 +#: src/user-defined-types/static.md #, fuzzy msgid "" "As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" @@ -4848,14 +4843,14 @@ msgstr "" "اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " "استفاده از `const` ترجیح داده می‌شود." -#: src/user-defined-types/static.md:23 +#: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" "از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " "`C++` هستند." -#: src/user-defined-types/static.md:24 +#: src/user-defined-types/static.md msgid "" "`static` provides object identity: an address in memory and state as " "required by types with interior mutability such as `Mutex`." @@ -4863,7 +4858,7 @@ msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." -#: src/user-defined-types/static.md:29 +#: src/user-defined-types/static.md #, fuzzy msgid "" "Because `static` variables are accessible from any thread, they must be " @@ -4878,74 +4873,28 @@ msgstr "" "دارد. ما در فصل Unsafe Rust به استاتیک های قابل تغییر [mutable statics](../" "unsafe/mutable-static-variables.md) نگاه خواهیم کرد." -#: src/user-defined-types/static.md:34 +#: src/user-defined-types/static.md #, fuzzy msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" "داده‌های `thread_local` را با ماکروی `std::thread_local` " "می‌توان ایجاد کرد." -#: src/user-defined-types/const.md:1 -msgid "`const`" -msgstr "" - -#: src/user-defined-types/const.md:3 -#, fuzzy -msgid "" -"Constants are evaluated at compile time and their values are inlined " -"wherever they are used:" -msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " -"استفاده می شوند، درج می شوند:" - -#: src/user-defined-types/const.md:26 -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/user-defined-types/const.md:28 -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/user-defined-types/const.md:33 -#, fuzzy -msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" -msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." - -#: src/user-defined-types/const.md:34 -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/user-defined-types/aliases.md:3 +#: src/user-defined-types/aliases.md msgid "" "A type alias creates a name for another type. The two types can be used " "interchangeably." msgstr "" -#: src/user-defined-types/aliases.md:13 +#: src/user-defined-types/aliases.md msgid "// Aliases are more useful with long, complex types:\n" msgstr "" -#: src/user-defined-types/aliases.md:23 +#: src/user-defined-types/aliases.md msgid "C programmers will recognize this as similar to a `typedef`." msgstr "" -#: src/user-defined-types/exercise.md:3 +#: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " "system. It is up to you to define the types and functions to construct " @@ -4953,101 +4902,101 @@ msgid "" "with `{:?}`." msgstr "" -#: src/user-defined-types/exercise.md:7 +#: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " "`main` runs without errors. The next part of the course will cover getting " "data out of these structures." msgstr "" -#: src/user-defined-types/exercise.md:12 src/user-defined-types/solution.md:4 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// An event in the elevator system that the controller must react to.\n" msgstr "" -#: src/user-defined-types/exercise.md:15 +#: src/user-defined-types/exercise.md msgid "// TODO: add required variants\n" msgstr "" -#: src/user-defined-types/exercise.md:17 src/user-defined-types/solution.md:22 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A direction of travel.\n" msgstr "" -#: src/user-defined-types/exercise.md:24 src/user-defined-types/solution.md:39 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car has arrived on the given floor.\n" msgstr "" -#: src/user-defined-types/exercise.md:29 src/user-defined-types/solution.md:44 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have opened.\n" msgstr "" -#: src/user-defined-types/exercise.md:34 src/user-defined-types/solution.md:49 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have closed.\n" msgstr "" -#: src/user-defined-types/exercise.md:39 src/user-defined-types/solution.md:54 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// A directional button was pressed in an elevator lobby on the given " "floor.\n" msgstr "" -#: src/user-defined-types/exercise.md:44 src/user-defined-types/solution.md:59 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A floor button was pressed in the elevator car.\n" msgstr "" -#: src/user-defined-types/exercise.md:52 src/user-defined-types/solution.md:67 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A ground floor passenger has pressed the up button: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md:55 src/user-defined-types/solution.md:70 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md:56 src/user-defined-types/solution.md:71 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door opened: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md:58 src/user-defined-types/solution.md:73 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md:61 src/user-defined-types/solution.md:76 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" msgstr "" -#: src/user-defined-types/exercise.md:62 src/user-defined-types/solution.md:77 +#: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the 3rd floor: {:?}\"" msgstr "" -#: src/user-defined-types/solution.md:7 +#: src/user-defined-types/solution.md msgid "/// A button was pressed.\n" msgstr "" -#: src/user-defined-types/solution.md:10 +#: src/user-defined-types/solution.md msgid "/// The car has arrived at the given floor.\n" msgstr "" -#: src/user-defined-types/solution.md:13 +#: src/user-defined-types/solution.md msgid "/// The car's doors have opened.\n" msgstr "" -#: src/user-defined-types/solution.md:16 +#: src/user-defined-types/solution.md msgid "/// The car's doors have closed.\n" msgstr "" -#: src/user-defined-types/solution.md:19 +#: src/user-defined-types/solution.md msgid "/// A floor is represented as an integer.\n" msgstr "" -#: src/user-defined-types/solution.md:29 +#: src/user-defined-types/solution.md msgid "/// A user-accessible button.\n" msgstr "" -#: src/user-defined-types/solution.md:33 +#: src/user-defined-types/solution.md msgid "/// A button in the elevator lobby on the given floor.\n" msgstr "" -#: src/user-defined-types/solution.md:36 +#: src/user-defined-types/solution.md msgid "/// A floor button within the car.\n" msgstr "" @@ -5098,7 +5047,7 @@ msgstr "" msgid "This segment should take about 1 hour. It contains:" msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شامل:" -#: src/pattern-matching/match.md:3 +#: src/pattern-matching/match.md 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." @@ -5106,72 +5055,67 @@ msgstr "" "کلمه کلیدی `match` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " "دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." -#: src/pattern-matching/match.md:6 +#: src/pattern-matching/match.md msgid "The patterns can be simple values, similarly to `switch` in C and C++:" msgstr "الگوها می توانند مقادیر ساده ای باشند، شبیه به `switch` در C و ++C:" -#: src/pattern-matching/match.md:11 +#: src/pattern-matching/match.md msgid "'x'" msgstr "" -#: src/pattern-matching/match.md:13 +#: src/pattern-matching/match.md msgid "'q'" msgstr "" -#: src/pattern-matching/match.md:13 +#: src/pattern-matching/match.md msgid "\"Quitting\"" msgstr "" -#: src/pattern-matching/match.md:14 src/generics/exercise.md:15 -#: src/generics/solution.md:17 src/std-traits/solution.md:16 -#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:75 -#: src/error-handling/solution.md:60 src/error-handling/solution.md:75 +#: src/pattern-matching/match.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" msgstr "" -#: src/pattern-matching/match.md:14 +#: src/pattern-matching/match.md msgid "'s'" msgstr "" -#: src/pattern-matching/match.md:14 +#: src/pattern-matching/match.md msgid "'w'" msgstr "" -#: src/pattern-matching/match.md:14 +#: src/pattern-matching/match.md msgid "'d'" msgstr "" -#: src/pattern-matching/match.md:14 +#: src/pattern-matching/match.md msgid "\"Moving around\"" msgstr "" -#: src/pattern-matching/match.md:15 src/error-handling/exercise.md:51 -#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:74 -#: src/error-handling/solution.md:51 src/error-handling/solution.md:60 -#: src/error-handling/solution.md:74 +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'0'" msgstr "" -#: src/pattern-matching/match.md:15 src/error-handling/exercise.md:51 -#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:74 -#: src/error-handling/solution.md:51 src/error-handling/solution.md:60 -#: src/error-handling/solution.md:74 +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'9'" msgstr "" -#: src/pattern-matching/match.md:15 +#: src/pattern-matching/match.md msgid "\"Number input\"" msgstr "" -#: src/pattern-matching/match.md:16 +#: src/pattern-matching/match.md msgid "\"Lowercase: {key}\"" msgstr "" -#: src/pattern-matching/match.md:17 +#: src/pattern-matching/match.md msgid "\"Something else\"" msgstr "" -#: src/pattern-matching/match.md:22 +#: src/pattern-matching/match.md msgid "" "The `_` pattern is a wildcard pattern which matches any value. The " "expressions _must_ be exhaustive, meaning that it covers every possibility, " @@ -5181,7 +5125,7 @@ msgstr "" "باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " "به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." -#: src/pattern-matching/match.md:26 +#: src/pattern-matching/match.md msgid "" "Match can be used as an expression. Just like `if`, each match arm must have " "the same type. The type is the last expression of the block, if any. In the " @@ -5191,7 +5135,7 @@ msgstr "" "match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " "وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." -#: src/pattern-matching/match.md:30 +#: src/pattern-matching/match.md msgid "" "A variable in the pattern (`key` in this example) will create a binding that " "can be used within the match arm." @@ -5199,37 +5143,37 @@ msgstr "" "یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " "بخش مطابقت استفاده کرد." -#: src/pattern-matching/match.md:33 +#: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" "یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " "باشد که شرط برقرار باشد." -#: src/pattern-matching/match.md:40 +#: src/pattern-matching/match.md msgid "" "You might point out how some specific characters are being used when in a " "pattern" msgstr "" "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" -#: src/pattern-matching/match.md:42 +#: src/pattern-matching/match.md msgid "`|` as an `or`" msgstr "`|` به عنوان `or`" -#: src/pattern-matching/match.md:43 +#: src/pattern-matching/match.md msgid "`..` can expand as much as it needs to be" msgstr "`..` برای تعیین همه محدوده یا تا جایی که میتوان گسترش یابد" -#: src/pattern-matching/match.md:44 +#: src/pattern-matching/match.md msgid "`1..=5` represents an inclusive range" msgstr "" "1..=5 نمایانگر یک محدوده خاص است" -#: src/pattern-matching/match.md:45 +#: src/pattern-matching/match.md msgid "`_` is a wild card" msgstr "`_` نمایانگر هر حالتی است" -#: src/pattern-matching/match.md:47 +#: src/pattern-matching/match.md msgid "" "Match guards as a separate syntax feature are important and necessary when " "we wish to concisely express more complex ideas than patterns alone would " @@ -5238,7 +5182,7 @@ msgstr "" "guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " "و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." -#: src/pattern-matching/match.md:49 +#: src/pattern-matching/match.md msgid "" "They are not the same as separate `if` expression inside of the match arm. " "An `if` expression inside of the branch block (after `=>`) happens after the " @@ -5250,55 +5194,55 @@ msgstr "" "اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " "عبارت `match` اصلی ندارد." -#: src/pattern-matching/match.md:53 +#: src/pattern-matching/match.md msgid "" "The condition defined in the guard applies to every expression in a pattern " "with an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." -#: src/pattern-matching/destructuring-structs.md:1 +#: src/pattern-matching/destructuring-structs.md msgid "Structs" msgstr "ساختارها" -#: src/pattern-matching/destructuring-structs.md:3 +#: src/pattern-matching/destructuring-structs.md msgid "Like tuples, Struct can also be destructured by matching:" msgstr "مانند tuple ها، ساختار را نیز می توان با تطبیق تخریب کرد:" -#: src/pattern-matching/destructuring-structs.md:15 +#: src/pattern-matching/destructuring-structs.md msgid "\"x.0 = 1, b = {b}, y = {y}\"" msgstr "" -#: src/pattern-matching/destructuring-structs.md:16 +#: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" msgstr "" -#: src/pattern-matching/destructuring-structs.md:17 +#: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" msgstr "" -#: src/pattern-matching/destructuring-structs.md:25 +#: src/pattern-matching/destructuring-structs.md msgid "Change the literal values in `foo` to match with the other patterns." msgstr "تغییر مقادیر لیترال در foo برای مطابقت با سایر الگوها." -#: src/pattern-matching/destructuring-structs.md:26 +#: src/pattern-matching/destructuring-structs.md msgid "Add a new field to `Foo` and make changes to the pattern as needed." msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغییرات مورد نیاز." -#: src/pattern-matching/destructuring-structs.md:27 +#: src/pattern-matching/destructuring-structs.md msgid "" "The distinction between a capture and a constant expression can be hard to " "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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍" +"`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." -#: src/pattern-matching/destructuring-enums.md:3 +#: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" msgstr "مانند tuple ها، enum ها را نیز می توان با تطبیق تخریب کرد:" -#: src/pattern-matching/destructuring-enums.md:5 +#: src/pattern-matching/destructuring-enums.md msgid "" "Patterns can also be used to bind variables to parts of your values. This is " "how you inspect the structure of your types. Let us start with a simple " @@ -5308,19 +5252,19 @@ msgstr "" "استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " "بیایید با یک نوع ساده `enum` شروع کنیم:" -#: src/pattern-matching/destructuring-enums.md:18 +#: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" msgstr "" -#: src/pattern-matching/destructuring-enums.md:25 +#: src/pattern-matching/destructuring-enums.md msgid "\"{n} divided in two is {half}\"" msgstr "" -#: src/pattern-matching/destructuring-enums.md:26 +#: src/pattern-matching/destructuring-enums.md msgid "\"sorry, an error happened: {msg}\"" msgstr "" -#: src/pattern-matching/destructuring-enums.md:31 +#: src/pattern-matching/destructuring-enums.md msgid "" "Here we have used the arms to _destructure_ the `Result` value. In the first " "arm, `half` is bound to the value inside the `Ok` variant. In the second " @@ -5330,7 +5274,7 @@ msgstr "" "`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " "`msg` به پیام خطا متصل شده است." -#: src/pattern-matching/destructuring-enums.md:38 +#: src/pattern-matching/destructuring-enums.md msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." @@ -5338,7 +5282,7 @@ msgstr "" "عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " "هم باز می‌شود." -#: src/pattern-matching/destructuring-enums.md:40 +#: src/pattern-matching/destructuring-enums.md msgid "" "You can try adding a third variant to the enum definition and displaying the " "errors when running the code. Point out the places where your code is now " @@ -5348,13 +5292,13 @@ msgstr "" "خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " "نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." -#: src/pattern-matching/destructuring-enums.md:43 +#: src/pattern-matching/destructuring-enums.md msgid "" "The values in the enum variants can only be accessed after being pattern " "matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." -#: src/pattern-matching/destructuring-enums.md:45 +#: src/pattern-matching/destructuring-enums.md msgid "" "Demonstrate what happens when the search is inexhaustive. Note the advantage " "the Rust compiler provides by confirming when all cases are handled." @@ -5363,7 +5307,7 @@ msgstr "" "کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " "شده‌اند." -#: src/pattern-matching/destructuring-enums.md:47 +#: src/pattern-matching/destructuring-enums.md msgid "" "Save the result of `divide_in_two` in the `result` variable and `match` it " "in a loop. That won't compile because `msg` is consumed when matched. To fix " @@ -5381,7 +5325,7 @@ msgstr "" "اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " "msg` در الگو استفاده کنید." -#: src/pattern-matching/let-control-flow.md:3 +#: src/pattern-matching/let-control-flow.md msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" @@ -5389,21 +5333,19 @@ msgstr "" "زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " "ساختارها برای مطابقت الگو استفاده می‌شوند:" -#: src/pattern-matching/let-control-flow.md:6 -#: src/pattern-matching/let-control-flow.md:10 +#: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" msgstr "عبارت `if let`" -#: src/pattern-matching/let-control-flow.md:7 -#: src/pattern-matching/let-control-flow.md:32 +#: src/pattern-matching/let-control-flow.md msgid "`let else` expressions" msgstr "عبارت `let else`" -#: src/pattern-matching/let-control-flow.md:8 +#: src/pattern-matching/let-control-flow.md msgid "`while let` expressions" msgstr "عبارت `while let`" -#: src/pattern-matching/let-control-flow.md:12 +#: src/pattern-matching/let-control-flow.md msgid "" "The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" "expr.html#if-let-expressions) lets you execute different code depending on " @@ -5413,11 +5355,11 @@ msgstr "" "html#if-let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " "یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" -#: src/pattern-matching/let-control-flow.md:22 +#: src/pattern-matching/let-control-flow.md msgid "\"slept for {:?}\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:34 +#: src/pattern-matching/let-control-flow.md msgid "" "For the common case of matching a pattern and returning from the function, " "use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" @@ -5429,34 +5371,29 @@ msgstr "" "در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " "- به غیر از اینکه از انتهای بلوک خارج شود)." -#: src/pattern-matching/let-control-flow.md:44 -#: src/pattern-matching/let-control-flow.md:107 -msgid "\"got None\"" +#: src/pattern-matching/let-control-flow.md +msgid "\"not a hex digit\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:50 -#: src/pattern-matching/let-control-flow.md:111 +#: src/pattern-matching/let-control-flow.md msgid "\"got empty string\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:56 -#: src/pattern-matching/let-control-flow.md:115 -msgid "\"not a hex digit\"" +#: src/pattern-matching/let-control-flow.md +msgid "\"got None\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:61 -#: src/pattern-matching/solution.md:113 +#: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md msgid "\"result: {:?}\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:61 src/generics/trait-bounds.md:16 -#: src/smart-pointers/solution.md:87 src/smart-pointers/solution.md:90 -#: src/testing/solution.md:83 src/android/testing.md -#: src/android/testing/googletest.md:11 src/android/testing/googletest.md:12 +#: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md +#: src/smart-pointers/solution.md src/testing/solution.md +#: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" msgstr "" -#: src/pattern-matching/let-control-flow.md:65 +#: src/pattern-matching/let-control-flow.md msgid "" "Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " @@ -5466,7 +5403,7 @@ msgstr "" "expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر " "مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" -#: src/pattern-matching/let-control-flow.md:81 +#: src/pattern-matching/let-control-flow.md msgid "" "Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) returns `Some(c)` until the string is empty, after " @@ -5478,11 +5415,11 @@ msgstr "" "برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " "این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." -#: src/pattern-matching/let-control-flow.md:89 +#: src/pattern-matching/let-control-flow.md msgid "if-let" msgstr "if-let" -#: src/pattern-matching/let-control-flow.md:91 +#: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not have to cover all branches. This can make " "it more concise than `match`." @@ -5491,24 +5428,24 @@ msgstr "" "پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " "کنید." -#: src/pattern-matching/let-control-flow.md:93 +#: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" "یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " "`Option` است:" -#: src/pattern-matching/let-control-flow.md:94 +#: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" "برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " "الگو استفاده نمیکند." -#: src/pattern-matching/let-control-flow.md:96 +#: src/pattern-matching/let-control-flow.md msgid "let-else" msgstr "let-else" -#: src/pattern-matching/let-control-flow.md:98 +#: src/pattern-matching/let-control-flow.md msgid "" "`if-let`s can pile up, as shown. The `let-else` construct supports " "flattening this nested code. Rewrite the awkward version for students, so " @@ -5519,15 +5456,15 @@ msgstr "" "می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " "مشاهده کنند." -#: src/pattern-matching/let-control-flow.md:102 +#: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" msgstr "نسخه‌ی بازنویسی شده به صورت زیر است:" -#: src/pattern-matching/let-control-flow.md:122 +#: src/pattern-matching/let-control-flow.md msgid "while-let" msgstr "while-let" -#: src/pattern-matching/let-control-flow.md:124 +#: src/pattern-matching/let-control-flow.md msgid "" "Point out that the `while let` loop will keep going as long as the value " "matches the pattern." @@ -5535,7 +5472,7 @@ msgstr "" "توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " "داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." -#: src/pattern-matching/let-control-flow.md:126 +#: src/pattern-matching/let-control-flow.md msgid "" "You could rewrite the `while let` loop as an infinite loop with an if " "statement that breaks when there is no value to unwrap for `name.pop()`. The " @@ -5546,11 +5483,11 @@ msgstr "" "pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " "می‌دهد." -#: src/pattern-matching/exercise.md:3 +#: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبارات حسابی بنویسیم." -#: src/pattern-matching/exercise.md:5 +#: src/pattern-matching/exercise.md msgid "" "The `Box` type here is a smart pointer, and will be covered in detail later " "in the course. An expression can be \"boxed\" with `Box::new` as seen in the " @@ -5562,7 +5499,7 @@ msgstr "" "شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " "عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." -#: src/pattern-matching/exercise.md:10 +#: src/pattern-matching/exercise.md msgid "" "Some expressions cannot be evaluated and will return an error. The standard " "[`Result`](https://doc.rust-lang.org/std/result/enum.Result." @@ -5575,7 +5512,7 @@ msgstr "" "html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " "(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." -#: src/pattern-matching/exercise.md:15 +#: src/pattern-matching/exercise.md msgid "" "Copy and paste the code into the Rust playground, and begin implementing " "`eval`. The final product should pass the tests. It may be helpful to use " @@ -5587,7 +5524,7 @@ msgstr "" "گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " "را با استفاده از `[ignore]#` نادیده بگیرید:" -#: src/pattern-matching/exercise.md:26 +#: src/pattern-matching/exercise.md msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" @@ -5596,32 +5533,31 @@ msgstr "" "سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " "panic مدیریت کنید؟" -#: src/pattern-matching/exercise.md:30 src/pattern-matching/solution.md:4 +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation to perform on two subexpressions.\n" msgstr "" -#: src/pattern-matching/exercise.md:38 src/pattern-matching/solution.md:12 +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An expression, in tree form.\n" msgstr "" -#: src/pattern-matching/exercise.md:42 src/pattern-matching/solution.md:16 +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation on two subexpressions.\n" msgstr "" -#: src/pattern-matching/exercise.md:45 src/pattern-matching/solution.md:19 +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// A literal value\n" msgstr "" -#: src/pattern-matching/exercise.md:104 src/pattern-matching/solution.md:40 -#: src/pattern-matching/solution.md:102 +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "\"division by zero\"" msgstr "" -#: src/pattern-matching/solution.md:112 +#: src/pattern-matching/solution.md msgid "\"expr: {:?}\"" msgstr "" -#: src/methods-and-traits/methods.md:3 +#: src/methods-and-traits/methods.md msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" @@ -5629,43 +5565,43 @@ msgstr "" "Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " "کار را با استفاده از بلوک `impl` انجام می‌دهید:" -#: src/methods-and-traits/methods.md:14 +#: src/methods-and-traits/methods.md msgid "// No receiver, a static method\n" msgstr "" -#: src/methods-and-traits/methods.md:19 +#: src/methods-and-traits/methods.md msgid "// Exclusive borrowed read-write access to self\n" msgstr "" -#: src/methods-and-traits/methods.md:24 +#: src/methods-and-traits/methods.md msgid "// Shared and read-only borrowed access to self\n" msgstr "" -#: src/methods-and-traits/methods.md:26 +#: src/methods-and-traits/methods.md msgid "\"Recorded {} laps for {}:\"" msgstr "" -#: src/methods-and-traits/methods.md:28 +#: src/methods-and-traits/methods.md msgid "\"Lap {idx}: {lap} sec\"" msgstr "" -#: src/methods-and-traits/methods.md:32 +#: src/methods-and-traits/methods.md msgid "// Exclusive ownership of self\n" msgstr "" -#: src/methods-and-traits/methods.md:35 +#: src/methods-and-traits/methods.md msgid "\"Race {} is finished, total lap time: {}\"" msgstr "" -#: src/methods-and-traits/methods.md:40 +#: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" msgstr "" -#: src/methods-and-traits/methods.md:47 +#: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" msgstr "" -#: src/methods-and-traits/methods.md:51 +#: src/methods-and-traits/methods.md msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" @@ -5673,7 +5609,7 @@ msgstr "" "آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " "می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" -#: src/methods-and-traits/methods.md:54 +#: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." @@ -5681,7 +5617,7 @@ msgstr "" "`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " "قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." -#: src/methods-and-traits/methods.md:56 +#: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." @@ -5690,7 +5626,7 @@ msgstr "" "تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " "به پایان برسد." -#: src/methods-and-traits/methods.md:58 +#: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " "method becomes the owner of the object. The object will be dropped " @@ -5701,11 +5637,11 @@ msgstr "" "مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " "آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." -#: src/methods-and-traits/methods.md:62 +#: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." msgstr "`mut self`: مشابه مورد بالا، اما متد می‌تواند شیء را تغییر دهد." -#: src/methods-and-traits/methods.md:63 +#: src/methods-and-traits/methods.md msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." @@ -5713,11 +5649,11 @@ msgstr "" "بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " "سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." -#: src/methods-and-traits/methods.md:71 +#: src/methods-and-traits/methods.md msgid "It can be helpful to introduce methods by comparing them to functions." msgstr "مفید است که متدها را با مقایسه آنها با توابع معرفی کنیم." -#: src/methods-and-traits/methods.md:72 +#: src/methods-and-traits/methods.md msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." @@ -5725,7 +5661,7 @@ msgstr "" "متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " "پارامتر اول نمونه را به‌عنوان نمونه `self`." -#: src/methods-and-traits/methods.md:74 +#: src/methods-and-traits/methods.md msgid "" "Developers may choose to use methods to take advantage of method receiver " "syntax and to help keep them more organized. By using methods we can keep " @@ -5735,12 +5671,12 @@ msgstr "" "متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " "می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." -#: src/methods-and-traits/methods.md:77 +#: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" "استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." -#: src/methods-and-traits/methods.md:78 +#: src/methods-and-traits/methods.md msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." @@ -5748,7 +5684,7 @@ msgstr "" "نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " "دهید که چگونه نام struct نیز می‌تواند استفاده شود." -#: src/methods-and-traits/methods.md:80 +#: src/methods-and-traits/methods.md msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." @@ -5756,7 +5692,7 @@ msgstr "" "توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " "قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." -#: src/methods-and-traits/methods.md:82 +#: src/methods-and-traits/methods.md #, fuzzy msgid "" "Note how `self` is used like other structs and dot notation can be used to " @@ -5765,7 +5701,7 @@ msgstr "" "توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " "می‌تواند برای ارجاع به فیلدهای فردی به کار رود." -#: src/methods-and-traits/methods.md:84 +#: src/methods-and-traits/methods.md msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." @@ -5773,7 +5709,7 @@ msgstr "" "این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " "تلاش برای اجرای متد `finish` دو بار." -#: src/methods-and-traits/methods.md:86 +#: src/methods-and-traits/methods.md msgid "" "Beyond variants on `self`, there are also [special wrapper types](https://" "doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " @@ -5783,22 +5719,22 @@ msgstr "" "rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " "به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " "redundant?" @@ -6117,7 +6052,7 @@ msgstr "" "_سوال:_ چرا `T` در عبارت `{} Point { .. }`." msgstr "این امکان وجود دارد که `{ .. }`, but methods in this " "block will only be available for `Point`." @@ -6141,7 +6076,7 @@ msgstr "" "`Point` هنوز هم generic است و می‌توانید از ``." @@ -6267,7 +6203,7 @@ msgstr "" "اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " "باشد، مانند `>(x: T) -> i32 {\n" msgstr "" -#: src/generics/impl-trait.md:19 +#: src/generics/impl-trait.md msgid "\"{many}\"" msgstr "" -#: src/generics/impl-trait.md:21 +#: src/generics/impl-trait.md msgid "\"{many_more}\"" msgstr "" -#: src/generics/impl-trait.md:23 +#: src/generics/impl-trait.md msgid "\"debuggable: {debuggable:?}\"" msgstr "" -#: src/generics/impl-trait.md:30 +#: src/generics/impl-trait.md msgid "" "`impl Trait` allows you to work with types which you cannot name. The " "meaning of `impl Trait` is a bit different in the different positions." @@ -6310,7 +6246,7 @@ msgstr "" "`impl Trait` به شما اجازه می‌دهد با تایپ‌هایی کار کنید که نمی‌توانید نام ببرید. " "معنی `impl Trait` در موقعیت‌های مختلف کمی متفاوت است." -#: src/generics/impl-trait.md:33 +#: src/generics/impl-trait.md msgid "" "For a parameter, `impl Trait` is like an anonymous generic parameter with a " "trait bound." @@ -6318,7 +6254,7 @@ msgstr "" "برای یک پارامتر، `impl Trait` شبیه به یک پارامتر generic ناشناخته با یک " "محدودیت trait است." -#: src/generics/impl-trait.md:36 +#: src/generics/impl-trait.md msgid "" "For a return type, it means that the return type is some concrete type that " "implements the trait, without naming the type. This can be useful when you " @@ -6328,7 +6264,7 @@ msgstr "" "پیاده‌سازی می‌کند، بدون اینکه تایپ را نام ببرید. این می‌تواند زمانی مفید باشد " "که نمی‌خواهید تایپ مشخص را در یک API عمومی افشا کنید." -#: src/generics/impl-trait.md:40 +#: src/generics/impl-trait.md msgid "" "Inference is hard in return position. A function returning `impl Foo` picks " "the concrete type it returns, without writing it out in the source. A " @@ -6344,7 +6280,7 @@ msgstr "" "نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " "یا با استفاده از ()`." -#: src/generics/impl-trait.md:47 +#: src/generics/impl-trait.md msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." @@ -6352,7 +6288,7 @@ msgstr "" "نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " "ببینید پیام خطا چه چیزی را نشان می‌دهد." -#: src/generics/dyn-trait.md:3 +#: src/generics/dyn-trait.md msgid "" "In addition to using traits for static dispatch via generics, Rust also " "supports using them for type-erased, dynamic dispatch via trait objects:" @@ -6361,24 +6297,23 @@ msgstr "" "همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " "اشیاء trait پشتیبانی می‌کند:" -#: src/generics/dyn-trait.md:27 src/smart-pointers/trait-objects.md:28 +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" msgstr "" -#: src/generics/dyn-trait.md:30 +#: src/generics/dyn-trait.md msgid "// Uses generics and static dispatch.\n" msgstr "" -#: src/generics/dyn-trait.md:33 src/generics/dyn-trait.md:38 -#: src/smart-pointers/trait-objects.md:38 +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Hello, who are you? {}\"" msgstr "" -#: src/generics/dyn-trait.md:35 +#: src/generics/dyn-trait.md msgid "// Uses type-erasure and dynamic dispatch.\n" msgstr "" -#: src/generics/dyn-trait.md:56 +#: src/generics/dyn-trait.md msgid "" "Generics, including `impl Trait`, use monomorphization to create a " "specialized instance of the function for each different type that the " @@ -6393,7 +6328,7 @@ msgstr "" "فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " "می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." -#: src/generics/dyn-trait.md:62 +#: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " "method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " @@ -6406,7 +6341,7 @@ msgstr "" "واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " "استفاده می‌شود." -#: src/generics/dyn-trait.md:67 +#: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, the trait object needs to be behind some kind of " "indirection. In this case it's a reference, though smart pointer types like " @@ -6417,7 +6352,7 @@ msgstr "" "اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " "سوم نشان داده خواهد شد)." -#: src/generics/dyn-trait.md:71 +#: src/generics/dyn-trait.md msgid "" "At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " "two pointers: One pointer points to the concrete object that implements " @@ -6436,7 +6371,7 @@ msgstr "" "`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " "`Pet` برای انجام این کار ندارد." -#: src/generics/dyn-trait.md:79 +#: src/generics/dyn-trait.md msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." @@ -6444,7 +6379,7 @@ msgstr "" "یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " "زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." -#: src/generics/exercise.md:3 +#: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " "determines the minimum of two values, using the [`Ord`](https://doc.rust-" @@ -6454,37 +6389,36 @@ msgstr "" "حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." "rust-lang.org/stable/std/cmp/trait.Ord.html)." -#: src/generics/exercise.md:8 +#: src/generics/exercise.md msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "" -#: src/generics/exercise.md:15 src/generics/solution.md:17 -#: src/error-handling/exercise.md:60 src/error-handling/exercise.md:75 -#: src/error-handling/solution.md:60 src/error-handling/solution.md:75 +#: src/generics/exercise.md src/generics/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "" -#: src/generics/exercise.md:16 src/generics/solution.md:18 +#: src/generics/exercise.md src/generics/solution.md msgid "'7'" msgstr "" -#: src/generics/exercise.md:16 src/generics/solution.md:18 +#: src/generics/exercise.md src/generics/solution.md msgid "'1'" msgstr "" -#: src/generics/exercise.md:18 src/generics/solution.md:20 +#: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" msgstr "" -#: src/generics/exercise.md:19 src/generics/solution.md:21 +#: src/generics/exercise.md src/generics/solution.md msgid "\"bat\"" msgstr "" -#: src/generics/exercise.md:19 src/generics/solution.md:21 +#: src/generics/exercise.md src/generics/solution.md msgid "\"armadillo\"" msgstr "" -#: src/generics/exercise.md:26 +#: src/generics/exercise.md msgid "" "Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." "html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." @@ -6494,15 +6428,15 @@ msgstr "" "[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " "enum را به دانش‌آموزان نشان دهید." -#: src/std-types.md src/std-types/option.md:1 +#: src/std-types.md src/std-types/option.md msgid "Option" msgstr "Option" -#: src/std-types.md src/std-types/result.md:1 src/error-handling.md +#: src/std-types.md src/std-types/result.md src/error-handling.md msgid "Result" msgstr "Result" -#: src/std-types.md src/std-types/string.md:1 +#: src/std-types.md src/std-types/string.md msgid "String" msgstr "String" @@ -6522,7 +6456,7 @@ msgstr "" "برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " "از متدهای رایج‌تر را برجسته کنید." -#: src/std-types/std.md:3 +#: src/std-types/std.md msgid "" "Rust comes with a standard library which helps establish a set of common " "types used by Rust libraries and programs. This way, two libraries can work " @@ -6533,7 +6467,7 @@ msgstr "" "کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " "استفاده می‌کنند." -#: src/std-types/std.md:7 +#: src/std-types/std.md msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." @@ -6541,7 +6475,7 @@ msgstr "" "در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " "`std`." -#: src/std-types/std.md:10 +#: src/std-types/std.md msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." @@ -6549,7 +6483,7 @@ msgstr "" "`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " "حتی وجود یک سیستم‌عامل وابسته نیستند." -#: src/std-types/std.md:12 +#: src/std-types/std.md msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." @@ -6557,18 +6491,18 @@ msgstr "" "`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند " "`Vec`، `Box` و `Arc`." -#: src/std-types/std.md:14 +#: src/std-types/std.md msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " "می‌کنند." -#: src/std-types/docs.md:3 +#: src/std-types/docs.md msgid "Rust comes with extensive documentation. For example:" msgstr "Rust دارای مستندات گسترده‌ای است. به عنوان مثال:" -#: src/std-types/docs.md:5 +#: src/std-types/docs.md msgid "" "All of the details about [loops](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." @@ -6576,7 +6510,7 @@ msgstr "" "تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." -#: src/std-types/docs.md:7 +#: src/std-types/docs.md msgid "" "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." @@ -6584,7 +6518,7 @@ msgstr "" "تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." -#: src/std-types/docs.md:9 +#: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" "option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" @@ -6594,11 +6528,11 @@ msgstr "" "std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" "stable/std/collections/struct.BinaryHeap.html)." -#: src/std-types/docs.md:13 +#: src/std-types/docs.md msgid "In fact, you can document your own code:" msgstr "در واقع، شما می‌توانید کد خود را مستند کنید:" -#: src/std-types/docs.md:16 +#: src/std-types/docs.md msgid "" "/// Determine whether the first argument is divisible by the second " "argument.\n" @@ -6606,7 +6540,7 @@ msgid "" "/// If the second argument is zero, the result is false.\n" msgstr "" -#: src/std-types/docs.md:27 +#: src/std-types/docs.md msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" @@ -6619,7 +6553,7 @@ msgstr "" "می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " "رایج مرسوم است." -#: src/std-types/docs.md:32 +#: src/std-types/docs.md msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" @@ -6627,13 +6561,13 @@ msgstr "" "برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " "`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" -#: src/std-types/docs.md:36 +#: src/std-types/docs.md msgid "" "//! This module contains functionality relating to divisibility of " "integers.\n" msgstr "" -#: src/std-types/docs.md:42 +#: src/std-types/docs.md msgid "" "Show students the generated docs for the `rand` crate at ." @@ -6641,7 +6575,7 @@ msgstr "" "مستندات تولیدشده برای `rand` crate را در به " "دانش‌آموزان نشان دهید." -#: src/std-types/option.md:3 +#: src/std-types/option.md msgid "" "We have already seen some use of `Option`. It stores either a value of " "type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" @@ -6652,33 +6586,33 @@ msgstr "" "[`String::find`](https://doc.rust-lang.org/stable/std/string/struct.String." "html#method.find) یک `` often has the same size in " "memory as `T`." @@ -6710,7 +6644,7 @@ msgstr "" "بهینه‌سازی niche به این معناست که `` " @@ -6720,23 +6654,23 @@ msgstr "" "هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/" "string/struct.String.html#deref-methods-str), which means that you can call " @@ -6811,7 +6744,7 @@ msgstr "" "std/string/struct.String.html#deref-methods-str) است، که به این معناست که " "می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." -#: src/std-types/string.md:30 +#: src/std-types/string.md msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." @@ -6819,7 +6752,7 @@ msgstr "" "`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " "استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." -#: src/std-types/string.md:32 +#: src/std-types/string.md msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." @@ -6827,7 +6760,7 @@ msgstr "" "`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " "طول آن به‌صورت کاراکتر متفاوت باشد)." -#: src/std-types/string.md:34 +#: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " "`char` can be different from what a human will consider a \"character\" due " @@ -6835,12 +6768,11 @@ msgid "" "unicode_segmentation/struct.Graphemes.html)." msgstr "" "`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " -"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." -"html)." +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر" +"\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/" +"unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." -#: src/std-types/string.md:37 +#: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." @@ -6848,7 +6780,7 @@ msgstr "" "زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " "باشد." -#: src/std-types/string.md:39 +#: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." @@ -6856,7 +6788,7 @@ msgstr "" "زمانی که یک تایپ، `` which transparently gives it " "access to `str`'s methods." @@ -6872,22 +6804,22 @@ msgstr "" "`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/" "struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " @@ -6959,7 +6891,7 @@ msgstr "" "vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " "متدهای برش را بر روی یک `Vec` فراخوانی کنید." -#: src/std-types/vec.md:38 +#: src/std-types/vec.md msgid "" "`Vec` is a type of collection, along with `String` and `HashMap`. The data " "it contains is stored on the heap. This means the amount of data doesn't " @@ -6969,7 +6901,7 @@ msgstr "" "heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " "کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." -#: src/std-types/vec.md:41 +#: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " "explicitly. As always with Rust type inference, the `T` was established " @@ -6979,7 +6911,7 @@ msgstr "" "صریح `T` ندارید. همان‌طور که همیشه با استنتاج تایپ در Rust ، `T` در زمان " "اولین فراخوانی `push` مشخص شده است." -#: src/std-types/vec.md:44 +#: src/std-types/vec.md msgid "" "`vec![...]` is a canonical macro to use instead of `Vec::new()` and it " "supports adding initial elements to the vector." @@ -6987,7 +6919,7 @@ msgstr "" "`[...]!vec` یک ماکرو استاندارد برای استفاده به‌جای `()Vec::new` است و از " "افزودن عناصر اولیه به vector پشتیبانی می‌کند." -#: src/std-types/vec.md:46 +#: src/std-types/vec.md msgid "" "To index the vector you use `[` `]`, but they will panic if out of bounds. " "Alternatively, using `get` will return an `Option`. The `pop` function will " @@ -6997,7 +6929,7 @@ msgstr "" "شود، باعث panic می‌شود. به‌طور جایگزین، استفاده از `get` یک `Option` را " "برمی‌گرداند. تابع `pop` آخرین عنصر را حذف می‌کند." -#: src/std-types/vec.md:49 +#: src/std-types/vec.md msgid "" "Slices are covered on day 3. For now, students only need to know that a " "value of type `Vec` gives access to all of the documented slice methods, too." @@ -7005,57 +6937,56 @@ msgstr "" "برش‌ها در روز سوم پوشش داده می‌شوند. در حال حاضر، دانش‌آموزان تنها باید بدانند " "که یک مقدار از تایپ `Vec` به تمام متدهای مستند شده برش‌ها نیز دسترسی دارد." -#: src/std-types/hashmap.md:3 +#: src/std-types/hashmap.md msgid "Standard hash map with protection against HashDoS attacks:" msgstr "نقشه hash استاندارد با حفاظت در برابر حملات HashDoS:" -#: src/std-types/hashmap.md:10 +#: src/std-types/hashmap.md msgid "\"Adventures of Huckleberry Finn\"" msgstr "" -#: src/std-types/hashmap.md:11 +#: src/std-types/hashmap.md msgid "\"Grimms' Fairy Tales\"" msgstr "" -#: src/std-types/hashmap.md:12 src/std-types/hashmap.md:21 -#: src/std-types/hashmap.md:29 +#: src/std-types/hashmap.md msgid "\"Pride and Prejudice\"" msgstr "" -#: src/std-types/hashmap.md:14 +#: src/std-types/hashmap.md msgid "\"Les Misérables\"" msgstr "" -#: src/std-types/hashmap.md:16 +#: src/std-types/hashmap.md msgid "\"We know about {} books, but not Les Misérables.\"" msgstr "" -#: src/std-types/hashmap.md:21 src/std-types/hashmap.md:29 +#: src/std-types/hashmap.md msgid "\"Alice's Adventure in Wonderland\"" msgstr "" -#: src/std-types/hashmap.md:23 +#: src/std-types/hashmap.md msgid "\"{book}: {count} pages\"" msgstr "" -#: src/std-types/hashmap.md:24 +#: src/std-types/hashmap.md msgid "\"{book} is unknown.\"" msgstr "" -#: src/std-types/hashmap.md:28 +#: src/std-types/hashmap.md msgid "// Use the .entry() method to insert a value if nothing is found.\n" msgstr "" -#: src/std-types/hashmap.md:34 +#: src/std-types/hashmap.md msgid "\"{page_counts:#?}\"" msgstr "" -#: src/std-types/hashmap.md:41 +#: src/std-types/hashmap.md msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." msgstr "`HashMap` در prelude تعریف نشده و باید به scope وارد شود." -#: src/std-types/hashmap.md:42 +#: src/std-types/hashmap.md msgid "" "Try the following lines of code. The first line will see if a book is in the " "hashmap and if not return an alternative value. The second line will insert " @@ -7065,31 +6996,31 @@ msgstr "" "`HashMap` وجود دارد یا خیر و اگر وجود نداشت، یک مقدار جایگزین برمی‌گرداند. " "سطر دوم مقدار جایگزین را در `HashMap` وارد می‌کند اگر کتاب پیدا نشد." -#: src/std-types/hashmap.md:48 src/std-types/hashmap.md:60 +#: src/std-types/hashmap.md msgid "\"Harry Potter and the Sorcerer's Stone\"" msgstr "" -#: src/std-types/hashmap.md:51 src/std-types/hashmap.md:61 +#: src/std-types/hashmap.md msgid "\"The Hunger Games\"" msgstr "" -#: src/std-types/hashmap.md:54 +#: src/std-types/hashmap.md msgid "Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." msgstr "برخلاف `!vec`، متأسفانه ماکروی استاندارد `!hashmap` وجود ندارد." -#: src/std-types/hashmap.md:55 +#: src/std-types/hashmap.md msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" +"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " +"easily initialize a hash map from a literal array:" msgstr "" "از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" "(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" "From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " "اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" -#: src/std-types/hashmap.md:65 +#: src/std-types/hashmap.md msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." @@ -7097,7 +7028,7 @@ msgstr "" "به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " "تولید می‌کند، ساخته شود." -#: src/std-types/hashmap.md:67 +#: src/std-types/hashmap.md msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " "examples easier. Using references in collections can, of course, be done, " @@ -7107,7 +7038,7 @@ msgstr "" "کلید اجتناب می‌کنیم تا مثال‌ها ساده‌تر شوند. استفاده از ارجاعات در مجموعه‌ها " "البته ممکن است، اما می‌تواند به مشکلاتی با borrow checker منجر شود." -#: src/std-types/hashmap.md:70 +#: src/std-types/hashmap.md msgid "" "Try removing `to_string()` from the example above and see if it still " "compiles. Where do you think we might run into issues?" @@ -7115,7 +7046,7 @@ msgstr "" "حذف `()to_string` از مثال بالا را امتحان کنید و ببینید آیا هنوز کامپایل " "می‌شود یا خیر. فکر می‌کنید ممکن است با چه مشکلاتی مواجه شویم؟" -#: src/std-types/hashmap.md:73 +#: src/std-types/hashmap.md msgid "" "This type has several \"method-specific\" return types, such as `std::" "collections::hash_map::Keys`. These types often appear in searches of the " @@ -7127,7 +7058,7 @@ msgstr "" "مستندات این تایپ را به دانش‌آموزان نشان دهید و پیوند مفید بازگشتی به متد " "`keys` را نیز نمایش دهید." -#: src/std-types/exercise.md:3 +#: src/std-types/exercise.md msgid "" "In this exercise you will take a very simple data structure and make it " "generic. It uses a [`std::collections::HashMap`](https://doc.rust-lang.org/" @@ -7139,7 +7070,7 @@ msgstr "" "std/collections/struct.HashMap.html) برای پیگیری اینکه چه مقادیری مشاهده " "شده‌اند و هرکدام چند بار ظاهر شده‌اند، استفاده می‌کند." -#: src/std-types/exercise.md:9 +#: src/std-types/exercise.md msgid "" "The initial version of `Counter` is hard coded to only work for `u32` " "values. Make the struct and its methods generic over the type of value being " @@ -7149,7 +7080,7 @@ msgstr "" "ساختار و متدهای آن را به‌صورت generic بر اساس تایپ مقداری که در حال پیگیری " "است، تغییر دهید، به‌طوری که `Counter` بتواند هر تایپ مقداری را پیگیری کند." -#: src/std-types/exercise.md:13 +#: src/std-types/exercise.md msgid "" "If you finish early, try using the [`entry`](https://doc.rust-lang.org/" "stable/std/collections/struct.HashMap.html#method.entry) method to halve the " @@ -7159,38 +7090,36 @@ msgstr "" "stable/std/collections/struct.HashMap.html#method.entry) استفاده کنید تا " "تعداد جستجوهای هش مورد نیاز برای پیاده‌سازی متد `count` را به نصف کاهش دهید." -#: src/std-types/exercise.md:20 src/std-types/solution.md:6 +#: src/std-types/exercise.md src/std-types/solution.md msgid "" "/// Counter counts the number of times each value of type T has been seen.\n" msgstr "" -#: src/std-types/exercise.md:27 src/std-types/solution.md:13 +#: src/std-types/exercise.md src/std-types/solution.md msgid "/// Create a new Counter.\n" msgstr "" -#: src/std-types/exercise.md:34 src/std-types/solution.md:18 +#: src/std-types/exercise.md src/std-types/solution.md msgid "/// Count an occurrence of the given value.\n" msgstr "" -#: src/std-types/exercise.md:43 src/std-types/solution.md:23 +#: src/std-types/exercise.md src/std-types/solution.md msgid "/// Return the number of times the given value has been seen.\n" msgstr "" -#: src/std-types/exercise.md:59 src/std-types/solution.md:39 +#: src/std-types/exercise.md src/std-types/solution.md msgid "\"saw {} values equal to {}\"" msgstr "" -#: src/std-types/exercise.md:63 src/std-types/exercise.md:65 -#: src/std-types/exercise.md:66 src/std-types/solution.md:43 -#: src/std-types/solution.md:45 src/std-types/solution.md:46 +#: src/std-types/exercise.md src/std-types/solution.md msgid "\"apple\"" msgstr "" -#: src/std-types/exercise.md:64 src/std-types/solution.md:44 +#: src/std-types/exercise.md src/std-types/solution.md msgid "\"orange\"" msgstr "" -#: src/std-types/exercise.md:66 src/std-types/solution.md:46 +#: src/std-types/exercise.md src/std-types/solution.md msgid "\"got {} apples\"" msgstr "" @@ -7224,7 +7153,7 @@ msgstr "" msgid "This section is long. Take a break midway through." msgstr "این بخش طولانی است. در میانه‌ی آن یک استراحت کنید." -#: src/std-traits/comparisons.md:3 +#: src/std-traits/comparisons.md msgid "" "These traits support comparisons between values. All traits can be derived " "for types containing fields that implement these traits." @@ -7233,11 +7162,11 @@ msgstr "" "برای تایپ‌هایی که شامل فیلدهایی هستند که این trait‌ها را پیاده‌سازی می‌کنند، " "به‌دست آورد." -#: src/std-traits/comparisons.md:6 +#: src/std-traits/comparisons.md msgid "`PartialEq` and `Eq`" msgstr "`PartialEq` and `Eq`" -#: src/std-traits/comparisons.md:8 +#: src/std-traits/comparisons.md msgid "" "`PartialEq` is a partial equivalence relation, with required method `eq` and " "provided method `ne`. The `==` and `!=` operators will call these methods." @@ -7245,7 +7174,7 @@ msgstr "" "`PartialEq` یک رابطه هم‌ارزی جزئی است که دارای متد الزامی `eq` و متد ارائه‌شده " "`ne` می‌باشد. عملگرهای `==` و `=!` این متدها را فراخوانی می‌کنند." -#: src/std-traits/comparisons.md:23 +#: src/std-traits/comparisons.md msgid "" "`Eq` is a full equivalence relation (reflexive, symmetric, and transitive) " "and implies `PartialEq`. Functions that require full equivalence will use " @@ -7255,11 +7184,11 @@ msgstr "" "`PartialEq` می‌شود. توابعی که به هم‌ارزی کامل نیاز دارند، از `Eq` به‌عنوان یک " "trait bound استفاده می‌کنند." -#: src/std-traits/comparisons.md:27 +#: src/std-traits/comparisons.md msgid "`PartialOrd` and `Ord`" msgstr "`PartialOrd` and `Ord`" -#: src/std-traits/comparisons.md:29 +#: src/std-traits/comparisons.md msgid "" "`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " "used to implement the `<`, `<=`, `>=`, and `>` operators." @@ -7267,12 +7196,12 @@ msgstr "" "`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " "ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." -#: src/std-traits/comparisons.md:49 +#: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." msgstr "" "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." -#: src/std-traits/comparisons.md:54 +#: src/std-traits/comparisons.md msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" @@ -7280,7 +7209,7 @@ msgstr "" "`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " "بازتابی است:" -#: src/std-traits/comparisons.md:69 +#: src/std-traits/comparisons.md msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." @@ -7288,7 +7217,7 @@ msgstr "" "در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " "آن‌ها به‌طور دستی پیاده‌سازی شوند." -#: src/std-traits/operators.md:3 +#: src/std-traits/operators.md msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." "rust-lang.org/std/ops/index.html):" @@ -7296,22 +7225,22 @@ msgstr "" "بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." "org/std/ops/index.html) پیاده‌سازی شده است:" -#: src/std-traits/operators.md:23 +#: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" msgstr "\"{:?} + {:?} = {:?}\"" -#: src/std-traits/operators.md:30 src/memory-management/drop.md:48 +#: src/std-traits/operators.md src/memory-management/drop.md msgid "Discussion points:" msgstr "نکات بحث:" -#: src/std-traits/operators.md:32 +#: src/std-traits/operators.md msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" "می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " "مفید است؟" -#: src/std-traits/operators.md:33 +#: src/std-traits/operators.md msgid "" "Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " "the operator is not `Copy`, you should consider overloading the operator for " @@ -7321,7 +7250,7 @@ msgstr "" "بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " "بگیرید. این کار از ایجاد کپی‌های غیرضروری در محل فراخوانی جلوگیری می‌کند." -#: src/std-traits/operators.md:36 +#: src/std-traits/operators.md msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" @@ -7329,7 +7258,7 @@ msgstr "" "چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " "متد تعریف کرد؟" -#: src/std-traits/operators.md:38 +#: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " "associated types (like `Output`) are controlled by the implementer of a " @@ -7338,7 +7267,7 @@ msgstr "" "پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " "تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." -#: src/std-traits/operators.md:41 +#: src/std-traits/operators.md msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." @@ -7346,21 +7275,31 @@ msgstr "" "شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." -#: src/std-traits/from-and-into.md:3 +#: src/std-traits/operators.md +msgid "" +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." +msgstr "" + +#: src/std-traits/from-and-into.md +#, fuzzy msgid "" "Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." "html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions:" +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" "تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." "From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " "را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" -#: src/std-traits/from-and-into.md:11 src/std-traits/from-and-into.md:23 +#: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" msgstr "\"{s}, {addr}, {one}, {bigger}\"" -#: src/std-traits/from-and-into.md:15 +#: src/std-traits/from-and-into.md msgid "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " "automatically implemented when [`From`](https://doc.rust-lang.org/std/" @@ -7370,7 +7309,7 @@ msgstr "" "زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" "trait.From.html) پیاده‌سازی شده باشد:" -#: src/std-traits/from-and-into.md:30 +#: src/std-traits/from-and-into.md msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." @@ -7378,7 +7317,7 @@ msgstr "" "به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " "پیاده‌سازی `Into` را نیز دریافت می‌کند." -#: src/std-traits/from-and-into.md:32 +#: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " "converted into a `String`\", the rule is opposite, you should use `Into`. " @@ -7390,7 +7329,7 @@ msgstr "" "قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " "پیاده‌سازی کرده‌اند." -#: src/std-traits/casting.md:3 +#: src/std-traits/casting.md msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." @@ -7398,19 +7337,19 @@ msgstr "" "Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " "می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." -#: src/std-traits/casting.md:9 +#: src/std-traits/casting.md msgid "\"as u16: {}\"" msgstr "\"as u16: {}\"" -#: src/std-traits/casting.md:10 +#: src/std-traits/casting.md msgid "\"as i16: {}\"" msgstr "\"as i16: {}\"" -#: src/std-traits/casting.md:11 +#: src/std-traits/casting.md msgid "\"as u8: {}\"" msgstr "\"as u8: {}\"" -#: src/std-traits/casting.md:15 +#: src/std-traits/casting.md msgid "" "The results of `as` are _always_ defined in Rust and consistent across " "platforms. This might not match your intuition for changing sign or casting " @@ -7420,7 +7359,7 @@ msgstr "" "هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " "مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." -#: src/std-traits/casting.md:19 +#: src/std-traits/casting.md msgid "" "Casting with `as` is a relatively sharp tool that is easy to use " "incorrectly, and can be a source of subtle bugs as future maintenance work " @@ -7436,7 +7375,7 @@ msgstr "" "باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " "بیت‌های بالا وجود دارد)." -#: src/std-traits/casting.md:25 +#: src/std-traits/casting.md msgid "" "For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " "over `as` to confirm that the cast is in fact infallible. For fallible " @@ -7449,11 +7388,11 @@ msgstr "" "می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " "کنید." -#: src/std-traits/casting.md:33 +#: src/std-traits/casting.md msgid "Consider taking a break after this slide." msgstr "در نظر داشته باشید که پس از این اسلاید استراحت کنید." -#: src/std-traits/casting.md:35 +#: src/std-traits/casting.md msgid "" "`as` is similar to a C++ static cast. Use of `as` in cases where data might " "be lost is generally discouraged, or at least deserves an explanatory " @@ -7463,13 +7402,13 @@ msgstr "" "است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " "دارد." -#: src/std-traits/casting.md:38 +#: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" "این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " "است." -#: src/std-traits/read-and-write.md:3 +#: src/std-traits/read-and-write.md msgid "" "Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " @@ -7479,19 +7418,19 @@ msgstr "" "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " "بر روی منابع `u8` انتزاع کنید:" -#: src/std-traits/read-and-write.md:14 +#: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" msgstr "b\"foo\\nbar\\nbaz\\n\"" -#: src/std-traits/read-and-write.md:15 +#: src/std-traits/read-and-write.md msgid "\"lines in slice: {}\"" msgstr "\"lines in slice: {}\"" -#: src/std-traits/read-and-write.md:18 +#: src/std-traits/read-and-write.md msgid "\"lines in file: {}\"" msgstr "\"lines in file: {}\"" -#: src/std-traits/read-and-write.md:23 +#: src/std-traits/read-and-write.md msgid "" "Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " "you abstract over `u8` sinks:" @@ -7499,19 +7438,19 @@ msgstr "" "به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " "به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" -#: src/std-traits/read-and-write.md:30 +#: src/std-traits/read-and-write.md msgid "\"\\n\"" msgstr "\"\\n\"" -#: src/std-traits/read-and-write.md:37 +#: src/std-traits/read-and-write.md msgid "\"Logged: {:?}\"" msgstr "\"Logged: {:?}\"" -#: src/std-traits/default.md:1 +#: src/std-traits/default.md msgid "The `Default` Trait" msgstr "The `Default` Trait" -#: src/std-traits/default.md:3 +#: src/std-traits/default.md msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." @@ -7519,35 +7458,35 @@ msgstr "" "ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " "یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." -#: src/std-traits/default.md:18 +#: src/std-traits/default.md msgid "\"John Smith\"" msgstr "\"John Smith\"" -#: src/std-traits/default.md:24 +#: src/std-traits/default.md msgid "\"{default_struct:#?}\"" msgstr "\"{default_struct:#?}\"" -#: src/std-traits/default.md:27 +#: src/std-traits/default.md msgid "\"Y is set!\"" msgstr "\"Y is set!\"" -#: src/std-traits/default.md:28 +#: src/std-traits/default.md msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md:31 src/lifetimes/exercise.md:197 -#: src/lifetimes/solution.md:196 +#: src/std-traits/default.md src/lifetimes/exercise.md +#: src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" -#: src/std-traits/default.md:38 +#: src/std-traits/default.md msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" "این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق " "`[derive(Default)]#` به صورت خودکار تولید شود." -#: src/std-traits/default.md:39 +#: src/std-traits/default.md msgid "" "A derived implementation will produce a value where all fields are set to " "their default values." @@ -7555,13 +7494,13 @@ msgstr "" "یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " "پیش‌فرض خود تنظیم شده‌اند." -#: src/std-traits/default.md:41 +#: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" "این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " "پیاده‌سازی کنند." -#: src/std-traits/default.md:42 +#: src/std-traits/default.md msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." @@ -7569,11 +7508,11 @@ msgstr "" "نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " "(مثل `0`، `\"\"` و غیره)." -#: src/std-traits/default.md:44 +#: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." msgstr "مقداردهی جزئی ساختارها با `Default` به خوبی کار می‌کند." -#: src/std-traits/default.md:45 +#: src/std-traits/default.md msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." @@ -7581,7 +7520,7 @@ msgstr "" "کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " "پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." -#: src/std-traits/default.md:47 +#: src/std-traits/default.md msgid "" "The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" "book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" @@ -7591,7 +7530,7 @@ msgstr "" "ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" "struct-update-syntax) شناخته می‌شود." -#: src/std-traits/closures.md:3 +#: src/std-traits/closures.md msgid "" "Closures or lambda expressions have types which cannot be named. However, " "they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." @@ -7604,49 +7543,57 @@ msgstr "" "html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " "هستند:" -#: src/std-traits/closures.md:10 -msgid "\"Calling function on {input}\"" +#: src/std-traits/closures.md +#, fuzzy +msgid "\"Calling {func_name}({input}): {}\"" msgstr "\"Calling function on {input}\"" -#: src/std-traits/closures.md:16 src/std-traits/closures.md:17 -msgid "\"add_3: {}\"" +#: src/std-traits/closures.md +#, fuzzy +msgid "\"add_3\"" msgstr "\"add_3: {}\"" -#: src/std-traits/closures.md:24 src/std-traits/closures.md:25 -msgid "\"accumulate: {}\"" +#: src/std-traits/closures.md +#, fuzzy +msgid "\"accumulate\"" msgstr "\"accumulate: {}\"" -#: src/std-traits/closures.md:28 -msgid "\"multiply_sum: {}\"" +#: src/std-traits/closures.md +#, fuzzy +msgid "\"multiply_sum\"" msgstr "\"multiply_sum: {}\"" -#: src/std-traits/closures.md:35 +#: src/std-traits/closures.md +#, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values, or " -"perhaps captures nothing at all. It can be called multiple times " -"concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " +"be called needing only a shared reference to the closure, which means the " +"closure can be executed repeatedly and even concurrently." msgstr "" "یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " "تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " "چندین بار فراخوانی شود." -#: src/std-traits/closures.md:38 +#: src/std-traits/closures.md +#, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " -"multiple times, but not concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." msgstr "" "یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " "شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." -#: src/std-traits/closures.md:41 +#: src/std-traits/closures.md +#, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " -"might consume captured values." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " +"Doing so consumes the closure and any values captured by move." msgstr "" "اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " "یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." -#: src/std-traits/closures.md:44 +#: src/std-traits/closures.md msgid "" "`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " "I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " @@ -7657,7 +7604,7 @@ msgstr "" "است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " "کنید." -#: src/std-traits/closures.md:48 +#: src/std-traits/closures.md msgid "" "When you define a function that takes a closure, you should take `FnOnce` if " "you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " @@ -7668,46 +7615,48 @@ msgstr "" "می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " "انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." -#: src/std-traits/closures.md:52 +#: src/std-traits/closures.md +#, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." msgstr "" "در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " "باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " "`FnOnce`." -#: src/std-traits/closures.md:55 +#: src/std-traits/closures.md +#, fuzzy msgid "" "The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " -"`multiply_sum`), depending on what the closure captures." +"`multiply_sum`), depending on what the closure captures. Function pointers " +"(references to `fn` items) implement `Copy` and `Fn`." msgstr "" "کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال " "`multiply_sum`) را بر اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." -#: src/std-traits/closures.md:58 +#: src/std-traits/closures.md msgid "" -"By default, closures will capture by reference if they can. The `move` " -"keyword makes them capture by value." +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." msgstr "" -"به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " -"می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " -"value) بگیرند." -#: src/std-traits/closures.md:63 src/smart-pointers/trait-objects.md:93 -#: src/smart-pointers/trait-objects.md:94 +#: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" msgstr "\"{} {}\"" -#: src/std-traits/closures.md:67 +#: src/std-traits/closures.md msgid "\"Hi\"" msgstr "\"Hi\"" -#: src/std-traits/closures.md:68 +#: src/std-traits/closures.md msgid "\"Greg\"" msgstr "\"Greg\"" -#: src/std-traits/exercise.md:3 +#: src/std-traits/exercise.md msgid "" "In this example, you will implement the classic [\"ROT13\" cipher](https://" "en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " @@ -7719,20 +7668,19 @@ msgstr "" "کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " "تا نتیجه همچنان UTF-8 معتبر باقی بماند." -#: src/std-traits/exercise.md:15 +#: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" msgstr "// Implement the `Read` trait for `RotDecoder`.\n" -#: src/std-traits/exercise.md:20 src/std-traits/exercise.md:33 -#: src/std-traits/solution.md:26 src/std-traits/solution.md:39 +#: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"Gb trg gb gur bgure fvqr!\"" msgstr "\"Gb trg gb gur bgure fvqr!\"" -#: src/std-traits/exercise.md:36 src/std-traits/solution.md:42 +#: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"To get to the other side!\"" msgstr "\"To get to the other side!\"" -#: src/std-traits/exercise.md:55 +#: src/std-traits/exercise.md msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" @@ -7740,7 +7688,7 @@ msgstr "" "چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " "۱۳ کاراکتر را بچرخانند؟" -#: src/std-traits/solution.md:16 +#: src/std-traits/solution.md msgid "'A'" msgstr "'A'" @@ -7772,7 +7720,7 @@ msgstr "" "با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " "بکشد. این جلسه شامل:" -#: src/memory-management.md src/memory-management/clone.md:1 +#: src/memory-management.md src/memory-management/clone.md msgid "Clone" msgstr "Clone" @@ -7780,49 +7728,49 @@ msgstr "Clone" msgid "Drop" msgstr "Drop" -#: src/memory-management/review.md:3 +#: src/memory-management/review.md msgid "Programs allocate memory in two ways:" msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌دهند:" -#: src/memory-management/review.md:5 +#: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "" "Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " "می‌شود." -#: src/memory-management/review.md:6 +#: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." msgstr "مقادیر دارای اندازه‌های ثابتی هستند که در زمان کامپایل شناخته می‌شوند." -#: src/memory-management/review.md:7 +#: src/memory-management/review.md msgid "Extremely fast: just move a stack pointer." msgstr "بسیار سریع: فقط یک اشاره‌گر stack را جابجا کنید." -#: src/memory-management/review.md:8 +#: src/memory-management/review.md msgid "Easy to manage: follows function calls." msgstr "مدیریت آسان: پیرو فراخوانی‌های تابع است." -#: src/memory-management/review.md:9 +#: src/memory-management/review.md msgid "Great memory locality." msgstr "بهره‌وری عالی از حافظه" -#: src/memory-management/review.md:11 +#: src/memory-management/review.md msgid "Heap: Storage of values outside of function calls." msgstr "Heap: ذخیره‌سازی مقادیر خارج از فراخوانی‌های تابع." -#: src/memory-management/review.md:12 +#: src/memory-management/review.md msgid "Values have dynamic sizes determined at runtime." msgstr "مقادیر دارای اندازه‌های پویا هستند که در زمان اجرا تعیین می‌شوند." -#: src/memory-management/review.md:13 +#: src/memory-management/review.md msgid "Slightly slower than the stack: some book-keeping needed." msgstr "کمی کندتر از stack: نیاز به برخی از عملیات‌های مدیریتی دارد." -#: src/memory-management/review.md:14 +#: src/memory-management/review.md msgid "No guarantee of memory locality." msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه ندارد" -#: src/memory-management/review.md:18 +#: src/memory-management/review.md msgid "" "Creating a `String` puts fixed-sized metadata on the stack and dynamically " "sized data, the actual string, on the heap:" @@ -7830,7 +7778,7 @@ msgstr "" "ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " "پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" -#: src/memory-management/review.md:44 +#: src/memory-management/review.md 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." @@ -7839,7 +7787,7 @@ msgstr "" "طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " "کند." -#: src/memory-management/review.md:47 +#: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " "allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" @@ -7852,7 +7800,7 @@ msgstr "" "استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " "پیاده‌سازی شوند" -#: src/memory-management/review.md:53 +#: src/memory-management/review.md msgid "" "We can inspect the memory layout with `unsafe` Rust. However, you should " "point out that this is rightfully unsafe!" @@ -7860,15 +7808,15 @@ msgstr "" "می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " "با این حال، باید اشاره کنید که این کار به درستی ناامن است!" -#: src/memory-management/review.md:59 src/testing/unit-tests.md:15 +#: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" msgstr "' '" -#: src/memory-management/review.md:60 +#: src/memory-management/review.md msgid "\"world\"" msgstr "\"دنیا\"" -#: src/memory-management/review.md:61 +#: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" " // String provides no guarantees about its layout, so this could lead " @@ -7880,34 +7828,34 @@ msgstr "" "to\n" " // undefined behavior.\n" -#: src/memory-management/review.md:66 +#: src/memory-management/review.md msgid "\"capacity = {capacity}, ptr = {ptr:#x}, len = {len}\"" msgstr "\"capacity = {capacity}, ptr = {ptr:#x}, len = {len}\"" -#: src/memory-management/approaches.md:3 +#: src/memory-management/approaches.md msgid "Traditionally, languages have fallen into two broad categories:" msgstr "به طور سنتی، زبان‌ها به دو دسته گسترده تقسیم شده‌اند:" -#: src/memory-management/approaches.md:5 +#: src/memory-management/approaches.md msgid "Full control via manual memory management: C, C++, Pascal, ..." msgstr "کنترل کامل از طریق مدیریت دستی حافظه: C++، C، پاسکال، ..." -#: src/memory-management/approaches.md:6 +#: src/memory-management/approaches.md msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." -#: src/memory-management/approaches.md:7 +#: src/memory-management/approaches.md msgid "" "Programmer must determine whether a pointer still points to valid memory." msgstr "" "برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " "یا نه." -#: src/memory-management/approaches.md:8 +#: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." msgstr "مطالعات نشان می‌دهد که برنامه‌نویسان اشتباهاتی مرتکب می‌شوند." -#: src/memory-management/approaches.md:9 +#: src/memory-management/approaches.md msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." @@ -7915,7 +7863,7 @@ msgstr "" "ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " "هسکل، ..." -#: src/memory-management/approaches.md:11 +#: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." @@ -7923,27 +7871,27 @@ msgstr "" "یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " "ارجاع داده شود، آزاد نمی‌شود." -#: src/memory-management/approaches.md:13 -msgid "" -"Typically implemented with reference counting, garbage collection, or RAII." +#: src/memory-management/approaches.md +#, fuzzy +msgid "Typically implemented with reference counting or garbage collection." msgstr "" "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." -#: src/memory-management/approaches.md:15 +#: src/memory-management/approaches.md msgid "Rust offers a new mix:" msgstr "Rust یک ترکیب جدید ارائه می‌دهد:" -#: src/memory-management/approaches.md:17 +#: src/memory-management/approaches.md msgid "" "Full control _and_ safety via compile time enforcement of correct memory " "management." msgstr "کنترل کامل و ایمنی از طریق اجرای صحیح مدیریت حافظه در زمان کامپایل." -#: src/memory-management/approaches.md:20 +#: src/memory-management/approaches.md msgid "It does this with an explicit ownership concept." msgstr "این کار را با استفاده از مفهوم مالکیت صریح انجام می‌دهد." -#: src/memory-management/approaches.md:25 +#: src/memory-management/approaches.md msgid "" "This slide is intended to help students coming from other languages to put " "Rust in context." @@ -7951,7 +7899,7 @@ msgstr "" "این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " "را در زمینه مناسب قرار دهند." -#: src/memory-management/approaches.md:28 +#: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " "forgetting to call `free`, calling it multiple times for the same pointer, " @@ -7962,7 +7910,7 @@ msgstr "" "اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " "اشاره می‌کند." -#: src/memory-management/approaches.md:32 +#: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " "advantage of language guarantees about calling destructors to ensure memory " @@ -7975,7 +7923,7 @@ msgstr "" "بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " "ایجاد کرد." -#: src/memory-management/approaches.md:37 +#: src/memory-management/approaches.md msgid "" "Java, Go, and Python rely on the garbage collector to identify memory that " "is no longer reachable and discard it. This guarantees that any pointer can " @@ -7988,7 +7936,7 @@ msgstr "" "آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " "در زمان اجرا دارد و تنظیم مناسب آن دشوار است." -#: src/memory-management/approaches.md:42 +#: src/memory-management/approaches.md msgid "" "Rust's ownership and borrowing model can, in many cases, get the performance " "of C, with alloc and free operations precisely where they are required -- " @@ -8004,7 +7952,7 @@ msgstr "" "دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " "اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." -#: src/memory-management/ownership.md:3 +#: src/memory-management/ownership.md msgid "" "All variable bindings have a _scope_ where they are valid and it is an error " "to use a variable outside its scope:" @@ -8012,7 +7960,7 @@ msgstr "" "تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " "از متغیر خارج از دامنه‌اش یک خطاست:" -#: src/memory-management/ownership.md:20 +#: src/memory-management/ownership.md msgid "" "We say that the variable _owns_ the value. Every Rust value has precisely " "one owner at all times." @@ -8020,7 +7968,7 @@ msgstr "" "می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " "دارد." -#: src/memory-management/ownership.md:23 +#: src/memory-management/ownership.md msgid "" "At the end of the scope, the variable is _dropped_ and the data is freed. A " "destructor can run here to free up resources." @@ -8028,7 +7976,7 @@ msgstr "" "در پایان دامنه، متغیر **حذف** می‌شود و داده‌ها آزاد می‌شوند. یک ویرایشگر " "(destructor) می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." -#: src/memory-management/ownership.md:29 +#: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " "garbage collector starts with a set of \"roots\" to find all reachable " @@ -8038,41 +7986,41 @@ msgstr "" "جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " "دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." -#: src/memory-management/move.md:3 +#: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" msgstr "انتساب, *مالکیت* را بین متغیرها منتقل می‌کند:" -#: src/memory-management/move.md:7 +#: src/memory-management/move.md src/concurrency/async-control-flow/select.md msgid "\"Hello!\"" msgstr "\"سلام!\"" -#: src/memory-management/move.md:10 +#: src/memory-management/move.md msgid "// println!(\"s1: {s1}\");\n" msgstr "// println!(\"s1: {s1}\");\n" -#: src/memory-management/move.md:14 +#: src/memory-management/move.md msgid "The assignment of `s1` to `s2` transfers ownership." msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." -#: src/memory-management/move.md:15 +#: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" "زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " "نیست." -#: src/memory-management/move.md:16 +#: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." msgstr "زمانی که دیگر در اسکوپ `s2` نیستیم, داده‌های رشته آزاد می‌شوند." -#: src/memory-management/move.md:18 +#: src/memory-management/move.md msgid "Before move to `s2`:" msgstr "قبل از انتقال به `s2` :" -#: src/memory-management/move.md:35 +#: src/memory-management/move.md msgid "After move to `s2`:" msgstr "بعد از انتقال به `s2` :" -#: src/memory-management/move.md:37 +#: src/memory-management/move.md msgid "" "```bob\n" " Stack Heap\n" @@ -8096,7 +8044,7 @@ msgid "" "```" msgstr "" -#: src/memory-management/move.md:58 +#: src/memory-management/move.md msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" @@ -8104,20 +8052,20 @@ msgstr "" "هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " "داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" -#: src/memory-management/move.md:63 src/memory-management/clone.md:8 +#: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" msgstr "\"سلام {name}\"" -#: src/memory-management/move.md:67 src/memory-management/clone.md:12 -#: src/android/interoperability/java.md:57 +#: src/memory-management/move.md src/memory-management/clone.md +#: src/android/interoperability/java.md msgid "\"Alice\"" msgstr "\"الیس\"" -#: src/memory-management/move.md:69 +#: src/memory-management/move.md msgid "// say_hello(name);\n" msgstr "// say_hello(name);\n" -#: src/memory-management/move.md:76 +#: src/memory-management/move.md 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!)." @@ -8126,7 +8074,7 @@ msgstr "" "است که در ان مقدار کپی میشود مگر که از `std::move` " "استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" -#: src/memory-management/move.md:79 +#: src/memory-management/move.md msgid "" "It is only the ownership that moves. Whether any machine code is generated " "to manipulate the data itself is a matter of optimization, and such copies " @@ -8136,22 +8084,22 @@ msgstr "" "خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " "به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." -#: src/memory-management/move.md:83 +#: src/memory-management/move.md msgid "" "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" "مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " "ببینید)." -#: src/memory-management/move.md:85 +#: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." msgstr "در Rust، کلون‌ها واضح بیان می‌شوند (با استفاده از `clone`)." -#: src/memory-management/move.md:87 +#: src/memory-management/move.md msgid "In the `say_hello` example:" msgstr "در مثال `say_hello`:" -#: src/memory-management/move.md:89 +#: src/memory-management/move.md msgid "" "With the first call to `say_hello`, `main` gives up ownership of `name`. " "Afterwards, `name` cannot be used anymore within `main`." @@ -8159,7 +8107,7 @@ msgstr "" "با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " "از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." -#: src/memory-management/move.md:91 +#: src/memory-management/move.md msgid "" "The heap memory allocated for `name` will be freed at the end of the " "`say_hello` function." @@ -8167,7 +8115,7 @@ msgstr "" "حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " "خواهد شد." -#: src/memory-management/move.md:93 +#: src/memory-management/move.md msgid "" "`main` can retain ownership if it passes `name` as a reference (`&name`) and " "if `say_hello` accepts a reference as a parameter." @@ -8176,7 +8124,7 @@ msgstr "" "(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " "را به عنوان پارامتر باید بپذیرد." -#: src/memory-management/move.md:95 +#: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." @@ -8184,7 +8132,7 @@ msgstr "" "به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " "تابع ای که در نظر داریم (`name.clone()`) منتقل کند." -#: src/memory-management/move.md:97 +#: src/memory-management/move.md 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." @@ -8193,44 +8141,44 @@ msgstr "" "زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " "هر جا که لازم هست به صورت صریح کلون را ایجاد کند." -#: src/memory-management/move.md:102 +#: src/memory-management/move.md msgid "Defensive Copies in Modern C++" msgstr "کپی‌های تدافعی در C++ مدرن" -#: src/memory-management/move.md:104 +#: src/memory-management/move.md msgid "Modern C++ solves this differently:" msgstr "C++ مدرن این مشکل را به شیوه متفاوتی حل می‌کند:" -#: src/memory-management/move.md:107 +#: src/memory-management/move.md msgid "\"Cpp\"" msgstr "\"Cpp\"" -#: src/memory-management/move.md:108 +#: src/memory-management/move.md msgid "// Duplicate the data in s1.\n" msgstr "// Duplicate the data in s1.\n" -#: src/memory-management/move.md:111 +#: src/memory-management/move.md msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" "داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " "این کپی به صورت مستقل است." -#: src/memory-management/move.md:112 +#: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" "حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " "جداگانه‌ای حافظه خود را آزاد میکنند." -#: src/memory-management/move.md:114 +#: src/memory-management/move.md msgid "Before copy-assignment:" msgstr "قبل از انتساب همراه کپی:" -#: src/memory-management/move.md:130 +#: src/memory-management/move.md msgid "After copy-assignment:" msgstr "بعد از انتساب همراه کپی:" -#: src/memory-management/move.md:155 +#: src/memory-management/move.md msgid "" "C++ has made a slightly different choice than Rust. Because `=` copies data, " "the string data has to be cloned. Otherwise we would get a double-free when " @@ -8241,7 +8189,7 @@ msgstr "" "این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " "آزادسازی مجدد حافظه رخ دهد." -#: src/memory-management/move.md:159 +#: src/memory-management/move.md msgid "" "C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " "which is used to indicate when a value may be moved from. If the example had " @@ -8256,7 +8204,7 @@ msgstr "" "نامشخص قرار میگرفت و برخلاف زبان Rust, توی زبان C++ " "برنامه‌نویس مجاز است که دوباره از `s1` استفاده کند." -#: src/memory-management/move.md:164 +#: src/memory-management/move.md msgid "" "Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " "which is being copied or moved." @@ -8264,7 +8212,7 @@ msgstr "" "بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " "انتقال دادن استفاده شود." -#: src/memory-management/clone.md:3 +#: src/memory-management/clone.md msgid "" "Sometimes you _want_ to make a copy of a value. The `Clone` trait " "accomplishes this." @@ -8272,7 +8220,7 @@ msgstr "" "گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " "انجام می‌دهد." -#: src/memory-management/clone.md:21 +#: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " "occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." @@ -8280,7 +8228,7 @@ msgstr "" "ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " "دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." -#: src/memory-management/clone.md:24 +#: src/memory-management/clone.md msgid "" "It's common to \"clone your way out\" of problems with the borrow checker, " "and return later to try to optimize those clones away." @@ -8288,7 +8236,7 @@ msgstr "" "معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " "کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." -#: src/memory-management/clone.md:27 +#: src/memory-management/clone.md msgid "" "`clone` generally performs a deep copy of the value, meaning that if you e." "g. clone an array, all of the elements of the array are cloned as well." @@ -8296,7 +8244,7 @@ msgstr "" "`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " "عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." -#: src/memory-management/clone.md:30 +#: src/memory-management/clone.md msgid "" "The behavior for `clone` is user-defined, so it can perform custom cloning " "logic if needed." @@ -8304,36 +8252,36 @@ msgstr "" "رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " "کپی‌برداری سفارشی را اجرا کند." -#: src/memory-management/copy-types.md:3 +#: src/memory-management/copy-types.md msgid "" "While move semantics are the default, certain types are copied by default:" msgstr "" "در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " "صورت پیش‌فرض کپی می‌شوند:" -#: src/memory-management/copy-types.md:16 +#: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." msgstr "این انواع‌داده ویژگی `Copy` را پیاده‌سازی کرده‌اند." -#: src/memory-management/copy-types.md:18 +#: src/memory-management/copy-types.md msgid "You can opt-in your own types to use copy semantics:" msgstr "البته که میتوان برای نوع‌هایی که میسازید هم مفهوم کپی را داشته باشید:" -#: src/memory-management/copy-types.md:34 +#: src/memory-management/copy-types.md msgid "After the assignment, both `p1` and `p2` own their own data." msgstr "پس از انتساب، هر دو `p1` و `p2` داده‌های خود مستقل خود را دارند." -#: src/memory-management/copy-types.md:35 +#: src/memory-management/copy-types.md msgid "We can also use `p1.clone()` to explicitly copy the data." msgstr "" "همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها " "استفاده کنیم." -#: src/memory-management/copy-types.md:40 +#: src/memory-management/copy-types.md msgid "Copying and cloning are not the same thing:" msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" -#: src/memory-management/copy-types.md:42 +#: src/memory-management/copy-types.md msgid "" "Copying refers to bitwise copies of memory regions and does not work on " "arbitrary objects." @@ -8341,14 +8289,14 @@ msgstr "" "کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " "تعریف شده توسط شما کار نمی‌کند." -#: src/memory-management/copy-types.md:44 +#: src/memory-management/copy-types.md msgid "" "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." -#: src/memory-management/copy-types.md:45 +#: src/memory-management/copy-types.md msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." @@ -8356,16 +8304,16 @@ msgstr "" "کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " "رفتار سفارشی را فراهم می‌کند." -#: src/memory-management/copy-types.md:47 +#: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." msgstr "" "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." -#: src/memory-management/copy-types.md:49 +#: src/memory-management/copy-types.md msgid "In the above example, try the following:" msgstr "در مثال بالا، موارد زیر را امتحان کنید:" -#: src/memory-management/copy-types.md:51 +#: src/memory-management/copy-types.md msgid "" "Add a `String` field to `struct Point`. It will not compile because `String` " "is not a `Copy` type." @@ -8373,7 +8321,7 @@ msgstr "" "یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " "یک نوع `Copy` نیست." -#: src/memory-management/copy-types.md:53 +#: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." @@ -8381,11 +8329,11 @@ msgstr "" "ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " "برای `p1` قرار دارد." -#: src/memory-management/copy-types.md:55 +#: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون کنید، کار می‌کند." -#: src/memory-management/copy-types.md:59 +#: src/memory-management/copy-types.md msgid "" "Shared references are `Copy`/`Clone`, mutable references are not. This is " "because rust requires that mutable references be exclusive, so while it's " @@ -8398,11 +8346,11 @@ msgstr "" "که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " "قوانین قرض‌گیری Rust را نقض می‌کند." -#: src/memory-management/drop.md:1 +#: src/memory-management/drop.md msgid "The `Drop` Trait" msgstr "ویژگی `Drop`" -#: src/memory-management/drop.md:3 +#: src/memory-management/drop.md msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" @@ -8411,50 +8359,49 @@ msgstr "" "را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " "شود:" -#: src/memory-management/drop.md:13 +#: src/memory-management/drop.md msgid "\"Dropping {}\"" msgstr "\"Dropping {}\"" -#: src/memory-management/drop.md:18 -#: src/concurrency/sync-exercises/link-checker.md:85 -#: src/concurrency/sync-exercises/solutions.md:121 +#: src/memory-management/drop.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"a\"" msgstr "\"a\"" -#: src/memory-management/drop.md:20 src/android/testing/googletest.md:12 +#: src/memory-management/drop.md src/android/testing/googletest.md msgid "\"b\"" msgstr "\"a\"" -#: src/memory-management/drop.md:22 +#: src/memory-management/drop.md msgid "\"c\"" msgstr "\"a\"" -#: src/memory-management/drop.md:23 +#: src/memory-management/drop.md msgid "\"d\"" msgstr "\"a\"" -#: src/memory-management/drop.md:24 +#: src/memory-management/drop.md msgid "\"Exiting block B\"" msgstr "\"Exiting block B\"" -#: src/memory-management/drop.md:26 +#: src/memory-management/drop.md msgid "\"Exiting block A\"" msgstr "\"Exiting block A\"" -#: src/memory-management/drop.md:29 +#: src/memory-management/drop.md msgid "\"Exiting main\"" msgstr "\"Exiting main\"" -#: src/memory-management/drop.md:36 +#: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." msgstr "" "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." -#: src/memory-management/drop.md:37 +#: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." msgstr "مقادیر به طور خودکار زمانی که از دامنه خارج می‌شوند، حذف می‌شوند." -#: src/memory-management/drop.md:38 +#: src/memory-management/drop.md msgid "" "When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" "drop` implementation will be called." @@ -8462,14 +8409,14 @@ msgstr "" "زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " "پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." -#: src/memory-management/drop.md:40 +#: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" "تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " "کرده باشد یا نه." -#: src/memory-management/drop.md:41 +#: src/memory-management/drop.md msgid "" "`std::mem::drop` is just an empty function that takes any value. The " "significance is that it takes ownership of the value, so at the end of its " @@ -8481,7 +8428,7 @@ msgstr "" "این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " "دامنه خارج می‌شوند، تبدیل می‌کند." -#: src/memory-management/drop.md:45 +#: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." @@ -8489,11 +8436,11 @@ msgstr "" "این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " "کردن قفل‌ها، بستن فایل‌ها و غیره." -#: src/memory-management/drop.md:50 +#: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" msgstr "چرا `Drop::drop` `self` را نمی‌گیرد؟" -#: src/memory-management/drop.md:51 +#: src/memory-management/drop.md msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" @@ -8502,11 +8449,11 @@ msgstr "" "منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " "می‌شد!" -#: src/memory-management/drop.md:53 +#: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." -#: src/memory-management/exercise.md:3 +#: src/memory-management/exercise.md msgid "" "In this example, we will implement a complex data type that owns all of its " "data. We will use the \"builder pattern\" to support building a new value " @@ -8516,102 +8463,102 @@ msgstr "" "داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " "به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." -#: src/memory-management/exercise.md:7 +#: src/memory-management/exercise.md msgid "Fill in the missing pieces." msgstr "جا‌های خالی را پر کنید." -#: src/memory-management/exercise.md:22 src/memory-management/solution.md:16 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// A representation of a software package.\n" msgstr "" -#: src/memory-management/exercise.md:34 src/memory-management/solution.md:28 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "" "/// Return a representation of this package as a dependency, for use in\n" " /// building other packages.\n" msgstr "" -#: src/memory-management/exercise.md:37 +#: src/memory-management/exercise.md msgid "\"1\"" msgstr "" -#: src/memory-management/exercise.md:40 src/memory-management/solution.md:37 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" -#: src/memory-management/exercise.md:46 +#: src/memory-management/exercise.md msgid "\"2\"" msgstr "" -#: src/memory-management/exercise.md:49 src/memory-management/solution.md:52 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the package version.\n" msgstr "" -#: src/memory-management/exercise.md:55 src/memory-management/solution.md:58 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the package authors.\n" msgstr "" -#: src/memory-management/exercise.md:57 +#: src/memory-management/exercise.md msgid "\"3\"" msgstr "" -#: src/memory-management/exercise.md:60 src/memory-management/solution.md:64 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Add an additional dependency.\n" msgstr "" -#: src/memory-management/exercise.md:62 +#: src/memory-management/exercise.md msgid "\"4\"" msgstr "" -#: src/memory-management/exercise.md:65 src/memory-management/solution.md:70 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the language. If not set, language defaults to None.\n" msgstr "" -#: src/memory-management/exercise.md:67 +#: src/memory-management/exercise.md msgid "\"5\"" msgstr "" -#: src/memory-management/exercise.md:76 src/memory-management/solution.md:82 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64\"" msgstr "" -#: src/memory-management/exercise.md:76 src/memory-management/solution.md:82 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.13\"" msgstr "" -#: src/memory-management/exercise.md:77 src/memory-management/solution.md:83 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64: {base64:?}\"" msgstr "" -#: src/memory-management/exercise.md:79 src/memory-management/solution.md:85 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log\"" msgstr "" -#: src/memory-management/exercise.md:79 src/memory-management/solution.md:85 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.4\"" msgstr "" -#: src/memory-management/exercise.md:80 src/memory-management/solution.md:86 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log: {log:?}\"" msgstr "" -#: src/memory-management/exercise.md:81 src/memory-management/solution.md:87 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" msgstr "" -#: src/memory-management/exercise.md:82 src/memory-management/solution.md:88 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"djmitche\"" msgstr "" -#: src/memory-management/exercise.md:83 src/memory-management/solution.md:89 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"4.0\"" msgstr "" -#: src/memory-management/exercise.md:87 src/memory-management/solution.md:93 +#: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde: {serde:?}\"" msgstr "" -#: src/memory-management/solution.md:45 +#: src/memory-management/solution.md msgid "\"0.1\"" msgstr "" @@ -8623,7 +8570,7 @@ msgstr "Box" msgid "Rc" msgstr "Rc" -#: src/smart-pointers/box.md:3 +#: src/smart-pointers/box.md msgid "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " "pointer to data on the heap:" @@ -8631,11 +8578,11 @@ msgstr "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " "به داده‌های روی heap است:" -#: src/smart-pointers/box.md:9 +#: src/smart-pointers/box.md msgid "\"five: {}\"" msgstr "" -#: src/smart-pointers/box.md:26 +#: src/smart-pointers/box.md msgid "" "`Box` implements `Deref`, which means that you can [call " "methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" @@ -8645,26 +8592,28 @@ msgstr "" "می‌توانید [مستقیم روش‌های `T` را روی `>` has the same size, as just `Box`, because " "compiler uses NULL-value to discriminate variants instead of using explicit " @@ -8772,27 +8721,27 @@ msgstr "" "می‌کند ([\"بهینه‌سازی اشاره‌گر خالی\"](https://doc.rust-lang.org/std/option/" "#representation)):" -#: src/smart-pointers/box.md:103 +#: src/smart-pointers/box.md msgid "\"Just box\"" msgstr "\"Just box\"" -#: src/smart-pointers/box.md:105 +#: src/smart-pointers/box.md msgid "\"Optional box\"" msgstr "\"Optional box\"" -#: src/smart-pointers/box.md:111 +#: src/smart-pointers/box.md msgid "\"Size of just_box: {}\"" msgstr "\"Size of just_box: {}\"" -#: src/smart-pointers/box.md:112 +#: src/smart-pointers/box.md msgid "\"Size of optional_box: {}\"" msgstr "\"Size of optional_box: {}\"" -#: src/smart-pointers/box.md:113 +#: src/smart-pointers/box.md msgid "\"Size of none: {}\"" msgstr "\"Size of none: {}\"" -#: src/smart-pointers/rc.md:3 +#: src/smart-pointers/rc.md msgid "" "[`Rc`](https://doc.rust-lang.org/std/rc/struct.Rc.html) is a reference-" "counted shared pointer. Use this when you need to refer to the same data " @@ -8802,15 +8751,15 @@ msgstr "" "شمارش ارجاع است. از این هنگام استفاده کنید که نیاز دارید به داده‌های یکسان از " "مکان‌های متعدد اشاره کنید:" -#: src/smart-pointers/rc.md:13 +#: src/smart-pointers/rc.md msgid "\"a: {a}\"" msgstr "\"a: {a}\"" -#: src/smart-pointers/rc.md:14 +#: src/smart-pointers/rc.md msgid "\"b: {b}\"" msgstr "\"b: {b}\"" -#: src/smart-pointers/rc.md:18 +#: src/smart-pointers/rc.md msgid "" "See [`Arc`](../concurrency/shared-state/arc.md) and [`Mutex`](https://doc." "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " @@ -8820,7 +8769,7 @@ msgstr "" "shared-state/arc.md) و [`Mutex`](https://doc.rust-lang.org/std/sync/struct." "Mutex.html) نگاه کنید." -#: src/smart-pointers/rc.md:19 +#: src/smart-pointers/rc.md msgid "" "You can _downgrade_ a shared pointer into a [`Weak`](https://doc.rust-lang." "org/std/rc/struct.Weak.html) pointer to create cycles that will get dropped." @@ -8829,7 +8778,7 @@ msgstr "" "lang.org/std/rc/struct.Weak.html) تغییر دهید تا دوره‌هایی ایجاد کنید که در " "نهایت حذف خواهند شد." -#: src/smart-pointers/rc.md:30 +#: src/smart-pointers/rc.md msgid "" "`Rc`'s count ensures that its contained value is valid for as long as there " "are references." @@ -8837,11 +8786,11 @@ msgstr "" "شمارش `Rc` تضمین می‌کند که مقدار درون آن به مدت زمانی که ارجاع‌هایی وجود دارد، " "معتبر خواهد بود." -#: src/smart-pointers/rc.md:32 +#: src/smart-pointers/rc.md msgid "`Rc` in Rust is like `std::shared_ptr` in C++." msgstr "`Rc` در Rust مشابه `std::shared_ptr` در ++C است." -#: src/smart-pointers/rc.md:33 +#: src/smart-pointers/rc.md msgid "" "`Rc::clone` is cheap: it creates a pointer to the same allocation and " "increases the reference count. Does not make a deep clone and can generally " @@ -8852,19 +8801,19 @@ msgstr "" "نمی‌دهد و به طور کلی هنگام جستجو برای مسائل عملکردی در کد می‌توان آن را نادیده " "گرفت." -#: src/smart-pointers/rc.md:36 +#: src/smart-pointers/rc.md msgid "" "`make_mut` actually clones the inner value if necessary (\"clone-on-write\") " "and returns a mutable reference." msgstr "" -"`make_mut` در واقع در صورت نیاز مقدار درونی را کپی می‌کند (\"clone-on-" -"write\") و یک ارجاع قابل تغییر (mutable reference) برمی‌گرداند." +"`make_mut` در واقع در صورت نیاز مقدار درونی را کپی می‌کند (\"clone-on-write" +"\") و یک ارجاع قابل تغییر (mutable reference) برمی‌گرداند." -#: src/smart-pointers/rc.md:38 +#: src/smart-pointers/rc.md msgid "Use `Rc::strong_count` to check the reference count." msgstr "از `Rc::strong_count` برای بررسی شمارش ارجاع‌ها استفاده کنید." -#: src/smart-pointers/rc.md:39 +#: src/smart-pointers/rc.md msgid "" "`Rc::downgrade` gives you a _weakly reference-counted_ object to create " "cycles that will be dropped properly (likely in combination with `RefCell`)." @@ -8872,7 +8821,7 @@ msgstr "" "`Rc::downgrade` یک شیء _با شمارش ارجاع ضعیف_ به شما می‌دهد تا دوره‌هایی ایجاد " "کنید که به درستی حذف خواهند شد (احتمالاً به همراه `RefCell`)." -#: src/smart-pointers/trait-objects.md:3 +#: src/smart-pointers/trait-objects.md msgid "" "We previously saw how trait objects can be used with references, e.g `&dyn " "Pet`. However, we can also use trait objects with smart pointers like `Box` " @@ -8883,11 +8832,11 @@ msgstr "" "هوشمند مانند `Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait " "object) ایجاد کنیم: `| \"::" -"talk\" | :\n" +" : | `----->| \"::talk" +"\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk" +"\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -8947,7 +8896,7 @@ msgid "" "```" msgstr "" -#: src/smart-pointers/trait-objects.md:80 +#: src/smart-pointers/trait-objects.md msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." @@ -8956,7 +8905,7 @@ msgstr "" "باشند. این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " "method:" @@ -9362,25 +9331,23 @@ msgstr "" "کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " "کنید:" -#: src/borrowing/exercise.md:45 +#: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor" +"\"" msgstr "" -#: src/borrowing/exercise.md:50 src/borrowing/exercise.md:56 -#: src/borrowing/exercise.md:60 src/borrowing/solution.md:52 -#: src/borrowing/solution.md:58 src/borrowing/solution.md:62 -#: src/android/build-rules/library.md:44 -#: src/android/aidl/example-service/client.md:15 +#: src/borrowing/exercise.md src/borrowing/solution.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "" -#: src/borrowing/exercise.md:51 src/borrowing/solution.md:53 +#: src/borrowing/exercise.md src/borrowing/solution.md msgid "\"I'm {} and my age is {}\"" msgstr "" -#: src/lifetimes/lifetime-annotations.md:3 +#: src/lifetimes/lifetime-annotations.md msgid "" "A reference has a _lifetime_, which must not \"outlive\" the value it refers " "to. This is verified by the borrow checker." @@ -9388,7 +9355,7 @@ msgstr "" "یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " "موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." -#: src/lifetimes/lifetime-annotations.md:6 +#: src/lifetimes/lifetime-annotations.md msgid "" "The lifetime can be implicit - this is what we have seen so far. Lifetimes " "can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " @@ -9400,7 +9367,7 @@ msgstr "" "`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " "`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." -#: src/lifetimes/lifetime-annotations.md:11 +#: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes are always inferred by the compiler: you cannot assign a lifetime " "yourself. Explicit lifetime annotations create constraints where there is " @@ -9410,7 +9377,7 @@ msgstr "" "عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " "صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." -#: src/lifetimes/lifetime-annotations.md:15 +#: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes become more complicated when considering passing values to and " "returning values from functions." @@ -9418,15 +9385,15 @@ msgstr "" "طول عمرها وقتی که به عبور مقادیر به توابع و بازگشت مقادیر از توابع می‌پردازیم " "پیچیده‌تر می‌شوند." -#: src/lifetimes/lifetime-annotations.md:36 +#: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" msgstr "" -#: src/lifetimes/lifetime-annotations.md:37 +#: src/lifetimes/lifetime-annotations.md msgid "\"p3: {p3:?}\"" msgstr "" -#: src/lifetimes/lifetime-annotations.md:44 +#: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " "Looking inside the function body shows that it can only safely assume that " @@ -9439,11 +9406,11 @@ msgstr "" "`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " "طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." -#: src/lifetimes/lifetime-annotations.md:50 +#: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه کنید:" -#: src/lifetimes/lifetime-annotations.md:56 +#: src/lifetimes/lifetime-annotations.md msgid "" "This says, \"given p1 and p2 which both outlive `'a`, the return value lives " "for at least `'a`." @@ -9451,18 +9418,18 @@ msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " "می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" -#: src/lifetimes/lifetime-annotations.md:59 +#: src/lifetimes/lifetime-annotations.md msgid "" "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" "در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " "بعدی توضیح داده شده است." -#: src/lifetimes/lifetime-elision.md:1 +#: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" msgstr "طول عمر در فراخوانی‌ توابع" -#: src/lifetimes/lifetime-elision.md:3 +#: src/lifetimes/lifetime-elision.md msgid "" "Lifetimes for function arguments and return values must be fully specified, " "but Rust allows lifetimes to be elided in most cases with [a few simple " @@ -9474,13 +9441,13 @@ msgstr "" "rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " "استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." -#: src/lifetimes/lifetime-elision.md:8 +#: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" "هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " "می‌شود." -#: src/lifetimes/lifetime-elision.md:9 +#: src/lifetimes/lifetime-elision.md msgid "" "If there is only one argument lifetime, it is given to all un-annotated " "return values." @@ -9488,7 +9455,7 @@ msgstr "" "اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " "حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." -#: src/lifetimes/lifetime-elision.md:11 +#: src/lifetimes/lifetime-elision.md msgid "" "If there are multiple argument lifetimes, but the first one is for `self`, " "that lifetime is given to all un-annotated return values." @@ -9496,11 +9463,11 @@ msgstr "" "اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " "تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." -#: src/lifetimes/lifetime-elision.md:53 +#: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." msgstr "در این مثال، `cab_distance` به طور خودکار حذف می‌شود." -#: src/lifetimes/lifetime-elision.md:55 +#: src/lifetimes/lifetime-elision.md msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." @@ -9508,13 +9475,13 @@ msgstr "" "تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " "نیاز به حاشیه‌نویسی صریح دارد." -#: src/lifetimes/lifetime-elision.md:58 +#: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" "امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " "داده می‌شوند:" -#: src/lifetimes/lifetime-elision.md:64 +#: src/lifetimes/lifetime-elision.md msgid "" "This won't compile, demonstrating that the annotations are checked for " "validity by the compiler. Note that this is not the case for raw pointers " @@ -9525,7 +9492,7 @@ msgstr "" "اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " "ناامن است." -#: src/lifetimes/lifetime-elision.md:68 +#: src/lifetimes/lifetime-elision.md msgid "" "Students may ask when to use lifetimes. Rust borrows _always_ have " "lifetimes. Most of the time, elision and type inference mean these don't " @@ -9540,37 +9507,37 @@ msgstr "" "پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " "صورت لزوم کلون کنید." -#: src/lifetimes/struct-lifetimes.md:1 +#: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "طول عمر در ساختمان داده" -#: src/lifetimes/struct-lifetimes.md:3 +#: src/lifetimes/struct-lifetimes.md msgid "" "If a data type stores borrowed data, it must be annotated with a lifetime:" msgstr "" "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" -#: src/lifetimes/struct-lifetimes.md:10 +#: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" msgstr "" -#: src/lifetimes/struct-lifetimes.md:14 +#: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "" -#: src/lifetimes/struct-lifetimes.md:17 +#: src/lifetimes/struct-lifetimes.md msgid "// erase(text);\n" msgstr "" -#: src/lifetimes/struct-lifetimes.md:18 +#: src/lifetimes/struct-lifetimes.md msgid "\"{fox:?}\"" msgstr "" -#: src/lifetimes/struct-lifetimes.md:19 +#: src/lifetimes/struct-lifetimes.md msgid "\"{dog:?}\"" msgstr "" -#: src/lifetimes/struct-lifetimes.md:26 +#: src/lifetimes/struct-lifetimes.md msgid "" "In the above example, the annotation on `Highlight` enforces that the data " "underlying the contained `&str` lives at least as long as any instance of " @@ -9580,7 +9547,7 @@ msgstr "" "`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " "می‌کند، زنده بماند." -#: src/lifetimes/struct-lifetimes.md:29 +#: src/lifetimes/struct-lifetimes.md msgid "" "If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " "the borrow checker throws an error." @@ -9588,7 +9555,7 @@ msgstr "" "اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " "(borrow checker) خطا می‌دهد." -#: src/lifetimes/struct-lifetimes.md:31 +#: src/lifetimes/struct-lifetimes.md msgid "" "Types with borrowed data force users to hold on to the original data. This " "can be useful for creating lightweight views, but it generally makes them " @@ -9598,11 +9565,11 @@ msgstr "" "داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " "اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." -#: src/lifetimes/struct-lifetimes.md:34 +#: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." msgstr "در صورت امکان، داده‌های ساختارها را به طور مستقیم مالکیت کنید." -#: src/lifetimes/struct-lifetimes.md:35 +#: src/lifetimes/struct-lifetimes.md msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " @@ -9614,7 +9581,7 @@ msgstr "" "عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " "بسیار پیشرفته هستند." -#: src/lifetimes/exercise.md:3 +#: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" "(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " @@ -9626,7 +9593,7 @@ msgstr "" "کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " "تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." -#: src/lifetimes/exercise.md:8 +#: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " "indexed by their field numbers. That is typically provided in a `proto` " @@ -9638,11 +9605,11 @@ msgstr "" "ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " "توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." -#: src/lifetimes/exercise.md:13 +#: src/lifetimes/exercise.md msgid "We'll use the following proto:" msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" -#: src/lifetimes/exercise.md:28 +#: src/lifetimes/exercise.md msgid "" "A proto message is encoded as a series of fields, one after the next. Each " "is implemented as a \"tag\" followed by the value. The tag contains a field " @@ -9654,7 +9621,7 @@ msgstr "" "شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " "که نحوه تعیین بار را از جریان بایت مشخص می‌کند." -#: src/lifetimes/exercise.md:33 +#: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " "called VARINT. Luckily, `parse_varint` is defined for you below. The given " @@ -9666,7 +9633,7 @@ msgstr "" "همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " "پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." -#: src/lifetimes/exercise.md:38 +#: src/lifetimes/exercise.md msgid "" "What remains for you is to implement the `parse_field` function and the " "`ProtoMessage` trait for `Person` and `PhoneNumber`." @@ -9674,111 +9641,120 @@ msgstr "" "برای شما باقی‌مانده است که تابع `parse_field` و ویژگی `ProtoMessage` را برای " "`Person` و `PhoneNumber` پیاده‌سازی کنید." -#: src/lifetimes/exercise.md:44 src/lifetimes/solution.md:4 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" msgstr "" -#: src/lifetimes/exercise.md:46 src/lifetimes/solution.md:6 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// The Varint WireType indicates the value is a single VARINT.\n" msgstr "" -#: src/lifetimes/exercise.md:48 src/lifetimes/solution.md:8 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"//I64, -- not needed for this exercise\n" +"/// The I64 WireType indicates that the value is precisely 8 bytes in\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" +" //I64, -- not needed for this exercise\n" " /// The Len WireType indicates that the value is a length represented as " "a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" -#: src/lifetimes/exercise.md:52 src/lifetimes/solution.md:12 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"/// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" /// little-endian order containing a 32-bit signed integer.\n" +"// The I32 WireType indicates that the value is precisely 4 bytes in\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" +" //I32, -- not needed for this exercise\n" msgstr "" -#: src/lifetimes/exercise.md:57 src/lifetimes/solution.md:17 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field's value, typed based on the wire type.\n" msgstr "" -#: src/lifetimes/exercise.md:61 src/lifetimes/solution.md:21 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//I64(i64), -- not needed for this exercise\n" msgstr "" -#: src/lifetimes/exercise.md:66 src/lifetimes/solution.md:26 +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//I32(i32), -- not needed for this exercise\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field, containing the field number and its value.\n" msgstr "" -#: src/lifetimes/exercise.md:81 src/lifetimes/solution.md:41 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//1 => WireType::I64, -- not needed for this exercise\n" msgstr "" -#: src/lifetimes/exercise.md:84 src/lifetimes/solution.md:44 +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//5 => WireType::I32, -- not needed for this exercise\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid wire type: {value}\"" msgstr "" -#: src/lifetimes/exercise.md:92 src/lifetimes/solution.md:52 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected string to be a `Len` field\"" msgstr "" -#: src/lifetimes/exercise.md:94 src/lifetimes/solution.md:54 +#: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "\"Invalid string\"" msgstr "String" -#: src/lifetimes/exercise.md:99 src/lifetimes/solution.md:59 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected bytes to be a `Len` field\"" msgstr "" -#: src/lifetimes/exercise.md:106 src/lifetimes/solution.md:66 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected `u64` to be a `Varint` field\"" msgstr "" -#: src/lifetimes/exercise.md:114 src/lifetimes/solution.md:74 -msgid "\"Expected `i32` to be an `I32` field\"" -msgstr "" - -#: src/lifetimes/exercise.md:119 src/lifetimes/solution.md:79 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" -#: src/lifetimes/exercise.md:124 src/lifetimes/solution.md:84 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" msgstr "" -#: src/lifetimes/exercise.md:127 src/lifetimes/solution.md:87 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// This is the last byte of the VARINT, so convert it to\n" " // a u64 and return it.\n" msgstr "" -#: src/lifetimes/exercise.md:137 src/lifetimes/solution.md:97 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "// More than 7 bytes is invalid.\n" msgstr "" -#: src/lifetimes/exercise.md:138 src/lifetimes/solution.md:98 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Too many bytes for varint\"" msgstr "" -#: src/lifetimes/exercise.md:140 src/lifetimes/solution.md:100 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Convert a tag into a field number and a WireType.\n" msgstr "" -#: src/lifetimes/exercise.md:148 src/lifetimes/solution.md:107 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" -#: src/lifetimes/exercise.md:154 +#: src/lifetimes/exercise.md msgid "" "\"Based on the wire type, build a Field, consuming as many bytes as " "necessary.\"" msgstr "" -#: src/lifetimes/exercise.md:156 +#: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" msgstr "" -#: src/lifetimes/exercise.md:158 src/lifetimes/solution.md:138 +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a message in the given data, calling `T::add_field` for each field " "in\n" @@ -9787,11 +9763,11 @@ msgid "" "/// The entire input is consumed.\n" msgstr "" -#: src/lifetimes/exercise.md:185 +#: src/lifetimes/exercise.md msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" msgstr "" -#: src/lifetimes/exercise.md:204 +#: src/lifetimes/exercise.md msgid "" "In this exercise there are various cases where protobuf parsing might fail, " "e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " @@ -9806,20 +9782,38 @@ msgstr "" "جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " "به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." -#: src/lifetimes/solution.md:119 +#: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" msgstr "" -#: src/lifetimes/solution.md:121 src/lifetimes/solution.md:128 +#: src/lifetimes/solution.md msgid "\"Unexpected EOF\"" msgstr "" -#: src/lifetimes/solution.md:131 -msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" +#: src/lifetimes/solution.md +msgid "// skip everything else\n" msgstr "" -#: src/lifetimes/solution.md:172 src/lifetimes/solution.md:182 -msgid "// skip everything else\n" +#: src/lifetimes/solution.md src/modules/exercise.md src/modules/solution.md +#: src/testing/unit-tests.md src/testing/solution.md +msgid "\"\"" +msgstr "" + +#: src/lifetimes/solution.md +#, fuzzy +msgid "\"beautiful name\"" +msgstr "\"سلام {name}\"" + +#: src/lifetimes/solution.md +msgid "\"Evan\"" +msgstr "" + +#: src/lifetimes/solution.md +msgid "\"+1234-777-9090\"" +msgstr "" + +#: src/lifetimes/solution.md +msgid "\"home\"" msgstr "" #: src/welcome-day-4.md @@ -9870,11 +9864,11 @@ msgstr "FromIterator" msgid "IntoIterator" msgstr "FromIterator" -#: src/iterators.md src/iterators/fromiterator.md:1 +#: src/iterators.md src/iterators/fromiterator.md msgid "FromIterator" msgstr "FromIterator" -#: src/iterators/iterator.md:3 +#: src/iterators/iterator.md msgid "" "The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " "trait supports iterating over values in a collection. It requires a `next` " @@ -9882,11 +9876,11 @@ msgid "" "`Iterator`, and you can implement it yourself, too:" msgstr "" -#: src/iterators/iterator.md:27 +#: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" msgstr "" -#: src/iterators/iterator.md:35 +#: src/iterators/iterator.md msgid "" "The `Iterator` trait implements many common functional programming " "operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " @@ -9895,7 +9889,7 @@ msgid "" "implementations." msgstr "" -#: src/iterators/iterator.md:40 +#: src/iterators/iterator.md msgid "" "`IntoIterator` is the trait that makes for loops work. It is implemented by " "collection types such as `Vec` and references to them such as `&Vec` " @@ -9903,7 +9897,7 @@ msgid "" "vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -#: src/iterators/intoiterator.md:3 +#: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " "iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" @@ -9911,47 +9905,47 @@ msgid "" "It is used automatically by the `for` loop." msgstr "" -#: src/iterators/intoiterator.md:49 +#: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" msgstr "" -#: src/iterators/intoiterator.md:57 +#: src/iterators/intoiterator.md msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" -#: src/iterators/intoiterator.md:60 +#: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," msgstr "" -#: src/iterators/intoiterator.md:61 +#: src/iterators/intoiterator.md msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." msgstr "" -#: src/iterators/intoiterator.md:63 +#: src/iterators/intoiterator.md msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" -#: src/iterators/intoiterator.md:66 +#: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." msgstr "" -#: src/iterators/intoiterator.md:68 +#: src/iterators/intoiterator.md msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -#: src/iterators/intoiterator.md:71 +#: src/iterators/intoiterator.md msgid "" "Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " "reference to the `Grid` in `GridIter`." msgstr "" -#: src/iterators/intoiterator.md:74 +#: src/iterators/intoiterator.md msgid "" "The same problem can occur for standard library types: `for e in " "some_vector` will take ownership of `some_vector` and iterate over owned " @@ -9959,60 +9953,60 @@ msgid "" "over references to elements of `some_vector`." msgstr "" -#: src/iterators/fromiterator.md:3 +#: src/iterators/fromiterator.md msgid "" "[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " "lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" "std/iter/trait.Iterator.html)." msgstr "" -#: src/iterators/fromiterator.md:9 +#: src/iterators/fromiterator.md msgid "\"prime_squares: {prime_squares:?}\"" msgstr "" -#: src/iterators/fromiterator.md:16 +#: src/iterators/fromiterator.md msgid "`Iterator` implements" msgstr "" -#: src/iterators/fromiterator.md:25 +#: src/iterators/fromiterator.md msgid "There are two ways to specify `B` for this method:" msgstr "" -#: src/iterators/fromiterator.md:27 +#: src/iterators/fromiterator.md msgid "" "With the \"turbofish\": `some_iterator.collect::()`, as " "shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " "elements." msgstr "" -#: src/iterators/fromiterator.md:29 +#: src/iterators/fromiterator.md msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" -#: src/iterators/fromiterator.md:32 +#: src/iterators/fromiterator.md msgid "" "There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " "There are also more specialized implementations which let you do cool things " "like convert an `Iterator>` into a `Result, E>`." msgstr "" -#: src/iterators/exercise.md:3 +#: src/iterators/exercise.md msgid "" "In this exercise, you will need to find and use some of the provided methods " "in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " "trait to implement a complex calculation." msgstr "" -#: src/iterators/exercise.md:6 +#: src/iterators/exercise.md msgid "" "Copy the following code to and make the tests " "pass. Use an iterator expression and `collect` the result to construct the " "return value." msgstr "" -#: src/iterators/exercise.md:11 src/iterators/solution.md:4 +#: src/iterators/exercise.md src/iterators/solution.md msgid "" "/// Calculate the differences between elements of `values` offset by " "`offset`,\n" @@ -10021,239 +10015,238 @@ msgid "" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -#: src/modules.md src/modules/paths.md:1 +#: src/modules.md src/modules/paths.md msgid "use, super, self" msgstr "" -#: src/modules/modules.md:3 +#: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" -#: src/modules/modules.md:5 +#: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -#: src/modules/modules.md:10 +#: src/modules/modules.md msgid "\"In the foo module\"" msgstr "" -#: src/modules/modules.md:16 +#: src/modules/modules.md msgid "\"In the bar module\"" msgstr "" -#: src/modules/modules.md:29 +#: src/modules/modules.md msgid "" "Packages provide functionality and include a `Cargo.toml` file that " "describes how to build a bundle of 1+ crates." msgstr "" -#: src/modules/modules.md:31 +#: src/modules/modules.md msgid "" "Crates are a tree of modules, where a binary crate creates an executable and " "a library crate compiles to a library." msgstr "" -#: src/modules/modules.md:33 +#: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." msgstr "" -#: src/modules/filesystem.md:3 +#: src/modules/filesystem.md msgid "" "Omitting the module content will tell Rust to look for it in another file:" msgstr "" -#: src/modules/filesystem.md:9 +#: src/modules/filesystem.md msgid "" "This tells rust that the `garden` module content is found at `src/garden." "rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" "vegetables.rs`." msgstr "" -#: src/modules/filesystem.md:13 +#: src/modules/filesystem.md msgid "The `crate` root is in:" msgstr "" -#: src/modules/filesystem.md:15 +#: src/modules/filesystem.md msgid "`src/lib.rs` (for a library crate)" msgstr "" -#: src/modules/filesystem.md:16 +#: src/modules/filesystem.md msgid "`src/main.rs` (for a binary crate)" msgstr "" -#: src/modules/filesystem.md:18 +#: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments" +"\". These document the item that contains them -- in this case, a module." msgstr "" -#: src/modules/filesystem.md:22 +#: src/modules/filesystem.md msgid "" "//! This module implements the garden, including a highly performant " "germination\n" "//! implementation.\n" msgstr "" -#: src/modules/filesystem.md:24 +#: src/modules/filesystem.md msgid "// Re-export types from this module.\n" msgstr "" -#: src/modules/filesystem.md:28 +#: src/modules/filesystem.md msgid "/// Sow the given seed packets.\n" msgstr "" -#: src/modules/filesystem.md:33 +#: src/modules/filesystem.md msgid "/// Harvest the produce in the garden that is ready.\n" msgstr "" -#: src/modules/filesystem.md:43 +#: src/modules/filesystem.md msgid "" "Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " "`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" -#: src/modules/filesystem.md:46 +#: src/modules/filesystem.md msgid "" "The main reason to introduce `filename.rs` as alternative to `filename/mod." "rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" -#: src/modules/filesystem.md:49 +#: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -#: src/modules/filesystem.md:59 +#: src/modules/filesystem.md msgid "" "The place rust will look for modules can be changed with a compiler " "directive:" msgstr "" -#: src/modules/filesystem.md:62 +#: src/modules/filesystem.md msgid "\"some/path.rs\"" msgstr "" -#: src/modules/filesystem.md:66 +#: src/modules/filesystem.md msgid "" "This is useful, for example, if you would like to place tests for a module " "in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" -#: src/modules/visibility.md:3 +#: src/modules/visibility.md msgid "Modules are a privacy boundary:" msgstr "" -#: src/modules/visibility.md:5 +#: src/modules/visibility.md msgid "Module items are private by default (hides implementation details)." msgstr "" -#: src/modules/visibility.md:6 +#: src/modules/visibility.md msgid "Parent and sibling items are always visible." msgstr "" -#: src/modules/visibility.md:7 +#: src/modules/visibility.md msgid "" "In other words, if an item is visible in module `foo`, it's visible in all " "the descendants of `foo`." msgstr "" -#: src/modules/visibility.md:13 +#: src/modules/visibility.md msgid "\"outer::private\"" msgstr "" -#: src/modules/visibility.md:17 +#: src/modules/visibility.md msgid "\"outer::public\"" msgstr "" -#: src/modules/visibility.md:22 +#: src/modules/visibility.md msgid "\"outer::inner::private\"" msgstr "" -#: src/modules/visibility.md:26 +#: src/modules/visibility.md msgid "\"outer::inner::public\"" msgstr "" -#: src/modules/visibility.md:40 +#: src/modules/visibility.md msgid "Use the `pub` keyword to make modules public." msgstr "" -#: src/modules/visibility.md:42 +#: src/modules/visibility.md msgid "" "Additionally, there are advanced `pub(...)` specifiers to restrict the scope " "of public visibility." msgstr "" -#: src/modules/visibility.md:45 +#: src/modules/visibility.md msgid "" "See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" "privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" -#: src/modules/visibility.md:47 +#: src/modules/visibility.md msgid "Configuring `pub(crate)` visibility is a common pattern." msgstr "" -#: src/modules/visibility.md:48 +#: src/modules/visibility.md msgid "Less commonly, you can give visibility to a specific path." msgstr "" -#: src/modules/visibility.md:49 +#: src/modules/visibility.md msgid "" "In any case, visibility must be granted to an ancestor module (and all of " "its descendants)." msgstr "" -#: src/modules/paths.md:3 +#: src/modules/paths.md msgid "" "A module can bring symbols from another module into scope with `use`. You " "will typically see something like this at the top of each module:" msgstr "" -#: src/modules/paths.md:11 +#: src/modules/paths.md msgid "Paths" msgstr "مسیر" -#: src/modules/paths.md:13 +#: src/modules/paths.md msgid "Paths are resolved as follows:" msgstr "" -#: src/modules/paths.md:15 +#: src/modules/paths.md msgid "As a relative path:" msgstr "" -#: src/modules/paths.md:16 +#: src/modules/paths.md msgid "`foo` or `self::foo` refers to `foo` in the current module," msgstr "" -#: src/modules/paths.md:17 +#: src/modules/paths.md msgid "`super::foo` refers to `foo` in the parent module." msgstr "" -#: src/modules/paths.md:19 +#: src/modules/paths.md msgid "As an absolute path:" msgstr "" -#: src/modules/paths.md:20 +#: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," msgstr "" -#: src/modules/paths.md:21 +#: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." msgstr "" -#: src/modules/paths.md:26 +#: src/modules/paths.md msgid "" "It is common to \"re-export\" symbols at a shorter path. For example, the " "top-level `lib.rs` in a crate might have" msgstr "" -#: src/modules/paths.md:36 +#: src/modules/paths.md msgid "" "making `DiskStorage` and `NetworkStorage` available to other crates with a " "convenient, short path." msgstr "" -#: src/modules/paths.md:39 +#: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " "However, a trait must be in scope to call any methods on that trait, even if " @@ -10262,270 +10255,259 @@ msgid "" "`use std::io::Read`." msgstr "" -#: src/modules/paths.md:45 +#: src/modules/paths.md msgid "" "The `use` statement can have a wildcard: `use std::io::*`. This is " "discouraged because it is not clear which items are imported, and those " "might change over time." msgstr "" -#: src/modules/exercise.md:3 +#: src/modules/exercise.md msgid "" "In this exercise, you will reorganize a small GUI Library implementation. " "This library defines a `Widget` trait and a few implementations of that " "trait, as well as a `main` function." msgstr "" -#: src/modules/exercise.md:7 +#: src/modules/exercise.md msgid "" "It is typical to put each type or set of closely-related types into its own " "module, so each widget type should get its own module." msgstr "" -#: src/modules/exercise.md:10 +#: src/modules/exercise.md #, fuzzy msgid "Cargo Setup" msgstr "تنظیم" -#: src/modules/exercise.md:12 +#: src/modules/exercise.md msgid "" "The Rust playground only supports one file, so you will need to make a Cargo " "project on your local filesystem:" msgstr "" -#: src/modules/exercise.md:21 +#: src/modules/exercise.md msgid "" "Edit the resulting `src/main.rs` to add `mod` statements, and add additional " "files in the `src` directory." msgstr "" -#: src/modules/exercise.md:24 +#: src/modules/exercise.md msgid "Source" msgstr "" -#: src/modules/exercise.md:26 +#: src/modules/exercise.md msgid "Here's the single-module implementation of the GUI library:" msgstr "" -#: src/modules/exercise.md:30 src/modules/solution.md:36 +#: src/modules/exercise.md src/modules/solution.md msgid "/// Natural width of `self`.\n" msgstr "" -#: src/modules/exercise.md:33 src/modules/solution.md:39 +#: src/modules/exercise.md src/modules/solution.md msgid "/// Draw the widget into a buffer.\n" msgstr "" -#: src/modules/exercise.md:36 src/modules/solution.md:42 +#: src/modules/exercise.md src/modules/solution.md msgid "/// Draw the widget on standard output.\n" msgstr "" -#: src/modules/exercise.md:40 src/modules/solution.md:46 +#: src/modules/exercise.md src/modules/solution.md msgid "\"{buffer}\"" msgstr "" -#: src/modules/exercise.md:88 +#: src/modules/exercise.md msgid "// Add 4 paddings for borders\n" msgstr "" -#: src/modules/exercise.md:100 +#: src/modules/exercise.md msgid "" "// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " "the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -#: src/modules/exercise.md:102 src/modules/exercise.md:108 -#: src/modules/solution.md:165 src/modules/solution.md:171 +#: src/modules/exercise.md src/modules/solution.md msgid "\"+-{:-. Then use\n" " // the ?-operator here instead of .unwrap().\n" msgstr "" -#: src/modules/solution.md:177 +#: src/modules/solution.md msgid "// ---- src/main.rs ----\n" msgstr "" -#: src/testing/unit-tests.md:1 +#: src/testing/unit-tests.md msgid "Unit Tests" msgstr "تست‌های واحد (Unit Tests)" -#: src/testing/unit-tests.md:3 +#: src/testing/unit-tests.md msgid "Rust and Cargo come with a simple unit test framework:" msgstr "" -#: src/testing/unit-tests.md:5 +#: src/testing/unit-tests.md msgid "Unit tests are supported throughout your code." msgstr "" -#: src/testing/unit-tests.md:7 +#: src/testing/unit-tests.md msgid "Integration tests are supported via the `tests/` directory." msgstr "" -#: src/testing/unit-tests.md:9 +#: src/testing/unit-tests.md msgid "" "Tests are marked with `#[test]`. Unit tests are often put in a nested " "`tests` module, using `#[cfg(test)]` to conditionally compile them only when " "building tests." msgstr "" -#: src/testing/unit-tests.md:37 +#: src/testing/unit-tests.md #, fuzzy msgid "\"Hello World\"" msgstr "سلام دنیا" -#: src/testing/unit-tests.md:42 +#: src/testing/unit-tests.md msgid "This lets you unit test private helpers." msgstr "" -#: src/testing/unit-tests.md:43 +#: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." msgstr "" -#: src/testing/unit-tests.md:48 +#: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." msgstr "" -#: src/testing/other.md:3 +#: src/testing/other.md msgid "Integration Tests" msgstr "Integration Tests" -#: src/testing/other.md:5 +#: src/testing/other.md msgid "If you want to test your library as a client, use an integration test." msgstr "" -#: src/testing/other.md:7 +#: src/testing/other.md msgid "Create a `.rs` file under `tests/`:" msgstr "" -#: src/testing/other.md:10 +#: src/testing/other.md msgid "// tests/my_library.rs\n" msgstr "" -#: src/testing/other.md:19 +#: src/testing/other.md msgid "These tests only have access to the public API of your crate." msgstr "" -#: src/testing/other.md:21 +#: src/testing/other.md msgid "Documentation Tests" msgstr "تست‌ سندها" -#: src/testing/other.md:23 +#: src/testing/other.md msgid "Rust has built-in support for documentation tests:" msgstr "" -#: src/testing/other.md:26 +#: src/testing/other.md msgid "" "/// Shortens a string to the given length.\n" "///\n" @@ -10536,62 +10518,62 @@ msgid "" "/// ```\n" msgstr "" -#: src/testing/other.md:38 +#: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." msgstr "" -#: src/testing/other.md:39 +#: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." msgstr "" -#: src/testing/other.md:40 +#: src/testing/other.md msgid "" "Adding `#` in the code will hide it from the docs, but will still compile/" "run it." msgstr "" -#: src/testing/other.md:42 +#: src/testing/other.md msgid "" "Test the above code on the [Rust Playground](https://play.rust-lang.org/?" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" -#: src/testing/lints.md:3 +#: src/testing/lints.md msgid "" "The Rust compiler produces fantastic error messages, as well as helpful " "built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " "more lints, organized into groups that can be enabled per-project." msgstr "" -#: src/testing/lints.md:14 +#: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -#: src/testing/lints.md:21 +#: src/testing/lints.md msgid "" "Run the code sample and examine the error message. There are also lints " "visible here, but those will not be shown once the code compiles. Switch to " "the Playground site to show those lints." msgstr "" -#: src/testing/lints.md:25 +#: src/testing/lints.md msgid "" "After resolving the lints, run `clippy` on the playground site to show " "clippy warnings. Clippy has extensive documentation of its lints, and adds " "new lints (including default-deny lints) all the time." msgstr "" -#: src/testing/lints.md:29 +#: src/testing/lints.md msgid "" "Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " "or via your editor." msgstr "" -#: src/testing/exercise.md:3 +#: src/testing/exercise.md msgid "Luhn Algorithm" msgstr "الگوریتم Luhn" -#: src/testing/exercise.md:5 +#: src/testing/exercise.md msgid "" "The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " "to validate credit card numbers. The algorithm takes a string as input and " @@ -10602,12 +10584,12 @@ msgstr "" "عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " "انجام می‌دهد:" -#: src/testing/exercise.md:9 +#: src/testing/exercise.md #, fuzzy msgid "Ignore all spaces. Reject numbers with fewer than two digits." msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی با کمتر از دو رقم را رد کنید." -#: src/testing/exercise.md:11 +#: src/testing/exercise.md 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`." @@ -10616,7 +10598,7 @@ msgstr "" "`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " "می‌کنیم." -#: src/testing/exercise.md:14 +#: src/testing/exercise.md 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`." @@ -10625,22 +10607,22 @@ msgstr "" "بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." -#: src/testing/exercise.md:17 +#: src/testing/exercise.md msgid "Sum all the undoubled and doubled digits." msgstr "تمام ارقام دو برابر نشده و دو برابر شده را جمع کنید." -#: src/testing/exercise.md:19 +#: src/testing/exercise.md msgid "The credit card number is valid if the sum ends with `0`." msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت اعتباری معتبر است." -#: src/testing/exercise.md:21 +#: src/testing/exercise.md msgid "" "The provided code provides a buggy implementation of the luhn algorithm, " "along with two basic unit tests that confirm that most of the algorithm is " "implemented correctly." msgstr "" -#: src/testing/exercise.md:25 +#: src/testing/exercise.md #, fuzzy msgid "" "Copy the code below to and write additional " @@ -10650,75 +10632,75 @@ msgstr "" "کد زیر را به کپی کنید و " "تابع را پیاده‌سازی کنید." -#: src/testing/exercise.md:57 src/testing/solution.md:69 +#: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" msgstr "" -#: src/testing/exercise.md:58 src/testing/solution.md:70 +#: src/testing/exercise.md src/testing/solution.md msgid "\"4539 3195 0343 6467\"" msgstr "" -#: src/testing/exercise.md:59 src/testing/solution.md:71 +#: src/testing/exercise.md src/testing/solution.md msgid "\"7992 7398 713\"" msgstr "" -#: src/testing/exercise.md:64 src/testing/solution.md:76 +#: src/testing/exercise.md src/testing/solution.md msgid "\"4223 9826 4026 9299\"" msgstr "" -#: src/testing/exercise.md:65 src/testing/solution.md:77 +#: src/testing/exercise.md src/testing/solution.md msgid "\"4539 3195 0343 6476\"" msgstr "" -#: src/testing/exercise.md:66 src/testing/solution.md:78 +#: src/testing/exercise.md src/testing/solution.md msgid "\"8273 1232 7352 0569\"" msgstr "" -#: src/testing/solution.md:4 +#: src/testing/solution.md msgid "// This is the buggy version that appears in the problem.\n" msgstr "" -#: src/testing/solution.md:27 +#: src/testing/solution.md msgid "// This is the solution and passes all of the tests below.\n" msgstr "" -#: src/testing/solution.md:56 +#: src/testing/solution.md msgid "\"1234 5678 1234 5670\"" msgstr "" -#: src/testing/solution.md:58 +#: src/testing/solution.md msgid "\"Is {cc_number} a valid credit card number? {}\"" msgstr "" -#: src/testing/solution.md:59 +#: src/testing/solution.md msgid "\"yes\"" msgstr "" -#: src/testing/solution.md:59 +#: src/testing/solution.md msgid "\"no\"" msgstr "" -#: src/testing/solution.md:84 +#: src/testing/solution.md msgid "\"foo 0 0\"" msgstr "" -#: src/testing/solution.md:90 +#: src/testing/solution.md msgid "\" \"" msgstr "" -#: src/testing/solution.md:91 +#: src/testing/solution.md msgid "\" \"" msgstr "" -#: src/testing/solution.md:92 +#: src/testing/solution.md msgid "\" \"" msgstr "" -#: src/testing/solution.md:97 +#: src/testing/solution.md msgid "\"0\"" msgstr "" -#: src/testing/solution.md:102 +#: src/testing/solution.md msgid "\" 0 0 \"" msgstr "" @@ -10740,107 +10722,107 @@ msgstr "صفت‌های بیشتر" msgid "thiserror and anyhow" msgstr "" -#: src/error-handling.md src/error-handling/exercise.md:1 +#: src/error-handling.md src/error-handling/exercise.md msgid "Exercise: Rewriting with Result" msgstr "" -#: src/error-handling/panics.md:3 +#: src/error-handling/panics.md msgid "Rust handles fatal errors with a \"panic\"." msgstr "" -#: src/error-handling/panics.md:5 +#: src/error-handling/panics.md msgid "Rust will trigger a panic if a fatal error happens at runtime:" msgstr "" -#: src/error-handling/panics.md:10 +#: src/error-handling/panics.md msgid "\"v[100]: {}\"" msgstr "" -#: src/error-handling/panics.md:14 +#: src/error-handling/panics.md msgid "Panics are for unrecoverable and unexpected errors." msgstr "" -#: src/error-handling/panics.md:15 +#: src/error-handling/panics.md msgid "Panics are symptoms of bugs in the program." msgstr "" -#: src/error-handling/panics.md:16 +#: src/error-handling/panics.md msgid "Runtime failures like failed bounds checks can panic" msgstr "" -#: src/error-handling/panics.md:17 +#: src/error-handling/panics.md msgid "Assertions (such as `assert!`) panic on failure" msgstr "" -#: src/error-handling/panics.md:18 +#: src/error-handling/panics.md msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" -#: src/error-handling/panics.md:19 +#: src/error-handling/panics.md msgid "" "A panic will \"unwind\" the stack, dropping values just as if the functions " "had returned." msgstr "" -#: src/error-handling/panics.md:21 +#: src/error-handling/panics.md msgid "" "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" -#: src/error-handling/panics.md:26 +#: src/error-handling/panics.md msgid "" "By default, a panic will cause the stack to unwind. The unwinding can be " "caught:" msgstr "" -#: src/error-handling/panics.md:32 +#: src/error-handling/panics.md msgid "\"No problem here!\"" msgstr "" -#: src/error-handling/panics.md:33 src/error-handling/panics.md:38 +#: src/error-handling/panics.md msgid "\"{result:?}\"" msgstr "" -#: src/error-handling/panics.md:36 +#: src/error-handling/panics.md msgid "\"oh no!\"" msgstr "" -#: src/error-handling/panics.md:42 +#: src/error-handling/panics.md msgid "" "Catching is unusual; do not attempt to implement exceptions with " "`catch_unwind`!" msgstr "" -#: src/error-handling/panics.md:44 +#: src/error-handling/panics.md msgid "" "This can be useful in servers which should keep running even if a single " "request crashes." msgstr "" -#: src/error-handling/panics.md:46 +#: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" -#: src/error-handling/result.md:3 +#: src/error-handling/result.md msgid "" "Our primary mechanism for error handling in Rust is the [`Result`](https://" "doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " "saw when discussing standard library types." msgstr "" -#: src/error-handling/result.md:33 +#: src/error-handling/result.md msgid "" "`Result` has two variants: `Ok` which contains the success value, and `Err` " "which contains an error value of some kind." msgstr "" -#: src/error-handling/result.md:36 +#: src/error-handling/result.md msgid "" "Whether or not a function can produce an error is encoded in the function's " "type signature by having the function return a `Result` value." msgstr "" -#: src/error-handling/result.md:39 +#: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " "access either the success value or the error value without first pattern " @@ -10850,18 +10832,18 @@ msgid "" "proper error handling is being skipped." msgstr "" -#: src/error-handling/result.md:48 +#: src/error-handling/result.md msgid "" "It may be helpful to compare error handling in Rust to error handling " "conventions that students may be familiar with from other programming " "languages." msgstr "" -#: src/error-handling/result.md:53 +#: src/error-handling/result.md msgid "Many languages use exceptions, e.g. C++, Java, Python." msgstr "" -#: src/error-handling/result.md:55 +#: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " "exception is not visible as part of its type signature. This generally means " @@ -10869,32 +10851,32 @@ msgid "" "not." msgstr "" -#: src/error-handling/result.md:60 +#: src/error-handling/result.md msgid "" "Exceptions generally unwind the call stack, propagating upward until a `try` " "block is reached. An error originating deep in the call stack may impact an " "unrelated function further up." msgstr "" -#: src/error-handling/result.md:64 +#: src/error-handling/result.md msgid "Error Numbers" msgstr "" -#: src/error-handling/result.md:66 +#: src/error-handling/result.md msgid "" "Some languages have functions return an error number (or some other error " "value) separately from the successful return value of the function. Examples " "include C and Go." msgstr "" -#: src/error-handling/result.md:70 +#: src/error-handling/result.md msgid "" "Depending on the language it may be possible to forget to check the error " "value, in which case you may be accessing an uninitialized or otherwise " "invalid success value." msgstr "" -#: src/error-handling/try.md:3 +#: src/error-handling/try.md msgid "" "Runtime errors like connection-refused or file-not-found are handled with " "the `Result` type, but matching this type on every call can be cumbersome. " @@ -10902,42 +10884,42 @@ msgid "" "turn the common" msgstr "" -#: src/error-handling/try.md:15 +#: src/error-handling/try.md msgid "into the much simpler" msgstr "" -#: src/error-handling/try.md:21 +#: src/error-handling/try.md msgid "We can use this to simplify our error handling code:" msgstr "" -#: src/error-handling/try.md:42 +#: src/error-handling/try.md msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" msgstr "" -#: src/error-handling/try.md:43 src/error-handling/try-conversions.md:65 -#: src/error-handling/thiserror-and-anyhow.md:36 +#: src/error-handling/try.md src/error-handling/try-conversions.md +#: src/error-handling/thiserror-and-anyhow.md msgid "\"config.dat\"" msgstr "" -#: src/error-handling/try.md:44 src/error-handling/try-conversions.md:66 +#: src/error-handling/try.md src/error-handling/try-conversions.md msgid "\"username or error: {username:?}\"" msgstr "" -#: src/error-handling/try.md:51 +#: src/error-handling/try.md msgid "Simplify the `read_username` function to use `?`." msgstr "" -#: src/error-handling/try.md:55 +#: src/error-handling/try.md msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." msgstr "" -#: src/error-handling/try.md:56 +#: src/error-handling/try.md msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" -#: src/error-handling/try.md:58 +#: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" "process::Termination`. In practice, this means that `E` implements `Debug`. " @@ -10945,36 +10927,36 @@ msgid "" "on error." msgstr "" -#: src/error-handling/try-conversions.md:3 +#: src/error-handling/try-conversions.md msgid "" "The effective expansion of `?` is a little more complicated than previously " "indicated:" msgstr "" -#: src/error-handling/try-conversions.md:10 +#: src/error-handling/try-conversions.md msgid "works the same as" msgstr "" -#: src/error-handling/try-conversions.md:19 +#: src/error-handling/try-conversions.md msgid "" "The `From::from` call here means we attempt to convert the error type to the " "type returned by the function. This makes it easy to encapsulate errors into " "higher-level errors." msgstr "" -#: src/error-handling/try-conversions.md:42 +#: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" msgstr "" -#: src/error-handling/try-conversions.md:43 +#: src/error-handling/try-conversions.md msgid "\"Found no username in {path}\"" msgstr "" -#: src/error-handling/try-conversions.md:64 +#: src/error-handling/try-conversions.md msgid "//std::fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "" -#: src/error-handling/try-conversions.md:73 +#: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " "function. For `Result`, it means that the error types have to be compatible. " @@ -10983,31 +10965,31 @@ msgid "" "same type or if `ErrorOuter` implements `From`." msgstr "" -#: src/error-handling/try-conversions.md:79 +#: src/error-handling/try-conversions.md msgid "" "A common alternative to a `From` implementation is `Result::map_err`, " "especially when the conversion only happens in one place." msgstr "" -#: src/error-handling/try-conversions.md:82 +#: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " "`Option` can use the `?` operator on `Option` for arbitrary `T` and " "`U` types." msgstr "" -#: src/error-handling/try-conversions.md:86 +#: src/error-handling/try-conversions.md msgid "" "A function that returns `Result` cannot use `?` on `Option` and vice versa. " "However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " "turns `Result` into `Option`." msgstr "" -#: src/error-handling/error.md:1 +#: src/error-handling/error.md msgid "Dynamic Error Types" msgstr "انواع خطاهای Dynamic" -#: src/error-handling/error.md:3 +#: src/error-handling/error.md msgid "" "Sometimes we want to allow any type of error to be returned without writing " "our own enum covering all the different possibilities. The `std::error::" @@ -11015,29 +10997,29 @@ msgid "" "error." msgstr "" -#: src/error-handling/error.md:20 src/error-handling/error.md:21 +#: src/error-handling/error.md msgid "\"count.dat\"" msgstr "" -#: src/error-handling/error.md:20 +#: src/error-handling/error.md msgid "\"1i3\"" msgstr "" -#: src/error-handling/error.md:22 +#: src/error-handling/error.md msgid "\"Count: {count}\"" msgstr "" -#: src/error-handling/error.md:23 +#: src/error-handling/error.md msgid "\"Error: {err}\"" msgstr "" -#: src/error-handling/error.md:31 +#: src/error-handling/error.md msgid "" "The `read_count` function can return `std::io::Error` (from file operations) " "or `std::num::ParseIntError` (from `String::parse`)." msgstr "" -#: src/error-handling/error.md:34 +#: src/error-handling/error.md msgid "" "Boxing errors saves on code, but gives up the ability to cleanly handle " "different error cases differently in the program. As such it's generally not " @@ -11046,7 +11028,7 @@ msgid "" "message somewhere." msgstr "" -#: src/error-handling/error.md:40 +#: src/error-handling/error.md msgid "" "Make sure to implement the `std::error::Error` trait when defining a custom " "error type so it can be boxed. But if you need to support the `no_std` " @@ -11055,101 +11037,101 @@ msgid "" "issues/103765) only." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:3 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" "anyhow/) crates are widely used to simplify error handling." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:7 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "`thiserror` is often used in libraries to create custom error types that " "implement `From`." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:9 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "`anyhow` is often used by applications to help with error handling in " "functions, including adding contextual information to your errors." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:19 +#: src/error-handling/thiserror-and-anyhow.md msgid "\"Found no username in {0}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:25 +#: src/error-handling/thiserror-and-anyhow.md msgid "\"Failed to open {path}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:27 +#: src/error-handling/thiserror-and-anyhow.md msgid "\"Failed to read\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:35 +#: src/error-handling/thiserror-and-anyhow.md msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:37 +#: src/error-handling/thiserror-and-anyhow.md msgid "\"Username: {username}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:38 +#: src/error-handling/thiserror-and-anyhow.md msgid "\"Error: {err:?}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:46 +#: src/error-handling/thiserror-and-anyhow.md msgid "`thiserror`" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:48 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:50 +#: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:51 +#: src/error-handling/thiserror-and-anyhow.md msgid "The message from `#[error]` is used to derive the `Display` trait." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:53 +#: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow`" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:55 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "`anyhow::Error` is essentially a wrapper around `Box`. As such " "it's again generally not a good choice for the public API of a library, but " "is widely used in applications." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:58 +#: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:59 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "Actual error type inside of it can be extracted for examination if necessary." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:60 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "Functionality provided by `anyhow::Result` may be familiar to Go " "developers, as it provides similar usage patterns and ergonomics to `(T, " "error)` from Go." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md:63 +#: src/error-handling/thiserror-and-anyhow.md msgid "" "`anyhow::Context` is a trait implemented for the standard `Result` and " "`Option` types. `use anyhow::Context` is necessary to enable `.context()` " "and `.with_context()` on those types." msgstr "" -#: src/error-handling/exercise.md:3 +#: src/error-handling/exercise.md msgid "" "The following implements a very simple parser for an expression language. " "However, it handles errors by panicking. Rewrite it to instead use idiomatic " @@ -11157,91 +11139,90 @@ msgid "" "use `thiserror` and `anyhow`." msgstr "" -#: src/error-handling/exercise.md:8 +#: src/error-handling/exercise.md msgid "" "HINT: start by fixing error handling in the `parse` function. Once that is " "working correctly, update `Tokenizer` to implement " "`Iterator>` and handle that in the parser." msgstr "" -#: src/error-handling/exercise.md:15 src/error-handling/solution.md:9 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An arithmetic operator.\n" msgstr "" -#: src/error-handling/exercise.md:22 src/error-handling/solution.md:16 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A token in the expression language.\n" msgstr "" -#: src/error-handling/exercise.md:30 src/error-handling/solution.md:24 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An expression in the expression language.\n" msgstr "" -#: src/error-handling/exercise.md:34 src/error-handling/solution.md:28 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A reference to a variable.\n" msgstr "" -#: src/error-handling/exercise.md:36 src/error-handling/solution.md:30 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A literal number.\n" msgstr "" -#: src/error-handling/exercise.md:38 src/error-handling/solution.md:32 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A binary operation.\n" msgstr "" -#: src/error-handling/exercise.md:60 src/error-handling/solution.md:60 -#: src/error-handling/solution.md:75 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'_'" msgstr "" -#: src/error-handling/exercise.md:76 src/error-handling/solution.md:76 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'+'" msgstr "" -#: src/error-handling/exercise.md:77 src/error-handling/solution.md:77 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'-'" msgstr "" -#: src/error-handling/exercise.md:78 +#: src/error-handling/exercise.md msgid "\"Unexpected character {c}\"" msgstr "" -#: src/error-handling/exercise.md:88 src/error-handling/solution.md:87 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"Unexpected end of input\"" msgstr "" -#: src/error-handling/exercise.md:92 +#: src/error-handling/exercise.md msgid "\"Invalid 32-bit integer'\"" msgstr "" -#: src/error-handling/exercise.md:96 src/error-handling/exercise.md:106 +#: src/error-handling/exercise.md msgid "\"Unexpected token {tok:?}\"" msgstr "" -#: src/error-handling/exercise.md:98 src/error-handling/solution.md:110 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "// Look ahead to parse a binary operation if present.\n" msgstr "" -#: src/error-handling/exercise.md:114 src/error-handling/solution.md:127 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"10+foo+20-30\"" msgstr "" -#: src/error-handling/exercise.md:115 src/error-handling/solution.md:128 +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"{expr:?}\"" msgstr "" -#: src/error-handling/solution.md:42 +#: src/error-handling/solution.md msgid "\"Unexpected character '{0}' in input\"" msgstr "" -#: src/error-handling/solution.md:85 +#: src/error-handling/solution.md msgid "\"Tokenizer error: {0}\"" msgstr "" -#: src/error-handling/solution.md:89 +#: src/error-handling/solution.md msgid "\"Unexpected token {0:?}\"" msgstr "" -#: src/error-handling/solution.md:91 +#: src/error-handling/solution.md msgid "\"Invalid number\"" msgstr "" @@ -11249,64 +11230,64 @@ msgstr "" msgid "This segment should take about 1 hour and 5 minutes. It contains:" msgstr "" -#: src/unsafe-rust/unsafe.md:3 +#: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" msgstr "" -#: src/unsafe-rust/unsafe.md:5 +#: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -#: src/unsafe-rust/unsafe.md:6 +#: src/unsafe-rust/unsafe.md msgid "" "**Unsafe Rust:** can trigger undefined behavior if preconditions are " "violated." msgstr "" -#: src/unsafe-rust/unsafe.md:8 +#: src/unsafe-rust/unsafe.md msgid "" "We saw mostly safe Rust in this course, but it's important to know what " "Unsafe Rust is." msgstr "" -#: src/unsafe-rust/unsafe.md:11 +#: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" -#: src/unsafe-rust/unsafe.md:14 +#: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" msgstr "" -#: src/unsafe-rust/unsafe.md:16 +#: src/unsafe-rust/unsafe.md msgid "Dereference raw pointers." msgstr "" -#: src/unsafe-rust/unsafe.md:17 +#: src/unsafe-rust/unsafe.md msgid "Access or modify mutable static variables." msgstr "" -#: src/unsafe-rust/unsafe.md:18 +#: src/unsafe-rust/unsafe.md msgid "Access `union` fields." msgstr "" -#: src/unsafe-rust/unsafe.md:19 +#: src/unsafe-rust/unsafe.md msgid "Call `unsafe` functions, including `extern` functions." msgstr "" -#: src/unsafe-rust/unsafe.md:20 +#: src/unsafe-rust/unsafe.md msgid "Implement `unsafe` traits." msgstr "" -#: src/unsafe-rust/unsafe.md:22 +#: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " "[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" "unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" -#: src/unsafe-rust/unsafe.md:29 +#: src/unsafe-rust/unsafe.md msgid "" "Unsafe Rust does not mean the code is incorrect. It means that developers " "have turned off some compiler safety features and have to write correct code " @@ -11314,15 +11295,15 @@ msgid "" "rules." msgstr "" -#: src/unsafe-rust/dereferencing.md:3 +#: src/unsafe-rust/dereferencing.md msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" msgstr "" -#: src/unsafe-rust/dereferencing.md:7 +#: src/unsafe-rust/dereferencing.md msgid "\"careful!\"" msgstr "" -#: src/unsafe-rust/dereferencing.md:12 +#: src/unsafe-rust/dereferencing.md msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" " // be non-null and properly aligned, the objects underlying the " @@ -11332,19 +11313,19 @@ msgid "" " // concurrently through any other pointers.\n" msgstr "" -#: src/unsafe-rust/dereferencing.md:18 +#: src/unsafe-rust/dereferencing.md msgid "\"r1 is: {}\"" msgstr "" -#: src/unsafe-rust/dereferencing.md:19 +#: src/unsafe-rust/dereferencing.md msgid "\"uhoh\"" msgstr "" -#: src/unsafe-rust/dereferencing.md:20 +#: src/unsafe-rust/dereferencing.md msgid "\"r2 is: {}\"" msgstr "" -#: src/unsafe-rust/dereferencing.md:23 +#: src/unsafe-rust/dereferencing.md msgid "" "// NOT SAFE. DO NOT DO THIS.\n" " /*\n" @@ -11354,83 +11335,83 @@ msgid "" " */" msgstr "" -#: src/unsafe-rust/dereferencing.md:35 +#: src/unsafe-rust/dereferencing.md msgid "" "It is good practice (and required by the Android Rust style guide) to write " "a comment for each `unsafe` block explaining how the code inside it " "satisfies the safety requirements of the unsafe operations it is doing." msgstr "" -#: src/unsafe-rust/dereferencing.md:39 +#: src/unsafe-rust/dereferencing.md msgid "" "In the case of pointer dereferences, this means that the pointers must be " "[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" -#: src/unsafe-rust/dereferencing.md:42 +#: src/unsafe-rust/dereferencing.md msgid "The pointer must be non-null." msgstr "" -#: src/unsafe-rust/dereferencing.md:43 +#: src/unsafe-rust/dereferencing.md msgid "" "The pointer must be _dereferenceable_ (within the bounds of a single " "allocated object)." msgstr "" -#: src/unsafe-rust/dereferencing.md:45 +#: src/unsafe-rust/dereferencing.md msgid "The object must not have been deallocated." msgstr "" -#: src/unsafe-rust/dereferencing.md:46 +#: src/unsafe-rust/dereferencing.md msgid "There must not be concurrent accesses to the same location." msgstr "" -#: src/unsafe-rust/dereferencing.md:47 +#: src/unsafe-rust/dereferencing.md msgid "" "If the pointer was obtained by casting a reference, the underlying object " "must be live and no reference may be used to access the memory." msgstr "" -#: src/unsafe-rust/dereferencing.md:50 +#: src/unsafe-rust/dereferencing.md msgid "In most cases the pointer must also be properly aligned." msgstr "" -#: src/unsafe-rust/dereferencing.md:52 +#: src/unsafe-rust/dereferencing.md msgid "" "The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " "has the `'static` lifetime, so `r3` has type `&'static String`, and thus " "outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" -#: src/unsafe-rust/mutable-static.md:3 +#: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" msgstr "" -#: src/unsafe-rust/mutable-static.md:6 +#: src/unsafe-rust/mutable-static.md #, fuzzy msgid "\"Hello, world!\"" msgstr "سلام دنیا" -#: src/unsafe-rust/mutable-static.md:9 +#: src/unsafe-rust/mutable-static.md msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" msgstr "" -#: src/unsafe-rust/mutable-static.md:13 +#: src/unsafe-rust/mutable-static.md msgid "" "However, since data races can occur, it is unsafe to read and write mutable " "static variables:" msgstr "" -#: src/unsafe-rust/mutable-static.md:20 src/unsafe-rust/mutable-static.md:29 +#: src/unsafe-rust/mutable-static.md msgid "" "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" -#: src/unsafe-rust/mutable-static.md:31 +#: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" msgstr "" -#: src/unsafe-rust/mutable-static.md:39 +#: src/unsafe-rust/mutable-static.md msgid "" "The program here is safe because it is single-threaded. However, the Rust " "compiler is conservative and will assume the worst. Try removing the " @@ -11438,37 +11419,37 @@ msgid "" "mutate a static from multiple threads." msgstr "" -#: src/unsafe-rust/mutable-static.md:44 +#: src/unsafe-rust/mutable-static.md msgid "" "Using a mutable static is generally a bad idea, but there are some cases " "where it might make sense in low-level `no_std` code, such as implementing a " "heap allocator or working with some C APIs." msgstr "" -#: src/unsafe-rust/unions.md:3 +#: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" msgstr "" -#: src/unsafe-rust/unions.md:14 +#: src/unsafe-rust/unions.md msgid "\"int: {}\"" msgstr "" -#: src/unsafe-rust/unions.md:15 +#: src/unsafe-rust/unions.md msgid "\"bool: {}\"" msgstr "" -#: src/unsafe-rust/unions.md:15 +#: src/unsafe-rust/unions.md #, fuzzy msgid "// Undefined behavior!\n" msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" -#: src/unsafe-rust/unions.md:22 +#: src/unsafe-rust/unions.md msgid "" "Unions are very rarely needed in Rust as you can usually use an enum. They " "are occasionally needed for interacting with C library APIs." msgstr "" -#: src/unsafe-rust/unions.md:25 +#: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " "[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." @@ -11476,62 +11457,55 @@ msgid "" "crates/zerocopy) crate." msgstr "" -#: src/unsafe-rust/unsafe-functions.md:3 src/unsafe-rust/unsafe-functions.md:76 +#: src/unsafe-rust/unsafe-functions.md msgid "Calling Unsafe Functions" msgstr "فراخوانی متدهای ناامن" -#: src/unsafe-rust/unsafe-functions.md:5 +#: src/unsafe-rust/unsafe-functions.md msgid "" "A function or method can be marked `unsafe` if it has extra preconditions " "you must uphold to avoid undefined behaviour:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:9 src/unsafe-rust/exercise.md:91 -#: src/unsafe-rust/solution.md:41 src/android/interoperability/with-c.md:9 -#: src/android/interoperability/with-c/rust.md:15 -#: src/android/interoperability/with-c/rust.md:30 -#: src/android/interoperability/cpp/cpp-bridge.md:29 -#: src/android/interoperability/cpp/cpp-bridge.md:38 -#: src/exercises/chromium/build-rules.md:8 -#: src/exercises/chromium/build-rules.md:21 -#: src/bare-metal/aps/inline-assembly.md:19 -#: src/bare-metal/aps/better-uart/using.md:24 -#: src/bare-metal/aps/logging/using.md:23 -#: src/exercises/bare-metal/solutions-afternoon.md:43 +#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md +#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md +#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "\"C\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:14 +#: src/unsafe-rust/unsafe-functions.md msgid "\"🗻∈🌏\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:16 +#: src/unsafe-rust/unsafe-functions.md msgid "" "// SAFETY: The indices are in the correct order, within the bounds of the\n" " // string slice, and lie on UTF-8 sequence boundaries.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:19 -#: src/unsafe-rust/unsafe-functions.md:20 -#: src/unsafe-rust/unsafe-functions.md:21 +#: src/unsafe-rust/unsafe-functions.md msgid "\"emoji: {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:24 +#: src/unsafe-rust/unsafe-functions.md msgid "\"char count: {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:26 +#: src/unsafe-rust/unsafe-functions.md msgid "" "// SAFETY: `abs` doesn't deal with pointers and doesn't have any safety\n" " // requirements.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:29 +#: src/unsafe-rust/unsafe-functions.md msgid "\"Absolute value of -3 according to C: {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:32 +#: src/unsafe-rust/unsafe-functions.md msgid "" "// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" " // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" @@ -11539,18 +11513,17 @@ msgid "" " // emojis.get_unchecked(0..3) }));\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:43 -#: src/unsafe-rust/unsafe-functions.md:88 +#: src/unsafe-rust/unsafe-functions.md msgid "Writing Unsafe Functions" msgstr "نوشتن متدهای ناامن" -#: src/unsafe-rust/unsafe-functions.md:45 +#: src/unsafe-rust/unsafe-functions.md msgid "" "You can mark your own functions as `unsafe` if they require particular " "conditions to avoid undefined behaviour." msgstr "" -#: src/unsafe-rust/unsafe-functions.md:49 +#: src/unsafe-rust/unsafe-functions.md msgid "" "/// Swaps the values pointed to by the given pointers.\n" "///\n" @@ -11559,15 +11532,15 @@ msgid "" "/// The pointers must be valid and properly aligned.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:64 +#: src/unsafe-rust/unsafe-functions.md msgid "// SAFETY: ...\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:69 +#: src/unsafe-rust/unsafe-functions.md msgid "\"a = {}, b = {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md:78 +#: src/unsafe-rust/unsafe-functions.md msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " "create UB if the range is incorrect. `abs` is incorrect for a different " @@ -11577,19 +11550,19 @@ msgid "" "undefined behaviour under any arbitrary circumstances." msgstr "" -#: src/unsafe-rust/unsafe-functions.md:85 +#: src/unsafe-rust/unsafe-functions.md msgid "" "The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" -#: src/unsafe-rust/unsafe-functions.md:90 +#: src/unsafe-rust/unsafe-functions.md msgid "" "We wouldn't actually use pointers for a `swap` function - it can be done " "safely with references." msgstr "" -#: src/unsafe-rust/unsafe-functions.md:93 +#: src/unsafe-rust/unsafe-functions.md msgid "" "Note that unsafe code is allowed within an unsafe function without an " "`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " @@ -11597,212 +11570,207 @@ msgid "" "edition." msgstr "" -#: src/unsafe-rust/unsafe-traits.md:1 +#: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" msgstr "پیاده سازی صفات (Traits) ناامن" -#: src/unsafe-rust/unsafe-traits.md:3 +#: src/unsafe-rust/unsafe-traits.md msgid "" "Like with functions, you can mark a trait as `unsafe` if the implementation " "must guarantee particular conditions to avoid undefined behaviour." msgstr "" -#: src/unsafe-rust/unsafe-traits.md:6 +#: src/unsafe-rust/unsafe-traits.md msgid "" "For example, the `zerocopy` crate has an unsafe trait that looks [something " "like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" -#: src/unsafe-rust/unsafe-traits.md:12 +#: src/unsafe-rust/unsafe-traits.md msgid "" "/// ...\n" "/// # Safety\n" "/// The type must have a defined representation and no padding.\n" msgstr "" -#: src/unsafe-rust/unsafe-traits.md:26 +#: src/unsafe-rust/unsafe-traits.md msgid "// SAFETY: `u32` has a defined representation and no padding.\n" msgstr "" -#: src/unsafe-rust/unsafe-traits.md:34 +#: src/unsafe-rust/unsafe-traits.md msgid "" "There should be a `# Safety` section on the Rustdoc for the trait explaining " "the requirements for the trait to be safely implemented." msgstr "" -#: src/unsafe-rust/unsafe-traits.md:37 +#: src/unsafe-rust/unsafe-traits.md msgid "" "The actual safety section for `AsBytes` is rather longer and more " "complicated." msgstr "" -#: src/unsafe-rust/unsafe-traits.md:39 +#: src/unsafe-rust/unsafe-traits.md msgid "The built-in `Send` and `Sync` traits are unsafe." msgstr "" -#: src/unsafe-rust/exercise.md:1 +#: src/unsafe-rust/exercise.md msgid "Safe FFI Wrapper" msgstr "امن بودن FFI Wrapper" -#: src/unsafe-rust/exercise.md:3 +#: src/unsafe-rust/exercise.md msgid "" "Rust has great support for calling functions through a _foreign function " "interface_ (FFI). We will use this to build a safe wrapper for the `libc` " "functions you would use from C to read the names of files in a directory." msgstr "" -#: src/unsafe-rust/exercise.md:7 +#: src/unsafe-rust/exercise.md msgid "You will want to consult the manual pages:" msgstr "" -#: src/unsafe-rust/exercise.md:9 +#: src/unsafe-rust/exercise.md msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" msgstr "" -#: src/unsafe-rust/exercise.md:10 +#: src/unsafe-rust/exercise.md msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" msgstr "" -#: src/unsafe-rust/exercise.md:11 +#: src/unsafe-rust/exercise.md msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" msgstr "" -#: src/unsafe-rust/exercise.md:13 +#: src/unsafe-rust/exercise.md msgid "" "You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" "ffi/) module. There you find a number of string types which you need for the " "exercise:" msgstr "" -#: src/unsafe-rust/exercise.md:16 +#: src/unsafe-rust/exercise.md msgid "Encoding" msgstr "" -#: src/unsafe-rust/exercise.md:16 +#: src/unsafe-rust/exercise.md msgid "Use" msgstr "" -#: src/unsafe-rust/exercise.md:18 +#: src/unsafe-rust/exercise.md msgid "" "[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" "(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" -#: src/unsafe-rust/exercise.md:18 +#: src/unsafe-rust/exercise.md msgid "UTF-8" msgstr "" -#: src/unsafe-rust/exercise.md:18 +#: src/unsafe-rust/exercise.md msgid "Text processing in Rust" msgstr "" -#: src/unsafe-rust/exercise.md:19 +#: src/unsafe-rust/exercise.md msgid "" "[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" "(https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" -#: src/unsafe-rust/exercise.md:19 +#: src/unsafe-rust/exercise.md msgid "NUL-terminated" msgstr "" -#: src/unsafe-rust/exercise.md:19 +#: src/unsafe-rust/exercise.md msgid "Communicating with C functions" msgstr "" -#: src/unsafe-rust/exercise.md:20 +#: src/unsafe-rust/exercise.md msgid "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " "[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" -#: src/unsafe-rust/exercise.md:20 +#: src/unsafe-rust/exercise.md msgid "OS-specific" msgstr "" -#: src/unsafe-rust/exercise.md:20 +#: src/unsafe-rust/exercise.md msgid "Communicating with the OS" msgstr "" -#: src/unsafe-rust/exercise.md:22 +#: src/unsafe-rust/exercise.md msgid "You will convert between all these types:" msgstr "" -#: src/unsafe-rust/exercise.md:24 +#: src/unsafe-rust/exercise.md msgid "" "`&str` to `CString`: you need to allocate space for a trailing `\\0` " "character," msgstr "" -#: src/unsafe-rust/exercise.md:25 +#: src/unsafe-rust/exercise.md msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" -#: src/unsafe-rust/exercise.md:26 +#: src/unsafe-rust/exercise.md msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" -#: src/unsafe-rust/exercise.md:28 +#: src/unsafe-rust/exercise.md msgid "" "`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " "unknown data\"," msgstr "" -#: src/unsafe-rust/exercise.md:30 +#: src/unsafe-rust/exercise.md msgid "" "`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" -#: src/unsafe-rust/exercise.md:33 +#: src/unsafe-rust/exercise.md msgid "" "`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " "return it and call `readdir` again." msgstr "" -#: src/unsafe-rust/exercise.md:36 +#: src/unsafe-rust/exercise.md msgid "" "The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " "useful chapter about FFI." msgstr "" -#: src/unsafe-rust/exercise.md:47 +#: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" -#: src/unsafe-rust/exercise.md:56 src/unsafe-rust/exercise.md:69 -#: src/unsafe-rust/exercise.md:80 src/unsafe-rust/exercise.md:94 -#: src/unsafe-rust/exercise.md:102 src/unsafe-rust/solution.md:6 -#: src/unsafe-rust/solution.md:19 src/unsafe-rust/solution.md:30 -#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" msgstr "" -#: src/unsafe-rust/exercise.md:59 src/unsafe-rust/solution.md:9 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html.\n" msgstr "" -#: src/unsafe-rust/exercise.md:66 src/unsafe-rust/solution.md:16 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// Layout according to the Linux man page for readdir(3), where ino_t and\n" " // off_t are resolved according to the definitions in\n" " // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h}.\n" msgstr "" -#: src/unsafe-rust/exercise.md:79 src/unsafe-rust/solution.md:29 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "// Layout according to the macOS man page for dir(5).\n" msgstr "" -#: src/unsafe-rust/exercise.md:94 src/unsafe-rust/exercise.md:102 -#: src/unsafe-rust/solution.md:44 src/unsafe-rust/solution.md:52 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"x86_64\"" msgstr "" -#: src/unsafe-rust/exercise.md:97 src/unsafe-rust/solution.md:47 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" @@ -11813,103 +11781,102 @@ msgid "" "PowerPC.\n" msgstr "" -#: src/unsafe-rust/exercise.md:103 src/unsafe-rust/solution.md:53 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" msgstr "" -#: src/unsafe-rust/exercise.md:121 src/unsafe-rust/solution.md:71 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// Call opendir and return a Ok value if that worked,\n" " // otherwise return Err with a message.\n" msgstr "" -#: src/unsafe-rust/exercise.md:130 +#: src/unsafe-rust/exercise.md msgid "// Keep calling readdir until we get a NULL pointer back.\n" msgstr "" -#: src/unsafe-rust/exercise.md:137 src/unsafe-rust/solution.md:105 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "// Call closedir as needed.\n" msgstr "" -#: src/unsafe-rust/exercise.md:143 src/unsafe-rust/solution.md:116 -#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 -#: src/android/interoperability/with-c/rust.md:44 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/android/interoperability/with-c/rust.md msgid "\".\"" msgstr "" -#: src/unsafe-rust/exercise.md:144 src/unsafe-rust/solution.md:117 +#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"files: {:#?}\"" msgstr "" -#: src/unsafe-rust/solution.md:74 +#: src/unsafe-rust/solution.md msgid "\"Invalid path: {err}\"" msgstr "" -#: src/unsafe-rust/solution.md:75 +#: src/unsafe-rust/solution.md msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" msgstr "" -#: src/unsafe-rust/solution.md:78 +#: src/unsafe-rust/solution.md msgid "\"Could not open {:?}\"" msgstr "" -#: src/unsafe-rust/solution.md:88 +#: src/unsafe-rust/solution.md msgid "" "// Keep calling readdir until we get a NULL pointer back.\n" " // SAFETY: self.dir is never NULL.\n" msgstr "" -#: src/unsafe-rust/solution.md:92 +#: src/unsafe-rust/solution.md msgid "// We have reached the end of the directory.\n" msgstr "" -#: src/unsafe-rust/solution.md:95 +#: src/unsafe-rust/solution.md msgid "" "// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" " // terminated.\n" msgstr "" -#: src/unsafe-rust/solution.md:107 +#: src/unsafe-rust/solution.md msgid "// SAFETY: self.dir is not NULL.\n" msgstr "" -#: src/unsafe-rust/solution.md:109 +#: src/unsafe-rust/solution.md msgid "\"Could not close {:?}\"" msgstr "" -#: src/unsafe-rust/solution.md:128 +#: src/unsafe-rust/solution.md msgid "\"no-such-directory\"" msgstr "" -#: src/unsafe-rust/solution.md:136 src/unsafe-rust/solution.md:151 +#: src/unsafe-rust/solution.md msgid "\"Non UTF-8 character in path\"" msgstr "" -#: src/unsafe-rust/solution.md:140 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/solution.md msgid "\"..\"" msgstr "" -#: src/unsafe-rust/solution.md:147 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/solution.md msgid "\"foo.txt\"" msgstr "" -#: src/unsafe-rust/solution.md:147 +#: src/unsafe-rust/solution.md msgid "\"The Foo Diaries\\n\"" msgstr "" -#: src/unsafe-rust/solution.md:148 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/solution.md msgid "\"bar.png\"" msgstr "" -#: src/unsafe-rust/solution.md:148 +#: src/unsafe-rust/solution.md msgid "\"\\n\"" msgstr "" -#: src/unsafe-rust/solution.md:149 src/unsafe-rust/solution.md:155 +#: src/unsafe-rust/solution.md msgid "\"crab.rs\"" msgstr "" -#: src/unsafe-rust/solution.md:149 +#: src/unsafe-rust/solution.md msgid "\"//! Crab\\n\"" msgstr "" @@ -12131,39 +12098,24 @@ msgstr "" "کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md +#, fuzzy msgid "" -"Soong has many similarities to Bazel, which is the open-source variant of " -"Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" "‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " "استفاده در google3)." -#: src/android/build-rules.md -msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/" -"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) to Bazel." -msgstr "" -"برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" -"bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" -"bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) به Bazel." - -#: src/android/build-rules.md -msgid "Learning Bazel-like build rules is useful for all Rust OS developers." -msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." - #: src/android/build-rules.md #, fuzzy msgid "Fun fact: Data from Star Trek is a Soong-type Android." msgstr "واقعیت جالب: داده‌های Star Trek یک اندروید از نوع Soong است." -#: src/android/build-rules/binary.md:1 +#: src/android/build-rules/binary.md msgid "Rust Binaries" msgstr "Rust Binaries" -#: src/android/build-rules/binary.md:3 +#: src/android/build-rules/binary.md msgid "" "Let us start with a simple application. At the root of an AOSP checkout, " "create the following files:" @@ -12171,42 +12123,42 @@ msgstr "" "اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " "ایجاد کنید:" -#: src/android/build-rules/binary.md:6 src/android/build-rules/library.md:13 +#: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" msgstr "_hello_rust/Android.bp_:" -#: src/android/build-rules/binary.md:10 src/android/build-rules/binary.md:11 +#: src/android/build-rules/binary.md #, fuzzy msgid "\"hello_rust\"" msgstr "\"hello_rust\"" -#: src/android/build-rules/binary.md:12 src/android/build-rules/library.md:19 +#: src/android/build-rules/binary.md src/android/build-rules/library.md #: src/android/logging.md msgid "\"src/main.rs\"" msgstr "\"src/main.rs\"" -#: src/android/build-rules/binary.md:16 src/android/build-rules/library.md:34 +#: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/src/main.rs_:" msgstr "_hello_rust/src/main.rs_:" -#: src/android/build-rules/binary.md:19 src/android/build-rules/library.md:37 +#: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "//! Rust demo.\n" msgstr "//! Rust demo.\n" -#: src/android/build-rules/binary.md:20 src/android/build-rules/library.md:41 +#: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "/// Prints a greeting to standard output.\n" msgstr "/// Prints a greeting to standard output.\n" -#: src/android/build-rules/binary.md:23 src/exercises/chromium/build-rules.md:9 +#: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md #, fuzzy msgid "\"Hello from Rust!\"" msgstr "\"Hello from Rust!\"" -#: src/android/build-rules/binary.md:27 +#: src/android/build-rules/binary.md msgid "You can now build, push, and run the binary:" msgstr "اکنون می‌توانید باینری را بسازید، push و اجرا کنید:" -#: src/android/build-rules/binary.md:29 +#: src/android/build-rules/binary.md msgid "" "```shell\n" "m hello_rust\n" @@ -12220,25 +12172,25 @@ msgstr "" "adb shell /data/local/tmp/hello_rust\n" "```" -#: src/android/build-rules/library.md:1 +#: src/android/build-rules/library.md msgid "Rust Libraries" msgstr "کتابخانه‌های Rust" -#: src/android/build-rules/library.md:3 +#: src/android/build-rules/library.md msgid "You use `rust_library` to create a new Rust library for Android." msgstr "" "شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده " "می‌کنید." -#: src/android/build-rules/library.md:5 +#: src/android/build-rules/library.md msgid "Here we declare a dependency on two libraries:" msgstr "در اینجا ما یک وابستگی به دو کتابخانه را اعلام می‌کنیم:" -#: src/android/build-rules/library.md:7 +#: src/android/build-rules/library.md msgid "`libgreeting`, which we define below," msgstr "‏ `libgreeting`, چیزی که در زیر تعریف می‌کنیم," -#: src/android/build-rules/library.md:8 +#: src/android/build-rules/library.md #, fuzzy msgid "" "`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" @@ -12249,56 +12201,56 @@ msgstr "" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/) عرضه شده است." -#: src/android/build-rules/library.md:17 src/android/build-rules/library.md:18 +#: src/android/build-rules/library.md #, fuzzy msgid "\"hello_rust_with_dep\"" msgstr "\"hello_rust_with_dep\"" -#: src/android/build-rules/library.md:21 src/android/build-rules/library.md:28 +#: src/android/build-rules/library.md msgid "\"libgreetings\"" msgstr "\"libgreetings\"" -#: src/android/build-rules/library.md:22 +#: src/android/build-rules/library.md msgid "\"libtextwrap\"" msgstr "\"libtextwrap\"" -#: src/android/build-rules/library.md:24 +#: src/android/build-rules/library.md msgid "// Need this to avoid dynamic link error.\n" msgstr "// Need this to avoid dynamic link error.\n" -#: src/android/build-rules/library.md:29 +#: src/android/build-rules/library.md #, fuzzy msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md:30 -#: src/android/aidl/example-service/service.md:28 src/android/testing.md -#: src/android/interoperability/java.md:39 +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/service.md src/android/testing.md +#: src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" -#: src/android/build-rules/library.md:48 +#: src/android/build-rules/library.md msgid "_hello_rust/src/lib.rs_:" msgstr "_hello_rust/src/lib.rs_:" -#: src/android/build-rules/library.md:51 +#: src/android/build-rules/library.md msgid "//! Greeting library.\n" msgstr "//! Greeting library.\n" -#: src/android/build-rules/library.md:52 +#: src/android/build-rules/library.md msgid "/// Greet `name`.\n" msgstr "/// Greet `name`.\n" -#: src/android/build-rules/library.md:55 +#: src/android/build-rules/library.md #, fuzzy msgid "\"Hello {name}, it is very nice to meet you!\"" msgstr "\"Hello {name}, it is very nice to meet you!\"" -#: src/android/build-rules/library.md:59 +#: src/android/build-rules/library.md msgid "You build, push, and run the binary like before:" msgstr "باینری را مانند قبل می سازید، push و اجرا می‌کنید:" -#: src/android/build-rules/library.md:61 +#: src/android/build-rules/library.md msgid "" "```shell\n" "m hello_rust_with_dep\n" @@ -12330,7 +12282,7 @@ msgstr "کد Rust می تواند سرورهای AIDL موجود را فراخو msgid "You can create new AIDL servers in Rust." msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجاد کنید." -#: src/android/aidl/birthday-service.md:3 +#: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " "process of creating a Binder interface. We're then going to both implement " @@ -12340,50 +12292,50 @@ msgstr "" "Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " "کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." -#: src/android/aidl/example-service/interface.md:1 +#: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" msgstr "AIDL Interfaces" -#: src/android/aidl/example-service/interface.md:3 +#: src/android/aidl/example-service/interface.md msgid "You declare the API of your service using an AIDL interface:" msgstr "شما API سرویس خود را با استفاده از یک AIDL interface اعلام می‌کنید:" -#: src/android/aidl/example-service/interface.md:5 -#: src/android/aidl/example-service/service-bindings.md:6 +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -#: src/android/aidl/example-service/interface.md:8 -#: src/android/aidl/example-service/service-bindings.md:9 -#: src/android/aidl/example-service/changing-definition.md:8 +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/example-service/changing-definition.md msgid "/** Birthday service interface. */" msgstr "/** Birthday service interface. */" -#: src/android/aidl/example-service/interface.md:10 -#: src/android/aidl/example-service/service-bindings.md:11 -#: src/android/aidl/example-service/changing-definition.md:11 +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/example-service/changing-definition.md msgid "/** Generate a Happy Birthday message. */" msgstr "/** Generate a Happy Birthday message. */" -#: src/android/aidl/example-service/interface.md:15 +#: src/android/aidl/example-service/interface.md msgid "_birthday_service/aidl/Android.bp_:" msgstr "_birthday_service/aidl/Android.bp_:" -#: src/android/aidl/example-service/interface.md:19 +#: src/android/aidl/example-service/interface.md msgid "\"com.example.birthdayservice\"" msgstr "\"com.example.birthdayservice\"" -#: src/android/aidl/example-service/interface.md:20 +#: src/android/aidl/example-service/interface.md msgid "\"com/example/birthdayservice/*.aidl\"" msgstr "\"com/example/birthdayservice/*.aidl\"" -#: src/android/aidl/example-service/interface.md:23 +#: src/android/aidl/example-service/interface.md msgid "// Rust is not enabled by default\n" msgstr "// Rust is not enabled by default\n" -#: src/android/aidl/example-service/interface.md:32 +#: src/android/aidl/example-service/interface.md #, fuzzy msgid "" "Note that the directory structure under the `aidl/` directory needs to match " @@ -12395,11 +12347,11 @@ msgstr "" "example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." "aidl` است. `." -#: src/android/aidl/example-service/service-bindings.md:1 +#: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" msgstr "Generated Service API" -#: src/android/aidl/example-service/service-bindings.md:3 +#: src/android/aidl/example-service/service-bindings.md msgid "" "Binder generates a trait corresponding to the interface definition. trait to " "talk to the service." @@ -12407,11 +12359,11 @@ msgstr "" "‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " "با سرویس" -#: src/android/aidl/example-service/service-bindings.md:16 +#: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" msgstr "_Generated trait_:" -#: src/android/aidl/example-service/service-bindings.md:24 +#: src/android/aidl/example-service/service-bindings.md msgid "" "Your service will need to implement this trait, and your client will use " "this trait to talk to the service." @@ -12419,7 +12371,7 @@ msgstr "" "سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " "صحبت با سرویس‌ها استفاده خواهد کرد." -#: src/android/aidl/example-service/service-bindings.md:29 +#: src/android/aidl/example-service/service-bindings.md msgid "" "The generated bindings can be found at `out/soong/.intermediates//`." @@ -12427,7 +12379,7 @@ msgstr "" "پیوندهای تولید شده را می توان در `out/soong/.intermediates//" "` یافت." -#: src/android/aidl/example-service/service-bindings.md:31 +#: src/android/aidl/example-service/service-bindings.md msgid "" "Point out how the generated function signature, specifically the argument " "and return types, correspond the interface definition." @@ -12435,7 +12387,7 @@ msgstr "" "اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " "بازگشتی، با تعریف interface مطابقت دارد." -#: src/android/aidl/example-service/service-bindings.md:33 +#: src/android/aidl/example-service/service-bindings.md msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." @@ -12443,61 +12395,61 @@ msgstr "" "‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " "type برگشتی می‌شود." -#: src/android/aidl/example-service/service.md:1 +#: src/android/aidl/example-service/service.md msgid "Service Implementation" msgstr "پیاده‌سازی سرویس‌ها" -#: src/android/aidl/example-service/service.md:3 +#: src/android/aidl/example-service/service.md msgid "We can now implement the AIDL service:" msgstr "اکنون می‌توانیم سرویس AIDL را پیاده‌سازی کنیم:" -#: src/android/aidl/example-service/service.md:5 -#: src/android/aidl/example-service/changing-implementation.md:5 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/changing-implementation.md msgid "_birthday_service/src/lib.rs_:" msgstr "_birthday_service/src/lib.rs_:" -#: src/android/aidl/example-service/service.md:10 +#: src/android/aidl/example-service/service.md msgid "/// The `IBirthdayService` implementation.\n" msgstr "/// The `IBirthdayService` implementation.\n" -#: src/android/aidl/example-service/service.md:18 -#: src/android/aidl/example-service/changing-implementation.md:16 -#: src/android/aidl/types/file-descriptor.md:57 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "\"Happy Birthday {name}, congratulations with the {years} years!\"" -#: src/android/aidl/example-service/service.md:23 -#: src/android/aidl/example-service/server.md:28 -#: src/android/aidl/example-service/client.md:31 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md msgid "_birthday_service/Android.bp_:" msgstr "_birthday_service/Android.bp_:" -#: src/android/aidl/example-service/service.md:27 -#: src/android/aidl/example-service/server.md:38 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md msgid "\"libbirthdayservice\"" msgstr "\"libbirthdayservice\"" -#: src/android/aidl/example-service/service.md:29 -#: src/android/aidl/example-service/server.md:13 -#: src/android/aidl/example-service/client.md:11 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md #, fuzzy msgid "\"birthdayservice\"" msgstr "\"birthdayservice\"" -#: src/android/aidl/example-service/service.md:31 -#: src/android/aidl/example-service/server.md:36 -#: src/android/aidl/example-service/client.md:39 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md msgid "\"com.example.birthdayservice-rust\"" msgstr "\"com.example.birthdayservice-rust\"" -#: src/android/aidl/example-service/service.md:32 -#: src/android/aidl/example-service/server.md:37 -#: src/android/aidl/example-service/client.md:40 +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md msgid "\"libbinder_rs\"" msgstr "\"libbinder_rs\"" -#: src/android/aidl/example-service/service.md:39 +#: src/android/aidl/example-service/service.md msgid "" "Point out the path to the generated `IBirthdayService` trait, and explain " "why each of the segments is necessary." @@ -12505,7 +12457,7 @@ msgstr "" "به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " "از بخش‌ها ضروری است." -#: src/android/aidl/example-service/service.md:41 +#: src/android/aidl/example-service/service.md msgid "" "TODO: What does the `binder::Interface` trait do? Are there methods to " "override? Where source?" @@ -12513,48 +12465,47 @@ msgstr "" "‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " "برای override وجود دارد؟ source کجاست؟" -#: src/android/aidl/example-service/server.md:1 +#: src/android/aidl/example-service/server.md msgid "AIDL Server" msgstr "AIDL Server" -#: src/android/aidl/example-service/server.md:3 +#: src/android/aidl/example-service/server.md msgid "Finally, we can create a server which exposes the service:" msgstr "در نهایت، می توانیم سروری ایجاد کنیم که سرویس را expose می‌کند:" -#: src/android/aidl/example-service/server.md:5 +#: src/android/aidl/example-service/server.md msgid "_birthday_service/src/server.rs_:" msgstr "_birthday_service/src/server.rs_:" -#: src/android/aidl/example-service/server.md:8 +#: src/android/aidl/example-service/server.md msgid "//! Birthday service.\n" msgstr "//! Birthday service.\n" -#: src/android/aidl/example-service/server.md:14 +#: src/android/aidl/example-service/server.md msgid "/// Entry point for birthday service.\n" msgstr "/// Entry point for birthday service.\n" -#: src/android/aidl/example-service/server.md:23 +#: src/android/aidl/example-service/server.md #, fuzzy msgid "\"Failed to register service\"" msgstr "\"Failed to register service\"" -#: src/android/aidl/example-service/server.md:32 -#: src/android/aidl/example-service/server.md:33 +#: src/android/aidl/example-service/server.md #, fuzzy msgid "\"birthday_server\"" msgstr "\"birthday_server\"" -#: src/android/aidl/example-service/server.md:34 +#: src/android/aidl/example-service/server.md #, fuzzy msgid "\"src/server.rs\"" msgstr "سرورها" -#: src/android/aidl/example-service/server.md:40 -#: src/android/aidl/example-service/client.md:42 +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md msgid "// To avoid dynamic link error.\n" msgstr "// To avoid dynamic link error.\n" -#: src/android/aidl/example-service/server.md:46 +#: src/android/aidl/example-service/server.md msgid "" "The process for taking a user-defined service implementation (in this case " "the `BirthdayService` type, which implements the `IBirthdayService`) and " @@ -12568,11 +12519,11 @@ msgstr "" "نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " "دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." -#: src/android/aidl/example-service/server.md:52 +#: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ایجاد کنید." -#: src/android/aidl/example-service/server.md:53 +#: src/android/aidl/example-service/server.md msgid "" "Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " "this case). This type is generated by Binder and provides the common Binder " @@ -12586,7 +12537,7 @@ msgstr "" "ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " "`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." -#: src/android/aidl/example-service/server.md:58 +#: src/android/aidl/example-service/server.md msgid "" "Call `add_service`, giving it a service identifier and your service object " "(the `BnBirthdayService` object in the example)." @@ -12594,7 +12545,7 @@ msgstr "" "‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " "(شی‏ «BnBirthdayService» در مثال)." -#: src/android/aidl/example-service/server.md:60 +#: src/android/aidl/example-service/server.md msgid "" "Call `join_thread_pool` to add the current thread to Binder's thread pool " "and start listening for connections." @@ -12602,11 +12553,11 @@ msgstr "" "‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " "اضافه کنید و شروع به گوش دادن برای connectionها کنید." -#: src/android/aidl/example-service/deploy.md:3 +#: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" msgstr "اکنون می‌توانیم سرویس را بسازیم، push کنیم و شروع کنیم:" -#: src/android/aidl/example-service/deploy.md:5 +#: src/android/aidl/example-service/deploy.md msgid "" "```shell\n" "m birthday_server\n" @@ -12624,67 +12575,65 @@ msgstr "" "adb shell /data/local/tmp/birthday_server\n" "```" -#: src/android/aidl/example-service/deploy.md:12 +#: src/android/aidl/example-service/deploy.md msgid "In another terminal, check that the service runs:" msgstr "در ترمینال دیگر، بررسی کنید که آیا سرویسی اجرا شود:" -#: src/android/aidl/example-service/deploy.md:22 +#: src/android/aidl/example-service/deploy.md msgid "You can also call the service with `service call`:" msgstr "همچنین می‌توانید با `service call` با سرویس تماس بگیرید:" -#: src/android/aidl/example-service/client.md:1 +#: src/android/aidl/example-service/client.md msgid "AIDL Client" msgstr "AIDL Client" -#: src/android/aidl/example-service/client.md:3 +#: src/android/aidl/example-service/client.md msgid "Finally, we can create a Rust client for our new service." msgstr "در‌نهایت، ما می‌توانیم یک Rust client برای سرویس جدید خود ایجاد کنیم." -#: src/android/aidl/example-service/client.md:5 -#: src/android/aidl/example-service/changing-implementation.md:29 +#: src/android/aidl/example-service/client.md +#: src/android/aidl/example-service/changing-implementation.md msgid "_birthday_service/src/client.rs_:" msgstr "_birthday_service/src/client.rs_:" -#: src/android/aidl/example-service/client.md:12 +#: src/android/aidl/example-service/client.md msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" -#: src/android/aidl/example-service/client.md:23 -#: src/android/aidl/types/objects.md:54 -#: src/android/aidl/types/parcelables.md:32 -#: src/android/aidl/types/file-descriptor.md:20 +#: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md +#: src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" -#: src/android/aidl/example-service/client.md:25 +#: src/android/aidl/example-service/client.md msgid "// Call the service.\n" msgstr "// Call the service.\n" -#: src/android/aidl/example-service/client.md:27 +#: src/android/aidl/example-service/client.md msgid "\"{msg}\"" msgstr "\"{msg}\"" -#: src/android/aidl/example-service/client.md:35 -#: src/android/aidl/example-service/client.md:36 +#: src/android/aidl/example-service/client.md #, fuzzy msgid "\"birthday_client\"" msgstr "\"birthday_client\"" -#: src/android/aidl/example-service/client.md:37 +#: src/android/aidl/example-service/client.md #, fuzzy msgid "\"src/client.rs\"" msgstr "\"src/client.rs\"" -#: src/android/aidl/example-service/client.md:46 +#: src/android/aidl/example-service/client.md msgid "Notice that the client does not depend on `libbirthdayservice`." msgstr "توجه داشته باشید که client به `libbirthdayservice` وابسته نیست." -#: src/android/aidl/example-service/client.md:48 +#: src/android/aidl/example-service/client.md msgid "Build, push, and run the client on your device:" msgstr "کلاینت را در دستگاه خود بسازید، push کرده و اجرا کنید:" -#: src/android/aidl/example-service/client.md:50 +#: src/android/aidl/example-service/client.md msgid "" "```shell\n" "m birthday_client\n" @@ -12700,7 +12649,7 @@ msgstr "" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" -#: src/android/aidl/example-service/client.md:62 +#: src/android/aidl/example-service/client.md msgid "" "`Strong` is the trait object representing the service " "that the client has connected to." @@ -12708,7 +12657,7 @@ msgstr "" "‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " "که کلاینت به آن متصل شده است." -#: src/android/aidl/example-service/client.md:64 +#: src/android/aidl/example-service/client.md msgid "" "`Strong` is a custom smart pointer type for Binder. It handles both an in-" "process ref count for the service trait object, and the global Binder ref " @@ -12719,7 +12668,7 @@ msgstr "" "شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " "ردیابی می‌کند." -#: src/android/aidl/example-service/client.md:67 +#: src/android/aidl/example-service/client.md #, fuzzy msgid "" "Note that the trait object that the client uses to talk to the service uses " @@ -12732,7 +12681,7 @@ msgstr "" "interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " "از آن استفاده می کنند." -#: src/android/aidl/example-service/client.md:71 +#: src/android/aidl/example-service/client.md msgid "" "Use the same service identifier used when registering the service. This " "should ideally be defined in a common crate that both the client and server " @@ -12742,7 +12691,7 @@ msgstr "" "ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " "آن وابسته باشند." -#: src/android/aidl/example-service/changing-definition.md:3 +#: src/android/aidl/example-service/changing-definition.md msgid "" "Let us extend the API with more functionality: we want to let clients " "specify a list of lines for the birthday card:" @@ -12750,11 +12699,11 @@ msgstr "" "اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " "دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" -#: src/android/aidl/example-service/changing-definition.md:16 +#: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" msgstr "این منجر به یک تعریف ویژگی به روز شده برای `IBirthdayService` می‌شود:" -#: src/android/aidl/example-service/changing-definition.md:31 +#: src/android/aidl/example-service/changing-definition.md msgid "" "Note how the `String[]` in the AIDL definition is translated as a " "`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " @@ -12764,66 +12713,66 @@ msgstr "" "Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " "شده تا جایی که ممکن است استفاده می‌شود:" -#: src/android/aidl/example-service/changing-definition.md:34 +#: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." msgstr "آرگومان های آرایه `in` به sliceها ترجمه می‌شوند." -#: src/android/aidl/example-service/changing-definition.md:35 +#: src/android/aidl/example-service/changing-definition.md msgid "`out` and `inout` args are translated to `&mut Vec`." msgstr "آرگومان‌های`out` و `inout` به `&mut Vec` ترجمه می‌شوند." -#: src/android/aidl/example-service/changing-definition.md:36 +#: src/android/aidl/example-service/changing-definition.md msgid "Return values are translated to returning a `Vec`." msgstr "مقادیر بازگشتی به بازگرداندن `Vec` ترجمه می‌شوند." -#: src/android/aidl/example-service/changing-implementation.md:1 +#: src/android/aidl/example-service/changing-implementation.md msgid "Updating Client and Service" msgstr "به‌روزرسانی کلاینت و سرویس‌ها" -#: src/android/aidl/example-service/changing-implementation.md:3 +#: src/android/aidl/example-service/changing-implementation.md msgid "Update the client and server code to account for the new API." msgstr "کد سرویس کلاینت و سرور را برای حساب کردن API جدید به‌روز کنید." -#: src/android/aidl/example-service/changing-implementation.md:20 +#: src/android/aidl/example-service/changing-implementation.md msgid "'\\n'" msgstr "'\\n'" -#: src/android/aidl/example-service/changing-implementation.md:36 +#: src/android/aidl/example-service/changing-implementation.md #, fuzzy msgid "\"Habby birfday to yuuuuu\"" msgstr "\"Habby birfday to yuuuuu\"" -#: src/android/aidl/example-service/changing-implementation.md:37 +#: src/android/aidl/example-service/changing-implementation.md #, fuzzy msgid "\"And also: many more\"" msgstr "\"And also: many more\"" -#: src/android/aidl/example-service/changing-implementation.md:44 +#: src/android/aidl/example-service/changing-implementation.md #, fuzzy msgid "" "TODO: Move code snippets into project files where they'll actually be built?" msgstr "" "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" -#: src/android/aidl/types.md:1 +#: src/android/aidl/types.md msgid "Working With AIDL Types" msgstr "کار با انواع AIDL" -#: src/android/aidl/types.md:3 +#: src/android/aidl/types.md msgid "AIDL types translate into the appropriate idiomatic Rust type:" msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه می‌شوند:" -#: src/android/aidl/types.md:5 +#: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." msgstr "" "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." -#: src/android/aidl/types.md:6 +#: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." -#: src/android/aidl/types.md:7 +#: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." @@ -12831,88 +12780,88 @@ msgstr "" "ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " "کرد." -#: src/android/aidl/types.md:9 +#: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور کامل پشتیبانی می‌شوند." -#: src/android/aidl/types/primitives.md:3 +#: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" msgstr "" "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" -#: src/android/aidl/types/primitives.md:5 +#: src/android/aidl/types/primitives.md #, fuzzy msgid "AIDL Type" msgstr "AIDL" -#: src/android/aidl/types/primitives.md:5 src/android/aidl/types/arrays.md:7 -#: src/android/interoperability/cpp/type-mapping.md:3 +#: src/android/aidl/types/primitives.md src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "Rust Type" msgstr "انواع داده‌های بازگشتی" -#: src/android/aidl/types/primitives.md:5 +#: src/android/aidl/types/primitives.md msgid "Note" msgstr "نکته" -#: src/android/aidl/types/primitives.md:7 +#: src/android/aidl/types/primitives.md msgid "`boolean`" msgstr "بولین‌ها`boolean`" -#: src/android/aidl/types/primitives.md:8 +#: src/android/aidl/types/primitives.md msgid "`byte`" msgstr "" -#: src/android/aidl/types/primitives.md:8 +#: src/android/aidl/types/primitives.md msgid "`i8`" msgstr "`i8`" -#: src/android/aidl/types/primitives.md:8 +#: src/android/aidl/types/primitives.md msgid "Note that bytes are signed." msgstr "توجه داشته باشید که بایت‌ها امضا شده‌اند." -#: src/android/aidl/types/primitives.md:9 +#: src/android/aidl/types/primitives.md msgid "`u16`" msgstr "`u16`" -#: src/android/aidl/types/primitives.md:9 +#: src/android/aidl/types/primitives.md msgid "Note the usage of `u16`, NOT `u32`." msgstr "به استفاده از `u16` توجه کنید، نه `u32`." -#: src/android/aidl/types/primitives.md:10 +#: src/android/aidl/types/primitives.md msgid "`int`" msgstr "`int`" -#: src/android/aidl/types/primitives.md:10 +#: src/android/aidl/types/primitives.md msgid "`i32`" msgstr "`i32`" -#: src/android/aidl/types/primitives.md:11 +#: src/android/aidl/types/primitives.md msgid "`long`" msgstr "`long`" -#: src/android/aidl/types/primitives.md:11 +#: src/android/aidl/types/primitives.md msgid "`i64`" msgstr "`i64`" -#: src/android/aidl/types/primitives.md:12 +#: src/android/aidl/types/primitives.md msgid "`float`" msgstr "`float`" -#: src/android/aidl/types/primitives.md:12 +#: src/android/aidl/types/primitives.md msgid "`f32`" msgstr "`f32`" -#: src/android/aidl/types/primitives.md:13 +#: src/android/aidl/types/primitives.md msgid "`double`" msgstr "`double`" -#: src/android/aidl/types/primitives.md:13 +#: src/android/aidl/types/primitives.md msgid "`f64`" msgstr "`f64`" -#: src/android/aidl/types/arrays.md:3 +#: src/android/aidl/types/arrays.md msgid "" "The array types (`T[]`, `byte[]`, and `List`) get translated to the " "appropriate Rust array type depending on how they are used in the function " @@ -12921,37 +12870,37 @@ msgstr "" "انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در " "function signature، به Rust array type مناسب ترجمه می‌شوند:" -#: src/android/aidl/types/arrays.md:7 +#: src/android/aidl/types/arrays.md #, fuzzy msgid "Position" msgstr "راه حل" -#: src/android/aidl/types/arrays.md:9 +#: src/android/aidl/types/arrays.md msgid "`in` argument" msgstr "`in` argument" -#: src/android/aidl/types/arrays.md:9 +#: src/android/aidl/types/arrays.md msgid "`&[T]`" msgstr "`&[T]`" -#: src/android/aidl/types/arrays.md:10 +#: src/android/aidl/types/arrays.md msgid "`out`/`inout` argument" msgstr "`out`/`inout` argument" -#: src/android/aidl/types/arrays.md:10 +#: src/android/aidl/types/arrays.md msgid "`&mut Vec`" msgstr "`&mut Vec`" -#: src/android/aidl/types/arrays.md:11 +#: src/android/aidl/types/arrays.md msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md:11 -#: src/android/interoperability/cpp/type-mapping.md:11 +#: src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" -#: src/android/aidl/types/arrays.md:15 +#: src/android/aidl/types/arrays.md msgid "" "In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " "becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " @@ -12963,11 +12912,11 @@ msgstr "" "(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " "type نمایش داده می‌شوند." -#: src/android/aidl/types/arrays.md:18 +#: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه به `Vec` ترجمه می‌شوند." -#: src/android/aidl/types/objects.md:3 +#: src/android/aidl/types/objects.md msgid "" "AIDL objects can be sent either as a concrete AIDL type or as the type-" "erased `IBinder` interface:" @@ -12975,7 +12924,7 @@ msgstr "" "‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " "interface پاک‌شده ارسال کرد:" -#: src/android/aidl/types/objects.md:6 +#: src/android/aidl/types/objects.md msgid "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." "aidl**:" @@ -12983,49 +12932,47 @@ msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." "aidl**:" -#: src/android/aidl/types/objects.md:17 -#: src/android/aidl/types/parcelables.md:16 -#: src/android/aidl/types/file-descriptor.md:6 +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" -#: src/android/aidl/types/objects.md:23 +#: src/android/aidl/types/objects.md msgid "/** The same thing, but using a binder object. */" msgstr "/** The same thing, but using a binder object. */" -#: src/android/aidl/types/objects.md:26 +#: src/android/aidl/types/objects.md msgid "/** The same thing, but using `IBinder`. */" msgstr "/** The same thing, but using `IBinder`. */" -#: src/android/aidl/types/objects.md:31 -#: src/android/aidl/types/parcelables.md:27 -#: src/android/aidl/types/file-descriptor.md:15 +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "**birthday_service/src/client.rs**:" msgstr "**birthday_service/src/client.rs**:" -#: src/android/aidl/types/objects.md:34 +#: src/android/aidl/types/objects.md msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" msgstr "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" -#: src/android/aidl/types/objects.md:56 +#: src/android/aidl/types/objects.md msgid "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" msgstr "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" -#: src/android/aidl/types/objects.md:62 +#: src/android/aidl/types/objects.md #, fuzzy msgid "// Send the binder object to the service.\n" msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" -#: src/android/aidl/types/objects.md:65 +#: src/android/aidl/types/objects.md #, fuzzy msgid "" "// Perform the same operation but passing the provider as an `SpIBinder`.\n" msgstr "" "// Perform the same operation but passing the provider as an `SpIBinder`.\n" -#: src/android/aidl/types/objects.md:72 +#: src/android/aidl/types/objects.md msgid "" "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " "`BnBirthdayService` that we saw previously." @@ -13033,23 +12980,23 @@ msgstr "" "به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف " "`BnBirthdayService` است که قبلاً دیدیم." -#: src/android/aidl/types/parcelables.md:3 +#: src/android/aidl/types/parcelables.md #, fuzzy msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" -#: src/android/aidl/types/parcelables.md:5 +#: src/android/aidl/types/parcelables.md msgid "" "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -#: src/android/aidl/types/parcelables.md:22 +#: src/android/aidl/types/parcelables.md #, fuzzy msgid "/** The same thing, but with a parcelable. */" msgstr "/** The same thing, but with a parcelable. */" -#: src/android/aidl/types/file-descriptor.md:3 +#: src/android/aidl/types/file-descriptor.md msgid "" "Files can be sent between Binder clients/servers using the " "`ParcelFileDescriptor` type:" @@ -13057,38 +13004,38 @@ msgstr "" "فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" "سرورهای Binder ارسال کرد:" -#: src/android/aidl/types/file-descriptor.md:10 +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "/** The same thing, but loads info from a file. */" msgstr "/** The same thing, but loads info from a file. */" -#: src/android/aidl/types/file-descriptor.md:22 +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "// Open a file and put the birthday info in it.\n" msgstr "// Open a file and put the birthday info in it.\n" -#: src/android/aidl/types/file-descriptor.md:23 +#: src/android/aidl/types/file-descriptor.md msgid "\"/data/local/tmp/birthday.info\"" msgstr "\"/data/local/tmp/birthday.info\"" -#: src/android/aidl/types/file-descriptor.md:24 +#: src/android/aidl/types/file-descriptor.md msgid "\"{name}\"" msgstr "\"{name}\"" -#: src/android/aidl/types/file-descriptor.md:25 +#: src/android/aidl/types/file-descriptor.md msgid "\"{years}\"" msgstr "\"{years}\"" -#: src/android/aidl/types/file-descriptor.md:27 +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" msgstr "// Create a `ParcelFileDescriptor` from the file and send it.\n" -#: src/android/aidl/types/file-descriptor.md:33 +#: src/android/aidl/types/file-descriptor.md msgid "**birthday_service/src/lib.rs**:" msgstr "**birthday_service/src/lib.rs**:" -#: src/android/aidl/types/file-descriptor.md:41 +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" @@ -13101,12 +13048,12 @@ msgstr "" "`File`\n" " // object.\n" -#: src/android/aidl/types/file-descriptor.md:48 +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Invalid file handle\"" msgstr "\"Invalid file handle\"" -#: src/android/aidl/types/file-descriptor.md:64 +#: src/android/aidl/types/file-descriptor.md msgid "" "`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " "`File` (or any other type that wraps an `OwnedFd`), and can be used to " @@ -13116,7 +13063,7 @@ msgstr "" "`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " "برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." -#: src/android/aidl/types/file-descriptor.md:67 +#: src/android/aidl/types/file-descriptor.md msgid "" "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " "UNIX sockets." @@ -13158,7 +13105,7 @@ msgstr "\"libleftpad_test\"" msgid "\"leftpad_test\"" msgstr "\"leftpad_test\"" -#: src/android/testing.md src/android/interoperability/with-c/bindgen.md:116 +#: src/android/testing.md src/android/interoperability/with-c/bindgen.md msgid "\"general-tests\"" msgstr "\"general-tests\"" @@ -13228,7 +13175,7 @@ msgstr "" "توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " "بازگشتی در ماژول‌های تودرتو یافت می‌شوند." -#: src/android/testing/googletest.md:3 +#: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" @@ -13236,15 +13183,15 @@ msgstr "" "جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " "اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" -#: src/android/testing/googletest.md:11 +#: src/android/testing/googletest.md msgid "\"baz\"" msgstr "\"baz\"" -#: src/android/testing/googletest.md:12 +#: src/android/testing/googletest.md msgid "\"xyz\"" msgstr "\"xyz\"" -#: src/android/testing/googletest.md:16 +#: src/android/testing/googletest.md msgid "" "If we change the last element to `\"!\"`, the test fails with a structured " "error message pin-pointing the error:" @@ -13252,7 +13199,7 @@ msgstr "" "اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " "که خطا را pin-pointing می‌کند، شکست می خورد:" -#: src/android/testing/googletest.md:37 +#: src/android/testing/googletest.md msgid "" "GoogleTest is not part of the Rust Playground, so you need to run this " "example in a local environment. Use `cargo add googletest` to quickly add it " @@ -13262,7 +13209,7 @@ msgstr "" "محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " "add googletest` استفاده کنید." -#: src/android/testing/googletest.md:41 +#: src/android/testing/googletest.md msgid "" "The `use googletest::prelude::*;` line imports a number of [commonly used " "macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." @@ -13272,14 +13219,15 @@ msgstr "" "(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " "می‌کند." -#: src/android/testing/googletest.md:44 +#: src/android/testing/googletest.md +#, fuzzy msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://github.com/mainmatter/rust-advanced-testing-" -"workshop), a self-guided Rust course: it provides a guided introduction to " -"the library, with exercises to help you get comfortable with `googletest` " -"macros, its matchers and its overall philosophy." +"going through the first chapter of [\"Advanced testing for Rust applications" +"\"](https://rust-exercises.com/advanced-testing/), a self-guided Rust " +"course: it provides a guided introduction to the library, with exercises to " +"help you get comfortable with `googletest` macros, its matchers and its " +"overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " "پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" @@ -13287,7 +13235,7 @@ msgstr "" "راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " "`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." -#: src/android/testing/googletest.md:51 +#: src/android/testing/googletest.md msgid "" "A particularly nice feature is that mismatches in multi-line strings are " "shown as a diff:" @@ -13295,7 +13243,7 @@ msgstr "" "یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " "نشان داده می شود:" -#: src/android/testing/googletest.md:57 +#: src/android/testing/googletest.md msgid "" "\"Memory safety found,\\n\\\n" " Rust's strong typing guides the way,\\n\\\n" @@ -13305,7 +13253,7 @@ msgstr "" " Rust's strong typing guides the way,\\n\\\n" " Secure code you'll write.\"" -#: src/android/testing/googletest.md:62 +#: src/android/testing/googletest.md msgid "" "\"Memory safety found,\\n\\\n" " Rust's silly humor guides the way,\\n\\\n" @@ -13315,11 +13263,11 @@ msgstr "" " Rust's silly humor guides the way,\\n\\\n" " Secure code you'll write.\"" -#: src/android/testing/googletest.md:69 +#: src/android/testing/googletest.md msgid "shows a color-coded diff (colors not shown here):" msgstr "تفاوت رنگی را نشان می‌دهد (رنگ ها در اینجا نشان‌داده نمی‌شوند):" -#: src/android/testing/googletest.md:86 +#: src/android/testing/googletest.md msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." @@ -13327,7 +13275,7 @@ msgstr "" "این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " "در Rust است." -#: src/android/testing/mocking.md:3 +#: src/android/testing/mocking.md msgid "" "For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " "You need to refactor your code to use traits, which you can then quickly " @@ -13337,7 +13285,7 @@ msgstr "" "بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " "دهید، سپس می‌توانید به سرعت آنها را mock کنید:" -#: src/android/testing/mocking.md:27 +#: src/android/testing/mocking.md msgid "" "Mockall is the recommended mocking library in Android (AOSP). There are " "other [mocking libraries available on crates.io](https://crates.io/keywords/" @@ -13351,7 +13299,7 @@ msgstr "" "مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " "را آسان می‌کنند." -#: src/android/testing/mocking.md:33 +#: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " "isolate a test from its dependencies. The immediate result is faster and " @@ -13364,7 +13312,7 @@ msgstr "" "پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " "برگرداند." -#: src/android/testing/mocking.md:38 +#: src/android/testing/mocking.md #, fuzzy msgid "" "If at all possible, it is recommended that you use the real dependencies. As " @@ -13378,7 +13326,7 @@ msgstr "" "دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " "مخصوص به خود پاک می شوند." -#: src/android/testing/mocking.md:43 +#: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " "binds to a random port on `localhost`. Always prefer this over mocking away " @@ -13389,7 +13337,7 @@ msgstr "" "همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " "را در محیط واقعی آزمایش کنید." -#: src/android/testing/mocking.md:47 +#: src/android/testing/mocking.md msgid "" "Mockall is not part of the Rust Playground, so you need to run this example " "in a local environment. Use `cargo add mockall` to quickly add Mockall to an " @@ -13399,7 +13347,7 @@ msgstr "" "local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " "پروژه Cargo موجود استفاده کنید." -#: src/android/testing/mocking.md:51 +#: src/android/testing/mocking.md msgid "" "Mockall has a lot more functionality. In particular, you can set up " "expectations which depend on the arguments passed. Here we use this to mock " @@ -13410,7 +13358,7 @@ msgstr "" "عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " "گرسنه می‌شود:" -#: src/android/testing/mocking.md:69 +#: src/android/testing/mocking.md msgid "" "You can use `.times(n)` to limit the number of times a mock method can be " "called to `n` --- the mock will automatically panic when dropped if this " @@ -13477,8 +13425,8 @@ msgstr "\"Things are going fine.\"" msgid "\"Something went wrong!\"" msgstr "\"Something went wrong!\"" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md:99 -#: src/android/interoperability/with-c/rust.md:72 +#: src/android/logging.md src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین." @@ -13527,11 +13475,11 @@ msgstr "" "خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " "می‌کنید." -#: src/android/interoperability/with-c.md:1 +#: src/android/interoperability/with-c.md msgid "Interoperability with C" msgstr "قابلیت همکاری با C" -#: src/android/interoperability/with-c.md:3 +#: src/android/interoperability/with-c.md msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." @@ -13540,20 +13488,20 @@ msgstr "" "به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " "کنید." -#: src/android/interoperability/with-c.md:6 +#: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" msgstr "در صورت تمایل می‌توانید این کار را دستی انجام دهید:" -#: src/android/interoperability/with-c.md:15 +#: src/android/interoperability/with-c.md #, fuzzy msgid "// SAFETY: `abs` doesn't have any safety requirements.\n" msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" -#: src/android/interoperability/with-c.md:17 +#: src/android/interoperability/with-c.md msgid "\"{x}, {abs_x}\"" msgstr "\"{x}, {abs_x}\"" -#: src/android/interoperability/with-c.md:21 +#: src/android/interoperability/with-c.md msgid "" "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" "exercise.md)." @@ -13561,22 +13509,22 @@ msgstr "" "ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " "دیدیم." -#: src/android/interoperability/with-c.md:24 +#: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." msgstr "" "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." -#: src/android/interoperability/with-c.md:27 +#: src/android/interoperability/with-c.md msgid "We will look at better options next." msgstr "در ادامه گزینه‌های بهتر را بررسی خواهیم کرد." -#: src/android/interoperability/with-c/bindgen.md:1 +#: src/android/interoperability/with-c/bindgen.md msgid "Using Bindgen" msgstr "با استفاده از Bindgen" -#: src/android/interoperability/with-c/bindgen.md:3 +#: src/android/interoperability/with-c/bindgen.md msgid "" "The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "tool can auto-generate bindings from a C header file." @@ -13584,61 +13532,55 @@ msgstr "" "ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." -#: src/android/interoperability/with-c/bindgen.md:6 +#: src/android/interoperability/with-c/bindgen.md msgid "First create a small C library:" msgstr "ابتدا یک کتابخانه کوچک C ایجاد کنید:" -#: src/android/interoperability/with-c/bindgen.md:8 +#: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday.h_:" msgstr "_interoperability/bindgen/libbirthday.h_:" -#: src/android/interoperability/with-c/bindgen.md:19 +#: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday.c_:" msgstr "_interoperability/bindgen/libbirthday.c_:" -#: src/android/interoperability/with-c/bindgen.md:22 +#: src/android/interoperability/with-c/bindgen.md msgid "" msgstr "" -#: src/android/interoperability/with-c/bindgen.md:23 -#: src/android/interoperability/with-c/bindgen.md:50 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday.h\"" msgstr "\"libbirthday.h\"" -#: src/android/interoperability/with-c/bindgen.md:26 -#: src/android/interoperability/with-c/bindgen.md:29 +#: src/android/interoperability/with-c/bindgen.md msgid "\"+--------------\\n\"" msgstr "\"+--------------\\n\"" -#: src/android/interoperability/with-c/bindgen.md:27 +#: src/android/interoperability/with-c/bindgen.md msgid "\"| Happy Birthday %s!\\n\"" msgstr "\"| Happy Birthday %s!\\n\"" -#: src/android/interoperability/with-c/bindgen.md:28 +#: src/android/interoperability/with-c/bindgen.md msgid "\"| Congratulations with the %i years!\\n\"" msgstr "\"| Congratulations with the %i years!\\n\"" -#: src/android/interoperability/with-c/bindgen.md:33 +#: src/android/interoperability/with-c/bindgen.md msgid "Add this to your `Android.bp` file:" msgstr "این را به فایل `Android.bp` خود اضافه کنید:" -#: src/android/interoperability/with-c/bindgen.md:35 -#: src/android/interoperability/with-c/bindgen.md:55 -#: src/android/interoperability/with-c/bindgen.md:69 -#: src/android/interoperability/with-c/bindgen.md:109 +#: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/Android.bp_:" msgstr "_interoperability/bindgen/Android.bp_:" -#: src/android/interoperability/with-c/bindgen.md:39 -#: src/android/interoperability/with-c/bindgen.md:63 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday\"" msgstr "\"libbirthday\"" -#: src/android/interoperability/with-c/bindgen.md:40 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday.c\"" msgstr "\"libbirthday.c\"" -#: src/android/interoperability/with-c/bindgen.md:44 +#: src/android/interoperability/with-c/bindgen.md msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" @@ -13646,53 +13588,52 @@ msgstr "" "یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " "نیست):" -#: src/android/interoperability/with-c/bindgen.md:47 +#: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" msgstr "_interoperability/bindgen/libbirthday_wrapper.h_:" -#: src/android/interoperability/with-c/bindgen.md:53 +#: src/android/interoperability/with-c/bindgen.md msgid "You can now auto-generate the bindings:" msgstr "اکنون می توانید اتصالات (bindings) را به طور خودکار ایجاد کنید:" -#: src/android/interoperability/with-c/bindgen.md:59 -#: src/android/interoperability/with-c/bindgen.md:75 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen\"" msgstr "\"libbirthday_bindgen\"" -#: src/android/interoperability/with-c/bindgen.md:60 +#: src/android/interoperability/with-c/bindgen.md msgid "\"birthday_bindgen\"" msgstr "\"birthday_bindgen\"" -#: src/android/interoperability/with-c/bindgen.md:61 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_wrapper.h\"" msgstr "\"libbirthday_wrapper.h\"" -#: src/android/interoperability/with-c/bindgen.md:62 +#: src/android/interoperability/with-c/bindgen.md msgid "\"bindings\"" msgstr "\"bindings\"" -#: src/android/interoperability/with-c/bindgen.md:67 +#: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can use the bindings in our Rust program:" msgstr "در نهایت، می‌توانیم از bindingها در برنامه Rust خود استفاده کنیم:" -#: src/android/interoperability/with-c/bindgen.md:73 +#: src/android/interoperability/with-c/bindgen.md #, fuzzy msgid "\"print_birthday_card\"" msgstr "\"print_birthday_card\"" -#: src/android/interoperability/with-c/bindgen.md:74 +#: src/android/interoperability/with-c/bindgen.md msgid "\"main.rs\"" msgstr "\"main.rs\"" -#: src/android/interoperability/with-c/bindgen.md:79 +#: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/main.rs_:" msgstr "_interoperability/bindgen/main.rs_:" -#: src/android/interoperability/with-c/bindgen.md:82 +#: src/android/interoperability/with-c/bindgen.md msgid "//! Bindgen demo.\n" msgstr "//! Bindgen demo.\n" -#: src/android/interoperability/with-c/bindgen.md:89 +#: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" " // reference, and the `name` it contains refers to `name` above which " @@ -13708,7 +13649,7 @@ msgstr "" "later\n" " // after it returns.\n" -#: src/android/interoperability/with-c/bindgen.md:101 +#: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" @@ -13724,106 +13665,103 @@ msgstr "" "adb shell /data/local/tmp/print_birthday_card\n" "```" -#: src/android/interoperability/with-c/bindgen.md:107 +#: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" "در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " "اتصالات (bindings) اجرا کنیم:" -#: src/android/interoperability/with-c/bindgen.md:113 -#: src/android/interoperability/with-c/bindgen.md:115 +#: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" msgstr "\"libbirthday_bindgen_test\"" -#: src/android/interoperability/with-c/bindgen.md:114 +#: src/android/interoperability/with-c/bindgen.md msgid "\":libbirthday_bindgen\"" msgstr "\":libbirthday_bindgen\"" -#: src/android/interoperability/with-c/bindgen.md:118 -#: src/android/interoperability/with-c/bindgen.md:119 +#: src/android/interoperability/with-c/bindgen.md msgid "\"none\"" msgstr "\"none\"" -#: src/android/interoperability/with-c/bindgen.md:118 +#: src/android/interoperability/with-c/bindgen.md msgid "// Generated file, skip linting\n" msgstr "// Generated file, skip linting\n" -#: src/android/interoperability/with-c/rust.md:1 +#: src/android/interoperability/with-c/rust.md msgid "Calling Rust" msgstr "فراخوانی Rust" -#: src/android/interoperability/with-c/rust.md:3 +#: src/android/interoperability/with-c/rust.md msgid "Exporting Rust functions and types to C is easy:" msgstr "صدور یا Exporting توابع و تایپ‌ها از Rust به C آسان است:" -#: src/android/interoperability/with-c/rust.md:5 +#: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.rs_" msgstr "_interoperability/rust/libanalyze/analyze.rs_" -#: src/android/interoperability/with-c/rust.md:8 +#: src/android/interoperability/with-c/rust.md msgid "//! Rust FFI demo.\n" msgstr "//! Rust FFI demo.\n" -#: src/android/interoperability/with-c/rust.md:12 +#: src/android/interoperability/with-c/rust.md msgid "/// Analyze the numbers.\n" msgstr "/// Analyze the numbers.\n" -#: src/android/interoperability/with-c/rust.md:17 +#: src/android/interoperability/with-c/rust.md #, fuzzy msgid "\"x ({x}) is smallest!\"" msgstr "\"x ({x}) is smallest!\"" -#: src/android/interoperability/with-c/rust.md:19 +#: src/android/interoperability/with-c/rust.md #, fuzzy msgid "\"y ({y}) is probably larger than x ({x})\"" msgstr "\"y ({y}) is probably larger than x ({x})\"" -#: src/android/interoperability/with-c/rust.md:24 +#: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.h_" msgstr "_interoperability/rust/libanalyze/analyze.h_" -#: src/android/interoperability/with-c/rust.md:37 +#: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "_interoperability/rust/libanalyze/Android.bp_" -#: src/android/interoperability/with-c/rust.md:41 -#: src/android/interoperability/with-c/rust.md:68 +#: src/android/interoperability/with-c/rust.md msgid "\"libanalyze_ffi\"" msgstr "\"libanalyze_ffi\"" -#: src/android/interoperability/with-c/rust.md:42 +#: src/android/interoperability/with-c/rust.md msgid "\"analyze_ffi\"" msgstr "\"analyze_ffi\"" -#: src/android/interoperability/with-c/rust.md:43 +#: src/android/interoperability/with-c/rust.md msgid "\"analyze.rs\"" msgstr "\"analyze.rs\"" -#: src/android/interoperability/with-c/rust.md:48 +#: src/android/interoperability/with-c/rust.md msgid "We can now call this from a C binary:" msgstr "اکنون می توانیم این را از یک باینری C فراخوانی کنیم:" -#: src/android/interoperability/with-c/rust.md:50 +#: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/main.c_" msgstr "_interoperability/rust/analyze/Android.bp_" -#: src/android/interoperability/with-c/rust.md:53 +#: src/android/interoperability/with-c/rust.md msgid "\"analyze.h\"" msgstr "\"analyze.h\"" -#: src/android/interoperability/with-c/rust.md:62 +#: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/Android.bp_" msgstr "_interoperability/rust/analyze/Android.bp_" -#: src/android/interoperability/with-c/rust.md:66 +#: src/android/interoperability/with-c/rust.md msgid "\"analyze_numbers\"" msgstr "\"analyze_numbers\"" -#: src/android/interoperability/with-c/rust.md:67 +#: src/android/interoperability/with-c/rust.md msgid "\"main.c\"" msgstr "\"main.c\"" -#: src/android/interoperability/with-c/rust.md:74 +#: src/android/interoperability/with-c/rust.md msgid "" "```shell\n" "m analyze_numbers\n" @@ -13839,7 +13777,7 @@ msgstr "" "adb shell /data/local/tmp/analyze_numbers\n" "```" -#: src/android/interoperability/with-c/rust.md:82 +#: src/android/interoperability/with-c/rust.md msgid "" "`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " "will just be the name of the function. You can also use `#[export_name = " @@ -13849,7 +13787,7 @@ msgstr "" "فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " "برای تعیین هر نامی استفاده کنید" -#: src/android/interoperability/cpp.md:3 +#: src/android/interoperability/cpp.md msgid "" "The [CXX crate](https://cxx.rs/) makes it possible to do safe " "interoperability between Rust and C++." @@ -13857,11 +13795,11 @@ msgstr "" "این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " "می‌کند." -#: src/android/interoperability/cpp.md:6 +#: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" msgstr "رویکرد کلی به این صورت است:" -#: src/android/interoperability/cpp/bridge.md:3 +#: src/android/interoperability/cpp/bridge.md msgid "" "CXX relies on a description of the function signatures that will be exposed " "from each language to the other. You provide this description using extern " @@ -13872,51 +13810,51 @@ msgstr "" "ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " "شده است." -#: src/android/interoperability/cpp/bridge.md:9 +#: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" msgstr "\"org::blobstore\"" -#: src/android/interoperability/cpp/bridge.md:11 +#: src/android/interoperability/cpp/bridge.md msgid "// Shared structs with fields visible to both languages.\n" msgstr "// Shared structs with fields visible to both languages.\n" -#: src/android/interoperability/cpp/bridge.md:17 -#: src/android/interoperability/cpp/generated-cpp.md:6 +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/generated-cpp.md msgid "// Rust types and signatures exposed to C++.\n" msgstr "// Rust types and signatures exposed to C++.\n" -#: src/android/interoperability/cpp/bridge.md:18 -#: src/android/interoperability/cpp/rust-bridge.md:6 -#: src/android/interoperability/cpp/generated-cpp.md:7 -#: src/android/interoperability/cpp/rust-result.md:6 -#: src/chromium/interoperability-with-cpp/example-bindings.md:9 -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:10 -#: src/chromium/interoperability-with-cpp/error-handling-png.md:9 +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/generated-cpp.md +#: src/android/interoperability/cpp/rust-result.md +#: src/chromium/interoperability-with-cpp/example-bindings.md +#: src/chromium/interoperability-with-cpp/error-handling-qr.md +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"Rust\"" msgstr "\"Rust\"" -#: src/android/interoperability/cpp/bridge.md:24 -#: src/android/interoperability/cpp/cpp-bridge.md:6 +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md msgid "// C++ types and signatures exposed to Rust.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md:25 -#: src/android/interoperability/cpp/cpp-bridge.md:7 -#: src/android/interoperability/cpp/cpp-exception.md:6 -#: src/chromium/interoperability-with-cpp/example-bindings.md:15 +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/cpp-exception.md +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"C++\"" msgstr "\"C++\"" -#: src/android/interoperability/cpp/bridge.md:26 -#: src/android/interoperability/cpp/cpp-bridge.md:8 +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md msgid "\"include/blobstore.h\"" msgstr "\"include/blobstore.h\"" -#: src/android/interoperability/cpp/bridge.md:40 +#: src/android/interoperability/cpp/bridge.md msgid "The bridge is generally declared in an `ffi` module within your crate." msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اعلام می‌شود." -#: src/android/interoperability/cpp/bridge.md:41 +#: src/android/interoperability/cpp/bridge.md msgid "" "From the declarations made in the bridge module, CXX will generate matching " "Rust and C++ type/function definitions in order to expose those items to " @@ -13926,7 +13864,7 @@ msgstr "" "function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " "دهد." -#: src/android/interoperability/cpp/bridge.md:44 +#: src/android/interoperability/cpp/bridge.md msgid "" "To view the generated Rust code, use [cargo-expand](https://github.com/" "dtolnay/cargo-expand) to view the expanded proc macro. For most of the " @@ -13938,28 +13876,28 @@ msgstr "" "نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " "(اگرچه این برای پروژه‌های Android کاربرد ندارد)." -#: src/android/interoperability/cpp/bridge.md:47 +#: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." msgstr "برای مشاهده کد ++C تولید شده به `target/cxxbridge` نگاه کنید." -#: src/android/interoperability/cpp/rust-bridge.md:1 +#: src/android/interoperability/cpp/rust-bridge.md msgid "Rust Bridge Declarations" msgstr "تعریف پل در Rust" -#: src/android/interoperability/cpp/rust-bridge.md:7 +#: src/android/interoperability/cpp/rust-bridge.md msgid "// Opaque type\n" msgstr "// Opaque type\n" -#: src/android/interoperability/cpp/rust-bridge.md:8 +#: src/android/interoperability/cpp/rust-bridge.md msgid "// Method on `MyType`\n" msgstr "// Method on `MyType`\n" -#: src/android/interoperability/cpp/rust-bridge.md:9 +#: src/android/interoperability/cpp/rust-bridge.md #, fuzzy msgid "// Free function\n" msgstr "توابع" -#: src/android/interoperability/cpp/rust-bridge.md:28 +#: src/android/interoperability/cpp/rust-bridge.md msgid "" "Items declared in the `extern \"Rust\"` reference items that are in scope in " "the parent module." @@ -13967,7 +13905,7 @@ msgstr "" "موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " "والد قرار دارند." -#: src/android/interoperability/cpp/rust-bridge.md:30 +#: src/android/interoperability/cpp/rust-bridge.md msgid "" "The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" "+ header file containing the corresponding C++ declarations. The generated " @@ -13979,28 +13917,28 @@ msgstr "" "دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." "h." -#: src/android/interoperability/cpp/generated-cpp.md:15 +#: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" msgstr "نتیجه (تقریبی) ++C در زیر است:" -#: src/android/interoperability/cpp/cpp-bridge.md:1 +#: src/android/interoperability/cpp/cpp-bridge.md #, fuzzy msgid "C++ Bridge Declarations" msgstr "C++ Bridge Declarations" -#: src/android/interoperability/cpp/cpp-bridge.md:20 +#: src/android/interoperability/cpp/cpp-bridge.md msgid "Results in (roughly) the following Rust:" msgstr "نتیجه (تقریبی) Rust در زیر است:" -#: src/android/interoperability/cpp/cpp-bridge.md:30 +#: src/android/interoperability/cpp/cpp-bridge.md msgid "\"org$blobstore$cxxbridge1$new_blobstore_client\"" msgstr "\"org$blobstore$cxxbridge1$new_blobstore_client\"" -#: src/android/interoperability/cpp/cpp-bridge.md:39 +#: src/android/interoperability/cpp/cpp-bridge.md msgid "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" -#: src/android/interoperability/cpp/cpp-bridge.md:56 +#: src/android/interoperability/cpp/cpp-bridge.md msgid "" "The programmer does not need to promise that the signatures they have typed " "in are accurate. CXX performs static assertions that the signatures exactly " @@ -14010,7 +13948,7 @@ msgstr "" "ندارد. CXX اظهارات ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C " "اعلام شده مطابقت دارند." -#: src/android/interoperability/cpp/cpp-bridge.md:59 +#: src/android/interoperability/cpp/cpp-bridge.md msgid "" "`unsafe extern` blocks allow you to declare C++ functions that are safe to " "call from Rust." @@ -14018,15 +13956,15 @@ msgstr "" "بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " "Rust امن هستند را اعلام کنید." -#: src/android/interoperability/cpp/shared-types.md:9 +#: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" msgstr "// A=1, J=11, Q=12, K=13\n" -#: src/android/interoperability/cpp/shared-types.md:23 +#: src/android/interoperability/cpp/shared-types.md msgid "Only C-like (unit) enums are supported." msgstr "فقط C-like (unit) enums پشتیبانی می‌شود." -#: src/android/interoperability/cpp/shared-types.md:24 +#: src/android/interoperability/cpp/shared-types.md msgid "" "A limited number of traits are supported for `#[derive()]` on shared types. " "Corresponding functionality is also generated for the C++ code, e.g. if you " @@ -14037,15 +13975,15 @@ msgstr "" "عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " "استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." -#: src/android/interoperability/cpp/shared-enums.md:15 +#: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" msgstr "Generated Rust:" -#: src/android/interoperability/cpp/shared-enums.md:33 +#: src/android/interoperability/cpp/shared-enums.md msgid "Generated C++:" msgstr "Generated C++:" -#: src/android/interoperability/cpp/shared-enums.md:46 +#: src/android/interoperability/cpp/shared-enums.md #, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " @@ -14058,22 +13996,22 @@ msgstr "" "متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " "رفتار مشابهی داشته باشد." -#: src/android/interoperability/cpp/rust-result.md:13 +#: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" msgstr "\"fallible1 requires depth > 0\"" -#: src/android/interoperability/cpp/rust-result.md:16 +#: src/android/interoperability/cpp/rust-result.md msgid "\"Success!\"" msgstr "\"Success!\"" -#: src/android/interoperability/cpp/rust-result.md:22 +#: src/android/interoperability/cpp/rust-result.md msgid "" "Rust functions that return `Result` are translated to exceptions on the C++ " "side." msgstr "" "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." -#: src/android/interoperability/cpp/rust-result.md:24 +#: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " "exposes a way to get the error message string. The error message will come " @@ -14083,22 +14021,22 @@ msgstr "" "اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " "خطای`Display` می‌آید." -#: src/android/interoperability/cpp/rust-result.md:27 +#: src/android/interoperability/cpp/rust-result.md msgid "" "A panic unwinding from Rust to C++ will always cause the process to " "immediately terminate." msgstr "" "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." -#: src/android/interoperability/cpp/cpp-exception.md:7 +#: src/android/interoperability/cpp/cpp-exception.md msgid "\"example/include/example.h\"" msgstr "\"example/include/example.h\"" -#: src/android/interoperability/cpp/cpp-exception.md:14 +#: src/android/interoperability/cpp/cpp-exception.md msgid "\"Error: {}\"" msgstr "\"Error: {}\"" -#: src/android/interoperability/cpp/cpp-exception.md:22 +#: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" "C++ functions declared to return a `Result` will catch any thrown exception " @@ -14108,7 +14046,7 @@ msgstr "" "سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " "برمی‌گردانند." -#: src/android/interoperability/cpp/cpp-exception.md:24 +#: src/android/interoperability/cpp/cpp-exception.md msgid "" "If an exception is thrown from an extern \"C++\" function that is not " "declared by the CXX bridge to return `Result`, the program calls C++'s `std::" @@ -14117,66 +14055,66 @@ msgid "" msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " "\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " -"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " -"C++ function فعال می‌شود." +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C" +"++ function فعال می‌شود." -#: src/android/interoperability/cpp/type-mapping.md:3 +#: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" msgstr "C++ Type" -#: src/android/interoperability/cpp/type-mapping.md:5 +#: src/android/interoperability/cpp/type-mapping.md msgid "`rust::String`" msgstr "`rust::String`" -#: src/android/interoperability/cpp/type-mapping.md:6 +#: src/android/interoperability/cpp/type-mapping.md msgid "`&str`" msgstr "`&str`" -#: src/android/interoperability/cpp/type-mapping.md:6 +#: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Str`" msgstr "`rust::Str`" -#: src/android/interoperability/cpp/type-mapping.md:7 +#: src/android/interoperability/cpp/type-mapping.md msgid "`CxxString`" msgstr "`CxxString`" -#: src/android/interoperability/cpp/type-mapping.md:7 +#: src/android/interoperability/cpp/type-mapping.md msgid "`std::string`" msgstr "`std::string`" -#: src/android/interoperability/cpp/type-mapping.md:8 +#: src/android/interoperability/cpp/type-mapping.md msgid "`&[T]`/`&mut [T]`" msgstr "`&[T]`/`&mut [T]`" -#: src/android/interoperability/cpp/type-mapping.md:8 +#: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Slice`" msgstr "`rust::Slice`" -#: src/android/interoperability/cpp/type-mapping.md:9 +#: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Box`" msgstr "`rust::Box`" -#: src/android/interoperability/cpp/type-mapping.md:10 +#: src/android/interoperability/cpp/type-mapping.md msgid "`UniquePtr`" msgstr "`UniquePtr`" -#: src/android/interoperability/cpp/type-mapping.md:10 +#: src/android/interoperability/cpp/type-mapping.md msgid "`std::unique_ptr`" msgstr "`std::unique_ptr`" -#: src/android/interoperability/cpp/type-mapping.md:11 +#: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Vec`" msgstr "`rust::Vec`" -#: src/android/interoperability/cpp/type-mapping.md:12 +#: src/android/interoperability/cpp/type-mapping.md msgid "`CxxVector`" msgstr "`CxxVector`" -#: src/android/interoperability/cpp/type-mapping.md:12 +#: src/android/interoperability/cpp/type-mapping.md msgid "`std::vector`" msgstr "`std::vector`" -#: src/android/interoperability/cpp/type-mapping.md:16 +#: src/android/interoperability/cpp/type-mapping.md msgid "" "These types can be used in the fields of shared structs and the arguments " "and returns of extern functions." @@ -14184,7 +14122,7 @@ msgstr "" "این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " "functionها استفاده کرد." -#: src/android/interoperability/cpp/type-mapping.md:18 +#: src/android/interoperability/cpp/type-mapping.md msgid "" "Note that Rust's `String` does not map directly to `std::string`. There are " "a few reasons for this:" @@ -14192,13 +14130,13 @@ msgstr "" "توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " "چند دلیل برای این وجود دارد:" -#: src/android/interoperability/cpp/type-mapping.md:20 +#: src/android/interoperability/cpp/type-mapping.md msgid "" "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." -#: src/android/interoperability/cpp/type-mapping.md:21 +#: src/android/interoperability/cpp/type-mapping.md msgid "" "The two types have different layouts in memory and so can't be passed " "directly between languages." @@ -14206,7 +14144,7 @@ msgstr "" "این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " "مستقیماً بین زبان‌ها منتقل کرد." -#: src/android/interoperability/cpp/type-mapping.md:23 +#: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" "`std::string` requires move constructors that don't match Rust's move " @@ -14215,13 +14153,13 @@ msgstr "" "‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " "ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." -#: src/android/interoperability/cpp/android-build-cpp.md:1 -#: src/android/interoperability/cpp/android-cpp-genrules.md:1 -#: src/android/interoperability/cpp/android-build-rust.md:1 +#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-rust.md msgid "Building in Android" msgstr "ساخت در اندروید" -#: src/android/interoperability/cpp/android-build-cpp.md:3 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." @@ -14229,30 +14167,30 @@ msgstr "" "یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " "شده CXX ایجاد کنید." -#: src/android/interoperability/cpp/android-build-cpp.md:8 -#: src/android/interoperability/cpp/android-build-rust.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-rust.md msgid "\"libcxx_test_cpp\"" msgstr "\"libcxx_test_cpp\"" -#: src/android/interoperability/cpp/android-build-cpp.md:9 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "\"cxx_test.cpp\"" msgstr "\"cxx_test.cpp\"" -#: src/android/interoperability/cpp/android-build-cpp.md:11 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "\"cxx-bridge-header\"" msgstr "\"cxx-bridge-header\"" -#: src/android/interoperability/cpp/android-build-cpp.md:12 -#: src/android/interoperability/cpp/android-cpp-genrules.md:10 +#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"libcxx_test_bridge_header\"" msgstr "\"libcxx_test_bridge_header\"" -#: src/android/interoperability/cpp/android-build-cpp.md:14 -#: src/android/interoperability/cpp/android-cpp-genrules.md:19 +#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"libcxx_test_bridge_code\"" msgstr "\"libcxx_test_bridge_code\"" -#: src/android/interoperability/cpp/android-build-cpp.md:20 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" "Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " "the dependencies for the CXX-generated C++ bindings. We'll show how these " @@ -14262,7 +14200,7 @@ msgstr "" "`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" "هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." -#: src/android/interoperability/cpp/android-build-cpp.md:23 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" "Note that you also need to depend on the `cxx-bridge-header` library in " "order to pull in common CXX definitions." @@ -14270,7 +14208,7 @@ msgstr "" "توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" "header` وابسته باشید." -#: src/android/interoperability/cpp/android-build-cpp.md:25 +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" "Full docs for using CXX in Android can be found in [the Android docs]" "(https://source.android.com/docs/setup/build/rust/building-rust-modules/" @@ -14284,7 +14222,7 @@ msgstr "" "ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " "که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." -#: src/android/interoperability/cpp/android-cpp-genrules.md:3 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" "Create two genrules: One to generate the CXX header, and one to generate the " "CXX source file. These are then used as inputs to the `cc_library_static`." @@ -14292,7 +14230,7 @@ msgstr "" "دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " "CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." -#: src/android/interoperability/cpp/android-cpp-genrules.md:7 +#: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy msgid "" "// Generate a C++ header containing the C++ bindings\n" @@ -14301,39 +14239,37 @@ msgstr "" "// Generate a C++ header containing the C++ bindings\n" "// to the Rust exported functions in lib.rs.\n" -#: src/android/interoperability/cpp/android-cpp-genrules.md:11 -#: src/android/interoperability/cpp/android-cpp-genrules.md:20 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"cxxbridge\"" msgstr "\"cxxbridge\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:12 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "\"$(location cxxbridge) $(in) --header > $(out)\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:13 -#: src/android/interoperability/cpp/android-cpp-genrules.md:22 -#: src/android/interoperability/cpp/android-build-rust.md:8 +#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-rust.md msgid "\"lib.rs\"" msgstr "\"lib.rs\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:14 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"lib.rs.h\"" msgstr "\"lib.rs.h\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:16 +#: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy msgid "// Generate the C++ code that Rust calls into.\n" msgstr "// Generate the C++ code that Rust calls into.\n" -#: src/android/interoperability/cpp/android-cpp-genrules.md:21 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"$(location cxxbridge) $(in) > $(out)\"" msgstr "\"$(location cxxbridge) $(in) > $(out)\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:23 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"lib.rs.cc\"" msgstr "\"lib.rs.cc\"" -#: src/android/interoperability/cpp/android-cpp-genrules.md:29 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" "The `cxxbridge` tool is a standalone tool that generates the C++ side of the " "bridge module. It is included in Android and available as a Soong tool." @@ -14341,7 +14277,7 @@ msgstr "" "ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در " "Android گنجانده شده و به عنوان ابزار Soong در دسترس است." -#: src/android/interoperability/cpp/android-cpp-genrules.md:31 +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" "By convention, if your Rust source file is `lib.rs` your header file will be " "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " @@ -14351,26 +14287,26 @@ msgstr "" "h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " "اجرا نمی‌شود." -#: src/android/interoperability/cpp/android-build-rust.md:3 +#: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" "یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " "دارد." -#: src/android/interoperability/cpp/android-build-rust.md:7 +#: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" msgstr "\"cxx_test\"" -#: src/android/interoperability/cpp/android-build-rust.md:9 +#: src/android/interoperability/cpp/android-build-rust.md msgid "\"libcxx\"" msgstr "\"libcxx\"" -#: src/android/interoperability/java.md:1 +#: src/android/interoperability/java.md msgid "Interoperability with Java" msgstr "قابلیت همکاری با جاوا" -#: src/android/interoperability/java.md:3 +#: src/android/interoperability/java.md msgid "" "Java can load shared objects via [Java Native Interface (JNI)](https://en." "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" @@ -14381,72 +14317,69 @@ msgstr "" "بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " "کتابخانه سازگار ایجاد کنید." -#: src/android/interoperability/java.md:8 +#: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" msgstr "ابتدا یک تابع Rust برای export به Java ایجاد می‌کنیم:" -#: src/android/interoperability/java.md:10 +#: src/android/interoperability/java.md msgid "_interoperability/java/src/lib.rs_:" msgstr "_interoperability/java/src/lib.rs_:" -#: src/android/interoperability/java.md:13 +#: src/android/interoperability/java.md #, fuzzy msgid "//! Rust <-> Java FFI demo.\n" msgstr "//! Rust <-> Java FFI demo.\n" -#: src/android/interoperability/java.md:18 +#: src/android/interoperability/java.md #, fuzzy msgid "/// HelloWorld::hello method implementation.\n" msgstr "/// HelloWorld::hello method implementation.\n" -#: src/android/interoperability/java.md:21 +#: src/android/interoperability/java.md msgid "\"system\"" msgstr "\"system\"" -#: src/android/interoperability/java.md:27 +#: src/android/interoperability/java.md msgid "\"Hello, {input}!\"" msgstr "\"Hello, {input}!\"" -#: src/android/interoperability/java.md:33 -#: src/android/interoperability/java.md:63 +#: src/android/interoperability/java.md msgid "_interoperability/java/Android.bp_:" msgstr "_interoperability/java/Android.bp_:" -#: src/android/interoperability/java.md:37 -#: src/android/interoperability/java.md:70 +#: src/android/interoperability/java.md msgid "\"libhello_jni\"" msgstr "\"libhello_jni\"" -#: src/android/interoperability/java.md:38 -#: src/android/interoperability/java.md:53 +#: src/android/interoperability/java.md msgid "\"hello_jni\"" msgstr "\"hello_jni\"" -#: src/android/interoperability/java.md:40 +#: src/android/interoperability/java.md msgid "\"libjni\"" msgstr "\"libjni\"" -#: src/android/interoperability/java.md:44 +#: src/android/interoperability/java.md msgid "We then call this function from Java:" msgstr "سپس این تابع را از جاوا فراخوانی می کنیم:" -#: src/android/interoperability/java.md:46 +#: src/android/interoperability/java.md msgid "_interoperability/java/HelloWorld.java_:" msgstr "_interoperability/java/HelloWorld.java_:" -#: src/android/interoperability/java.md:67 +#: src/android/interoperability/java.md msgid "\"helloworld_jni\"" msgstr "\"helloworld_jni\"" -#: src/android/interoperability/java.md:68 +#: src/android/interoperability/java.md msgid "\"HelloWorld.java\"" msgstr "سلام دنیا\"HelloWorld.java\"" -#: src/android/interoperability/java.md:69 +#: src/android/interoperability/java.md msgid "\"HelloWorld\"" msgstr "\"HelloWorld\"" -#: src/android/interoperability/java.md:74 +#: src/android/interoperability/java.md msgid "Finally, you can build, sync, and run the binary:" msgstr "در نهایت، می‌توانید باینری را بسازید، همگام‌سازی کنید و اجرا کنید:" @@ -15033,11 +14966,11 @@ msgstr "" "این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " "از برخی از آنها استفاده خواهیم کرد." -#: src/chromium/build-rules/unsafe.md:1 +#: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" msgstr "شامل کد `unsafe` Rust." -#: src/chromium/build-rules/unsafe.md:3 +#: src/chromium/build-rules/unsafe.md msgid "" "Unsafe Rust code is forbidden in `rust_static_library` by default --- it " "won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " @@ -15049,7 +14982,7 @@ msgstr "" "به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " "است.)" -#: src/chromium/build-rules/unsafe.md:7 +#: src/chromium/build-rules/unsafe.md msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" @@ -15077,11 +15010,11 @@ msgstr "" "}\n" "```" -#: src/chromium/build-rules/depending.md:3 +#: src/chromium/build-rules/depending.md msgid "Simply add the above target to the `deps` of some Chromium C++ target." msgstr "به سادگی هدف بالا را به `deps` برخی از اهداف Chromium C++ اضافه کنید." -#: src/chromium/build-rules/depending.md:5 +#: src/chromium/build-rules/depending.md msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" @@ -15111,7 +15044,7 @@ msgstr "" "}\n" "```" -#: src/chromium/build-rules/vscode.md:3 +#: src/chromium/build-rules/vscode.md msgid "" "Types are elided in Rust code, which makes a good IDE even more useful than " "for C++. Visual Studio code works well for Rust in Chromium. To use it," @@ -15120,7 +15053,7 @@ msgstr "" "باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " "استفاده از آن،" -#: src/chromium/build-rules/vscode.md:6 +#: src/chromium/build-rules/vscode.md #, fuzzy msgid "" "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " @@ -15129,7 +15062,7 @@ msgstr "" "اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " "قبلی پشتیبانی از Rust" -#: src/chromium/build-rules/vscode.md:8 +#: src/chromium/build-rules/vscode.md msgid "" "`gn gen out/Debug --export-rust-project` (or equivalent for your output " "directory)" @@ -15137,11 +15070,11 @@ msgstr "" "‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " "شما)" -#: src/chromium/build-rules/vscode.md:10 +#: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" -#: src/chromium/build-rules/vscode.md:16 +#: src/chromium/build-rules/vscode.md msgid "" "A demo of some of the code annotation and exploration features of rust-" "analyzer might be beneficial if the audience are naturally skeptical of IDEs." @@ -15149,7 +15082,7 @@ msgstr "" "اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " "ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." -#: src/chromium/build-rules/vscode.md:19 +#: src/chromium/build-rules/vscode.md msgid "" "The following steps may help with the demo (but feel free to instead use a " "piece of Chromium-related Rust that you are most familiar with):" @@ -15157,12 +15090,12 @@ msgstr "" "مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " "به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" -#: src/chromium/build-rules/vscode.md:22 +#: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" -#: src/chromium/build-rules/vscode.md:23 +#: src/chromium/build-rules/vscode.md msgid "" "Place the cursor over the `QrCode::new` call (around line 26) in " "\\`qr_code_generator_ffi_glue.rs" @@ -15170,7 +15103,7 @@ msgstr "" "مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در " "\\`qr_code_generator_ffi_glue.rs قرار دهید" -#: src/chromium/build-rules/vscode.md:25 +#: src/chromium/build-rules/vscode.md msgid "" "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." @@ -15178,7 +15111,7 @@ msgstr "" "نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" "CoC = K)." -#: src/chromium/build-rules/vscode.md:27 +#: src/chromium/build-rules/vscode.md msgid "" "Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " "(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" @@ -15187,7 +15120,7 @@ msgstr "" "vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." "rs` می‌رساند.)" -#: src/chromium/build-rules/vscode.md:29 +#: src/chromium/build-rules/vscode.md msgid "" "Demo **outline** and navigate to the `QrCode::with_bits` method (around line " "164; the outline is in the file explorer pane in vscode; typical vim/CoC " @@ -15197,7 +15130,7 @@ msgstr "" "خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " "bindings = space o)" -#: src/chromium/build-rules/vscode.md:32 +#: src/chromium/build-rules/vscode.md msgid "" "Demo **type annotations** (there are quite a few nice examples in the " "`QrCode::with_bits` method)" @@ -15205,7 +15138,7 @@ msgstr "" "نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" "with_bits` وجود دارد)" -#: src/chromium/build-rules/vscode.md:35 +#: src/chromium/build-rules/vscode.md msgid "" "It may be worth pointing out that `gn gen ... --export-rust-project` will " "need to be rerun after editing `BUILD.gn` files (which we will do a few " @@ -15215,11 +15148,11 @@ msgstr "" "فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " "اجرا شود." -#: src/exercises/chromium/build-rules.md:1 +#: src/exercises/chromium/build-rules.md msgid "Build rules exercise" msgstr "تمرین قواعد ساخت" -#: src/exercises/chromium/build-rules.md:3 +#: src/exercises/chromium/build-rules.md msgid "" "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " "containing:" @@ -15227,7 +15160,7 @@ msgstr "" "در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " "که حاوی:" -#: src/exercises/chromium/build-rules.md:13 +#: src/exercises/chromium/build-rules.md msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " "by the Rust compiler, so you'll need to allow unsafe code in your `gn` " @@ -15237,7 +15170,7 @@ msgstr "" "ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " "`gn` target خود مجاز کنید." -#: src/exercises/chromium/build-rules.md:16 +#: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " "function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " @@ -15247,7 +15180,7 @@ msgstr "" "تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " "خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" -#: src/exercises/chromium/build-rules.md:24 +#: src/exercises/chromium/build-rules.md msgid "" "Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " "we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " @@ -15259,7 +15192,7 @@ msgstr "" "می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " "بارها چاپ می‌شود." -#: src/exercises/chromium/build-rules.md:28 +#: src/exercises/chromium/build-rules.md msgid "" "If you use VSCode, now set up Rust to work well in VSCode. It will be useful " "in subsequent exercises. If you've succeeded, you will be able to use right-" @@ -15269,12 +15202,12 @@ msgstr "" "کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " "از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." -#: src/exercises/chromium/build-rules.md:32 -#: src/exercises/chromium/interoperability-with-cpp.md:48 +#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Where to find help" msgstr "کجا می‌توان help پیدا کرد" -#: src/exercises/chromium/build-rules.md:34 +#: src/exercises/chromium/build-rules.md msgid "" "The options available to the [`rust_static_library` gn template](https://" "source.chromium.org/chromium/chromium/src/+/main:build/rust/" @@ -15284,7 +15217,7 @@ msgstr "" "chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" "l=16)" -#: src/exercises/chromium/build-rules.md:35 +#: src/exercises/chromium/build-rules.md msgid "" "Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" "abi.html#the-no_mangle-attribute)" @@ -15292,7 +15225,7 @@ msgstr "" "اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." "html#the-no_mangle-attribute)" -#: src/exercises/chromium/build-rules.md:36 +#: src/exercises/chromium/build-rules.md msgid "" "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." "extern.html)" @@ -15300,7 +15233,7 @@ msgstr "" "اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." "html)" -#: src/exercises/chromium/build-rules.md:37 +#: src/exercises/chromium/build-rules.md #, fuzzy msgid "" "Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" @@ -15309,7 +15242,7 @@ msgstr "" "اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" "gn/+/main/docs/reference.md#compilation-database) سوییچ." -#: src/exercises/chromium/build-rules.md:38 +#: src/exercises/chromium/build-rules.md #, fuzzy msgid "" "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" @@ -15318,7 +15251,7 @@ msgstr "" "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" "languages/rust)" -#: src/exercises/chromium/build-rules.md:44 +#: src/exercises/chromium/build-rules.md msgid "" "This example is unusual because it boils down to the lowest-common-" "denominator interop language, C. Both C++ and Rust can natively declare and " @@ -15328,7 +15261,7 @@ msgstr "" "این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " "می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." -#: src/exercises/chromium/build-rules.md:48 +#: src/exercises/chromium/build-rules.md msgid "" "`allow_unsafe = true` is required here because `#[no_mangle]` might allow " "Rust to generate two functions with the same name, and Rust can no longer " @@ -15338,7 +15271,7 @@ msgstr "" "به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " "کند که تابع مورد نظر فراخوانی شده است." -#: src/exercises/chromium/build-rules.md:52 +#: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." @@ -15443,7 +15376,7 @@ msgstr "" "چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " "بهره‌مند شود." -#: src/chromium/testing/rust-gtest-interop.md:3 +#: src/chromium/testing/rust-gtest-interop.md msgid "" "The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" "main/testing/rust_gtest_interop/README.md) library provides a way to:" @@ -15451,7 +15384,7 @@ msgstr "" "کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" "src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" -#: src/chromium/testing/rust-gtest-interop.md:5 +#: src/chromium/testing/rust-gtest-interop.md msgid "" "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " "attribute)" @@ -15459,7 +15392,7 @@ msgstr "" "از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " "`#[gtest(...)]` attribute)" -#: src/chromium/testing/rust-gtest-interop.md:7 +#: src/chromium/testing/rust-gtest-interop.md msgid "" "Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " "panicking and not terminating the test when the assertion fails)." @@ -15467,11 +15400,11 @@ msgstr "" "از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " "وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." -#: src/chromium/testing/rust-gtest-interop.md:10 +#: src/chromium/testing/rust-gtest-interop.md msgid "Example:" msgstr "مثال:" -#: src/chromium/testing/build-gn.md:3 +#: src/chromium/testing/build-gn.md msgid "" "The simplest way to build Rust `gtest` tests is to add them to an existing " "test binary that already contains tests authored in C++. For example:" @@ -15479,7 +15412,7 @@ msgstr "" "ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " "است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" -#: src/chromium/testing/build-gn.md:6 +#: src/chromium/testing/build-gn.md msgid "" "```gn\n" "test(\"ui_base_unittests\") {\n" @@ -15497,7 +15430,7 @@ msgstr "" "}\n" "```" -#: src/chromium/testing/build-gn.md:14 +#: src/chromium/testing/build-gn.md msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" @@ -15505,7 +15438,7 @@ msgstr "" "نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " "اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" -#: src/chromium/testing/build-gn.md:17 +#: src/chromium/testing/build-gn.md msgid "" "```gn\n" "rust_static_library(\"my_rust_lib_unittests\") {\n" @@ -15543,7 +15476,7 @@ msgstr "" "}\n" "```" -#: src/chromium/testing/chromium-import-macro.md:3 +#: src/chromium/testing/chromium-import-macro.md msgid "" "After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " "import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " @@ -15559,15 +15492,15 @@ msgstr "" "از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " "درنتیجه از کار با چنین نامی پرهیز کنیم:" -#: src/chromium/testing/chromium-import-macro.md:12 +#: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" msgstr "\"//ui/base:my_rust_lib\"" -#: src/chromium/testing/chromium-import-macro.md:18 +#: src/chromium/testing/chromium-import-macro.md msgid "Under the covers the macro expands to something similar to:" msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر گسترش می یابد:" -#: src/chromium/testing/chromium-import-macro.md:26 +#: src/chromium/testing/chromium-import-macro.md msgid "" "More information can be found in [the doc comment](https://source.chromium." "org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" @@ -15580,7 +15513,7 @@ msgstr "" "third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" "import`." -#: src/chromium/testing/chromium-import-macro.md:31 +#: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " "property, but doing this is discouraged. And it is discouraged because the " @@ -15594,19 +15527,19 @@ msgstr "" "تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " "در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." -#: src/exercises/chromium/testing.md:1 +#: src/exercises/chromium/testing.md msgid "Testing exercise" msgstr "تمرین تستی" -#: src/exercises/chromium/testing.md:3 +#: src/exercises/chromium/testing.md msgid "Time for another exercise!" msgstr "وقت یک تمرین دیگر است!" -#: src/exercises/chromium/testing.md:5 +#: src/exercises/chromium/testing.md msgid "In your Chromium build:" msgstr "درChromium build شما باید:" -#: src/exercises/chromium/testing.md:7 +#: src/exercises/chromium/testing.md msgid "" "Add a testable function next to `hello_from_rust`. Some suggestions: adding " "two integers received as arguments, computing the nth Fibonacci number, " @@ -15616,15 +15549,15 @@ msgstr "" "کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " "اعداد صحیح در یک برش و غیره." -#: src/exercises/chromium/testing.md:10 +#: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." msgstr "یک فایل`..._unittest.rs` جداگانه با یک تست برای تابع جدید اضافه کنید." -#: src/exercises/chromium/testing.md:11 +#: src/exercises/chromium/testing.md msgid "Add the new tests to `BUILD.gn`." msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." -#: src/exercises/chromium/testing.md:12 +#: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." msgstr "" "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." @@ -15735,7 +15668,7 @@ msgstr "" "Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " "string را با NUL خاتمه دهد)." -#: src/chromium/interoperability-with-cpp/example-bindings.md:3 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." @@ -15743,19 +15676,19 @@ msgstr "" "‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." "rs` اعلام شود." -#: src/chromium/interoperability-with-cpp/example-bindings.md:16 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" msgstr "\"example/include/blobstore.h\"" -#: src/chromium/interoperability-with-cpp/example-bindings.md:24 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "// Definitions of Rust types and functions go here\n" msgstr "// Definitions of Rust types and functions go here\n" -#: src/chromium/interoperability-with-cpp/example-bindings.md:30 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Point out:" msgstr "اشاره کنید:" -#: src/chromium/interoperability-with-cpp/example-bindings.md:32 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " "procedural macro does complex things to it. The generated code is quite a " @@ -15766,23 +15699,23 @@ msgstr "" "bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " "است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." -#: src/chromium/interoperability-with-cpp/example-bindings.md:36 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" msgstr "پشتیبانی Native در ++C برای`std::unique_ptr`در Rust" -#: src/chromium/interoperability-with-cpp/example-bindings.md:37 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for Rust slices in C++" msgstr "پشتیبانی Native برای Rust Slices در ++C" -#: src/chromium/interoperability-with-cpp/example-bindings.md:38 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from C++ to Rust, and Rust types (in the top part)" msgstr "فراخوانی از ++C به Rust و تایپ‌های Rust (در قسمت بالا)" -#: src/chromium/interoperability-with-cpp/example-bindings.md:39 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from Rust to C++, and C++ types (in the bottom part)" msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قسمت پایین)" -#: src/chromium/interoperability-with-cpp/example-bindings.md:41 +#: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "**Common misconception**: It _looks_ like a C++ header is being parsed by " "Rust, but this is misleading. This header is never interpreted by Rust, but " @@ -15793,7 +15726,7 @@ msgstr "" "گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " "`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:3 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "By far the most useful page when using CXX is the [type reference](https://" "cxx.rs/bindings.html)." @@ -15801,11 +15734,11 @@ msgstr "" "تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" "(https://cxx.rs/bindings.html) است." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:5 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:7 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Your Rust-C++ interface is sufficiently simple that you can declare all of " "it." @@ -15813,7 +15746,7 @@ msgstr "" "اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " "declare کنید." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:8 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You're using only the types natively supported by CXX already, for example " "`std::unique_ptr`, `std::string`, `&[u8]` etc." @@ -15821,7 +15754,7 @@ msgstr "" "شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " "مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:11 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "It has many limitations --- for example lack of support for Rust's `Option` " "type." @@ -15829,7 +15762,7 @@ msgstr "" "این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " "Rust." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:14 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "These limitations constrain us to using Rust in Chromium only for well " "isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " @@ -15837,28 +15770,28 @@ msgid "" "draft the CXX bindings for the language boundary to see if it appears simple " "enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " -"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " -"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " -"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " -"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ" +"\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در " +"نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که " +"پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا " +"ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:26 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You should also discuss some of the other sticky points with CXX, for " "example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:28 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" -#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md:29 +#: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Function pointers are awkward to use." msgstr "استفاده ازFunction pointerها دشوار است." -#: src/chromium/interoperability-with-cpp/error-handling.md:3 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " "on C++ exceptions, so we can't use that in Chromium. Alternatives:" @@ -15867,11 +15800,11 @@ msgstr "" "+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " "جایگزین‌های آن عبارتند از:" -#: src/chromium/interoperability-with-cpp/error-handling.md:6 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" msgstr "قسمت `T` از `نتیجه` می تواند باشد:" -#: src/chromium/interoperability-with-cpp/error-handling.md:7 +#: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " @@ -15881,11 +15814,11 @@ msgstr "" "این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " "باشد:" -#: src/chromium/interoperability-with-cpp/error-handling.md:9 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" msgstr "یک type اولیه (مانند `u32` یا `usize`)" -#: src/chromium/interoperability-with-cpp/error-handling.md:10 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." @@ -15894,7 +15827,7 @@ msgstr "" "دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " "`Box`)." -#: src/chromium/interoperability-with-cpp/error-handling.md:12 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Retained on the Rust side, and exposed via reference. This may be needed " "when `T` is a Rust type, which cannot be passed across the FFI boundary, and " @@ -15904,11 +15837,11 @@ msgstr "" "است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " "کند و نمی تواند در `UniquePtr` ذخیره شود." -#: src/chromium/interoperability-with-cpp/error-handling.md:16 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" msgstr "قسمت `E` از `Result` می‌تواند باشد:" -#: src/chromium/interoperability-with-cpp/error-handling.md:17 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Returned as a boolean (e.g. `true` representing success, and `false` " "representing failure)" @@ -15916,7 +15849,7 @@ msgstr "" "به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " "نشان‌دهنده یک شکست است)" -#: src/chromium/interoperability-with-cpp/error-handling.md:19 +#: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Preserving error details is in theory possible, but so far hasn't been " "needed in practice." @@ -15924,11 +15857,11 @@ msgstr "" "حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " "است." -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:1 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" msgstr "مدیریت خطا CXX: مثال QR" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:3 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" "chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." @@ -15941,11 +15874,11 @@ msgstr "" "drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " "جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:8 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" msgstr "\"qr_code_generator\"" -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:23 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "Students may be curious about the semantics of the `out_qr_size` output. " "This is not the size of the vector, but the size of the QR code (and " @@ -15956,7 +15889,7 @@ msgstr "" "اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " "جذر اندازه بردار است)." -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:27 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "It may be worth pointing out the importance of initializing `out_qr_size` " "before calling into the Rust function. Creation of a Rust reference that " @@ -15968,7 +15901,7 @@ msgstr "" "منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " "حافظه‌ای منجر به UB می‌شود)." -#: src/chromium/interoperability-with-cpp/error-handling-qr.md:32 +#: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "If students ask about `Pin`, then explain why CXX needs it for mutable " "references to C++ data: the answer is that C++ data can’t be moved around " @@ -15979,11 +15912,11 @@ msgstr "" "نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " "خودارجاعی (self-referential pointers) باشد." -#: src/chromium/interoperability-with-cpp/error-handling-png.md:1 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" msgstr "مدیریت خطا CXX: مثال PNG" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:3 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "A prototype of a PNG decoder illustrates what can be done when the " "successful result cannot be passed across the FFI boundary:" @@ -15991,11 +15924,11 @@ msgstr "" "نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " "FFI عبور کند و چه کاری می توان انجام داد:" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:7 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" msgstr "\"gfx::rust_bindings\"" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:10 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" @@ -16003,15 +15936,15 @@ msgstr "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:14 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" msgstr "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:21 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" -#: src/chromium/interoperability-with-cpp/error-handling-png.md:32 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " "types cannot cross the FFI boundary without indirection of a `Box`. We " @@ -16023,7 +15956,7 @@ msgstr "" "نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " "نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." -#: src/chromium/interoperability-with-cpp/error-handling-png.md:37 +#: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "This example illustrates that even though CXX doesn't support arbitrary " "generics nor templates, we can still pass them across the FFI boundary by " @@ -16039,11 +15972,11 @@ msgstr "" "مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " "ارسال می‌شود." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:1 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" msgstr "استفاده از cxx در Chromium" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:3 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" "node where we want to use Rust. You'd typically have one for each " @@ -16053,7 +15986,7 @@ msgstr "" "Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " "یکی دارید. پس فقط اضافه کنید." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:7 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "```gn\n" "cxx_bindings = [ \"my_rust_file.rs\" ]\n" @@ -16067,21 +16000,21 @@ msgstr "" "allow_unsafe = true\n" "```" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:13 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "to your existing `rust_static_library` target alongside `crate_root` and " "`sources`." msgstr "به هدف `rust_static_library` موجود در کنار `crate_root` و `sources`." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:16 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "C++ headers will be generated at a sensible location, so you can just" msgstr "‏ headerهای ++C در یک مکان منطقی تولید می‌شوند، بنابراین شما می‌توانید." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:19 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "\"ui/base/my_rust_file.rs.h\"" msgstr "\"ui/base/my_rust_file.rs.h\"" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:22 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "You will find some utility functions in `//base` to convert to/from Chromium " "C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" @@ -16093,12 +16026,12 @@ msgstr "" "source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." "h;l=21)." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:27 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" msgstr "" "دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:29 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The broad answer is that no C/C++ code is \"safe\" by the normal Rust " "standards. Calling back and forth to C/C++ from Rust may do arbitrary things " @@ -16116,7 +16049,7 @@ msgstr "" "the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " "می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." -#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md:36 +#: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" "interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " @@ -16127,15 +16060,15 @@ msgstr "" "است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " "در بخش قبل به صورت دستی انجام دادیم." -#: src/exercises/chromium/interoperability-with-cpp.md:1 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" msgstr "تمرین: قابلیت همکاری با ++C" -#: src/exercises/chromium/interoperability-with-cpp.md:3 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Part one" msgstr "قسمت اول" -#: src/exercises/chromium/interoperability-with-cpp.md:5 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "In the Rust file you previously created, add a `#[cxx::bridge]` which " "specifies a single function, to be called from C++, called " @@ -16145,7 +16078,7 @@ msgstr "" "تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " "بدون اینکه پارامتر و هیچ مقداری برگرداند." -#: src/exercises/chromium/interoperability-with-cpp.md:8 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " "`#[no_mangle]`. This is now just a standard Rust function." @@ -16153,11 +16086,11 @@ msgstr "" "تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` " "تغییر دهید. حالا این فقط یک تابع استاندارد Rust است." -#: src/exercises/chromium/interoperability-with-cpp.md:10 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Modify your `gn` target to build these bindings." msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindings) تغییر دهید." -#: src/exercises/chromium/interoperability-with-cpp.md:11 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "In your C++ code, remove the forward-declaration of `hello_from_rust`. " "Instead, include the generated header file." @@ -16165,15 +16098,15 @@ msgstr "" "در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " "عوض، فایل هِدِر تولید شده را اضافه کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:13 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" msgstr "Build و run!" -#: src/exercises/chromium/interoperability-with-cpp.md:15 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Part two" msgstr "قسمت دوم" -#: src/exercises/chromium/interoperability-with-cpp.md:17 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "It's a good idea to play with CXX a little. It helps you think about how " "flexible Rust in Chromium actually is." @@ -16181,15 +16114,15 @@ msgstr "" "ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " "کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." -#: src/exercises/chromium/interoperability-with-cpp.md:20 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" msgstr "برخی از چیزهایی که باید امتحان کنید:" -#: src/exercises/chromium/interoperability-with-cpp.md:22 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Call back into C++ from Rust. You will need:" msgstr "از Rust دوباره به ++C فراخوانی کنید. درنهایت شما نیاز خواهید داشت:" -#: src/exercises/chromium/interoperability-with-cpp.md:23 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." @@ -16197,7 +16130,7 @@ msgstr "" "یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " "شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:25 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "An `unsafe` block to call such a function, or alternatively specify the " "`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" @@ -16207,22 +16140,23 @@ msgstr "" "`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" "(https://cxx.rs/extern-c++.html#functions-and-member-functions)." -#: src/exercises/chromium/interoperability-with-cpp.md:27 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" +"\"`" msgstr "" "همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" "cxx.h\"` را وارد کنید." +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." msgstr "یک رشته++C را از ++C به Rust منتقل کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:30 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a reference to a C++ object into Rust." msgstr "ارسال یک reference از یک C++ object به Rust ." -#: src/exercises/chromium/interoperability-with-cpp.md:31 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." @@ -16230,7 +16164,7 @@ msgstr "" "عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " "و به خطاهایی که می بینید عادت کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:33 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." @@ -16238,7 +16172,7 @@ msgstr "" "عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " "به خطاهایی که می بینید عادت کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:35 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " "own some C++ object." @@ -16246,7 +16180,7 @@ msgstr "" "یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " "بتواند دارای یک C++ object باشد." -#: src/exercises/chromium/interoperability-with-cpp.md:37 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " "need a `Box`)." @@ -16254,19 +16188,19 @@ msgstr "" "یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " "(نکته: شما به یک `Box` نیاز دارید)." -#: src/exercises/chromium/interoperability-with-cpp.md:39 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." msgstr "چند متد را در نوع ++C اعلام کنید. آنها را از Rust فراخوانی کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:40 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a Rust type. Call them from C++." msgstr "چند متد را در Rust type اعلام کنید. از ++C آن‌ها را فراخوانی کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:42 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Part three" msgstr "قسمت سوم" -#: src/exercises/chromium/interoperability-with-cpp.md:44 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Now you understand the strengths and limitations of CXX interop, think of a " "couple of use-cases for Rust in Chromium where the interface would be " @@ -16276,11 +16210,11 @@ msgstr "" "برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " "تعریف این رابط را ترسیم کنید." -#: src/exercises/chromium/interoperability-with-cpp.md:50 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" msgstr "یک [`cxx` binding reference](https://cxx.rs/bindings.html)" -#: src/exercises/chromium/interoperability-with-cpp.md:51 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "The [`rust_static_library` gn template](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" @@ -16288,11 +16222,11 @@ msgstr "" "یک [`rust_static_library` gn template](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" -#: src/exercises/chromium/interoperability-with-cpp.md:57 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "برخی از سؤالاتی که ممکن است با آن مواجه شوید:" -#: src/exercises/chromium/interoperability-with-cpp.md:59 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "I'm seeing a problem initializing a variable of type X with type Y, where X " "and Y are both function types. This is because your C++ function doesn't " @@ -16302,7 +16236,7 @@ msgstr "" "هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " "`cxx::bridge` شما مطابقت ندارد." -#: src/exercises/chromium/interoperability-with-cpp.md:62 +#: src/exercises/chromium/interoperability-with-cpp.md msgid "" "I seem to be able to freely convert C++ references into Rust references. " "Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" @@ -16404,11 +16338,11 @@ msgstr "چگونه قوانین ساخت `gn` برای آن ایجاد کنیم" msgid "How to audit its source code for sufficient safety." msgstr "نحوه بررسی کد منبع آن برای ایمنی کافی" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:1 +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "Configuring the `Cargo.toml` file to add crates" msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3 +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "Chromium has a single set of centrally-managed direct crate dependencies. " "These are managed through a single [`Cargo.toml`](https://source.chromium." @@ -16420,7 +16354,7 @@ msgstr "" "chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " "می‌شوند :" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6 +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "```toml\n" "[dependencies]\n" @@ -16438,7 +16372,7 @@ msgstr "" "# lots more...\n" "```" -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14 +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " "dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" @@ -16450,7 +16384,7 @@ msgstr "" "مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " "کنید را مشخص کنید." -#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18 +#: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "When adding a crate to Chromium, you'll often need to provide some extra " "information in an additional file, `gnrt_config.toml`, which we'll meet next." @@ -16458,7 +16392,7 @@ msgstr "" "هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، " "`gnrt_config.toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." @@ -16469,19 +16403,19 @@ msgstr "" "toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " "crate است." -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "If you add a new crate, you should specify at least the `group`. This is one " "of:" msgstr "" "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15 -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:15 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "For instance," msgstr "به عنوان مثال،" -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Depending on the crate source code layout, you may also need to use this " "file to specify where its `LICENSE` file(s) can be found." @@ -16489,7 +16423,7 @@ msgstr "" "بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " "یافتن فایل (های) مجوز آن استفاده کنید." -#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25 +#: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Later, we'll see some other things you will need to configure in this file " "to resolve problems." @@ -16497,7 +16431,7 @@ msgstr "" "بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " "مشاهده خواهیم کرد." -#: src/chromium/adding-third-party-crates/downloading-crates.md:3 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "A tool called `gnrt` knows how to download crates and how to generate `BUILD." "gn` rules." @@ -16505,11 +16439,11 @@ msgstr "" "ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " "`BUILD.gn` را ایجاد کند." -#: src/chromium/adding-third-party-crates/downloading-crates.md:6 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" msgstr "برای شروع، crate مورد نظر خود را به صورت زیر دانلود کنید:" -#: src/chromium/adding-third-party-crates/downloading-crates.md:13 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "Although the `gnrt` tool is part of the Chromium source code, by running " "this command you will be downloading and running its dependencies from " @@ -16520,19 +16454,19 @@ msgstr "" "وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." "md) را در مورد این تصمیم امنیتی ببینید." -#: src/chromium/adding-third-party-crates/downloading-crates.md:17 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" msgstr "این `vendor` command ممکن است بارگیری کند:" -#: src/chromium/adding-third-party-crates/downloading-crates.md:19 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "Your crate" msgstr "جعبه‌های (crates) کاربردی شما" -#: src/chromium/adding-third-party-crates/downloading-crates.md:20 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "Direct and transitive dependencies" msgstr "وابستگی های مستقیم و گذرا" -#: src/chromium/adding-third-party-crates/downloading-crates.md:21 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "New versions of other crates, as required by `cargo` to resolve the complete " "set of crates required by Chromium." @@ -16540,7 +16474,7 @@ msgstr "" "نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " "جعبه‌های مورد نیاز Chromium لازم است." -#: src/chromium/adding-third-party-crates/downloading-crates.md:24 +#: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "Chromium maintains patches for some crates, kept in `//third_party/rust/" "chromium_crates_io/patches`. These will be reapplied automatically, but if " @@ -16550,24 +16484,24 @@ msgstr "" "rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " "اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Now run `git status`. You should find:" msgstr "اکنون `git status` را اجرا کنید. شما باید این موارد را پیدا کنید:" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new crate source code in `third_party/rust/chromium_crates_io/" "vendor`" msgstr "" "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new `BUILD.gn` in `third_party/rust//v`" @@ -16575,11 +16509,11 @@ msgstr "" "حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "An appropriate `README.chromium`" msgstr "یک `README.chromium` مناسب" -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "The \"major semver version\" is a [Rust \"semver\" version number](https://" "doc.rust-lang.org/cargo/reference/semver.html)." @@ -16587,13 +16521,13 @@ msgstr "" "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " "مراجعه کنید." -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Take a close look, especially at the things generated in `third_party/rust`." msgstr "" "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." -#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23 +#: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Talk a little about semver --- and specifically the way that in Chromium " "it's to allow multiple incompatible versions of a crate, which is " @@ -16603,7 +16537,7 @@ msgstr "" "ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " "منع می‌شود ولی گاهی اوقات ضروری است." -#: src/chromium/adding-third-party-crates/resolving-problems.md:3 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " "arbitrary things at build time. This is fundamentally at odds with the " @@ -16615,72 +16549,66 @@ msgstr "" "طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " "رساندن موازی‌سازی و تکرارپذیری buildها است." -#: src/chromium/adding-third-party-crates/resolving-problems.md:8 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Some `build.rs` actions are automatically supported; others require action:" msgstr "" "برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " "اقدام دارند:" -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" msgstr "ساخت افکت اسکریپت" -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Supported by our gn templates" msgstr "توسط قالب‌های gn ما پشتیبانی می‌شود" -#: src/chromium/adding-third-party-crates/resolving-problems.md:10 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Work required by you" msgstr "کار مورد نیاز شما" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking rustc version to configure features on and off" msgstr "بررسی نسخه rustc برای پیکربندی ویژگی‌ها روشن و خاموش" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Yes" msgstr "بلی" -#: src/chromium/adding-third-party-crates/resolving-problems.md:12 -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "None" msgstr "None" -#: src/chromium/adding-third-party-crates/resolving-problems.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking platform or CPU to configure features on and off" msgstr "بررسی پلتفرم یا CPU برای پیکربندی ویژگی‌های روشن و خاموش" -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Generating code" msgstr "تولید کردن کد" -#: src/chromium/adding-third-party-crates/resolving-problems.md:14 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Yes - specify in `gnrt_config.toml`" msgstr "بله - در `gnrt_config.toml` مشخص کنید" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Building C/C++" msgstr "Building C/C++" -#: src/exercises/chromium/interoperability-with-cpp.md:29 -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 -#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "No" msgstr "خیر" -#: src/chromium/adding-third-party-crates/resolving-problems.md:15 -#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Patch around it" msgstr "اطراف آن را Patch کنید" -#: src/chromium/adding-third-party-crates/resolving-problems.md:16 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Arbitrary other actions" msgstr "سایر اقدامات دلخواه" -#: src/chromium/adding-third-party-crates/resolving-problems.md:18 +#: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." @@ -16688,7 +16616,7 @@ msgstr "" "خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " "scriptها تنها دو عمل اصلی را انجام می‌دهند." -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:3 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." @@ -16696,7 +16624,7 @@ msgstr "" "اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " "ببینید که آیا کدهای منبع را می‌نویسد." -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:6 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " "add `build-script-outputs` to the crate. If this is a transitive dependency, " @@ -16710,7 +16638,7 @@ msgstr "" "`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " "فایل وجود دارد:" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:11 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "```toml\n" "[crate.unicode-linebreak]\n" @@ -16724,7 +16652,7 @@ msgstr "" "build-script-outputs = [\"tables.rs\"]\n" "```" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md:17 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " "`BUILD.gn` files to inform ninja that this particular output file is input " @@ -16734,7 +16662,7 @@ msgstr "" "تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " "فایل خروجی خاص ورودی مراحل build بعدی است." -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:3 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" "Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " "link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" @@ -16749,19 +16677,19 @@ msgstr "" "سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " "است." -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:8 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" msgstr "بنابراین، گزینه‌های شما عبارتند از:" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:10 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Avoid these crates" msgstr "از این crateها اجتناب کنید" -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:11 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Apply a patch to the crate." msgstr "یک وصله (patch) روی crate بزنید." -#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md:13 +#: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" "Patches should be kept in `third_party/rust/chromium_crates_io/patches/" @@ -16776,7 +16704,7 @@ msgstr "" "chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " "خودکار توسط`gnrt` اعمال می‌شود." -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:3 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "Once you've added a third-party crate and generated build rules, depending " "on a crate is simple. Find your `rust_static_library` target, and add a " @@ -16786,27 +16714,27 @@ msgstr "" "توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " "را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:7 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," msgstr "به‌طور‌مشخص،" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:9 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" +"\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" +"\"\n" " +------------+ +----------------------+\n" "```" -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md:17 +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "```gn\n" "rust_static_library(\"my_rust_lib\") {\n" @@ -16824,11 +16752,11 @@ msgstr "" "}\n" "```" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:1 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Auditing Third Party Crates" msgstr "حسابرسی Crateهای شخص ثالث" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:3 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" "chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." @@ -16844,7 +16772,7 @@ msgstr "" "زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " "جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:9 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Over time Chromium aims to move to a process based around [cargo vet]" "(https://mozilla.github.io/cargo-vet/)." @@ -16852,12 +16780,12 @@ msgstr "" "با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" "mozilla.github.io/cargo-vet/) حرکت کند." -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:11 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:13 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Understand why each crate is used. What's the relationship between crates? " "If the build system for each crate contains a `build.rs` or procedural " @@ -16869,12 +16797,12 @@ msgstr "" "کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " "ساخته و built می‌شود سازگار هستند؟" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:17 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy msgid "Check each crate seems to be reasonably well maintained" msgstr "بررسی کنید که هر crate به نظر برسد که به خوبی نگهداری شده باشد." -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:18 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " "vulnerabilities (first you'll need to `cargo install cargo-audit`, which " @@ -16886,7 +16814,7 @@ msgstr "" "audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." "md))" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:21 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Ensure any `unsafe` code is good enough for the [Rule of Two](https://" "chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." @@ -16896,11 +16824,11 @@ msgstr "" "googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" "in-safe-languages) خوب است" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:22 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررسی کنید" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:23 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Read all the code at a sufficient level to look for anything out of place " "that might have been maliciously inserted. (You can't realistically aim for " @@ -16910,7 +16838,7 @@ msgstr "" "وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " "نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" -#: src/chromium/adding-third-party-crates/reviews-and-audits.md:27 +#: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "These are just guidelines --- work with reviewers from `security@chromium." "org` to work out the right way to become confident of the crate." @@ -16918,19 +16846,19 @@ msgstr "" "این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " "کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." -#: src/chromium/adding-third-party-crates/checking-in.md:1 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" msgstr "بررسی Crateها در کد منبع Chromium" -#: src/chromium/adding-third-party-crates/checking-in.md:3 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "`git status` should reveal:" msgstr "‏ `git status` باید نشان دهد:" -#: src/chromium/adding-third-party-crates/checking-in.md:5 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "کد Crate را در `//third_party/rust/chromium_crates_io`." -#: src/chromium/adding-third-party-crates/checking-in.md:6 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" @@ -16938,11 +16866,11 @@ msgstr "" "متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" "`" -#: src/chromium/adding-third-party-crates/checking-in.md:9 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضافه کنید." -#: src/chromium/adding-third-party-crates/checking-in.md:11 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "" "You should land all this, along with your `Cargo.toml` and `gnrt_config." "toml` changes, into the Chromium repo." @@ -16950,7 +16878,7 @@ msgstr "" "باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " "مخزن Chromium قرار دهید." -#: src/chromium/adding-third-party-crates/checking-in.md:14 +#: src/chromium/adding-third-party-crates/checking-in.md msgid "" "**Important**: you need to use `git add -f` because otherwise `.gitignore` " "files may result in some files being skipped." @@ -16958,7 +16886,7 @@ msgstr "" "**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." "gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." -#: src/chromium/adding-third-party-crates/checking-in.md:17 +#: src/chromium/adding-third-party-crates/checking-in.md #, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " @@ -16971,7 +16899,7 @@ msgstr "" "نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " "استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" -#: src/chromium/adding-third-party-crates/keeping-up-to-date.md:3 +#: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" "As the OWNER of any third party Chromium dependency, you are [expected to " "keep it up to date with any security fixes](https://chromium.googlesource." @@ -16985,7 +16913,7 @@ msgstr "" "این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " "شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." -#: src/exercises/chromium/third-party.md:3 +#: src/exercises/chromium/third-party.md #, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " @@ -16999,7 +16927,7 @@ msgstr "" "Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " "نمی‌شود." -#: src/exercises/chromium/third-party.md:7 +#: src/exercises/chromium/third-party.md msgid "" "(In the next exercise we'll use uwuify from Chromium, but feel free to skip " "ahead and do that now if you like. Or, you could create a new " @@ -17011,47 +16939,47 @@ msgstr "" "(https://source.chromium.org /chromium/chromium/src/+/main:build/rust/" "rust_executable.gni) جدید ایجاد کنید که از `uwuify` استفاده می‌کند)." -#: src/exercises/chromium/third-party.md:13 +#: src/exercises/chromium/third-party.md msgid "Students will need to download lots of transitive dependencies." msgstr "دانش‌آموزان باید تعداد زیادی وابستگی گذرا را دانلود کنند." -#: src/exercises/chromium/third-party.md:15 +#: src/exercises/chromium/third-party.md msgid "The total crates needed are:" msgstr "کل crateهای مورد نیاز عبارتند از:" -#: src/exercises/chromium/third-party.md:17 +#: src/exercises/chromium/third-party.md msgid "`instant`," msgstr "`instant`," -#: src/exercises/chromium/third-party.md:18 +#: src/exercises/chromium/third-party.md msgid "`lock_api`," msgstr "`lock_api`," -#: src/exercises/chromium/third-party.md:19 +#: src/exercises/chromium/third-party.md msgid "`parking_lot`," msgstr "`parking_lot`," -#: src/exercises/chromium/third-party.md:20 +#: src/exercises/chromium/third-party.md msgid "`parking_lot_core`," msgstr "`parking_lot_core`," -#: src/exercises/chromium/third-party.md:21 +#: src/exercises/chromium/third-party.md msgid "`redox_syscall`," msgstr "`redox_syscall`," -#: src/exercises/chromium/third-party.md:22 +#: src/exercises/chromium/third-party.md msgid "`scopeguard`," msgstr "`scopeguard`," -#: src/exercises/chromium/third-party.md:23 +#: src/exercises/chromium/third-party.md msgid "`smallvec`, and" msgstr "`smallvec`, و" -#: src/exercises/chromium/third-party.md:24 +#: src/exercises/chromium/third-party.md msgid "`uwuify`." msgstr "`uwuify`." -#: src/exercises/chromium/third-party.md:26 +#: src/exercises/chromium/third-party.md msgid "" "If students are downloading even more than that, they probably forgot to " "turn off the default features." @@ -17059,7 +16987,7 @@ msgstr "" "اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " "ویژگی‌های پیش‌فرض را خاموش کنند." -#: src/exercises/chromium/third-party.md:29 +#: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" @@ -17264,7 +17192,7 @@ msgid "" "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" -#: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md:33 +#: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" msgstr "" @@ -17368,85 +17296,85 @@ msgstr "" msgid "`std` re-exports the contents of both `core` and `alloc`." msgstr "" -#: src/bare-metal/minimal.md:1 +#: src/bare-metal/minimal.md msgid "A minimal `no_std` program" msgstr "" -#: src/bare-metal/minimal.md:19 +#: src/bare-metal/minimal.md msgid "This will compile to an empty binary." msgstr "" -#: src/bare-metal/minimal.md:20 +#: src/bare-metal/minimal.md msgid "`std` provides a panic handler; without it we must provide our own." msgstr "" -#: src/bare-metal/minimal.md:21 +#: src/bare-metal/minimal.md msgid "It can also be provided by another crate, such as `panic-halt`." msgstr "" -#: src/bare-metal/minimal.md:22 +#: src/bare-metal/minimal.md msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -#: src/bare-metal/minimal.md:24 +#: src/bare-metal/minimal.md msgid "" "Note that there is no `main` or any other entry point; it's up to you to " "define your own entry point. This will typically involve a linker script and " "some assembly code to set things up ready for Rust code to run." msgstr "" -#: src/bare-metal/alloc.md:3 +#: src/bare-metal/alloc.md msgid "" "To use `alloc` you must implement a [global (heap) allocator](https://doc." "rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" -#: src/bare-metal/alloc.md:23 +#: src/bare-metal/alloc.md msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" msgstr "" -#: src/bare-metal/alloc.md:25 +#: src/bare-metal/alloc.md msgid "// Give the allocator some memory to allocate.\n" msgstr "" -#: src/bare-metal/alloc.md:29 +#: src/bare-metal/alloc.md msgid "// Now we can do things that require heap allocation.\n" msgstr "" -#: src/bare-metal/alloc.md:31 +#: src/bare-metal/alloc.md #, fuzzy msgid "\"A string\"" msgstr "String" -#: src/bare-metal/alloc.md:37 +#: src/bare-metal/alloc.md msgid "" "`buddy_system_allocator` is a third-party crate implementing a basic buddy " "system allocator. Other crates are available, or you can write your own or " "hook into your existing allocator." msgstr "" -#: src/bare-metal/alloc.md:40 +#: src/bare-metal/alloc.md msgid "" "The const parameter of `LockedHeap` is the max order of the allocator; i.e. " "in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" -#: src/bare-metal/alloc.md:42 +#: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " "exactly one global allocator defined in your binary. Usually this is done in " "the top-level binary crate." msgstr "" -#: src/bare-metal/alloc.md:45 +#: src/bare-metal/alloc.md msgid "" "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " "crate is linked in so we get its panic handler." msgstr "" -#: src/bare-metal/alloc.md:47 +#: src/bare-metal/alloc.md msgid "This example will build but not run, as it doesn't have an entry point." msgstr "" @@ -17472,101 +17400,100 @@ msgstr "" msgid "Run the example with `cargo embed --bin minimal`" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:3 +#: src/bare-metal/microcontrollers/mmio.md msgid "" "Most microcontrollers access peripherals via memory-mapped IO. Let's try " "turning on an LED on our micro:bit:" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:16 +#: src/bare-metal/microcontrollers/mmio.md msgid "/// GPIO port 0 peripheral address\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:19 +#: src/bare-metal/microcontrollers/mmio.md msgid "// GPIO peripheral offsets\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:24 +#: src/bare-metal/microcontrollers/mmio.md msgid "// PIN_CNF fields\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:34 -#: src/bare-metal/microcontrollers/pacs.md:21 -#: src/bare-metal/microcontrollers/hals.md:26 +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/hals.md msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:37 -#: src/bare-metal/microcontrollers/mmio.md:59 +#: src/bare-metal/microcontrollers/mmio.md msgid "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:56 -#: src/bare-metal/microcontrollers/pacs.md:39 -#: src/bare-metal/microcontrollers/hals.md:30 +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/hals.md msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:72 +#: src/bare-metal/microcontrollers/mmio.md msgid "" "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " "to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md:75 -#: src/bare-metal/microcontrollers/pacs.md:61 -#: src/bare-metal/microcontrollers/hals.md:44 -#: src/bare-metal/microcontrollers/board-support.md:37 +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:1 +#: src/bare-metal/microcontrollers/pacs.md msgid "Peripheral Access Crates" msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:3 +#: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " "wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" "pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:49 +#: src/bare-metal/microcontrollers/pacs.md msgid "" "SVD (System View Description) files are XML files typically provided by " "silicon vendors which describe the memory map of the device." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:51 +#: src/bare-metal/microcontrollers/pacs.md msgid "" "They are organised by peripheral, register, field and value, with names, " "descriptions, addresses and so on." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:53 +#: src/bare-metal/microcontrollers/pacs.md msgid "" "SVD files are often buggy and incomplete, so there are various projects " "which patch the mistakes, add missing details, and publish the generated " "crates." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:56 +#: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." msgstr "" -#: src/bare-metal/microcontrollers/pacs.md:57 +#: src/bare-metal/microcontrollers/pacs.md msgid "" "If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " "pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" -#: src/bare-metal/microcontrollers/hals.md:1 +#: src/bare-metal/microcontrollers/hals.md msgid "HAL crates" msgstr "" -#: src/bare-metal/microcontrollers/hals.md:3 +#: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" "implementation-crates) for many microcontrollers provide wrappers around " @@ -17574,72 +17501,72 @@ msgid "" "(https://crates.io/crates/embedded-hal)." msgstr "" -#: src/bare-metal/microcontrollers/hals.md:23 +#: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "" -#: src/bare-metal/microcontrollers/hals.md:40 +#: src/bare-metal/microcontrollers/hals.md msgid "" "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" -#: src/bare-metal/microcontrollers/hals.md:41 +#: src/bare-metal/microcontrollers/hals.md msgid "" "HAL crates exist for many Cortex-M and RISC-V devices, including various " "STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md:1 +#: src/bare-metal/microcontrollers/board-support.md msgid "Board support crates" msgstr "" -#: src/bare-metal/microcontrollers/board-support.md:3 +#: src/bare-metal/microcontrollers/board-support.md msgid "" "Board support crates provide a further level of wrapping for a specific " "board for convenience." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md:31 +#: src/bare-metal/microcontrollers/board-support.md msgid "" "In this case the board support crate is just providing more useful names, " "and a bit of initialisation." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md:33 +#: src/bare-metal/microcontrollers/board-support.md msgid "" "The crate may also include drivers for some on-board devices outside of the " "microcontroller itself." msgstr "" -#: src/bare-metal/microcontrollers/board-support.md:35 +#: src/bare-metal/microcontrollers/board-support.md msgid "`microbit-v2` includes a simple driver for the LED matrix." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:1 +#: src/bare-metal/microcontrollers/type-state.md msgid "The type state pattern" msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:11 +#: src/bare-metal/microcontrollers/type-state.md msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:19 +#: src/bare-metal/microcontrollers/type-state.md msgid "// pin_input.is_high(); // Error, moved.\n" msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:33 +#: src/bare-metal/microcontrollers/type-state.md msgid "" "Pins don't implement `Copy` or `Clone`, so only one instance of each can " "exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:35 +#: src/bare-metal/microcontrollers/type-state.md msgid "" "Changing the configuration of a pin consumes the old pin instance, so you " "can’t keep use the old instance afterwards." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:37 +#: src/bare-metal/microcontrollers/type-state.md msgid "" "The type of a value indicates the state that it is in: e.g. in this case, " "the configuration state of a GPIO pin. This encodes the state machine into " @@ -17648,39 +17575,39 @@ msgid "" "caught at compile time." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:42 +#: src/bare-metal/microcontrollers/type-state.md msgid "" "You can call `is_high` on an input pin and `set_high` on an output pin, but " "not vice-versa." msgstr "" -#: src/bare-metal/microcontrollers/type-state.md:44 +#: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:3 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:6 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:7 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "PWM" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:8 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "Delay timers" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:9 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "I2C and SPI buses and devices" msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:11 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " "out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" @@ -17688,66 +17615,66 @@ msgid "" "crates.io/crates/rand_core) respectively." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:14 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "Other crates then implement [drivers](https://github.com/rust-embedded/" "awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " "accelerometer driver might need an I2C or SPI device instance." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:19 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "The traits cover using the peripherals but not initialising or configuring " "them, as initialisation and configuration is usually highly platform-" "specific." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:21 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "There are implementations for many microcontrollers, as well as other " "platforms such as Linux on Raspberry Pi." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:23 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -#: src/bare-metal/microcontrollers/embedded-hal.md:24 +#: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " "another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" "crates/nb) crate." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:3 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " "like OpenOCD but better integrated." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:6 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:7 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:8 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "Cargo integration" msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:10 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " "(Real Time Transfers) output and connect GDB. It's configured by an `Embed." "toml` file in your project directory." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:16 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " "an Arm standard protocol over USB for an in-circuit debugger to access the " @@ -17755,141 +17682,141 @@ msgid "" "on-board debugger on the BBC micro:bit uses." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:20 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " "is a range from SEGGER." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:22 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " "Serial Wire Debug." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:24 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "probe-rs is a library which you can integrate into your own tools if you " "want to." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:26 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" "adapter-protocol/) lets VSCode and other IDEs debug code running on any " "supported microcontroller." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:30 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -#: src/bare-metal/microcontrollers/probe-rs.md:31 +#: src/bare-metal/microcontrollers/probe-rs.md msgid "" "RTT (Real Time Transfers) is a mechanism to transfer data between the debug " "host and the target through a number of ringbuffers." msgstr "" -#: src/bare-metal/microcontrollers/debugging.md:3 +#: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md:15 +#: src/bare-metal/microcontrollers/debugging.md msgid "In one terminal under `src/bare-metal/microcontrollers/examples/`:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md:23 +#: src/bare-metal/microcontrollers/debugging.md msgid "In another terminal in the same directory:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md:25 +#: src/bare-metal/microcontrollers/debugging.md msgid "On gLinux or Debian:" msgstr "" -#: src/bare-metal/microcontrollers/debugging.md:43 +#: src/bare-metal/microcontrollers/debugging.md msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:1 -#: src/bare-metal/aps/other-projects.md:1 +#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/aps/other-projects.md msgid "Other projects" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:3 +#: src/bare-metal/microcontrollers/other-projects.md msgid "[RTIC](https://rtic.rs/)" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:4 +#: src/bare-metal/microcontrollers/other-projects.md msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:5 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "Shared resource management, message passing, task scheduling, timer queue" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:6 +#: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:7 +#: src/bare-metal/microcontrollers/other-projects.md msgid "`async` executors with priorities, timers, networking, USB" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:8 +#: src/bare-metal/microcontrollers/other-projects.md msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:9 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:11 +#: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:12 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "Microkernel RTOS from Oxide Computer Company with memory protection, " "unprivileged drivers, IPC" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:14 +#: src/bare-metal/microcontrollers/other-projects.md msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:15 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." "github.io/book/overview/using-the-standard-library.html)." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:20 +#: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:21 +#: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:22 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " "scheduling rather than a proper kernel." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:24 +#: src/bare-metal/microcontrollers/other-projects.md msgid "Cortex-M only." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:25 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md:26 +#: src/bare-metal/microcontrollers/other-projects.md msgid "" "FreeRTOS is mostly written in C, but there are Rust bindings for writing " "applications." @@ -17909,18 +17836,18 @@ msgstr "" "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " "نگاه کنید." -#: src/exercises/bare-metal/compass.md:3 +#: src/exercises/bare-metal/compass.md msgid "" "We will read the direction from an I2C compass, and log the readings to a " "serial port. If you have time, try displaying it on the LEDs somehow too, or " "use the buttons somehow." msgstr "" -#: src/exercises/bare-metal/compass.md:7 +#: src/exercises/bare-metal/compass.md msgid "Hints:" msgstr "" -#: src/exercises/bare-metal/compass.md:9 +#: src/exercises/bare-metal/compass.md msgid "" "Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" "latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" @@ -17928,112 +17855,112 @@ msgid "" "org/hardware/)." msgstr "" -#: src/exercises/bare-metal/compass.md:13 +#: src/exercises/bare-metal/compass.md msgid "" "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" -#: src/exercises/bare-metal/compass.md:14 +#: src/exercises/bare-metal/compass.md msgid "" "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" -#: src/exercises/bare-metal/compass.md:15 +#: src/exercises/bare-metal/compass.md msgid "" "The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" "I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" "microbit/hal/struct.Twim.html) struct implements this." msgstr "" -#: src/exercises/bare-metal/compass.md:19 +#: src/exercises/bare-metal/compass.md msgid "" "You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" "struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" -#: src/exercises/bare-metal/compass.md:22 +#: src/exercises/bare-metal/compass.md msgid "" "You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." "com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " "this exercise." msgstr "" -#: src/exercises/bare-metal/compass.md:26 +#: src/exercises/bare-metal/compass.md msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `compass` directory for the following files." msgstr "" -#: src/exercises/bare-metal/compass.md:29 src/exercises/bare-metal/rtc.md:22 +#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_src/main.rs_:" msgstr "" -#: src/exercises/bare-metal/compass.md:71 src/exercises/bare-metal/rtc.md:393 +#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_Cargo.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md:93 +#: src/exercises/bare-metal/compass.md msgid "_Embed.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md:109 src/exercises/bare-metal/rtc.md:1000 +#: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_.cargo/config.toml_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/compass.md:122 +#: src/exercises/bare-metal/compass.md msgid "See the serial output on Linux with:" msgstr "" -#: src/exercises/bare-metal/compass.md:130 +#: src/exercises/bare-metal/compass.md msgid "" "Or on Mac OS something like (the device name may be slightly different):" msgstr "" -#: src/exercises/bare-metal/compass.md:138 +#: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:1 +#: src/exercises/bare-metal/solutions-morning.md msgid "Bare Metal Rust Morning Exercise" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:5 +#: src/exercises/bare-metal/solutions-morning.md msgid "([back to exercise](compass.md))" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:34 +#: src/exercises/bare-metal/solutions-morning.md msgid "// Configure serial port.\n" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:42 +#: src/exercises/bare-metal/solutions-morning.md msgid "// Use the system timer as a delay provider.\n" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:45 +#: src/exercises/bare-metal/solutions-morning.md msgid "// Set up the I2C controller and Inertial Measurement Unit.\n" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:46 +#: src/exercises/bare-metal/solutions-morning.md msgid "\"Setting up IMU...\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:64 +#: src/exercises/bare-metal/solutions-morning.md msgid "// Set up display and timer.\n" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:71 +#: src/exercises/bare-metal/solutions-morning.md msgid "\"Ready.\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:74 +#: src/exercises/bare-metal/solutions-morning.md msgid "// Read compass data and log it to the serial port.\n" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:82 +#: src/exercises/bare-metal/solutions-morning.md msgid "\"{},{},{}\\t{},{},{}\"" msgstr "" -#: src/exercises/bare-metal/solutions-morning.md:120 +#: src/exercises/bare-metal/solutions-morning.md msgid "" "// If button A is pressed, switch to the next mode and briefly blink all " "LEDs\n" @@ -18066,12 +17993,12 @@ msgid "" "hardware, but is designed purely for virtual machines." msgstr "" -#: src/bare-metal/aps/entry-point.md:3 +#: src/bare-metal/aps/entry-point.md msgid "" "Before we can start running Rust code, we need to do some initialisation." msgstr "" -#: src/bare-metal/aps/entry-point.md:5 +#: src/bare-metal/aps/entry-point.md msgid "" "```armasm\n" ".section .init.entry, \"ax\"\n" @@ -18147,13 +18074,13 @@ msgid "" "```" msgstr "" -#: src/bare-metal/aps/entry-point.md:77 +#: src/bare-metal/aps/entry-point.md msgid "" "This is the same as it would be for C: initialising the processor state, " "zeroing the BSS, and setting up the stack pointer." msgstr "" -#: src/bare-metal/aps/entry-point.md:79 +#: src/bare-metal/aps/entry-point.md msgid "" "The BSS (block starting symbol, for historical reasons) is the part of the " "object file which containing statically allocated variables which are " @@ -18162,19 +18089,19 @@ msgid "" "them." msgstr "" -#: src/bare-metal/aps/entry-point.md:84 +#: src/bare-metal/aps/entry-point.md msgid "" "The BSS may already be zeroed, depending on how memory is initialised and " "the image is loaded, but we zero it to be sure." msgstr "" -#: src/bare-metal/aps/entry-point.md:86 +#: src/bare-metal/aps/entry-point.md msgid "" "We need to enable the MMU and cache before reading or writing any memory. If " "we don't:" msgstr "" -#: src/bare-metal/aps/entry-point.md:88 +#: src/bare-metal/aps/entry-point.md msgid "" "Unaligned accesses will fault. We build the Rust code for the `aarch64-" "unknown-none` target which sets `+strict-align` to prevent the compiler " @@ -18182,7 +18109,7 @@ msgid "" "is not necessarily the case in general." msgstr "" -#: src/bare-metal/aps/entry-point.md:92 +#: src/bare-metal/aps/entry-point.md msgid "" "If it were running in a VM, this can lead to cache coherency issues. The " "problem is that the VM is accessing memory directly with the cache disabled, " @@ -18193,7 +18120,7 @@ msgid "" "not VA or IPA.)" msgstr "" -#: src/bare-metal/aps/entry-point.md:99 +#: src/bare-metal/aps/entry-point.md msgid "" "For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " "identity maps the first 1 GiB of address space for devices, the next 1 GiB " @@ -18201,24 +18128,24 @@ msgid "" "memory layout that QEMU uses." msgstr "" -#: src/bare-metal/aps/entry-point.md:103 +#: src/bare-metal/aps/entry-point.md msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" -#: src/bare-metal/aps/entry-point.md:105 +#: src/bare-metal/aps/entry-point.md msgid "" "All examples this afternoon assume we will be running at exception level 1 " "(EL1). If you need to run at a different exception level you'll need to " "modify `entry.S` accordingly." msgstr "" -#: src/bare-metal/aps/inline-assembly.md:1 +#: src/bare-metal/aps/inline-assembly.md msgid "Inline assembly" msgstr "Inline assembly" -#: src/bare-metal/aps/inline-assembly.md:3 +#: src/bare-metal/aps/inline-assembly.md msgid "" "Sometimes we need to use assembly to do things that aren't possible with " "Rust code. For example, to make an HVC (hypervisor call) to tell the " @@ -18228,7 +18155,7 @@ msgstr "" "استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " "که به firmware بگویید سیستم را خاموش کند:" -#: src/bare-metal/aps/inline-assembly.md:20 +#: src/bare-metal/aps/inline-assembly.md #, fuzzy msgid "" "// SAFETY: this only uses the declared registers and doesn't do anything\n" @@ -18237,43 +18164,43 @@ msgstr "" "// SAFETY: this only uses the declared registers and doesn't do anything\n" " // with memory.\n" -#: src/bare-metal/aps/inline-assembly.md:23 +#: src/bare-metal/aps/inline-assembly.md msgid "\"hvc #0\"" msgstr "\"hvc #0\"" -#: src/bare-metal/aps/inline-assembly.md:24 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w0\"" msgstr "\"w0\"" -#: src/bare-metal/aps/inline-assembly.md:25 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w1\"" msgstr "\"w1\"" -#: src/bare-metal/aps/inline-assembly.md:26 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w2\"" msgstr "\"w2\"" -#: src/bare-metal/aps/inline-assembly.md:27 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w3\"" msgstr "\"w3\"" -#: src/bare-metal/aps/inline-assembly.md:28 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w4\"" msgstr "\"w4\"" -#: src/bare-metal/aps/inline-assembly.md:29 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w5\"" msgstr "\"w5\"" -#: src/bare-metal/aps/inline-assembly.md:30 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w6\"" msgstr "\"w6\"" -#: src/bare-metal/aps/inline-assembly.md:31 +#: src/bare-metal/aps/inline-assembly.md msgid "\"w7\"" msgstr "\"w7\"" -#: src/bare-metal/aps/inline-assembly.md:40 +#: src/bare-metal/aps/inline-assembly.md msgid "" "(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" "smccc) crate which has wrappers for all these functions.)" @@ -18282,7 +18209,7 @@ msgstr "" "crates.io/crates/smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این " "عملکردها است.)" -#: src/bare-metal/aps/inline-assembly.md:45 +#: src/bare-metal/aps/inline-assembly.md msgid "" "PSCI is the Arm Power State Coordination Interface, a standard set of " "functions to manage system and CPU power states, among other things. It is " @@ -18292,7 +18219,7 @@ msgstr "" "برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " "مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." -#: src/bare-metal/aps/inline-assembly.md:48 +#: src/bare-metal/aps/inline-assembly.md msgid "" "The `0 => _` syntax means initialise the register to 0 before running the " "inline assembly code, and ignore its contents afterwards. We need to use " @@ -18304,7 +18231,7 @@ msgstr "" "از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " "محتویات رجیسترها را مخدوش کند." -#: src/bare-metal/aps/inline-assembly.md:52 +#: src/bare-metal/aps/inline-assembly.md msgid "" "This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " "it is called from our entry point in `entry.S`." @@ -18312,7 +18239,7 @@ msgstr "" "این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " "نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." -#: src/bare-metal/aps/inline-assembly.md:54 +#: src/bare-metal/aps/inline-assembly.md msgid "" "`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " "used by the bootloader to pass things like a pointer to the device tree. " @@ -18329,7 +18256,7 @@ msgstr "" "نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " "نمی‌دهد." -#: src/bare-metal/aps/inline-assembly.md:60 +#: src/bare-metal/aps/inline-assembly.md msgid "" "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" "examples`." @@ -18337,19 +18264,19 @@ msgstr "" "مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " "اجرا کنید." -#: src/bare-metal/aps/mmio.md:1 +#: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" msgstr "دسترسی به حافظه فرار برای MMIO" -#: src/bare-metal/aps/mmio.md:3 +#: src/bare-metal/aps/mmio.md msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." msgstr "از `pointer::read_volatile` و `pointer::write_volatile` استفاده کنید." -#: src/bare-metal/aps/mmio.md:4 +#: src/bare-metal/aps/mmio.md msgid "Never hold a reference." msgstr "هرگز reference‌ای را نگه ندارید." -#: src/bare-metal/aps/mmio.md:5 +#: src/bare-metal/aps/mmio.md msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." @@ -18357,7 +18284,7 @@ msgstr "" "‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " "ساختارها را دریافت کنید." -#: src/bare-metal/aps/mmio.md:10 +#: src/bare-metal/aps/mmio.md msgid "" "Volatile access: read or write operations may have side-effects, so prevent " "the compiler or hardware from reordering, duplicating or eliding them." @@ -18366,7 +18293,7 @@ msgstr "" "داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " "حذف آنها جلوگیری کنید." -#: src/bare-metal/aps/mmio.md:12 +#: src/bare-metal/aps/mmio.md msgid "" "Usually if you write and then read, e.g. via a mutable reference, the " "compiler may assume that the value read is the same as the value just " @@ -18376,7 +18303,7 @@ msgstr "" "کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " "است و در واقع خواندن memory را سخت‌تر نکند." -#: src/bare-metal/aps/mmio.md:15 +#: src/bare-metal/aps/mmio.md msgid "" "Some existing crates for volatile access to hardware do hold references, but " "this is unsound. Whenever a reference exist, the compiler may choose to " @@ -18386,7 +18313,7 @@ msgstr "" "referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " "داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." -#: src/bare-metal/aps/mmio.md:18 +#: src/bare-metal/aps/mmio.md msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." @@ -18394,11 +18321,11 @@ msgstr "" "از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " "ساختار استفاده کنید." -#: src/bare-metal/aps/uart.md:1 +#: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" msgstr "بیایید یک درایور UART بنویسیم" -#: src/bare-metal/aps/uart.md:3 +#: src/bare-metal/aps/uart.md msgid "" "The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" "documentation/ddi0183/g) UART, so let's write a driver for that." @@ -18406,12 +18333,12 @@ msgstr "" "این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" "ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." -#: src/bare-metal/aps/uart.md:9 +#: src/bare-metal/aps/uart.md #, fuzzy msgid "/// Minimal driver for a PL011 UART.\n" msgstr "/// Minimal driver for a PL011 UART.\n" -#: src/bare-metal/aps/uart.md:17 src/bare-metal/aps/better-uart/driver.md:13 +#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -18436,17 +18363,17 @@ msgstr "" "process\n" " /// as device memory and not have any other aliases.\n" -#: src/bare-metal/aps/uart.md:29 src/bare-metal/aps/better-uart/driver.md:25 +#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "/// Writes a single byte to the UART.\n" msgstr "/// Writes a single byte to the UART.\n" -#: src/bare-metal/aps/uart.md:31 src/bare-metal/aps/better-uart/driver.md:27 +#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "// Wait until there is room in the TX buffer.\n" msgstr "// Wait until there is room in the TX buffer.\n" -#: src/bare-metal/aps/uart.md:34 src/bare-metal/aps/uart.md:46 +#: src/bare-metal/aps/uart.md #, fuzzy msgid "" "// SAFETY: We know that the base address points to the control\n" @@ -18455,17 +18382,17 @@ msgstr "" "// SAFETY: We know that the base address points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" -#: src/bare-metal/aps/uart.md:37 src/bare-metal/aps/better-uart/driver.md:33 +#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "// Write to the TX buffer.\n" msgstr "// Write to the TX buffer.\n" -#: src/bare-metal/aps/uart.md:41 src/bare-metal/aps/better-uart/driver.md:37 +#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "// Wait until the UART is no longer busy.\n" msgstr "// Wait until the UART is no longer busy.\n" -#: src/bare-metal/aps/uart.md:55 +#: src/bare-metal/aps/uart.md msgid "" "Note that `Uart::new` is unsafe while the other methods are safe. This is " "because as long as the caller of `Uart::new` guarantees that its safety " @@ -18481,7 +18408,7 @@ msgstr "" "همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " "را فرض کنیم." -#: src/bare-metal/aps/uart.md:61 +#: src/bare-metal/aps/uart.md msgid "" "We could have done it the other way around (making `new` safe but " "`write_byte` unsafe), but that would be much less convenient to use as every " @@ -18492,7 +18419,7 @@ msgstr "" "زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " "استدلال کند." -#: src/bare-metal/aps/uart.md:64 +#: src/bare-metal/aps/uart.md #, fuzzy msgid "" "This is a common pattern for writing safe wrappers of unsafe code: moving " @@ -18502,18 +18429,18 @@ msgstr "" "این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " "سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." -#: src/bare-metal/aps/uart/traits.md:1 +#: src/bare-metal/aps/uart/traits.md msgid "More traits" msgstr "‏ traitهای بیشتر" -#: src/bare-metal/aps/uart/traits.md:3 +#: src/bare-metal/aps/uart/traits.md msgid "" "We derived the `Debug` trait. It would be useful to implement a few more " "traits too." msgstr "" "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." -#: src/bare-metal/aps/uart/traits.md:17 +#: src/bare-metal/aps/uart/traits.md #, fuzzy msgid "" "// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" @@ -18522,7 +18449,7 @@ msgstr "" "// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" -#: src/bare-metal/aps/uart/traits.md:25 +#: src/bare-metal/aps/uart/traits.md msgid "" "Implementing `Write` lets us use the `write!` and `writeln!` macros with our " "`Uart` type." @@ -18530,7 +18457,7 @@ msgstr "" "پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ " "`Uart` خود استفاده کنیم." -#: src/bare-metal/aps/uart/traits.md:27 +#: src/bare-metal/aps/uart/traits.md msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." @@ -18538,11 +18465,11 @@ msgstr "" "مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " "اجرا کنید." -#: src/bare-metal/aps/better-uart.md:1 +#: src/bare-metal/aps/better-uart.md msgid "A better UART driver" msgstr "یک درایور UART بهتر" -#: src/bare-metal/aps/better-uart.md:3 +#: src/bare-metal/aps/better-uart.md #, fuzzy msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" @@ -18557,168 +18484,167 @@ msgstr "" "خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " "به آنها به روشی ساختاریافته خوب است." -#: src/bare-metal/aps/better-uart.md:7 +#: src/bare-metal/aps/better-uart.md msgid "Offset" msgstr "افست" -#: src/bare-metal/aps/better-uart.md:7 +#: src/bare-metal/aps/better-uart.md msgid "Register name" msgstr "نام رجیستر" -#: src/bare-metal/aps/better-uart.md:7 +#: src/bare-metal/aps/better-uart.md msgid "Width" msgstr "عرض" -#: src/bare-metal/aps/better-uart.md:9 +#: src/bare-metal/aps/better-uart.md msgid "0x00" msgstr "0x00" -#: src/bare-metal/aps/better-uart.md:9 +#: src/bare-metal/aps/better-uart.md msgid "DR" msgstr "DR" -#: src/bare-metal/aps/better-uart.md:9 +#: src/bare-metal/aps/better-uart.md msgid "12" msgstr "12" -#: src/bare-metal/aps/better-uart.md:10 +#: src/bare-metal/aps/better-uart.md msgid "0x04" msgstr "0x04" -#: src/bare-metal/aps/better-uart.md:10 +#: src/bare-metal/aps/better-uart.md msgid "RSR" msgstr "RSR" -#: src/bare-metal/aps/better-uart.md:10 +#: src/bare-metal/aps/better-uart.md msgid "4" msgstr "4" -#: src/bare-metal/aps/better-uart.md:11 +#: src/bare-metal/aps/better-uart.md msgid "0x18" msgstr "0x18" -#: src/bare-metal/aps/better-uart.md:11 +#: src/bare-metal/aps/better-uart.md msgid "FR" msgstr "FR" -#: src/bare-metal/aps/better-uart.md:11 +#: src/bare-metal/aps/better-uart.md msgid "9" msgstr "9" -#: src/bare-metal/aps/better-uart.md:12 +#: src/bare-metal/aps/better-uart.md msgid "0x20" msgstr "0x20" -#: src/bare-metal/aps/better-uart.md:12 +#: src/bare-metal/aps/better-uart.md msgid "ILPR" msgstr "ILPR" -#: src/bare-metal/aps/better-uart.md:12 src/bare-metal/aps/better-uart.md:15 +#: src/bare-metal/aps/better-uart.md msgid "8" msgstr "8" -#: src/bare-metal/aps/better-uart.md:13 +#: src/bare-metal/aps/better-uart.md msgid "0x24" msgstr "0x24" -#: src/bare-metal/aps/better-uart.md:13 +#: src/bare-metal/aps/better-uart.md msgid "IBRD" msgstr "IBRD" -#: src/bare-metal/aps/better-uart.md:13 src/bare-metal/aps/better-uart.md:16 +#: src/bare-metal/aps/better-uart.md msgid "16" msgstr "16" -#: src/bare-metal/aps/better-uart.md:14 +#: src/bare-metal/aps/better-uart.md msgid "0x28" msgstr "0x28" -#: src/bare-metal/aps/better-uart.md:14 +#: src/bare-metal/aps/better-uart.md msgid "FBRD" msgstr "FBRD" -#: src/bare-metal/aps/better-uart.md:14 src/bare-metal/aps/better-uart.md:17 +#: src/bare-metal/aps/better-uart.md msgid "6" msgstr "6" -#: src/bare-metal/aps/better-uart.md:15 +#: src/bare-metal/aps/better-uart.md msgid "0x2c" msgstr "0x2c" -#: src/bare-metal/aps/better-uart.md:15 +#: src/bare-metal/aps/better-uart.md msgid "LCR_H" msgstr "LCR_H" -#: src/bare-metal/aps/better-uart.md:16 +#: src/bare-metal/aps/better-uart.md msgid "0x30" msgstr "0x30" -#: src/bare-metal/aps/better-uart.md:16 +#: src/bare-metal/aps/better-uart.md msgid "CR" msgstr "CR" -#: src/bare-metal/aps/better-uart.md:17 +#: src/bare-metal/aps/better-uart.md msgid "0x34" msgstr "0x34" -#: src/bare-metal/aps/better-uart.md:17 +#: src/bare-metal/aps/better-uart.md msgid "IFLS" msgstr "IFLS" -#: src/bare-metal/aps/better-uart.md:18 +#: src/bare-metal/aps/better-uart.md msgid "0x38" msgstr "0x38" -#: src/bare-metal/aps/better-uart.md:18 +#: src/bare-metal/aps/better-uart.md msgid "IMSC" msgstr "IMSC" -#: src/bare-metal/aps/better-uart.md:18 src/bare-metal/aps/better-uart.md:19 -#: src/bare-metal/aps/better-uart.md:20 src/bare-metal/aps/better-uart.md:21 +#: src/bare-metal/aps/better-uart.md msgid "11" msgstr "11" -#: src/bare-metal/aps/better-uart.md:19 +#: src/bare-metal/aps/better-uart.md msgid "0x3c" msgstr "0x3c" -#: src/bare-metal/aps/better-uart.md:19 +#: src/bare-metal/aps/better-uart.md msgid "RIS" msgstr "RIS" -#: src/bare-metal/aps/better-uart.md:20 +#: src/bare-metal/aps/better-uart.md msgid "0x40" msgstr "0x40" -#: src/bare-metal/aps/better-uart.md:20 +#: src/bare-metal/aps/better-uart.md msgid "MIS" msgstr "MIS" -#: src/bare-metal/aps/better-uart.md:21 +#: src/bare-metal/aps/better-uart.md msgid "0x44" msgstr "0x44" -#: src/bare-metal/aps/better-uart.md:21 +#: src/bare-metal/aps/better-uart.md msgid "ICR" msgstr "ICR" -#: src/bare-metal/aps/better-uart.md:22 +#: src/bare-metal/aps/better-uart.md msgid "0x48" msgstr "0x48" -#: src/bare-metal/aps/better-uart.md:22 +#: src/bare-metal/aps/better-uart.md msgid "DMACR" msgstr "DMACR" -#: src/bare-metal/aps/better-uart.md:22 +#: src/bare-metal/aps/better-uart.md msgid "3" msgstr "3" -#: src/bare-metal/aps/better-uart.md:26 +#: src/bare-metal/aps/better-uart.md msgid "There are also some ID registers which have been omitted for brevity." msgstr "همچنین برخی از ID register هایی وجود دارد که برای اختصار حذف شده‌اند." -#: src/bare-metal/aps/better-uart/bitflags.md:3 +#: src/bare-metal/aps/better-uart/bitflags.md msgid "" "The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " "working with bitflags." @@ -18726,57 +18652,57 @@ msgstr "" "این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " "bitflags مفید است." -#: src/bare-metal/aps/better-uart/bitflags.md:10 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Flags from the UART flag register.\n" msgstr "/// Flags from the UART flag register.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:14 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Clear to send.\n" msgstr "/// Clear to send.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:16 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Data set ready.\n" msgstr "/// Data set ready.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:18 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Data carrier detect.\n" msgstr "/// Data carrier detect.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:20 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// UART busy transmitting data.\n" msgstr "/// UART busy transmitting data.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:22 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Receive FIFO is empty.\n" msgstr "/// Receive FIFO is empty.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:24 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Transmit FIFO is full.\n" msgstr "/// Transmit FIFO is full.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:26 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Receive FIFO is full.\n" msgstr "/// Receive FIFO is full.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:28 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Transmit FIFO is empty.\n" msgstr "/// Transmit FIFO is empty.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:30 +#: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy msgid "/// Ring indicator.\n" msgstr "/// Ring indicator.\n" -#: src/bare-metal/aps/better-uart/bitflags.md:38 +#: src/bare-metal/aps/better-uart/bitflags.md msgid "" "The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " "with a bunch of method implementations to get and set flags." @@ -18784,18 +18710,18 @@ msgstr "" "ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " "پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." -#: src/bare-metal/aps/better-uart/registers.md:1 +#: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" -#: src/bare-metal/aps/better-uart/registers.md:3 +#: src/bare-metal/aps/better-uart/registers.md msgid "" "We can use a struct to represent the memory layout of the UART's registers." msgstr "" "ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " "کنیم." -#: src/bare-metal/aps/better-uart/registers.md:43 +#: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " @@ -18810,17 +18736,16 @@ msgstr "" "اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " "کند." -#: src/bare-metal/aps/better-uart/driver.md:3 +#: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." msgstr "حال بیایید از ساختار جدید `Registers` در درایور خود استفاده کنیم." -#: src/bare-metal/aps/better-uart/driver.md:6 +#: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "/// Driver for a PL011 UART.\n" msgstr "/// Driver for a PL011 UART.\n" -#: src/bare-metal/aps/better-uart/driver.md:30 -#: src/bare-metal/aps/better-uart/driver.md:56 +#: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" @@ -18829,7 +18754,7 @@ msgstr "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL011 device which is appropriately mapped.\n" -#: src/bare-metal/aps/better-uart/driver.md:41 +#: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "/// Reads and returns a pending byte, or `None` if nothing has been\n" @@ -18839,7 +18764,7 @@ msgstr "" " /// received.\n" "\n" -#: src/bare-metal/aps/better-uart/driver.md:47 +#: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control\n" @@ -18848,12 +18773,12 @@ msgstr "" "// SAFETY: We know that self.registers points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" -#: src/bare-metal/aps/better-uart/driver.md:50 +#: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "// TODO: Check for error conditions in bits 8-11.\n" msgstr "// TODO: Check for error conditions in bits 8-11.\n" -#: src/bare-metal/aps/better-uart/driver.md:65 +#: src/bare-metal/aps/better-uart/driver.md msgid "" "Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." @@ -18861,12 +18786,11 @@ msgstr "" "به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " "جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." -#: src/bare-metal/aps/better-uart/using.md:1 -#: src/bare-metal/aps/logging/using.md:1 +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md msgid "Using it" msgstr "با استفاده از آن" -#: src/bare-metal/aps/better-uart/using.md:3 +#: src/bare-metal/aps/better-uart/using.md msgid "" "Let's write a small program using our driver to write to the serial console, " "and echo incoming bytes." @@ -18874,16 +18798,14 @@ msgstr "" "بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " "بنویسیم و بایت‌های ورودی را echo کنیم." -#: src/bare-metal/aps/better-uart/using.md:19 -#: src/bare-metal/aps/logging/using.md:18 -#: src/exercises/bare-metal/solutions-afternoon.md:33 +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Base address of the primary PL011 UART.\n" msgstr "/// Base address of the primary PL011 UART.\n" -#: src/bare-metal/aps/better-uart/using.md:25 -#: src/bare-metal/aps/logging/using.md:24 -#: src/exercises/bare-metal/solutions-afternoon.md:44 +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" @@ -18892,29 +18814,28 @@ msgstr "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" " // nothing else accesses that address range.\n" -#: src/bare-metal/aps/better-uart/using.md:29 -#: src/bare-metal/aps/logging/using.md:29 +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgstr "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" -#: src/bare-metal/aps/better-uart/using.md:35 +#: src/bare-metal/aps/better-uart/using.md msgid "b'\\r'" msgstr "b'\\r'" -#: src/bare-metal/aps/better-uart/using.md:36 -#: src/concurrency/async-pitfalls/cancellation.md:27 +#: src/bare-metal/aps/better-uart/using.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "b'\\n'" msgstr "b'\\n'" -#: src/bare-metal/aps/better-uart/using.md:38 +#: src/bare-metal/aps/better-uart/using.md msgid "b'q'" msgstr "b'q'" -#: src/bare-metal/aps/better-uart/using.md:44 +#: src/bare-metal/aps/better-uart/using.md msgid "\"Bye!\"" msgstr "\"Bye!\"" -#: src/bare-metal/aps/better-uart/using.md:51 +#: src/bare-metal/aps/better-uart/using.md msgid "" "As in the [inline assembly](../inline-assembly.md) example, this `main` " "function is called from our entry point code in `entry.S`. See the speaker " @@ -18924,14 +18845,14 @@ msgstr "" "از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " "یادداشت‌های سخنرانی‌ها را در آنجا ببینید." -#: src/bare-metal/aps/better-uart/using.md:54 +#: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" "مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " "کنید." -#: src/bare-metal/aps/logging.md:3 +#: src/bare-metal/aps/logging.md msgid "" "It would be nice to be able to use the logging macros from the [`log`]" "(https://crates.io/crates/log) crate. We can do this by implementing the " @@ -18941,16 +18862,16 @@ msgstr "" "crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " "دهیم." -#: src/bare-metal/aps/logging.md:26 +#: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" msgstr "\"[{}] {}\"" -#: src/bare-metal/aps/logging.md:35 +#: src/bare-metal/aps/logging.md #, fuzzy msgid "/// Initialises UART logger.\n" msgstr "/// Initialises UART logger.\n" -#: src/bare-metal/aps/logging.md:48 +#: src/bare-metal/aps/logging.md msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." @@ -18958,21 +18879,21 @@ msgstr "" "باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " "مقداردهی اولیه می‌کنیم." -#: src/bare-metal/aps/logging/using.md:3 +#: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." msgstr "قبل از استفاده از لاگر باید مقداردهی اولیه کنیم." -#: src/bare-metal/aps/logging/using.md:38 -#: src/exercises/bare-metal/solutions-afternoon.md:115 +#: src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "\"{info}\"" msgstr "\"{info}\"" -#: src/bare-metal/aps/logging/using.md:46 +#: src/bare-metal/aps/logging/using.md msgid "Note that our panic handler can now log details of panics." msgstr "" "توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." -#: src/bare-metal/aps/logging/using.md:47 +#: src/bare-metal/aps/logging/using.md msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." @@ -18980,7 +18901,7 @@ msgstr "" "مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " "اجرا کنید." -#: src/bare-metal/aps/exceptions.md:3 +#: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " "exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " @@ -18994,12 +18915,12 @@ msgstr "" "این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " "فراخوانی Rust در stack ذخیره کنیم:" -#: src/bare-metal/aps/exceptions.md:67 +#: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." msgstr "" "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." -#: src/bare-metal/aps/exceptions.md:68 +#: src/bare-metal/aps/exceptions.md msgid "" "For simplicity we aren't distinguishing between SP0 and SPx for the current " "EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." @@ -19007,7 +18928,7 @@ msgstr "" "برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " "AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." -#: src/bare-metal/aps/exceptions.md:70 +#: src/bare-metal/aps/exceptions.md msgid "" "For this example we just log the exception and power down, as we don't " "expect any of them to actually happen." @@ -19015,7 +18936,7 @@ msgstr "" "برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " "نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." -#: src/bare-metal/aps/exceptions.md:72 +#: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" "We can think of exception handlers and our main execution context more or " @@ -19033,24 +18954,24 @@ msgstr "" "`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " "قرار دهیم." -#: src/bare-metal/aps/other-projects.md:3 +#: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" msgstr "[oreboot](https://github.com/oreboot/oreboot)" -#: src/bare-metal/aps/other-projects.md:4 +#: src/bare-metal/aps/other-projects.md #, fuzzy msgid "\"coreboot without the C\"" msgstr "\"coreboot without the C\"" -#: src/bare-metal/aps/other-projects.md:5 +#: src/bare-metal/aps/other-projects.md msgid "Supports x86, aarch64 and RISC-V." msgstr "پشتیبانی از x86، aarch64 و RISC-V." -#: src/bare-metal/aps/other-projects.md:6 +#: src/bare-metal/aps/other-projects.md msgid "Relies on LinuxBoot rather than having many drivers itself." msgstr "به جای اینکه خود درایورهای زیادی داشته باشد، به LinuxBoot متکی است." -#: src/bare-metal/aps/other-projects.md:7 +#: src/bare-metal/aps/other-projects.md msgid "" "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" "raspberrypi-OS-tutorials)" @@ -19058,7 +18979,7 @@ msgstr "" "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" "raspberrypi-OS-tutorials)" -#: src/bare-metal/aps/other-projects.md:8 +#: src/bare-metal/aps/other-projects.md msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " "exception handling, page tables" @@ -19066,7 +18987,7 @@ msgstr "" "راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " "exception و page tableها" -#: src/bare-metal/aps/other-projects.md:10 +#: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." @@ -19074,15 +18995,15 @@ msgstr "" "برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " "برای کپی کردن برای کد production نیست." -#: src/bare-metal/aps/other-projects.md:12 +#: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" msgstr "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" -#: src/bare-metal/aps/other-projects.md:13 +#: src/bare-metal/aps/other-projects.md msgid "Static analysis to determine maximum stack usage." msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداکثر استفاده از stack." -#: src/bare-metal/aps/other-projects.md:17 +#: src/bare-metal/aps/other-projects.md msgid "" "The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " "enabled. This will read and write memory (e.g. the stack). However:" @@ -19091,7 +19012,7 @@ msgstr "" "می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " "بااین‌حال:" -#: src/bare-metal/aps/other-projects.md:19 +#: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" "Without the MMU and cache, unaligned accesses will fault. It builds with " @@ -19104,7 +19025,7 @@ msgstr "" "ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " "صحیح باشد، اما لزوماً اینطور نیست." -#: src/bare-metal/aps/other-projects.md:23 +#: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" "If it were running in a VM, this can lead to cache coherency issues. The " @@ -19135,7 +19056,7 @@ msgstr "" "ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " "را حل می‌کند." -#: src/bare-metal/useful-crates/zerocopy.md:3 +#: src/bare-metal/useful-crates/zerocopy.md msgid "" "The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " "traits and macros for safely converting between byte sequences and other " @@ -19144,7 +19065,7 @@ msgstr "" "این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " "ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." -#: src/bare-metal/useful-crates/zerocopy.md:42 +#: src/bare-metal/useful-crates/zerocopy.md msgid "" "This is not suitable for MMIO (as it doesn't use volatile reads and writes), " "but can be useful for working with structures shared with hardware e.g. by " @@ -19154,7 +19075,7 @@ msgstr "" "نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " "توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." -#: src/bare-metal/useful-crates/zerocopy.md:48 +#: src/bare-metal/useful-crates/zerocopy.md msgid "" "`FromBytes` can be implemented for types for which any byte pattern is " "valid, and so can safely be converted from an untrusted sequence of bytes." @@ -19163,7 +19084,7 @@ msgstr "" "پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " "تبدیل کرد." -#: src/bare-metal/useful-crates/zerocopy.md:50 +#: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " "`RequestType` doesn't use all possible u32 values as discriminants, so not " @@ -19173,14 +19094,14 @@ msgstr "" "`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " "بنابراین همه الگوهای بایت معتبر نیستند." -#: src/bare-metal/useful-crates/zerocopy.md:53 +#: src/bare-metal/useful-crates/zerocopy.md #, fuzzy msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." -#: src/bare-metal/useful-crates/zerocopy.md:54 +#: src/bare-metal/useful-crates/zerocopy.md msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "zerocopy-example/`. (It won't run in the Playground because of the crate " @@ -19189,7 +19110,7 @@ msgstr "" "مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" "`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" -#: src/bare-metal/useful-crates/aarch64-paging.md:3 +#: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " "you create page tables according to the AArch64 Virtual Memory System " @@ -19199,22 +19120,22 @@ msgstr "" "امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " "کنید." -#: src/bare-metal/useful-crates/aarch64-paging.md:14 +#: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy msgid "// Create a new page table with identity mapping.\n" msgstr "// Create a new page table with identity mapping.\n" -#: src/bare-metal/useful-crates/aarch64-paging.md:16 +#: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy msgid "// Map a 2 MiB region of memory as read-only.\n" msgstr "// Map a 2 MiB region of memory as read-only.\n" -#: src/bare-metal/useful-crates/aarch64-paging.md:21 +#: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "// Set `TTBR0_EL1` to activate the page table.\n" -#: src/bare-metal/useful-crates/aarch64-paging.md:28 +#: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "For now it only supports EL1, but support for other exception levels should " "be straightforward to add." @@ -19222,7 +19143,7 @@ msgstr "" "در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " "ساده باشد." -#: src/bare-metal/useful-crates/aarch64-paging.md:30 +#: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "This is used in Android for the [Protected VM Firmware](https://cs.android." "com/android/platform/superproject/+/master:packages/modules/Virtualization/" @@ -19232,7 +19153,7 @@ msgstr "" "android/platform/superproject/+/master:packages/modules/Virtualization/" "pvmfw/) استفاده می‌شود." -#: src/bare-metal/useful-crates/aarch64-paging.md:31 +#: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "There's no easy way to run this example, as it needs to run on real hardware " "or under QEMU." @@ -19240,7 +19161,7 @@ msgstr "" "هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " "یا تحت QEMU اجرا شود." -#: src/bare-metal/useful-crates/buddy_system_allocator.md:3 +#: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" "[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " "is a third-party crate implementing a basic buddy system allocator. It can " @@ -19261,11 +19182,11 @@ msgstr "" "استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " "اختصاص دهیم:" -#: src/bare-metal/useful-crates/buddy_system_allocator.md:29 +#: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اندازه خود هستند." -#: src/bare-metal/useful-crates/buddy_system_allocator.md:30 +#: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "allocator-example/`. (It won't run in the Playground because of the crate " @@ -19274,7 +19195,7 @@ msgstr "" "مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " "اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" -#: src/bare-metal/useful-crates/tinyvec.md:3 +#: src/bare-metal/useful-crates/tinyvec.md msgid "" "Sometimes you want something which can be resized like a `Vec`, but without " "heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " @@ -19289,21 +19210,21 @@ msgstr "" "شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " "کنید panic می‌کند." -#: src/bare-metal/useful-crates/tinyvec.md:25 +#: src/bare-metal/useful-crates/tinyvec.md msgid "" "`tinyvec` requires that the element type implement `Default` for " "initialisation." msgstr "" "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." -#: src/bare-metal/useful-crates/tinyvec.md:27 +#: src/bare-metal/useful-crates/tinyvec.md msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" "‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " "داخلی اجرا می‌شود." -#: src/bare-metal/useful-crates/spin.md:3 +#: src/bare-metal/useful-crates/spin.md msgid "" "`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " "are not available in `core` or `alloc`. How can we manage synchronisation or " @@ -19313,7 +19234,7 @@ msgstr "" "`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " "اشتراک‌گذاری وضعیت بین CPU‌های مختلف را مدیریت کنیم؟" -#: src/bare-metal/useful-crates/spin.md:7 +#: src/bare-metal/useful-crates/spin.md msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." @@ -19321,13 +19242,13 @@ msgstr "" "این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " "spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." -#: src/bare-metal/useful-crates/spin.md:26 +#: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" "اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " "کنید." -#: src/bare-metal/useful-crates/spin.md:27 +#: src/bare-metal/useful-crates/spin.md msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." @@ -19335,7 +19256,7 @@ msgstr "" "‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " "`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." -#: src/bare-metal/useful-crates/spin.md:29 +#: src/bare-metal/useful-crates/spin.md msgid "" "The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " "useful types for late initialisation with a slightly different approach to " @@ -19345,7 +19266,7 @@ msgstr "" "تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" "once::Once` است." -#: src/bare-metal/useful-crates/spin.md:31 +#: src/bare-metal/useful-crates/spin.md msgid "" "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" @@ -19364,16 +19285,17 @@ msgstr "" "script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " "ELF به یک raw binary آماده اجرا استفاده کنید." -#: src/bare-metal/android/vmbase.md:1 +#: src/bare-metal/android/vmbase.md msgid "vmbase" msgstr "vmbase" -#: src/bare-metal/android/vmbase.md:3 +#: src/bare-metal/android/vmbase.md +#, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" -"master/vmbase/) library provides a linker script and useful defaults for the " -"build rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" "برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" "(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" @@ -19381,7 +19303,7 @@ msgstr "" "می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " "موارد دیگر." -#: src/bare-metal/android/vmbase.md:24 +#: src/bare-metal/android/vmbase.md msgid "" "The `main!` macro marks your main function, to be called from the `vmbase` " "entry point." @@ -19389,7 +19311,7 @@ msgstr "" "این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " "فراخوانی شود." -#: src/bare-metal/android/vmbase.md:26 +#: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." @@ -19409,12 +19331,12 @@ msgstr "" "پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " "شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md:1 -#: src/exercises/bare-metal/solutions-afternoon.md:3 +#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" -#: src/exercises/bare-metal/rtc.md:3 +#: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" @@ -19425,7 +19347,7 @@ msgstr "" "com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " "برای آن بنویسید." -#: src/exercises/bare-metal/rtc.md:6 +#: src/exercises/bare-metal/rtc.md msgid "" "Use it to print the current time to the serial console. You can use the " "[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." @@ -19434,7 +19356,7 @@ msgstr "" "[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " "کنید." -#: src/exercises/bare-metal/rtc.md:8 +#: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" "Use the match register and raw interrupt status to busy-wait until a given " @@ -19445,7 +19367,7 @@ msgstr "" "بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" "(https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" -#: src/exercises/bare-metal/rtc.md:11 +#: src/exercises/bare-metal/rtc.md msgid "" "_Extension if you have time:_ Enable and handle the interrupt generated by " "the RTC match. You can use the driver provided in the [`arm-gic`](https://" @@ -19456,11 +19378,11 @@ msgstr "" "docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " "کنید." -#: src/exercises/bare-metal/rtc.md:14 +#: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." msgstr "از وقفه RTC استفاده کنید که به عنوان `IntId::spi(2)` به GIC متصل است." -#: src/exercises/bare-metal/rtc.md:15 +#: src/exercises/bare-metal/rtc.md msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." @@ -19469,7 +19391,7 @@ msgstr "" "wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " "به خواب برود." -#: src/exercises/bare-metal/rtc.md:19 +#: src/exercises/bare-metal/rtc.md msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `rtc` directory for the following files." @@ -19477,83 +19399,83 @@ msgstr "" "دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " "فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." -#: src/exercises/bare-metal/rtc.md:79 +#: src/exercises/bare-metal/rtc.md msgid "" "_src/exceptions.rs_ (you should only need to change this for the 3rd part of " "the exercise):" msgstr "" "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:156 +#: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "‏ _src/logger.rs_ (نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:216 +#: src/exercises/bare-metal/rtc.md msgid "_src/pl011.rs_ (you shouldn't need to change this):" msgstr "_src/pl011.rs_ (نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:419 +#: src/exercises/bare-metal/rtc.md msgid "_build.rs_ (you shouldn't need to change this):" msgstr "_build.rs_ (نیازی نیست این مورد رو تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:456 +#: src/exercises/bare-metal/rtc.md msgid "_entry.S_ (you shouldn't need to change this):" msgstr "_entry.S_ ( نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:606 +#: src/exercises/bare-metal/rtc.md msgid "_exceptions.S_ (you shouldn't need to change this):" msgstr "_exceptions.S_ ( نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:792 +#: src/exercises/bare-metal/rtc.md msgid "_idmap.S_ (you shouldn't need to change this):" msgstr "_idmap.S_ (نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:842 +#: src/exercises/bare-metal/rtc.md msgid "_image.ld_ (you shouldn't need to change this):" msgstr "_image.ld_ (نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:954 +#: src/exercises/bare-metal/rtc.md msgid "_Makefile_ (you shouldn't need to change this):" msgstr "_Makefile_ (نیازی نیست این مورد را تغییر دهید):" -#: src/exercises/bare-metal/rtc.md:1011 +#: src/exercises/bare-metal/rtc.md msgid "Run the code in QEMU with `make qemu`." msgstr "کد را در QEMU با `make qemu` اجرا کنید." -#: src/exercises/bare-metal/solutions-afternoon.md:1 +#: src/exercises/bare-metal/solutions-afternoon.md msgid "Bare Metal Rust Afternoon" msgstr "بعدازظهربا Bare Metal Rust" -#: src/exercises/bare-metal/solutions-afternoon.md:5 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "([back to exercise](rtc.md))" msgstr "([back to exercise](rtc.md))" -#: src/exercises/bare-metal/solutions-afternoon.md:7 +#: src/exercises/bare-metal/solutions-afternoon.md msgid "_main.rs_:" msgstr "_main.rs_:" -#: src/exercises/bare-metal/solutions-afternoon.md:29 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Base addresses of the GICv3.\n" msgstr "/// Base addresses of the GICv3.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:36 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Base address of the PL031 RTC.\n" msgstr "/// Base address of the PL031 RTC.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:38 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// The IRQ used by the PL031 RTC.\n" msgstr "/// The IRQ used by the PL031 RTC.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:49 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" msgstr "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" -#: src/exercises/bare-metal/solutions-afternoon.md:51 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" @@ -19564,7 +19486,7 @@ msgstr "" " // addresses of a GICv3 distributor and redistributor respectively, and\n" " // nothing else accesses those address ranges.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:57 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" @@ -19573,91 +19495,86 @@ msgstr "" "// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" " // nothing else accesses that address range.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:62 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "\"RTC: {time}\"" msgstr "\"RTC: {time}\"" -#: src/exercises/bare-metal/solutions-afternoon.md:70 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "// Wait for 3 seconds, without interrupts.\n" msgstr "// Wait for 3 seconds, without interrupts.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:73 -#: src/exercises/bare-metal/solutions-afternoon.md:91 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "\"Waiting for {}\"" msgstr "\"Waiting for {}\"" -#: src/exercises/bare-metal/solutions-afternoon.md:75 -#: src/exercises/bare-metal/solutions-afternoon.md:83 -#: src/exercises/bare-metal/solutions-afternoon.md:96 -#: src/exercises/bare-metal/solutions-afternoon.md:104 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "\"matched={}, interrupt_pending={}\"" msgstr "\"matched={}, interrupt_pending={}\"" -#: src/exercises/bare-metal/solutions-afternoon.md:87 -#: src/exercises/bare-metal/solutions-afternoon.md:108 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "\"Finished waiting\"" msgstr "\"Finished waiting\"" -#: src/exercises/bare-metal/solutions-afternoon.md:89 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "// Wait another 3 seconds for an interrupt.\n" msgstr "// Wait another 3 seconds for an interrupt.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:121 +#: src/exercises/bare-metal/solutions-afternoon.md msgid "_pl031.rs_:" msgstr "_pl031.rs_:" -#: src/exercises/bare-metal/solutions-afternoon.md:128 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Data register\n" msgstr "/// Data register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:130 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Match register\n" msgstr "/// Match register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:132 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Load register\n" msgstr "/// Load register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:134 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Control register\n" msgstr "/// Control register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:137 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Interrupt Mask Set or Clear register\n" msgstr "/// Interrupt Mask Set or Clear register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:140 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Raw Interrupt Status\n" msgstr "/// Raw Interrupt Status\n" -#: src/exercises/bare-metal/solutions-afternoon.md:143 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Masked Interrupt Status\n" msgstr "/// Masked Interrupt Status\n" -#: src/exercises/bare-metal/solutions-afternoon.md:146 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Interrupt Clear Register\n" msgstr "/// Interrupt Clear Register\n" -#: src/exercises/bare-metal/solutions-afternoon.md:150 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Driver for a PL031 real-time clock.\n" msgstr "/// Driver for a PL031 real-time clock.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:158 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -19682,17 +19599,12 @@ msgstr "" "process\n" " /// as device memory and not have any other aliases.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:170 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Reads the current RTC value.\n" msgstr "/// Reads the current RTC value.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:172 -#: src/exercises/bare-metal/solutions-afternoon.md:180 -#: src/exercises/bare-metal/solutions-afternoon.md:188 -#: src/exercises/bare-metal/solutions-afternoon.md:199 -#: src/exercises/bare-metal/solutions-afternoon.md:211 -#: src/exercises/bare-metal/solutions-afternoon.md:218 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" @@ -19701,7 +19613,7 @@ msgstr "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL031 device which is appropriately mapped.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:177 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" @@ -19710,7 +19622,7 @@ msgstr "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" " /// will be generated (if it is enabled).\n" -#: src/exercises/bare-metal/solutions-afternoon.md:185 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "/// Returns whether the match register matches the RTC value, whether or " @@ -19721,7 +19633,7 @@ msgstr "" "not\n" " /// the interrupt is enabled.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:194 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "/// Returns whether there is currently an interrupt pending.\n" @@ -19734,7 +19646,7 @@ msgstr "" " /// This should be true if and only if `matched` returns true and the\n" " /// interrupt is masked.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:205 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "/// Sets or clears the interrupt mask.\n" @@ -19749,12 +19661,12 @@ msgstr "" "the\n" " /// interrupt is disabled.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:216 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "/// Clears a pending interrupt, if any.\n" msgstr "/// Clears a pending interrupt, if any.\n" -#: src/exercises/bare-metal/solutions-afternoon.md:223 +#: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `Rtc` just contains a pointer to device memory, which can be\n" @@ -19823,43 +19735,45 @@ msgstr "" msgid "This segment should take about 30 minutes. It contains:" msgstr "این بخش باید حدود ۳۰ دقیقه طول بکشد و شامل موارد زیر است:" -#: src/concurrency/threads/plain.md:3 +#: src/concurrency/threads/plain.md msgid "Rust threads work similarly to threads in other languages:" msgstr " threadهای Rust مانند threadها در زبان‌های دیگر کار می‌کنند:" -#: src/concurrency/threads/plain.md:12 +#: src/concurrency/threads/plain.md msgid "\"Count in thread: {i}!\"" msgstr "\"شمارنده thread: {i}!\"" -#: src/concurrency/threads/plain.md:18 +#: src/concurrency/threads/plain.md msgid "\"Main thread: {i}\"" msgstr "\"Main thread: {i}\"" -#: src/concurrency/threads/plain.md:24 -msgid "Threads are all daemon threads, the main thread does not wait for them." -msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." +#: src/concurrency/threads/plain.md +msgid "" +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." +msgstr "" -#: src/concurrency/threads/plain.md:25 +#: src/concurrency/threads/plain.md msgid "Thread panics are independent of each other." msgstr "Thread panicها مستقل از یکدیگر هستند." -#: src/concurrency/threads/plain.md:26 +#: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" "‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " "کرد." -#: src/concurrency/threads/plain.md:31 +#: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" "‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " "آن‌ها است." -#: src/concurrency/threads/plain.md:33 +#: src/concurrency/threads/plain.md msgid "Run the example." msgstr "مثال را اجرا کنید." -#: src/concurrency/threads/plain.md:34 +#: src/concurrency/threads/plain.md msgid "" "5ms timing is loose enough that main and spawned threads stay mostly in " "lockstep." @@ -19867,13 +19781,13 @@ msgstr "" "زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " "عمدتاً همگام می‌مانند." -#: src/concurrency/threads/plain.md:36 +#: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" "توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " "پایان می‌رسد!" -#: src/concurrency/threads/plain.md:37 +#: src/concurrency/threads/plain.md msgid "" "This is because main ends the program and spawned threads do not make it " "persist." @@ -19881,15 +19795,15 @@ msgstr "" "این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " "تداوم آن نمی‌شوند." -#: src/concurrency/threads/plain.md:39 +#: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." msgstr "در مقابسه با pthreads/C++ std::thread/boost::thread اگر مطلوب باشد." -#: src/concurrency/threads/plain.md:41 +#: src/concurrency/threads/plain.md msgid "How do we wait around for the spawned thread to complete?" msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل شود؟" -#: src/concurrency/threads/plain.md:42 +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. Look at the docs." @@ -19897,7 +19811,7 @@ msgstr "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. به سند نگاه کنید." -#: src/concurrency/threads/plain.md:43 +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) method that blocks." @@ -19905,7 +19819,7 @@ msgstr "" "`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) متد آن بلاک‌ها." -#: src/concurrency/threads/plain.md:45 +#: src/concurrency/threads/plain.md msgid "" "Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " "the thread to finish and have the program count all the way to 10." @@ -19913,15 +19827,15 @@ msgstr "" "از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " "تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." -#: src/concurrency/threads/plain.md:48 +#: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" msgstr "حالا اگر بخواهیم مقداری را برگردانیم چه؟" -#: src/concurrency/threads/plain.md:49 +#: src/concurrency/threads/plain.md msgid "Look at docs again:" msgstr "دوباره به اسناد نگاه کنید:" -#: src/concurrency/threads/plain.md:50 +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" @@ -19929,7 +19843,7 @@ msgstr "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" -#: src/concurrency/threads/plain.md:51 +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) returns `thread::Result`" @@ -19937,23 +19851,23 @@ msgstr "" "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) returns `thread::Result`" -#: src/concurrency/threads/plain.md:53 +#: src/concurrency/threads/plain.md msgid "" "Use the `Result` return value from `handle.join()` to get access to the " "returned value." msgstr "" "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." -#: src/concurrency/threads/plain.md:56 +#: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" msgstr "خوب، مورد دیگر چطور؟" -#: src/concurrency/threads/plain.md:57 +#: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." -#: src/concurrency/threads/plain.md:58 +#: src/concurrency/threads/plain.md msgid "" "Access the panic payload. This is a good time to talk about [`Any`](https://" "doc.rust-lang.org/std/any/index.html)." @@ -19961,30 +19875,30 @@ msgstr "" "دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" "(https://doc.rust-lang.org/std/any/index.html)." -#: src/concurrency/threads/plain.md:60 +#: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" msgstr "" "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" -#: src/concurrency/threads/plain.md:61 +#: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." msgstr "چیزی را از طریق reference در بسته‌بندی thread ثبت کنید." -#: src/concurrency/threads/plain.md:62 +#: src/concurrency/threads/plain.md msgid "An error message indicates we must move it." msgstr "یک پیغام خطا نشان می‌دهد که باید آن را جابجا کنیم." -#: src/concurrency/threads/plain.md:63 +#: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" "آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " "مشتق شده را برگردانیم." -#: src/concurrency/threads/plain.md:65 +#: src/concurrency/threads/plain.md msgid "If we want to borrow?" msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" -#: src/concurrency/threads/plain.md:66 +#: src/concurrency/threads/plain.md msgid "" "Main kills child threads when it returns, but another function would just " "return and leave them running." @@ -19992,21 +19906,21 @@ msgstr "" " تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " "return می‌شود و آنها را در حال اجرا می‌گذارد." -#: src/concurrency/threads/plain.md:68 +#: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" "این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " "نقض می‌کند!" -#: src/concurrency/threads/plain.md:69 +#: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." msgstr "چگونه از آن جلوگیری کنیم؟ صفحه بعدی را ببینید." -#: src/concurrency/threads/scoped.md:3 +#: src/concurrency/threads/scoped.md msgid "Normal threads cannot borrow from their environment:" msgstr "‏thread‌های معمولی نمی‌توانند از محیط خود قرض (borrow) بگیرند:" -#: src/concurrency/threads/scoped.md:20 +#: src/concurrency/threads/scoped.md msgid "" "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" "fn.scope.html) for this:" @@ -20014,7 +19928,7 @@ msgstr "" "به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" "std/thread/fn.scope.html) ببینید:" -#: src/concurrency/threads/scoped.md:41 +#: src/concurrency/threads/scoped.md msgid "" "The reason for that is that when the `thread::scope` function completes, all " "the threads are guaranteed to be joined, so they can return borrowed data." @@ -20022,7 +19936,7 @@ msgstr "" "دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " "تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." -#: src/concurrency/threads/scoped.md:43 +#: src/concurrency/threads/scoped.md msgid "" "Normal Rust borrowing rules apply: you can either borrow mutably by one " "thread, or immutably by any number of threads." @@ -20035,74 +19949,68 @@ msgstr "" msgid "This segment should take about 20 minutes. It contains:" msgstr "" -#: src/concurrency/channels/senders-receivers.md:3 +#: src/concurrency/channels/senders-receivers.md msgid "" "Rust channels have two parts: a `Sender` and a `Receiver`. The two " "parts are connected via the channel, but you only see the end-points." msgstr "" -#: src/concurrency/channels/senders-receivers.md:15 -#: src/concurrency/channels/senders-receivers.md:16 -#: src/concurrency/channels/senders-receivers.md:20 +#: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" msgstr "" -#: src/concurrency/channels/senders-receivers.md:27 +#: src/concurrency/channels/senders-receivers.md msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " "implement `Clone` (so you can make multiple producers) but `Receiver` does " "not." msgstr "" -#: src/concurrency/channels/senders-receivers.md:30 +#: src/concurrency/channels/senders-receivers.md msgid "" "`send()` and `recv()` return `Result`. If they return `Err`, it means the " "counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" -#: src/concurrency/channels/unbounded.md:3 +#: src/concurrency/channels/unbounded.md msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" msgstr "" -#: src/concurrency/channels/unbounded.md:16 -#: src/concurrency/channels/bounded.md:16 +#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:17 -#: src/concurrency/channels/bounded.md:17 +#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: sent Message {i}\"" msgstr "" -#: src/concurrency/channels/unbounded.md:19 -#: src/concurrency/channels/bounded.md:19 +#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: done\"" msgstr "" -#: src/concurrency/channels/unbounded.md:24 -#: src/concurrency/channels/bounded.md:24 +#: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Main: got {msg}\"" msgstr "" -#: src/concurrency/channels/bounded.md:3 +#: src/concurrency/channels/bounded.md msgid "" "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" -#: src/concurrency/channels/bounded.md:32 +#: src/concurrency/channels/bounded.md msgid "" "Calling `send` will block the current thread until there is space in the " "channel for the new message. The thread can be blocked indefinitely if there " "is nobody who reads from the channel." msgstr "" -#: src/concurrency/channels/bounded.md:35 +#: src/concurrency/channels/bounded.md msgid "" "A call to `send` will abort with an error (that is why it returns `Result`) " "if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" -#: src/concurrency/channels/bounded.md:37 +#: src/concurrency/channels/bounded.md msgid "" "A bounded channel with a size of zero is called a \"rendezvous channel\". " "Every send will block the current thread until another thread calls `recv`." @@ -20116,7 +20024,7 @@ msgstr "ارسال" msgid "Sync" msgstr "همگام سازی" -#: src/concurrency/send-sync/marker-traits.md:3 +#: src/concurrency/send-sync/marker-traits.md msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" @@ -20124,7 +20032,7 @@ msgstr "" "‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " "دو trait است:" -#: src/concurrency/send-sync/marker-traits.md:6 +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " "is `Send` if it is safe to move a `T` across a thread boundary." @@ -20132,7 +20040,7 @@ msgstr "" "‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " "جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." -#: src/concurrency/send-sync/marker-traits.md:8 +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " "is `Sync` if it is safe to move a `&T` across a thread boundary." @@ -20141,7 +20049,7 @@ msgstr "" "جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " "`Sync` است." -#: src/concurrency/send-sync/marker-traits.md:11 +#: src/concurrency/send-sync/marker-traits.md msgid "" "`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " "The compiler will automatically derive them for your types as long as they " @@ -20153,7 +20061,7 @@ msgstr "" "دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " "پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." -#: src/concurrency/send-sync/marker-traits.md:22 +#: src/concurrency/send-sync/marker-traits.md msgid "" "One can think of these traits as markers that the type has certain thread-" "safety properties." @@ -20161,11 +20069,11 @@ msgstr "" "می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" "safety خاصی را دارد." -#: src/concurrency/send-sync/marker-traits.md:24 +#: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." msgstr "آنها را می‌توان در محدودیت‌های generic به عنوان trait عادی استفاده کرد." -#: src/concurrency/send-sync/send.md:3 +#: src/concurrency/send-sync/send.md msgid "" "A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " "if it is safe to move a `T` value to another thread." @@ -20173,7 +20081,7 @@ msgstr "" "اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" "doc.rust-lang.org/std/marker/trait.Send.html) است." -#: src/concurrency/send-sync/send.md:5 +#: src/concurrency/send-sync/send.md msgid "" "The effect of moving ownership to another thread is that _destructors_ will " "run in that thread. So the question is when you can allocate a value in one " @@ -20184,7 +20092,7 @@ msgstr "" "است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " "thread دیگر توزیع کنید." -#: src/concurrency/send-sync/send.md:14 +#: src/concurrency/send-sync/send.md msgid "" "As an example, a connection to the SQLite library must only be accessed from " "a single thread." @@ -20192,7 +20100,7 @@ msgstr "" "به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " "باشد." -#: src/concurrency/send-sync/sync.md:3 +#: src/concurrency/send-sync/sync.md msgid "" "A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " "if it is safe to access a `T` value from multiple threads at the same time." @@ -20201,15 +20109,15 @@ msgstr "" "Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " "همزمان امن باشد." -#: src/concurrency/send-sync/sync.md:6 +#: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" msgstr "به طور دقیق‌تر، تعریف این طور است:" -#: src/concurrency/send-sync/sync.md:8 +#: src/concurrency/send-sync/sync.md msgid "`T` is `Sync` if and only if `&T` is `Send`" msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد." -#: src/concurrency/send-sync/sync.md:15 +#: src/concurrency/send-sync/sync.md msgid "" "This statement is essentially a shorthand way of saying that if a type is " "thread-safe for shared use, it is also thread-safe to pass references of it " @@ -20219,7 +20127,7 @@ msgstr "" "استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " "امن است." -#: src/concurrency/send-sync/sync.md:19 +#: src/concurrency/send-sync/sync.md msgid "" "This is because if a type is Sync it means that it can be shared across " "multiple threads without the risk of data races or other synchronization " @@ -20233,45 +20141,45 @@ msgstr "" "نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " "می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." -#: src/concurrency/send-sync/examples.md:3 +#: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" msgstr "`Send + Sync`" -#: src/concurrency/send-sync/examples.md:5 +#: src/concurrency/send-sync/examples.md msgid "Most types you come across are `Send + Sync`:" msgstr "اکثر انواعی که با آنها روبرو می شوید `Send + Sync` هستند:" -#: src/concurrency/send-sync/examples.md:7 +#: src/concurrency/send-sync/examples.md msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..." msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." -#: src/concurrency/send-sync/examples.md:8 +#: src/concurrency/send-sync/examples.md msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." -#: src/concurrency/send-sync/examples.md:9 +#: src/concurrency/send-sync/examples.md msgid "`String`, `Option`, `Vec`, `Box`, ..." msgstr "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." -#: src/concurrency/send-sync/examples.md:10 +#: src/concurrency/send-sync/examples.md msgid "`Arc`: Explicitly thread-safe via atomic reference count." msgstr "`String`, `Option`, `Vec`, `Box`, ..." -#: src/concurrency/send-sync/examples.md:11 +#: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." msgstr "" "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." -#: src/concurrency/send-sync/examples.md:12 +#: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." msgstr "`mpsc::Sender`: از 1.72.0." -#: src/concurrency/send-sync/examples.md:13 +#: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "" "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." -#: src/concurrency/send-sync/examples.md:15 +#: src/concurrency/send-sync/examples.md msgid "" "The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." @@ -20279,11 +20187,11 @@ msgstr "" "در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " "هستند.`Send + Sync`." -#: src/concurrency/send-sync/examples.md:18 +#: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" msgstr "`Send + !Sync`" -#: src/concurrency/send-sync/examples.md:20 +#: src/concurrency/send-sync/examples.md msgid "" "These types can be moved to other threads, but they're not thread-safe. " "Typically because of interior mutability:" @@ -20291,48 +20199,52 @@ msgstr "" "این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " "معمول به دلیل تغییرپذیری داخلی(interior mutability):" -#: src/concurrency/send-sync/examples.md:23 +#: src/concurrency/send-sync/examples.md msgid "`mpsc::Receiver`" msgstr "`mpsc::Receiver`" -#: src/concurrency/send-sync/examples.md:24 +#: src/concurrency/send-sync/examples.md msgid "`Cell`" msgstr "`Cell`" -#: src/concurrency/send-sync/examples.md:25 +#: src/concurrency/send-sync/examples.md msgid "`RefCell`" msgstr "`RefCell`" -#: src/concurrency/send-sync/examples.md:27 +#: src/concurrency/send-sync/examples.md msgid "`!Send + Sync`" msgstr "`!Send + Sync`" -#: src/concurrency/send-sync/examples.md:29 +#: src/concurrency/send-sync/examples.md +#, fuzzy msgid "" -"These types are thread-safe, but they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" msgstr "" "این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " "منتقل کرد:" -#: src/concurrency/send-sync/examples.md:31 +#: src/concurrency/send-sync/examples.md +#, fuzzy msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them." +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" "‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " "threadای که آنها را ایجاد کرده است، توزیع شوند." -#: src/concurrency/send-sync/examples.md:34 +#: src/concurrency/send-sync/examples.md msgid "`!Send + !Sync`" msgstr "`!Send + !Sync`" -#: src/concurrency/send-sync/examples.md:36 +#: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" "این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " "منتقل کرد:" -#: src/concurrency/send-sync/examples.md:38 +#: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." @@ -20340,7 +20252,7 @@ msgstr "" "‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " "مراجع غیر atomic است." -#: src/concurrency/send-sync/examples.md:40 +#: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." @@ -20356,7 +20268,7 @@ msgstr "Arc" msgid "Mutex" msgstr "Mutex" -#: src/concurrency/shared-state/arc.md:3 +#: src/concurrency/shared-state/arc.md msgid "" "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " "read-only access via `Arc::clone`:" @@ -20364,17 +20276,15 @@ msgstr "" "‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " "تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" -#: src/concurrency/shared-state/arc.md:16 +#: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" msgstr "\"{thread_id:?}: {v:?}\"" -#: src/concurrency/shared-state/arc.md:21 -#: src/concurrency/shared-state/example.md:17 -#: src/concurrency/shared-state/example.md:46 +#: src/concurrency/shared-state/arc.md src/concurrency/shared-state/example.md msgid "\"v: {v:?}\"" msgstr "\"v: {v:?}\"" -#: src/concurrency/shared-state/arc.md:30 +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." @@ -20382,7 +20292,7 @@ msgstr "" "‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " "عملیات atomic استفاده می‌کند." -#: src/concurrency/shared-state/arc.md:32 +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." @@ -20391,7 +20301,7 @@ msgstr "" "کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " "آنها را پیاده‌سازی کند." -#: src/concurrency/shared-state/arc.md:34 +#: src/concurrency/shared-state/arc.md msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." @@ -20399,7 +20309,7 @@ msgstr "" "‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن " "استفاده از `T` آزاد است." -#: src/concurrency/shared-state/arc.md:36 +#: src/concurrency/shared-state/arc.md msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." @@ -20407,11 +20317,11 @@ msgstr "" "مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " "استفاده نمی‌کند." -#: src/concurrency/shared-state/arc.md:38 +#: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." msgstr "`std::sync::Weak` می‌تواند مفید باشد." -#: src/concurrency/shared-state/mutex.md:3 +#: src/concurrency/shared-state/mutex.md msgid "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " "mutual exclusion _and_ allows mutable access to `T` behind a read-only " @@ -20423,12 +20333,11 @@ msgstr "" "یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" "borrowing/interior-mutability.md)) فراهم می‌کند." -#: src/concurrency/shared-state/mutex.md:12 -#: src/concurrency/shared-state/mutex.md:19 +#: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" msgstr "\"v: {:?}\"" -#: src/concurrency/shared-state/mutex.md:23 +#: src/concurrency/shared-state/mutex.md msgid "" "Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " @@ -20438,7 +20347,7 @@ msgstr "" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " "کامل آن داریم." -#: src/concurrency/shared-state/mutex.md:33 +#: src/concurrency/shared-state/mutex.md msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." @@ -20446,7 +20355,7 @@ msgstr "" "‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " "(protected) به نظر می‌رسد." -#: src/concurrency/shared-state/mutex.md:35 +#: src/concurrency/shared-state/mutex.md msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." @@ -20454,7 +20363,7 @@ msgstr "" "نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " "فراموش کرد." -#: src/concurrency/shared-state/mutex.md:37 +#: src/concurrency/shared-state/mutex.md msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." @@ -20462,7 +20371,7 @@ msgstr "" "با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " "تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." -#: src/concurrency/shared-state/mutex.md:39 +#: src/concurrency/shared-state/mutex.md msgid "" "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " "implements `Send`." @@ -20470,21 +20379,21 @@ msgstr "" "‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " "استفاده‌ می‌کنند." -#: src/concurrency/shared-state/mutex.md:41 +#: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." msgstr "‏ همتای قفل خواندن و نوشتن: `RwLock`." -#: src/concurrency/shared-state/mutex.md:42 +#: src/concurrency/shared-state/mutex.md msgid "Why does `lock()` return a `Result`?" msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" -#: src/concurrency/shared-state/mutex.md:43 +#: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" +"\" to signal that the data it protected might be in an inconsistent state. " +"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" +"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " +"`into_inner()` on the error to recover the data regardless." msgstr "" "اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" "poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " @@ -20493,29 +20402,29 @@ msgstr "" "می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " "فراخوانی کنید." -#: src/concurrency/shared-state/example.md:3 +#: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" msgstr "اجازه دهید `Arc` و `Mutex` را در عمل ببینیم:" -#: src/concurrency/shared-state/example.md:6 +#: src/concurrency/shared-state/example.md msgid "// use std::sync::{Arc, Mutex};\n" msgstr "// use std::sync::{Arc, Mutex};\n" -#: src/concurrency/shared-state/example.md:24 +#: src/concurrency/shared-state/example.md msgid "Possible solution:" msgstr "راه‌حل ممکن:" -#: src/concurrency/shared-state/example.md:50 +#: src/concurrency/shared-state/example.md msgid "Notable parts:" msgstr "بخش‌های قابل توجه:" -#: src/concurrency/shared-state/example.md:52 +#: src/concurrency/shared-state/example.md msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." -#: src/concurrency/shared-state/example.md:54 +#: src/concurrency/shared-state/example.md msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." @@ -20523,7 +20432,7 @@ msgstr "" "قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " "قابل تغییر (mutable) بین threadها است." -#: src/concurrency/shared-state/example.md:56 +#: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." @@ -20531,17 +20440,17 @@ msgstr "" "‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " "منتقل کرد. نکته `move` به lambda signature اضافه شد." -#: src/concurrency/shared-state/example.md:58 +#: src/concurrency/shared-state/example.md msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." -#: src/concurrency/sync-exercises/dining-philosophers.md:3 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "The dining philosophers problem is a classic problem in concurrency:" msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک مسئله کلاسیک concurrency است:" -#: src/concurrency/sync-exercises/dining-philosophers.md:5 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "Five philosophers dine together at the same table. Each philosopher has " "their own place at the table. There is a fork between each plate. The dish " @@ -20561,7 +20470,7 @@ msgstr "" "در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " "پایین می‌گذارد." -#: src/concurrency/sync-exercises/dining-philosophers.md:13 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "You will need a local [Cargo installation](../../cargo/running-locally.md) " "for this exercise. Copy the code below to a file called `src/main.rs`, fill " @@ -20571,8 +20480,8 @@ msgstr "" "محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " "خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" -#: src/concurrency/sync-exercises/dining-philosophers.md:28 -#: src/concurrency/async-exercises/dining-philosophers.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "// left_fork: ...\n" " // right_fork: ...\n" @@ -20582,90 +20491,90 @@ msgstr "" " // right_fork: ...\n" " // thoughts: ...\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:36 -#: src/concurrency/sync-exercises/solutions.md:22 -#: src/concurrency/async-exercises/dining-philosophers.md:31 -#: src/concurrency/async-exercises/solutions.md:23 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Eureka! {} has a new idea!\"" msgstr "\"ایول! {} یک ایده جدید!\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:41 -#: src/concurrency/async-exercises/solutions.md:31 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Pick up forks...\n" msgstr "// Pick up forks...\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:42 -#: src/concurrency/sync-exercises/solutions.md:31 -#: src/concurrency/async-exercises/dining-philosophers.md:38 -#: src/concurrency/async-exercises/solutions.md:51 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"{} is eating...\"" msgstr "\"{} is eating...\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Socrates\"" msgstr "\"Socrates\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Hypatia\"" msgstr "\"Hypatia\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Plato\"" msgstr "\"Plato\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"Aristotle\"" msgstr "\"Aristotle\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:48 -#: src/concurrency/sync-exercises/solutions.md:37 -#: src/concurrency/async-exercises/dining-philosophers.md:44 -#: src/concurrency/async-exercises/solutions.md:59 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Pythagoras\"" msgstr "\"Pythagoras\"" -#: src/concurrency/sync-exercises/dining-philosophers.md:51 -#: src/concurrency/async-exercises/dining-philosophers.md:48 -#: src/concurrency/async-exercises/solutions.md:63 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Create forks\n" msgstr "// Create forks\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:53 -#: src/concurrency/async-exercises/dining-philosophers.md:50 -#: src/concurrency/async-exercises/solutions.md:67 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Create philosophers\n" msgstr "// Create philosophers\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:55 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "// Make each of them think and eat 100 times\n" msgstr "// Make each of them think and eat 100 times\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:57 -#: src/concurrency/async-exercises/dining-philosophers.md:54 -#: src/concurrency/async-exercises/solutions.md:95 +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Output their thoughts\n" msgstr "// Output their thoughts\n" -#: src/concurrency/sync-exercises/dining-philosophers.md:61 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "You can use the following `Cargo.toml`:" msgstr "می توانید از `Cargo.toml` زیر استفاده کنید:" -#: src/concurrency/sync-exercises/dining-philosophers.md:65 +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" @@ -20681,7 +20590,7 @@ msgstr "" "edition = \"2021\"\n" "```" -#: src/concurrency/sync-exercises/link-checker.md:3 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Let us use our new knowledge to create a multi-threaded link checker. It " "should start at a webpage and check that links on the page are valid. It " @@ -20693,7 +20602,7 @@ msgstr "" "معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " "کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." -#: src/concurrency/sync-exercises/link-checker.md:8 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" "reqwest/). You will also need a way to find links, we can use [`scraper`]" @@ -20706,14 +20615,14 @@ msgstr "" "برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" "thiserror/) استفاده خواهیم کرد." -#: src/concurrency/sync-exercises/link-checker.md:12 +#: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" "یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " "اعلام کنید:" -#: src/concurrency/sync-exercises/link-checker.md:22 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." @@ -20721,13 +20630,13 @@ msgstr "" "اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." "toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." -#: src/concurrency/sync-exercises/link-checker.md:25 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" -#: src/concurrency/sync-exercises/link-checker.md:29 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "```toml\n" "[package]\n" @@ -20737,8 +20646,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" +"\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -20751,13 +20660,13 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" +"\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" -#: src/concurrency/sync-exercises/link-checker.md:42 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "You can now download the start page. Try with a small site such as `https://" "www.google.org/`." @@ -20765,55 +20674,55 @@ msgstr "" "اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." "google.org/` امتحان کنید." -#: src/concurrency/sync-exercises/link-checker.md:45 +#: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "فایل `src/main.rs` شما باید چیزی شبیه به این باشد:" -#: src/concurrency/sync-exercises/link-checker.md:57 -#: src/concurrency/sync-exercises/solutions.md:93 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "\"request error: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md:59 -#: src/concurrency/sync-exercises/solutions.md:95 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"bad http response: {0}\"" msgstr "\"bad http response: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md:70 -#: src/concurrency/sync-exercises/solutions.md:106 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "\"بررسی {:#}\"" -#: src/concurrency/sync-exercises/link-checker.md:88 -#: src/concurrency/sync-exercises/solutions.md:124 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "\"href\"" -#: src/concurrency/sync-exercises/link-checker.md:95 -#: src/concurrency/sync-exercises/solutions.md:131 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" -#: src/concurrency/sync-exercises/link-checker.md:104 -#: src/concurrency/sync-exercises/solutions.md:241 +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "\"https://www.google.org\"" -#: src/concurrency/sync-exercises/link-checker.md:107 +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Links: {links:#?}\"" msgstr "\"Links: {links:#?}\"" -#: src/concurrency/sync-exercises/link-checker.md:108 +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Could not extract links: {err:#}\"" msgstr "\"نمی‌تواند لینک را باز کند: {err:#}\"" -#: src/concurrency/sync-exercises/link-checker.md:113 +#: src/concurrency/sync-exercises/link-checker.md msgid "Run the code in `src/main.rs` with" msgstr "این کد را در `src/main.rs` اجرا کنید" -#: src/concurrency/sync-exercises/link-checker.md:121 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." @@ -20822,7 +20731,7 @@ msgstr "" "شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " "بررسی کنند." -#: src/concurrency/sync-exercises/link-checker.md:123 +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Extend this to recursively extract links from all pages on the `www.google." "org` domain. Put an upper limit of 100 pages or so so that you don't end up " @@ -20832,11 +20741,11 @@ msgstr "" "google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " "نهایت توسط سایت مسدود نشوید." -#: src/concurrency/sync-exercises/solutions.md:27 +#: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" msgstr "\"{} is trying to eat\"" -#: src/concurrency/sync-exercises/solutions.md:51 +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "" "// To avoid a deadlock, we have to break the symmetry\n" @@ -20847,22 +20756,22 @@ msgstr "" " // somewhere. This will swap the forks without deinitializing\n" " // either of them.\n" -#: src/concurrency/sync-exercises/solutions.md:75 +#: src/concurrency/sync-exercises/solutions.md msgid "\"{thought}\"" msgstr "\"{thought}\"" -#: src/concurrency/sync-exercises/solutions.md:80 +#: src/concurrency/sync-exercises/solutions.md msgid "Link Checker" msgstr "جستجوگر Link" -#: src/concurrency/sync-exercises/solutions.md:150 +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "" "/// Determine whether links within the given page should be extracted.\n" msgstr "" "/// Determine whether links within the given page should be extracted.\n" -#: src/concurrency/sync-exercises/solutions.md:158 +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "" "/// Mark the given page as visited, returning false if it had already\n" @@ -20871,16 +20780,16 @@ msgstr "" "/// Mark the given page as visited, returning false if it had already\n" " /// been visited.\n" -#: src/concurrency/sync-exercises/solutions.md:184 +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "// The sender got dropped. No more commands coming in.\n" msgstr "// The sender got dropped. No more commands coming in.\n" -#: src/concurrency/sync-exercises/solutions.md:225 +#: src/concurrency/sync-exercises/solutions.md msgid "\"Got crawling error: {:#}\"" msgstr "\"خطای crawling دریافت شد: {:#}\"" -#: src/concurrency/sync-exercises/solutions.md:243 +#: src/concurrency/sync-exercises/solutions.md msgid "\"Bad URLs: {:#?}\"" msgstr "\"Bad URLs: {:#?}\"" @@ -20942,7 +20851,7 @@ msgstr "" msgid "async/await" msgstr "async/await" -#: src/concurrency/async/async-await.md:3 +#: src/concurrency/async/async-await.md #, fuzzy msgid "" "At a high level, async Rust code looks very much like \"normal\" sequential " @@ -20951,12 +20860,12 @@ msgstr "" "در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " "sequential code):" -#: src/concurrency/async/async-await.md:10 +#: src/concurrency/async/async-await.md #, fuzzy msgid "\"Count is: {i}!\"" msgstr "\"Count is: {i}!\"" -#: src/concurrency/async/async-await.md:28 +#: src/concurrency/async/async-await.md msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" @@ -20964,17 +20873,17 @@ msgstr "" "توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " "طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" -#: src/concurrency/async/async-await.md:31 +#: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" msgstr "نوع برگشت async call چیست؟" -#: src/concurrency/async/async-await.md:32 +#: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" "برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " "کنید." -#: src/concurrency/async/async-await.md:34 +#: src/concurrency/async/async-await.md msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." @@ -20982,7 +20891,7 @@ msgstr "" "کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " "یک future جایگزین می‌کند." -#: src/concurrency/async/async-await.md:37 +#: src/concurrency/async/async-await.md msgid "" "You cannot make `main` async, without additional instructions to the " "compiler on how to use the returned future." @@ -20990,7 +20899,7 @@ msgstr "" "شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " "future بازگشتی، `main` را async کنید." -#: src/concurrency/async/async-await.md:40 +#: src/concurrency/async/async-await.md msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." @@ -20998,13 +20907,13 @@ msgstr "" "برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که " "thread رشته فعلی را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." -#: src/concurrency/async/async-await.md:43 +#: src/concurrency/async/async-await.md msgid "" "`.await` asynchronously waits for the completion of another operation. " "Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" -#: src/concurrency/async/async-await.md:46 +#: src/concurrency/async/async-await.md msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." @@ -21012,7 +20921,7 @@ msgstr "" "‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " "مورد در آینده معرفی می‌شوند)." -#: src/concurrency/async/futures.md:3 +#: src/concurrency/async/futures.md msgid "" "[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " "trait, implemented by objects that represent an operation that may not be " @@ -21024,7 +20933,7 @@ msgstr "" "کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" "doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." -#: src/concurrency/async/futures.md:23 +#: src/concurrency/async/futures.md msgid "" "An async function returns an `impl Future`. It's also possible (but " "uncommon) to implement `Future` for your own types. For example, the " @@ -21036,7 +20945,7 @@ msgstr "" "`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " "امکان پیوستن (joining) به آن را فراهم کند." -#: src/concurrency/async/futures.md:27 +#: src/concurrency/async/futures.md msgid "" "The `.await` keyword, applied to a Future, causes the current async function " "to pause until that Future is ready, and then evaluates to its output." @@ -21044,7 +20953,7 @@ msgstr "" "کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " "فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." -#: src/concurrency/async/futures.md:33 +#: src/concurrency/async/futures.md msgid "" "The `Future` and `Poll` types are implemented exactly as shown; click the " "links to show the implementations in the docs." @@ -21052,7 +20961,7 @@ msgstr "" "تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " "برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." -#: src/concurrency/async/futures.md:36 +#: src/concurrency/async/futures.md msgid "" "We will not get to `Pin` and `Context`, as we will focus on writing async " "code, rather than building new async primitives. Briefly:" @@ -21060,7 +20969,7 @@ msgstr "" "ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " "بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" -#: src/concurrency/async/futures.md:39 +#: src/concurrency/async/futures.md msgid "" "`Context` allows a Future to schedule itself to be polled again when an " "event occurs." @@ -21068,7 +20977,7 @@ msgstr "" "‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " "poll مجدد برنامه‌ریزی کند." -#: src/concurrency/async/futures.md:42 +#: src/concurrency/async/futures.md msgid "" "`Pin` ensures that the Future isn't moved in memory, so that pointers into " "that future remain valid. This is required to allow references to remain " @@ -21078,7 +20987,7 @@ msgstr "" "future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " "ماندن پس از `.await` لازم است." -#: src/concurrency/async/runtimes.md:3 +#: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " "_reactor_) and is responsible for executing futures (an _executor_). Rust " @@ -21088,7 +20997,7 @@ msgstr "" "کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " "اما چندین گزینه دیگر در دسترس است:" -#: src/concurrency/async/runtimes.md:7 +#: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " "functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" @@ -21098,7 +21007,7 @@ msgstr "" "بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " "[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." -#: src/concurrency/async/runtimes.md:10 +#: src/concurrency/async/runtimes.md msgid "" "[async-std](https://async.rs/): aims to be a \"std for async\", and includes " "a basic runtime in `async::task`." @@ -21106,11 +21015,11 @@ msgstr "" "‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " "شامل یک runtime اولیه در `async::task` است." -#: src/concurrency/async/runtimes.md:12 +#: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است." -#: src/concurrency/async/runtimes.md:14 +#: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" "(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" @@ -21120,7 +21029,7 @@ msgstr "" "[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" "fuchsia-async/src/lib.rs) اکنون یکی runtime دارد." -#: src/concurrency/async/runtimes.md:21 +#: src/concurrency/async/runtimes.md msgid "" "Note that of the listed runtimes, only Tokio is supported in the Rust " "playground. The playground also does not permit any I/O, so most interesting " @@ -21130,7 +21039,7 @@ msgstr "" "زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " "دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." -#: src/concurrency/async/runtimes.md:25 +#: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " @@ -21142,52 +21051,52 @@ msgstr "" "آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " "هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." -#: src/concurrency/async/runtimes/tokio.md:3 +#: src/concurrency/async/runtimes/tokio.md #, fuzzy msgid "Tokio provides:" msgstr "Tokio provides:" -#: src/concurrency/async/runtimes/tokio.md:5 +#: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." msgstr "" "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." -#: src/concurrency/async/runtimes/tokio.md:6 +#: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." msgstr "یک asynchronous version کتابخانه‌ای استاندارد است." -#: src/concurrency/async/runtimes/tokio.md:7 +#: src/concurrency/async/runtimes/tokio.md msgid "A large ecosystem of libraries." msgstr "اکوسیستم بزرگی از کتابخانه‌ها." -#: src/concurrency/async/runtimes/tokio.md:14 +#: src/concurrency/async/runtimes/tokio.md #, fuzzy msgid "\"Count in task: {i}!\"" msgstr "\"connection from {addr:?}\"" -#: src/concurrency/async/runtimes/tokio.md:24 +#: src/concurrency/async/runtimes/tokio.md #, fuzzy msgid "\"Main task: {i}\"" msgstr "\"Main task: {i}\"" -#: src/concurrency/async/runtimes/tokio.md:32 +#: src/concurrency/async/runtimes/tokio.md msgid "With the `tokio::main` macro we can now make `main` async." msgstr "با ماکرو `tokio::main` اکنون می‌توانیم `main` را async کنیم." -#: src/concurrency/async/runtimes/tokio.md:34 +#: src/concurrency/async/runtimes/tokio.md msgid "The `spawn` function creates a new, concurrent \"task\"." msgstr "تابع `spawn` یک \"task\" جدید و همزمان ایجاد می‌کند." -#: src/concurrency/async/runtimes/tokio.md:36 +#: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" "توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." -#: src/concurrency/async/runtimes/tokio.md:38 +#: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" msgstr "**Further بررسی:**" -#: src/concurrency/async/runtimes/tokio.md:40 +#: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " "cancellation. `tokio::spawn` returns a handle which can be awaited to wait " @@ -21196,19 +21105,19 @@ msgstr "" "چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " "`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." -#: src/concurrency/async/runtimes/tokio.md:44 +#: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." msgstr "به جای spawn مورد `count_to(10).await`» را امتحان کنید." -#: src/concurrency/async/runtimes/tokio.md:46 +#: src/concurrency/async/runtimes/tokio.md msgid "Try awaiting the task returned from `tokio::spawn`." msgstr "منتظر کار برگشتی از `tokio::spawn` باشید." -#: src/concurrency/async/tasks.md:3 +#: src/concurrency/async/tasks.md msgid "Rust has a task system, which is a form of lightweight threading." msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن است." -#: src/concurrency/async/tasks.md:5 +#: src/concurrency/async/tasks.md msgid "" "A task has a single top-level future which the executor polls to make " "progress. That future may have one or more nested futures that its `poll` " @@ -21222,45 +21131,43 @@ msgstr "" "مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " "یک تایمر و یک عملیات I/O امکان‌پذیر است." -#: src/concurrency/async/tasks.md:16 +#: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" msgstr "\"127.0.0.1:0\"" -#: src/concurrency/async/tasks.md:17 +#: src/concurrency/async/tasks.md #, fuzzy msgid "\"listening on port {}\"" msgstr "\"listening on port {}\"" -#: src/concurrency/async/tasks.md:22 +#: src/concurrency/async/tasks.md #, fuzzy msgid "\"connection from {addr:?}\"" msgstr "\"connection from {addr:?}\"" -#: src/concurrency/async/tasks.md:25 +#: src/concurrency/async/tasks.md #, fuzzy msgid "b\"Who are you?\\n\"" msgstr "b\"Who are you?\\n\"" -#: src/concurrency/async/tasks.md:25 src/concurrency/async/tasks.md:28 -#: src/concurrency/async/tasks.md:31 +#: src/concurrency/async/tasks.md #, fuzzy msgid "\"socket error\"" msgstr "\"socket error\"" -#: src/concurrency/async/tasks.md:30 +#: src/concurrency/async/tasks.md #, fuzzy msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"Thanks for dialing in, {name}!\\n\"" -#: src/concurrency/async/tasks.md:40 -#: src/concurrency/async-control-flow/join.md:37 +#: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md msgid "" "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" "این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " "کنید." -#: src/concurrency/async/tasks.md:42 +#: src/concurrency/async/tasks.md msgid "" "Try connecting to it with a TCP connection tool like [nc](https://www.unix." "com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" @@ -21269,7 +21176,7 @@ msgstr "" "سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" "linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." -#: src/concurrency/async/tasks.md:46 +#: src/concurrency/async/tasks.md #, fuzzy msgid "" "Ask students to visualize what the state of the example server would be with " @@ -21278,7 +21185,7 @@ msgstr "" "از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " "کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" -#: src/concurrency/async/tasks.md:49 +#: src/concurrency/async/tasks.md #, fuzzy msgid "" "This is the first time we've seen an `async` block. This is similar to a " @@ -21288,7 +21195,7 @@ msgstr "" "این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " "هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." -#: src/concurrency/async/tasks.md:53 +#: src/concurrency/async/tasks.md msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." @@ -21296,43 +21203,43 @@ msgstr "" "بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " "بخشید." -#: src/concurrency/async-control-flow/channels.md:3 +#: src/concurrency/async-control-flow/channels.md msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" -#: src/concurrency/async-control-flow/channels.md:13 +#: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "\"Received {count} pings so far.\"" msgstr "\"Received {count} pings so far.\"" -#: src/concurrency/async-control-flow/channels.md:16 +#: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "\"ping_handler complete\"" msgstr "\"ping_handler complete\"" -#: src/concurrency/async-control-flow/channels.md:24 +#: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "\"Failed to send ping.\"" msgstr "\"Failed to send ping.\"" -#: src/concurrency/async-control-flow/channels.md:25 +#: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "\"Sent {} pings so far.\"" msgstr "\"Sent {} pings so far.\"" -#: src/concurrency/async-control-flow/channels.md:29 +#: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "\"Something went wrong in ping handler task.\"" msgstr "\"Something went wrong in ping handler task.\"" -#: src/concurrency/async-control-flow/channels.md:36 +#: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." -#: src/concurrency/async-control-flow/channels.md:38 +#: src/concurrency/async-control-flow/channels.md msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " "[morning class](../channels.md)." @@ -21340,11 +21247,11 @@ msgstr "" "به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" "channels.md) دیده می‌شود." -#: src/concurrency/async-control-flow/channels.md:41 +#: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می‌افتد؟ چرا؟" -#: src/concurrency/async-control-flow/channels.md:43 +#: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " "implement both `sync` and `async` `send` and `recv`. This can be convenient " @@ -21354,7 +21261,7 @@ msgstr "" "کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " "می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." -#: src/concurrency/async-control-flow/channels.md:47 +#: src/concurrency/async-control-flow/channels.md msgid "" "What makes working with `async` channels preferable is the ability to " "combine them with other `future`s to combine them and create complex control " @@ -21363,7 +21270,7 @@ msgstr "" "چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " "`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." -#: src/concurrency/async-control-flow/join.md:3 +#: src/concurrency/async-control-flow/join.md msgid "" "A join operation waits until all of a set of futures are ready, and returns " "a collection of their results. This is similar to `Promise.all` in " @@ -21373,26 +21280,26 @@ msgstr "" "مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " "در JavaScript یا `asyncio.gather` در پایتون است." -#: src/concurrency/async-control-flow/join.md:21 +#: src/concurrency/async-control-flow/join.md #, fuzzy msgid "\"https://google.com\"" msgstr "\"https://google.com\"" -#: src/concurrency/async-control-flow/join.md:22 +#: src/concurrency/async-control-flow/join.md #, fuzzy msgid "\"https://httpbin.org/ip\"" msgstr "\"https://httpbin.org/ip\"" -#: src/concurrency/async-control-flow/join.md:23 +#: src/concurrency/async-control-flow/join.md #, fuzzy msgid "\"https://play.rust-lang.org/\"" msgstr "\"https://play.rust-lang.org/\"" -#: src/concurrency/async-control-flow/join.md:24 +#: src/concurrency/async-control-flow/join.md msgid "\"BAD_URL\"" msgstr "\"BAD_URL\"" -#: src/concurrency/async-control-flow/join.md:39 +#: src/concurrency/async-control-flow/join.md msgid "" "For multiple futures of disjoint types, you can use `std::future::join!` but " "you must know how many futures you will have at compile time. This is " @@ -21403,7 +21310,7 @@ msgstr "" "حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " "می‌شود." -#: src/concurrency/async-control-flow/join.md:43 +#: src/concurrency/async-control-flow/join.md msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." @@ -21411,7 +21318,7 @@ msgstr "" "خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " "باعث می‌شود برنامه شما متوقف شود." -#: src/concurrency/async-control-flow/join.md:46 +#: src/concurrency/async-control-flow/join.md msgid "" "You can also combine `join_all` with `join!` for instance to join all " "requests to an http service as well as a database query. Try adding a " @@ -21425,7 +21332,7 @@ msgstr "" "future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " "بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." -#: src/concurrency/async-control-flow/select.md:3 +#: src/concurrency/async-control-flow/select.md msgid "" "A select operation waits until any of a set of futures is ready, and " "responds to that future's result. In JavaScript, this is similar to `Promise." @@ -21437,7 +21344,7 @@ msgstr "" "است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)` قابل مقایسه می‌باشد." -#: src/concurrency/async-control-flow/select.md:8 +#: src/concurrency/async-control-flow/select.md msgid "" "Similar to a match statement, the body of `select!` has a number of arms, " "each of the form `pattern = future => statement`. When a `future` is ready, " @@ -21451,76 +21358,37 @@ msgstr "" "`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " "`select!` می‌شود." -#: src/concurrency/async-control-flow/select.md:40 -#, fuzzy -msgid "\"Felix\"" -msgstr "\"Felix\"" - -#: src/concurrency/async-control-flow/select.md:40 -#, fuzzy -msgid "\"Failed to send cat.\"" -msgstr "\"Failed to send cat.\"" - -#: src/concurrency/async-control-flow/select.md:44 -#, fuzzy -msgid "\"Failed to send dog.\"" -msgstr "\"Failed to send dog.\"" - -#: src/concurrency/async-control-flow/select.md:49 -#, fuzzy -msgid "\"Failed to receive winner\"" -msgstr "\"Failed to receive winner\"" - -#: src/concurrency/async-control-flow/select.md:51 +#: src/concurrency/async-control-flow/select.md #, fuzzy -msgid "\"Winner is {winner:?}\"" -msgstr "\"Winner is {winner:?}\"" +msgid "\"got: {msg}\"" +msgstr "\"{msg}\"" -#: src/concurrency/async-control-flow/select.md:58 -msgid "" -"In this example, we have a race between a cat and a dog. " -"`first_animal_to_finish_race` listens to both channels and will pick " -"whichever arrives first. Since the dog takes 50ms, it wins against the cat " -"that take 500ms." +#: src/concurrency/async-control-flow/select.md +msgid "\"timeout\"" msgstr "" -"در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به " -"هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." -"بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " -"می‌کشد تا پیروز شود." -#: src/concurrency/async-control-flow/select.md:63 -msgid "" -"You can use `oneshot` channels in this example as the channels are supposed " -"to receive only one `send`." -msgstr "" -"در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " -"کانال‌ها فقط یک `send` را دریافت کنند." +#: src/concurrency/async-control-flow/select.md +#, fuzzy +msgid "\"Failed to send greeting\"" +msgstr "\"Failed to send ping.\"" -#: src/concurrency/async-control-flow/select.md:66 -msgid "" -"Try adding a deadline to the race, demonstrating selecting different sorts " -"of futures." +#: src/concurrency/async-control-flow/select.md +msgid "\"Listener failed\"" msgstr "" -"سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " -"نشان دهید." -#: src/concurrency/async-control-flow/select.md:69 +#: src/concurrency/async-control-flow/select.md msgid "" -"Note that `select!` drops unmatched branches, which cancels their futures. " -"It is easiest to use when every execution of `select!` creates new futures." +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" -"توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " -"future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " -"جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." -#: src/concurrency/async-control-flow/select.md:72 +#: src/concurrency/async-control-flow/select.md msgid "" -"An alternative is to pass `&mut future` instead of the future itself, but " -"this can lead to issues, further discussed in the pinning slide." +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" -"یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، " -"اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning " -"slide) شده بحث شده است." #: src/concurrency/async-pitfalls.md msgid "" @@ -21538,11 +21406,11 @@ msgstr "" msgid "Pin" msgstr "Pin" -#: src/concurrency/async-pitfalls/blocking-executor.md:1 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "Blocking the executor" msgstr "مسدود کردن executor" -#: src/concurrency/async-pitfalls/blocking-executor.md:3 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Most async runtimes only allow IO tasks to run concurrently. This means that " "CPU blocking tasks will block the executor and prevent other tasks from " @@ -21554,17 +21422,17 @@ msgstr "" "مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " "است که در صورت امکان از متدهای معادل async استفاده کنید." -#: src/concurrency/async-pitfalls/blocking-executor.md:14 +#: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" msgstr "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" -#: src/concurrency/async-pitfalls/blocking-executor.md:19 +#: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy msgid "\"current_thread\"" msgstr "\"current_thread\"" -#: src/concurrency/async-pitfalls/blocking-executor.md:30 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." @@ -21572,7 +21440,7 @@ msgstr "" "کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت " "همزمان (concurrent)." -#: src/concurrency/async-pitfalls/blocking-executor.md:33 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "The `\"current_thread\"` flavor puts all tasks on a single thread. This " "makes the effect more obvious, but the bug is still present in the multi-" @@ -21582,14 +21450,14 @@ msgstr "" "اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " "دارد." -#: src/concurrency/async-pitfalls/blocking-executor.md:37 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" "‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " "باشید." -#: src/concurrency/async-pitfalls/blocking-executor.md:39 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." @@ -21597,7 +21465,7 @@ msgstr "" "راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " "و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." -#: src/concurrency/async-pitfalls/blocking-executor.md:42 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " @@ -21613,7 +21481,7 @@ msgstr "" "ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " "بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." -#: src/concurrency/async-pitfalls/blocking-executor.md:48 +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Use sync mutexes with care. Holding a mutex over an `.await` may cause " "another task to block, and that task may be running on the same thread." @@ -21622,7 +21490,7 @@ msgstr "" "await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " "thread در حال اجرا باشد." -#: src/concurrency/async-pitfalls/pin.md:3 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Async blocks and functions return types implementing the `Future` trait. The " "type returned is the result of a compiler transformation which turns local " @@ -21632,7 +21500,7 @@ msgstr "" "می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " "ذخیره شده در future تبدیل می کند." -#: src/concurrency/async-pitfalls/pin.md:7 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Some of those variables can hold pointers to other local variables. Because " "of that, the future should never be moved to a different memory location, as " @@ -21642,7 +21510,7 @@ msgstr "" "دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " "این pointerها را باطل می‌کند." -#: src/concurrency/async-pitfalls/pin.md:11 +#: src/concurrency/async-pitfalls/pin.md msgid "" "To prevent moving the future type in memory, it can only be polled through a " "pinned pointer. `Pin` is a wrapper around a reference that disallows all " @@ -21654,7 +21522,7 @@ msgstr "" "عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " "متفاوت منتقل کند را ممنوع می‌کند." -#: src/concurrency/async-pitfalls/pin.md:20 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "// A work item. In this case, just sleep for the given time and respond\n" @@ -21663,47 +21531,47 @@ msgstr "" "// A work item. In this case, just sleep for the given time and respond\n" "// with a message on the `respond_on` channel.\n" -#: src/concurrency/async-pitfalls/pin.md:28 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "// A worker which listens for work on a queue and performs it.\n" msgstr "// A worker which listens for work on a queue and performs it.\n" -#: src/concurrency/async-pitfalls/pin.md:35 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "// Pretend to work.\n" msgstr "// Pretend to work.\n" -#: src/concurrency/async-pitfalls/pin.md:38 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "\"failed to send response\"" msgstr "\"failed to send response\"" -#: src/concurrency/async-pitfalls/pin.md:41 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "// TODO: report number of iterations every 100ms\n" msgstr "// TODO: report number of iterations every 100ms\n" -#: src/concurrency/async-pitfalls/pin.md:45 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "// A requester which requests work and waits for it to complete.\n" msgstr "// A requester which requests work and waits for it to complete.\n" -#: src/concurrency/async-pitfalls/pin.md:52 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "\"failed to send on work queue\"" msgstr "\"failed to send on work queue\"" -#: src/concurrency/async-pitfalls/pin.md:53 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "\"failed waiting for response\"" msgstr "\"failed waiting for response\"" -#: src/concurrency/async-pitfalls/pin.md:62 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "\"work result for iteration {i}: {resp}\"" msgstr "\"Welcome to chat! Type a message\"" -#: src/concurrency/async-pitfalls/pin.md:70 +#: src/concurrency/async-pitfalls/pin.md msgid "" "You may recognize this as an example of the actor pattern. Actors typically " "call `select!` in a loop." @@ -21711,7 +21579,7 @@ msgstr "" "شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " "دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." -#: src/concurrency/async-pitfalls/pin.md:73 +#: src/concurrency/async-pitfalls/pin.md msgid "" "This serves as a summation of a few of the previous lessons, so take your " "time with it." @@ -21719,7 +21587,7 @@ msgstr "" "این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " "آن کنید." -#: src/concurrency/async-pitfalls/pin.md:76 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" @@ -21727,12 +21595,12 @@ msgstr "" "به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " "`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" -#: src/concurrency/async-pitfalls/pin.md:79 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" -#: src/concurrency/async-pitfalls/pin.md:90 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " @@ -21743,7 +21611,7 @@ msgstr "" "`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" "pin` استفاده کنید:" -#: src/concurrency/async-pitfalls/pin.md:104 +#: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " "iteration (a fused future would help with this). Update to reset " @@ -21753,7 +21621,7 @@ msgstr "" "`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " "بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" -#: src/concurrency/async-pitfalls/pin.md:119 +#: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " @@ -21765,7 +21633,7 @@ msgstr "" "یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " "دشوار است." -#: src/concurrency/async-pitfalls/pin.md:123 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Another alternative is to not use `pin` at all but spawn another task that " "will send to a `oneshot` channel every 100ms." @@ -21773,7 +21641,7 @@ msgstr "" "جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " "ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." -#: src/concurrency/async-pitfalls/pin.md:126 +#: src/concurrency/async-pitfalls/pin.md msgid "" "Data that contains pointers to itself is called self-referential. Normally, " "the Rust borrow checker would prevent self-referential data from being " @@ -21787,7 +21655,7 @@ msgstr "" "اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " "borrow checker تأیید نمی‌شود." -#: src/concurrency/async-pitfalls/pin.md:132 +#: src/concurrency/async-pitfalls/pin.md msgid "" "`Pin` is a wrapper around a reference. An object cannot be moved from its " "place using a pinned pointer. However, it can still be moved through an " @@ -21797,7 +21665,7 @@ msgstr "" "از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " "از طریق یک pointer بدون پین جابجا کرد." -#: src/concurrency/async-pitfalls/pin.md:136 +#: src/concurrency/async-pitfalls/pin.md msgid "" "The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " "`&mut Self` to refer to the instance. That's why it can only be called on a " @@ -21807,7 +21675,7 @@ msgstr "" "اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " "را روی یک اشاره‌‌گر پین شده فراخوانی کرد." -#: src/concurrency/async-pitfalls/async-traits.md:3 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Async methods in traits are were stabilized only recently, in the 1.75 " "release. This required support for using return-position `impl Trait` (RPIT) " @@ -21819,7 +21687,7 @@ msgstr "" "داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " "Future` است." -#: src/concurrency/async-pitfalls/async-traits.md:7 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "However, even with the native support today there are some pitfalls around " "`async fn` and RPIT in traits:" @@ -21827,7 +21695,7 @@ msgstr "" "با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " "RPIT در ویژگی‌ها وجود دارد:" -#: src/concurrency/async-pitfalls/async-traits.md:10 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Return-position impl Trait captures all in-scope lifetimes (so some patterns " "of borrowing cannot be expressed)" @@ -21835,7 +21703,7 @@ msgstr "" "‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " "(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" -#: src/concurrency/async-pitfalls/async-traits.md:13 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Traits whose methods use return-position `impl trait` or `async` are not " "`dyn` compatible." @@ -21843,7 +21711,7 @@ msgstr "" "ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " "می‌کنند با `dyn` سازگار نیستند." -#: src/concurrency/async-pitfalls/async-traits.md:16 +#: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" "If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" @@ -21854,17 +21722,17 @@ msgstr "" "trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " "چند نکته:" -#: src/concurrency/async-pitfalls/async-traits.md:46 +#: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "\"running all sleepers..\"" msgstr "\"running all sleepers..\"" -#: src/concurrency/async-pitfalls/async-traits.md:50 +#: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "\"slept for {}ms\"" msgstr "\"slept for {}ms\"" -#: src/concurrency/async-pitfalls/async-traits.md:68 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." @@ -21873,7 +21741,7 @@ msgstr "" "هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " "عملکرد است." -#: src/concurrency/async-pitfalls/async-traits.md:71 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "The challenges in language support for `async trait` are deep Rust and " "probably not worth describing in-depth. Niko Matsakis did a good job of " @@ -21887,7 +21755,7 @@ msgstr "" "hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " "هستید." -#: src/concurrency/async-pitfalls/async-traits.md:77 +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " "time and adding it to the Vec." @@ -21895,7 +21763,7 @@ msgstr "" "سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " "را به Vec اضافه کنید." -#: src/concurrency/async-pitfalls/cancellation.md:3 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " "_cancellation_ and it can occur at any `await` point. Care is needed to " @@ -21907,23 +21775,22 @@ msgstr "" "اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " "به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." -#: src/concurrency/async-pitfalls/cancellation.md:35 -#: src/concurrency/async-pitfalls/cancellation.md:102 +#: src/concurrency/async-pitfalls/cancellation.md #, fuzzy msgid "\"not UTF-8\"" msgstr "\"not UTF-8\"" -#: src/concurrency/async-pitfalls/cancellation.md:51 +#: src/concurrency/async-pitfalls/cancellation.md #, fuzzy msgid "\"hi\\nthere\\n\"" msgstr "\"hi\\nthere\\n\"" -#: src/concurrency/async-pitfalls/cancellation.md:57 +#: src/concurrency/async-pitfalls/cancellation.md #, fuzzy msgid "\"tick!\"" msgstr "\"tick!\"" -#: src/concurrency/async-pitfalls/cancellation.md:73 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." @@ -21931,7 +21798,7 @@ msgstr "" "کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " "بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." -#: src/concurrency/async-pitfalls/cancellation.md:76 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." @@ -21939,29 +21806,29 @@ msgstr "" "برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " "به خطا) است." -#: src/concurrency/async-pitfalls/cancellation.md:79 +#: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "اسن مثال بخش‌هایی از string را از دست می‌دهد." -#: src/concurrency/async-pitfalls/cancellation.md:81 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." -#: src/concurrency/async-pitfalls/cancellation.md:84 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" -#: src/concurrency/async-pitfalls/cancellation.md:98 +#: src/concurrency/async-pitfalls/cancellation.md #, fuzzy msgid "// prefix buf and bytes with self.\n" msgstr "// prefix buf and bytes with self.\n" -#: src/concurrency/async-pitfalls/cancellation.md:108 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." "html#method.tick) is cancellation-safe because it keeps track of whether a " @@ -21971,7 +21838,7 @@ msgstr "" "html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " "tick تحویل داده شده است." -#: src/concurrency/async-pitfalls/cancellation.md:112 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncReadExt.html#method.read) is cancellation-safe because it either " @@ -21981,7 +21848,7 @@ msgstr "" "AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " "برمی‌گرداند یا نمی‌خواند." -#: src/concurrency/async-pitfalls/cancellation.md:115 +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " @@ -21991,13 +21858,13 @@ msgstr "" "AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" "safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." -#: src/concurrency/async-exercises/dining-philosophers.md:1 -#: src/concurrency/async-exercises/solutions.md:3 +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "Dining Philosophers --- Async" msgstr "فلسفه Dining --- Async" -#: src/concurrency/async-exercises/dining-philosophers.md:3 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." @@ -22005,7 +21872,7 @@ msgstr "" "برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" "philosophers.md) مراجعه کنید." -#: src/concurrency/async-exercises/dining-philosophers.md:6 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "As before, you will need a local [Cargo installation](../../cargo/running-" "locally.md) for this exercise. Copy the code below to a file called `src/" @@ -22015,19 +21882,19 @@ msgstr "" "md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " "را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" -#: src/concurrency/async-exercises/dining-philosophers.md:37 -#: src/concurrency/async-exercises/solutions.md:29 +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Keep trying until we have both forks\n" msgstr "// Keep trying until we have both forks\n" -#: src/concurrency/async-exercises/dining-philosophers.md:52 -#: src/concurrency/async-exercises/solutions.md:85 +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Make them think and eat\n" msgstr "// Make them think and eat\n" -#: src/concurrency/async-exercises/dining-philosophers.md:58 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Since this time you are using Async Rust, you'll need a `tokio` dependency. " "You can use the following `Cargo.toml`:" @@ -22035,7 +21902,7 @@ msgstr "" "از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " "دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" -#: src/concurrency/async-exercises/dining-philosophers.md:63 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" @@ -22059,7 +21926,7 @@ msgstr "" "\"rt-multi-thread\"] }\n" "```" -#: src/concurrency/async-exercises/dining-philosophers.md:73 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Also note that this time you have to use the `Mutex` and the `mpsc` module " "from the `tokio` crate." @@ -22067,11 +21934,11 @@ msgstr "" "همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " "crate استفاده کنید." -#: src/concurrency/async-exercises/dining-philosophers.md:79 +#: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread ای کنید؟" -#: src/concurrency/async-exercises/chat-app.md:3 +#: src/concurrency/async-exercises/chat-app.md msgid "" "In this exercise, we want to use our new knowledge to implement a broadcast " "chat application. We have a chat server that the clients connect to and " @@ -22085,7 +21952,7 @@ msgstr "" "استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " "دریافت می‌کند برای همه کاربران پخش می‌کند." -#: src/concurrency/async-exercises/chat-app.md:9 +#: src/concurrency/async-exercises/chat-app.md msgid "" "For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" "sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" @@ -22096,15 +21963,16 @@ msgstr "" "sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" "docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." -#: src/concurrency/async-exercises/chat-app.md:12 +#: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" msgstr "یک پروژه Cargo جدید ایجاد کنید و وابستگی‌های زیر را اضافه کنید:" -#: src/concurrency/async-exercises/chat-app.md:14 +#: src/concurrency/async-exercises/chat-app.md msgid "_Cargo.toml_:" msgstr "_Cargo.toml_:" -#: src/concurrency/async-exercises/chat-app.md:18 +#: src/concurrency/async-exercises/chat-app.md +#, fuzzy msgid "" "```toml\n" "[package]\n" @@ -22115,9 +21983,9 @@ msgid "" "[dependencies]\n" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" -"tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio = { version = \"1.40.0\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand" +"\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22130,15 +21998,15 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" +"\", \"server\", \"sha1_smol\"] }\n" "```" -#: src/concurrency/async-exercises/chat-app.md:31 +#: src/concurrency/async-exercises/chat-app.md msgid "The required APIs" msgstr "‏API‌های مورد نیاز" -#: src/concurrency/async-exercises/chat-app.md:33 +#: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " "[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " @@ -22147,7 +22015,7 @@ msgstr "" "شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" "websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." -#: src/concurrency/async-exercises/chat-app.md:37 +#: src/concurrency/async-exercises/chat-app.md msgid "" "[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" "trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " @@ -22157,7 +22025,7 @@ msgstr "" "trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " "ناهمزمان پیام‌ها از یک جریان وب سوکت." -#: src/concurrency/async-exercises/chat-app.md:39 +#: src/concurrency/async-exercises/chat-app.md msgid "" "[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" "trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " @@ -22167,7 +22035,7 @@ msgstr "" "trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " "ارسال ناهمزمان پیام‌ها در یک Websocket Stream." -#: src/concurrency/async-exercises/chat-app.md:41 +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." "html#method.next_line): for asynchronously reading user messages from the " @@ -22177,7 +22045,7 @@ msgstr "" "html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " "استاندارد." -#: src/concurrency/async-exercises/chat-app.md:43 +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." @@ -22185,11 +22053,11 @@ msgstr "" "‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." -#: src/concurrency/async-exercises/chat-app.md:45 +#: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" msgstr "دو باینری" -#: src/concurrency/async-exercises/chat-app.md:47 +#: src/concurrency/async-exercises/chat-app.md msgid "" "Normally in a Cargo project, you can have only one binary, and one `src/main." "rs` file. In this project, we need two binaries. One for the client, and one " @@ -22207,7 +22075,7 @@ msgstr "" "(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." "html#binaries) مراجعه کنید )." -#: src/concurrency/async-exercises/chat-app.md:54 +#: src/concurrency/async-exercises/chat-app.md msgid "" "Copy the following server and client code into `src/bin/server.rs` and `src/" "bin/client.rs`, respectively. Your task is to complete these files as " @@ -22217,68 +22085,67 @@ msgstr "" "کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " "شده است تکمیل کنید." -#: src/concurrency/async-exercises/chat-app.md:58 -#: src/concurrency/async-exercises/solutions.md:104 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "_src/bin/server.rs_:" -#: src/concurrency/async-exercises/chat-app.md:77 -#: src/concurrency/async-exercises/chat-app.md:124 +#: src/concurrency/async-exercises/chat-app.md #, fuzzy msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "// TODO: For a hint, see the description of the task below.\n" -#: src/concurrency/async-exercises/chat-app.md:85 -#: src/concurrency/async-exercises/solutions.md:154 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "\"127.0.0.1:2000\"" -#: src/concurrency/async-exercises/chat-app.md:86 -#: src/concurrency/async-exercises/solutions.md:155 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"listening on port 2000\"" msgstr "\"listening on port 2000\"" -#: src/concurrency/async-exercises/chat-app.md:90 -#: src/concurrency/async-exercises/solutions.md:159 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"New connection from {addr:?}\"" msgstr "\"New connection from {addr:?}\"" -#: src/concurrency/async-exercises/chat-app.md:93 -#: src/concurrency/async-exercises/solutions.md:162 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "// Wrap the raw TCP stream into a websocket.\n" -#: src/concurrency/async-exercises/chat-app.md:102 -#: src/concurrency/async-exercises/solutions.md:171 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "_src/bin/client.rs_:" -#: src/concurrency/async-exercises/chat-app.md:116 -#: src/concurrency/async-exercises/solutions.md:183 +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"ws://127.0.0.1:2000\"" msgstr "\"ws://127.0.0.1:2000\"" -#: src/concurrency/async-exercises/chat-app.md:129 +#: src/concurrency/async-exercises/chat-app.md msgid "Running the binaries" msgstr "راه‌اندازی باینری" -#: src/concurrency/async-exercises/chat-app.md:131 +#: src/concurrency/async-exercises/chat-app.md msgid "Run the server with:" msgstr "سرور را راه‌اندازی کنید با استفاده از:" -#: src/concurrency/async-exercises/chat-app.md:137 +#: src/concurrency/async-exercises/chat-app.md msgid "and the client with:" msgstr "و این کلاینت با:" -#: src/concurrency/async-exercises/chat-app.md:145 +#: src/concurrency/async-exercises/chat-app.md msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌سازی کنید." -#: src/concurrency/async-exercises/chat-app.md:146 +#: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: Use `tokio::select!` for concurrently performing two tasks in a " "continuous loop. One task receives messages from the client and broadcasts " @@ -22289,11 +22156,11 @@ msgstr "" "پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " "می‌کند." -#: src/concurrency/async-exercises/chat-app.md:149 +#: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." -#: src/concurrency/async-exercises/chat-app.md:150 +#: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " "performing two tasks: (1) reading user messages from standard input and " @@ -22304,7 +22171,7 @@ msgstr "" "task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " "به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." -#: src/concurrency/async-exercises/chat-app.md:154 +#: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." @@ -22312,7 +22179,7 @@ msgstr "" "اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " "جز فرستنده پیام، منتشر شود." -#: src/concurrency/async-exercises/solutions.md:35 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "" "// If we didn't get the left fork, drop the right fork if we\n" @@ -22321,7 +22188,7 @@ msgstr "" "// If we didn't get the left fork, drop the right fork if we\n" " // have it and let other tasks make progress.\n" -#: src/concurrency/async-exercises/solutions.md:42 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "" "// If we didn't get the right fork, drop the left fork and let\n" @@ -22330,27 +22197,27 @@ msgstr "" "// If we didn't get the right fork, drop the left fork and let\n" " // other tasks make progress.\n" -#: src/concurrency/async-exercises/solutions.md:54 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// The locks are dropped here\n" msgstr "// The locks are dropped here\n" -#: src/concurrency/async-exercises/solutions.md:82 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "// tx is dropped here, so we don't need to explicitly drop it later\n" -#: src/concurrency/async-exercises/solutions.md:97 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"Here is a thought: {thought}\"" msgstr "\"Here is a thought: {thought}\"" -#: src/concurrency/async-exercises/solutions.md:122 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"Welcome to chat! Type a message\"" msgstr "\"Welcome to chat! Type a message\"" -#: src/concurrency/async-exercises/solutions.md:126 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "" "// A continuous loop for concurrently performing two tasks: (1) receiving\n" @@ -22361,28 +22228,28 @@ msgstr "" " // messages from `ws_stream` and broadcasting them, and (2) receiving\n" " // messages on `bcast_rx` and sending them to the client.\n" -#: src/concurrency/async-exercises/solutions.md:135 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"From client {addr:?} {text:?}\"" msgstr "\"From client {addr:?} {text:?}\"" -#: src/concurrency/async-exercises/solutions.md:190 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Continuous loop for concurrently sending and receiving messages.\n" msgstr "// Continuous loop for concurrently sending and receiving messages.\n" -#: src/concurrency/async-exercises/solutions.md:197 +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"From server: {}\"" msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " +"it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " -"برده باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " +"باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" @@ -22423,6 +22290,13 @@ msgstr "" "argument: \n" "اطلاعاتی که به یک تابع یا متد منتقل می‌شود." +#: src/glossary.md +msgid "" +"associated type: \n" +"A type associated with a specific trait. Useful for defining the " +"relationship between types." +msgstr "" + #: src/glossary.md msgid "" "Bare-metal Rust: \n" @@ -23181,11 +23055,12 @@ msgstr "" "پوشش داده شده است." #: src/other-resources.md +#, fuzzy msgid "" -"[Advanced testing for Rust applications](https://github.com/mainmatter/rust-" -"advanced-testing-workshop): a self-paced workshop that goes beyond Rust's " -"built-in testing framework. It covers `googletest`, snapshot testing, " -"mocking as well as how to write your own custom test harness." +"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" +"testing/): a self-paced workshop that goes beyond Rust's built-in testing " +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." msgstr "" "‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" "advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " @@ -23286,6 +23161,102 @@ msgstr "" "از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " "license، دایرکتوری `third_party/cxx/` را ببینید." +#~ msgid "Slices: `&[T]`" +#~ msgstr "برش ها: `&[T]`" + +#~ msgid "Slices: &\\[T\\]" +#~ msgstr "برش‌ها: `[T]&`" + +#~ msgid "" +#~ "By default, closures will capture by reference if they can. The `move` " +#~ "keyword makes them capture by value." +#~ msgstr "" +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " +#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " +#~ "value) بگیرند." + +#~ msgid "" +#~ "There is a plan to transition [Android](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." +#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction) to Bazel." +#~ msgstr "" +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." +#~ "com/docs/setup/build/bazel/introduction) به Bazel." + +#~ msgid "" +#~ "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "" +#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." + +#~ msgid "" +#~ "Threads are all daemon threads, the main thread does not wait for them." +#~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." + +#, fuzzy +#~ msgid "\"Felix\"" +#~ msgstr "\"Felix\"" + +#, fuzzy +#~ msgid "\"Failed to send cat.\"" +#~ msgstr "\"Failed to send cat.\"" + +#, fuzzy +#~ msgid "\"Failed to send dog.\"" +#~ msgstr "\"Failed to send dog.\"" + +#, fuzzy +#~ msgid "\"Failed to receive winner\"" +#~ msgstr "\"Failed to receive winner\"" + +#, fuzzy +#~ msgid "\"Winner is {winner:?}\"" +#~ msgstr "\"Winner is {winner:?}\"" + +#~ msgid "" +#~ "In this example, we have a race between a cat and a dog. " +#~ "`first_animal_to_finish_race` listens to both channels and will pick " +#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " +#~ "cat that take 500ms." +#~ msgstr "" +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " +#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." +#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " +#~ "می‌کشد تا پیروز شود." + +#~ msgid "" +#~ "You can use `oneshot` channels in this example as the channels are " +#~ "supposed to receive only one `send`." +#~ msgstr "" +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " +#~ "کانال‌ها فقط یک `send` را دریافت کنند." + +#~ msgid "" +#~ "Try adding a deadline to the race, demonstrating selecting different " +#~ "sorts of futures." +#~ msgstr "" +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " +#~ "نشان دهید." + +#~ msgid "" +#~ "Note that `select!` drops unmatched branches, which cancels their " +#~ "futures. It is easiest to use when every execution of `select!` creates " +#~ "new futures." +#~ msgstr "" +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " +#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " +#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." + +#~ msgid "" +#~ "An alternative is to pass `&mut future` instead of the future itself, but " +#~ "this can lead to issues, further discussed in the pinning slide." +#~ msgstr "" +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " +#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " +#~ "(pinning slide) شده بحث شده است." + #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" From 64218f9c65ff3c51b1a92990dc15981ea4962646 Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 11 Sep 2024 22:28:10 +0000 Subject: [PATCH 67/92] fa: refreshed Translation For Farsi and formatted --- po/fa.po | 1 + 1 file changed, 1 insertion(+) diff --git a/po/fa.po b/po/fa.po index f8d6037c6f4..ed8d03b59b7 100644 --- a/po/fa.po +++ b/po/fa.po @@ -6157,6 +6157,7 @@ msgstr "" "هنگام کار با generic‌ها، معمولاً می‌خواهید نیاز داشته باشید که تایپ، trait ترید " "خاص را پیاده‌سازی کنند، تا بتوانید متدهای آن trait را فراخوانی کنید." + #: src/generics/trait-bounds.md #, fuzzy msgid "You can do this with `T: Trait`:" From 1e807b85f896fcec9e0618e77cd135c2de9fd48f Mon Sep 17 00:00:00 2001 From: Danny Khosravi Date: Wed, 11 Sep 2024 22:28:40 +0000 Subject: [PATCH 68/92] fa: refreshed Translation For Farsi and formatted --- po/fa.po | 1 - 1 file changed, 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index ed8d03b59b7..f8d6037c6f4 100644 --- a/po/fa.po +++ b/po/fa.po @@ -6157,7 +6157,6 @@ msgstr "" "هنگام کار با generic‌ها، معمولاً می‌خواهید نیاز داشته باشید که تایپ، trait ترید " "خاص را پیاده‌سازی کنند، تا بتوانید متدهای آن trait را فراخوانی کنید." - #: src/generics/trait-bounds.md #, fuzzy msgid "You can do this with `T: Trait`:" From 50632d7c74ed23ba1bf92f289186c1c7396ba14e Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Sep 2024 02:25:45 +0330 Subject: [PATCH 69/92] fa: refreshed Translation For Farsi - formatted 2 --- po/fa.po | 140 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/po/fa.po b/po/fa.po index f8d6037c6f4..e9b1d3ddff6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1492,8 +1492,8 @@ msgstr "فرض میشود" #: src/index.md msgid "" "The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and C" -"++ to better explain or contrast the Rust approach." +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" @@ -1552,8 +1552,8 @@ msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker Notes" -"\"). This way you have a clean screen to present to the class." +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" "با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " "نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " @@ -4152,8 +4152,8 @@ msgstr "" #: src/references/shared.md msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in C" -"++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" "راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " "متدها (`ref_x.count_ones()` را امتحان کنید)." @@ -4348,8 +4348,8 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello" -"\"`), are stored in the program’s binary." +"encoded string data stored in a block of memory. String literals " +"(`\"Hello\"`), are stored in the program’s binary." msgstr "" "`&str` یک برش رشته‌ای را معرفی می‌کند، که یک مرجع " "غیرقابل تغییر به داده‌های رشته‌ای رمزشده UTF-8 است که در یک بلوک حافظه ذخیره " @@ -4419,9 +4419,9 @@ msgstr "" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n" -"\" == \"\\\\n\"`. You can embed double-quotes by using an equal amount of " -"`#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" "رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " @@ -4705,9 +4705,9 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" "If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche optimization" -"\"). For example, `Option<&u8>` stores either a pointer to an integer or " -"`NULL` for the `None` variant." +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md @@ -5234,8 +5234,8 @@ 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` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " "به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md @@ -6768,9 +6768,10 @@ msgid "" "unicode_segmentation/struct.Graphemes.html)." msgstr "" "`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر" -"\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/" -"unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " +"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." +"html)." #: src/std-types/string.md msgid "" @@ -7011,9 +7012,9 @@ msgstr "برخلاف `!vec`، متأسفانه ماکروی استاندارد ` #: src/std-types/hashmap.md msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C" -"%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to " -"easily initialize a hash map from a literal array:" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" "از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" "(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" @@ -8806,8 +8807,8 @@ msgid "" "`make_mut` actually clones the inner value if necessary (\"clone-on-write\") " "and returns a mutable reference." msgstr "" -"`make_mut` در واقع در صورت نیاز مقدار درونی را کپی می‌کند (\"clone-on-write" -"\") و یک ارجاع قابل تغییر (mutable reference) برمی‌گرداند." +"`make_mut` در واقع در صورت نیاز مقدار درونی را کپی می‌کند (\"clone-on-" +"write\") و یک ارجاع قابل تغییر (mutable reference) برمی‌گرداند." #: src/smart-pointers/rc.md msgid "Use `Rc::strong_count` to check the reference count." @@ -8855,8 +8856,8 @@ msgid "" "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:\"Dog" -"\"| :\n" +": : | : | data:" +"\"Dog\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " @@ -8878,16 +8879,16 @@ msgid "" "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk" -"\" | :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk" -"\" | :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" @@ -9333,8 +9334,8 @@ msgstr "" #: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor" -"\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "" #: src/borrowing/exercise.md src/borrowing/solution.md @@ -10077,8 +10078,9 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments" -"\". These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md @@ -13223,11 +13225,11 @@ msgstr "" #, fuzzy msgid "" "This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust applications" -"\"](https://rust-exercises.com/advanced-testing/), a self-guided Rust " -"course: it provides a guided introduction to the library, with exercises to " -"help you get comfortable with `googletest` macros, its matchers and its " -"overall philosophy." +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " "پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" @@ -14055,8 +14057,8 @@ msgid "" msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " "\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " -"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C" -"++ function فعال می‌شود." +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " +"C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -15770,11 +15772,11 @@ msgid "" "draft the CXX bindings for the language boundary to see if it appears simple " "enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ" -"\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در " -"نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که " -"پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا " -"ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " +"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " +"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " +"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " +"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" @@ -16142,8 +16144,8 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h" -"\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" "همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" "cxx.h\"` را وارد کنید." @@ -16722,15 +16724,15 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" -"\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib" -"\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" @@ -20389,11 +20391,11 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned" -"\" to signal that the data it protected might be in an inconsistent state. " -"Calling `lock()` on a poisoned mutex fails with a [`PoisonError`](https://" -"doc.rust-lang.org/std/sync/struct.PoisonError.html). You can call " -"`into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." msgstr "" "اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" "poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " @@ -20646,8 +20648,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" -"\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -20660,8 +20662,8 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls" -"\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -21984,8 +21986,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand" -"\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -21998,8 +22000,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand" -"\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22245,11 +22247,11 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that " -"it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " -"باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " +"برده باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" From c908721b7e9e49826c34acae937fd915df3b33c6 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Sep 2024 23:07:18 +0330 Subject: [PATCH 70/92] fa: reform -> generics + borrowing + lifetimes --- po/fa.po | 386 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 195 insertions(+), 191 deletions(-) diff --git a/po/fa.po b/po/fa.po index e9b1d3ddff6..03d86dc14d5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-08 20:39+0330\n" +"PO-Revision-Date: 2024-09-12 23:03+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.0.1\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🦀" @@ -603,16 +603,16 @@ msgid "Test Modules" msgstr "تست‌ ماژول‌ها" #: src/SUMMARY.md src/testing.md src/testing/other.md -msgid "Other Types of Tests" +msgid "انواع دیگر تست‌ها" msgstr "" #: src/SUMMARY.md src/testing.md src/testing/lints.md msgid "Compiler Lints and Clippy" -msgstr "" +msgstr "کامپایلر Lints و Clippy" #: src/SUMMARY.md src/testing.md src/testing/exercise.md msgid "Exercise: Luhn Algorithm" -msgstr "" +msgstr "تمرین: الگوریتم Luhn" #: src/SUMMARY.md msgid "Day 4: Afternoon" @@ -2437,7 +2437,7 @@ msgstr "بلوک های کد در این دوره کاملاً تعاملی(inte #: src/cargo/code-samples.md src/cargo/running-locally.md msgid "\"Edit me!\"" -msgstr "" +msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy @@ -3866,7 +3866,7 @@ msgstr "/// Determine the length of the collatz sequence beginning at `n`.\n" #: src/control-flow-basics/solution.md src/concurrency/threads/scoped.md msgid "\"Length: {}\"" -msgstr "" +msgstr "\"Length: {}\"" #: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md #: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md @@ -4582,7 +4582,7 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" -msgstr "" +msgstr "\"از یک دانشمند حوزه موشک در ناسا بپرس\"" #: src/user-defined-types/tuple-structs.md #: src/android/interoperability/cpp/cpp-bridge.md @@ -4651,7 +4651,7 @@ msgstr "" #: src/user-defined-types/enums.md msgid "\"On this turn: {:?}\"" -msgstr "" +msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." @@ -4825,7 +4825,7 @@ msgstr "به روز ۱ خوش آمدید" #: src/user-defined-types/static.md msgid "\"{BANNER}\"" -msgstr "" +msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy @@ -4945,8 +4945,9 @@ msgid "/// A floor button was pressed in the elevator car.\n" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "\"A ground floor passenger has pressed the up button: {:?}\"" -msgstr "" +msgstr "\"یک مسافر طبقه همکف دکمه بالا را فشار داده است: {:?} \"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" @@ -4958,7 +4959,7 @@ msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" -msgstr "" +msgstr "\"یک مسافر دکمه طبقه 3 را فشار داده است: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" @@ -5069,7 +5070,7 @@ msgstr "" #: src/pattern-matching/match.md msgid "\"Quitting\"" -msgstr "" +msgstr "\"ترک کردن\"" #: src/pattern-matching/match.md src/generics/exercise.md #: src/generics/solution.md src/std-traits/solution.md @@ -5091,7 +5092,7 @@ msgstr "" #: src/pattern-matching/match.md msgid "\"Moving around\"" -msgstr "" +msgstr "\"حرکت در اطراف\"" #: src/pattern-matching/match.md src/error-handling/exercise.md #: src/error-handling/solution.md @@ -5105,11 +5106,11 @@ msgstr "" #: src/pattern-matching/match.md msgid "\"Number input\"" -msgstr "" +msgstr "\"ورودی شماره\"" #: src/pattern-matching/match.md msgid "\"Lowercase: {key}\"" -msgstr "" +msgstr "\"حروف کوچک: {key}\"" #: src/pattern-matching/match.md msgid "\"Something else\"" @@ -5254,11 +5255,11 @@ msgstr "" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" -msgstr "" +msgstr "\"نمی توان {n} را به دو قسمت مساوی تقسیم کرد\"" #: src/pattern-matching/destructuring-enums.md msgid "\"{n} divided in two is {half}\"" -msgstr "" +msgstr "\"{n} تقسیم به دو است {half}\"" #: src/pattern-matching/destructuring-enums.md msgid "\"sorry, an error happened: {msg}\"" @@ -5373,11 +5374,11 @@ msgstr "" #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" -msgstr "" +msgstr "\"نه یک hex digit\"" #: src/pattern-matching/let-control-flow.md msgid "\"got empty string\"" -msgstr "" +msgstr "\"یک string خالی دریافت کردم\"" #: src/pattern-matching/let-control-flow.md msgid "\"got None\"" @@ -5385,13 +5386,13 @@ msgstr "" #: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md msgid "\"result: {:?}\"" -msgstr "" +msgstr "\"نتیجه: {:؟}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md #: src/smart-pointers/solution.md src/testing/solution.md #: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" -msgstr "" +msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" @@ -5551,11 +5552,11 @@ msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "\"division by zero\"" -msgstr "" +msgstr "\"تقسیم بر صفر\"" #: src/pattern-matching/solution.md msgid "\"expr: {:?}\"" -msgstr "" +msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" @@ -5579,11 +5580,12 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "\"Recorded {} laps for {}:\"" -msgstr "" +msgstr "\"ضبط {} دور برای {}:\"" #: src/methods-and-traits/methods.md +#, fuzzy msgid "\"Lap {idx}: {lap} sec\"" -msgstr "" +msgstr "\"Lap {idx}: {lap} sec\"" #: src/methods-and-traits/methods.md msgid "// Exclusive ownership of self\n" @@ -5591,11 +5593,11 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "\"Race {} is finished, total lap time: {}\"" -msgstr "" +msgstr "\"مسابقه {} به پایان رسید، کل زمان دور: {}\"" #: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" -msgstr "" +msgstr "«جایزه بزرگ موناکو»" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" @@ -5752,7 +5754,7 @@ msgstr "" #: src/methods-and-traits/traits/implementing.md msgid "\"Oh you're a cutie! What's your name? {}\"" -msgstr "" +msgstr "\"اوه تو چثدر زیبا هستی! اسمت چیه؟ {}\"" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md @@ -5762,7 +5764,7 @@ msgstr "" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Fido\"" -msgstr "" +msgstr "\"Fido\"" #: src/methods-and-traits/traits/implementing.md msgid "" @@ -5804,11 +5806,11 @@ msgstr "" #: src/methods-and-traits/traits/supertraits.md msgid "\"Rex\"" -msgstr "" +msgstr "\"Rex\"" #: src/methods-and-traits/traits/supertraits.md msgid "\"{} has {} legs\"" -msgstr "" +msgstr "\"{} has {} legs\"" #: src/methods-and-traits/traits/supertraits.md msgid "" @@ -5830,7 +5832,7 @@ msgstr "" #: src/methods-and-traits/traits/associated-types.md #: src/concurrency/async-control-flow/join.md msgid "\"{:?}\"" -msgstr "" +msgstr "\"{:?}\"" #: src/methods-and-traits/traits/associated-types.md msgid "" @@ -5866,7 +5868,7 @@ msgstr "" #: src/methods-and-traits/deriving.md msgid "\"EldurScrollz\"" -msgstr "" +msgstr "\"dog\"" #: src/methods-and-traits/deriving.md msgid "// Debug trait adds support for printing with `{:?}`.\n" @@ -5874,7 +5876,7 @@ msgstr "" #: src/methods-and-traits/deriving.md msgid "\"{:?} vs. {:?}\"" -msgstr "" +msgstr "\"{:?} vs. {:?}\"" #: src/methods-and-traits/deriving.md msgid "" @@ -5934,7 +5936,7 @@ msgstr "" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"FYI\"" -msgstr "" +msgstr "\"FYI\"" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"Uhoh\"" @@ -5987,7 +5989,7 @@ msgstr "" #: src/generics/generic-functions.md msgid "\"picked a number: {:?}\"" -msgstr "" +msgstr "\"شماره ای را انتخاب کرد: {:؟}\"" #: src/generics/generic-functions.md msgid "\"picked a tuple: {:?}\"" @@ -5995,11 +5997,11 @@ msgstr "" #: src/generics/generic-functions.md msgid "\"dog\"" -msgstr "" +msgstr "\"سگ\"" #: src/generics/generic-functions.md msgid "\"cat\"" -msgstr "" +msgstr "\"گربه\"" #: src/generics/generic-functions.md msgid "" @@ -6038,11 +6040,11 @@ msgstr "می‌توانید از generic‌ ها برای انتزاع نوع ف #: src/generics/generic-data.md msgid "\"{integer:?} and {float:?}\"" -msgstr "" +msgstr "\"{integer:?} و {float:?}\"" #: src/generics/generic-data.md msgid "\"coords: {:?}\"" -msgstr "" +msgstr "\"coords: {:?}\"" #: src/generics/generic-data.md msgid "" @@ -6096,15 +6098,15 @@ msgstr "" #: src/generics/generic-traits.md msgid "\"Converted from integer: {from}\"" -msgstr "" +msgstr "\"تبدیل شده از integer: {from}\"" #: src/generics/generic-traits.md msgid "\"Converted from bool: {from}\"" -msgstr "" +msgstr "\"تبدیل‌شده از bool: {from}\"" #: src/generics/generic-traits.md msgid "\"{from_int:?}, {from_bool:?}\"" -msgstr "" +msgstr "\"{from_int:?}, {from_bool:?}\"" #: src/generics/generic-traits.md msgid "" @@ -6169,7 +6171,7 @@ msgstr "" #: src/generics/trait-bounds.md msgid "\"{pair:?}\"" -msgstr "" +msgstr "\"{pair:?}\"" #: src/generics/trait-bounds.md msgid "Try making a `NonClonable` and passing it to `duplicate`." @@ -6228,11 +6230,11 @@ msgstr "" #: src/generics/impl-trait.md msgid "\"{many}\"" -msgstr "" +msgstr "\"{many}\"" #: src/generics/impl-trait.md msgid "\"{many_more}\"" -msgstr "" +msgstr "\"{many_more}\"" #: src/generics/impl-trait.md msgid "\"debuggable: {debuggable:?}\"" @@ -6299,7 +6301,7 @@ msgstr "" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" -msgstr "" +msgstr "\"Miau!\"" #: src/generics/dyn-trait.md msgid "// Uses generics and static dispatch.\n" @@ -6307,7 +6309,7 @@ msgstr "" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Hello, who are you? {}\"" -msgstr "" +msgstr "\"سلام، شما کی هستید؟ {}\"" #: src/generics/dyn-trait.md msgid "// Uses type-erasure and dynamic dispatch.\n" @@ -6408,15 +6410,15 @@ msgstr "" #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" -msgstr "" +msgstr "\"خداحافظ\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"bat\"" -msgstr "" +msgstr "\"bat\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"armadillo\"" -msgstr "" +msgstr "\"آرمادیلو\"" #: src/generics/exercise.md msgid "" @@ -6588,7 +6590,7 @@ msgstr "" #: src/std-types/option.md msgid "\"Löwe 老虎 Léopard Gepardi\"" -msgstr "" +msgstr "\"Löwe 老虎 Léopard Gepardi\"" #: src/std-types/option.md msgid "'é'" @@ -6596,7 +6598,7 @@ msgstr "" #: src/std-types/option.md msgid "\"find returned {position:?}\"" -msgstr "" +msgstr "\"پیدا کردن نوع بازگشتی{position:?}\"" #: src/std-types/option.md msgid "'Z'" @@ -6604,7 +6606,7 @@ msgstr "" #: src/std-types/option.md msgid "\"Character not found\"" -msgstr "" +msgstr "\"Character not found\"" #: src/std-types/option.md msgid "`Option` is widely used, not just in the standard library." @@ -6656,15 +6658,15 @@ msgstr "" #: src/std-types/result.md src/error-handling/result.md msgid "\"diary.txt\"" -msgstr "" +msgstr "\"diary.txt\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Dear diary: {contents} ({bytes} bytes)\"" -msgstr "" +msgstr "\"دفتر خاطرات عزیز: {contents} ({bytes} bytes)\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Could not read file content\"" -msgstr "" +msgstr "\"نمی‌توان محتوای فایل را خواند\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" @@ -6716,7 +6718,7 @@ msgstr "\"سلام\"" #: src/std-types/string.md msgid "\"s1: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"s1: len = {}, capacity = {}\"" #: src/std-types/string.md msgid "'!'" @@ -6724,15 +6726,15 @@ msgstr "" #: src/std-types/string.md msgid "\"s2: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"s2: len = {}, capacity = {}\"" #: src/std-types/string.md msgid "\"🇨🇭\"" -msgstr "" +msgstr "\"🇨🇭\"" #: src/std-types/string.md msgid "\"s3: len = {}, number of chars = {}\"" -msgstr "" +msgstr "\"s3: len = {}, number of chars = {}\"" #: src/std-types/string.md msgid "" @@ -6876,7 +6878,7 @@ msgstr "" #: src/std-types/vec.md msgid "\"{v3:?}\"" -msgstr "" +msgstr "\"{v3:?}\"" #: src/std-types/vec.md msgid "// Remove consecutive duplicates.\n" @@ -6944,19 +6946,19 @@ msgstr "نقشه hash استاندارد با حفاظت در برابر حمل #: src/std-types/hashmap.md msgid "\"Adventures of Huckleberry Finn\"" -msgstr "" +msgstr "\"ماجراهای هاکلبری فین\"" #: src/std-types/hashmap.md msgid "\"Grimms' Fairy Tales\"" -msgstr "" +msgstr "\"قصه‌های گریمز\"" #: src/std-types/hashmap.md msgid "\"Pride and Prejudice\"" -msgstr "" +msgstr "\"غرور و تعصب\"" #: src/std-types/hashmap.md msgid "\"Les Misérables\"" -msgstr "" +msgstr "\"Les Misérables\"" #: src/std-types/hashmap.md msgid "\"We know about {} books, but not Les Misérables.\"" @@ -6964,15 +6966,15 @@ msgstr "" #: src/std-types/hashmap.md msgid "\"Alice's Adventure in Wonderland\"" -msgstr "" +msgstr "\"ماجراجویی آلیس در سرزمین عجایب\"" #: src/std-types/hashmap.md msgid "\"{book}: {count} pages\"" -msgstr "" +msgstr "\"{book}: {count} صفحه‌ها\"" #: src/std-types/hashmap.md msgid "\"{book} is unknown.\"" -msgstr "" +msgstr "\"{book} ناشناخته است.\"" #: src/std-types/hashmap.md msgid "// Use the .entry() method to insert a value if nothing is found.\n" @@ -6980,7 +6982,7 @@ msgstr "" #: src/std-types/hashmap.md msgid "\"{page_counts:#?}\"" -msgstr "" +msgstr "\"{page_counts:#?}\"" #: src/std-types/hashmap.md msgid "" @@ -6999,7 +7001,7 @@ msgstr "" #: src/std-types/hashmap.md msgid "\"Harry Potter and the Sorcerer's Stone\"" -msgstr "" +msgstr "\"هری پاتر و سنگ جادو\"" #: src/std-types/hashmap.md msgid "\"The Hunger Games\"" @@ -7114,15 +7116,15 @@ msgstr "" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"apple\"" -msgstr "" +msgstr "\"سیب\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"orange\"" -msgstr "" +msgstr "نارنجی" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"got {} apples\"" -msgstr "" +msgstr "\"داشتم {} سیب‌ها\"" #: src/std-traits.md src/concurrency/sync-exercises.md #: src/concurrency/async-exercises.md @@ -7545,9 +7547,8 @@ msgstr "" "هستند:" #: src/std-traits/closures.md -#, fuzzy msgid "\"Calling {func_name}({input}): {}\"" -msgstr "\"Calling function on {input}\"" +msgstr "\"فراخوانی {func_name}({input}): {}\"" #: src/std-traits/closures.md #, fuzzy @@ -8375,11 +8376,11 @@ msgstr "\"a\"" #: src/memory-management/drop.md msgid "\"c\"" -msgstr "\"a\"" +msgstr "\"c\"" #: src/memory-management/drop.md msgid "\"d\"" -msgstr "\"a\"" +msgstr "\"d\"" #: src/memory-management/drop.md msgid "\"Exiting block B\"" @@ -8489,7 +8490,7 @@ msgstr "" #: src/memory-management/exercise.md msgid "\"2\"" -msgstr "" +msgstr "\"2\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the package version.\n" @@ -8501,7 +8502,7 @@ msgstr "" #: src/memory-management/exercise.md msgid "\"3\"" -msgstr "" +msgstr "\"3\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Add an additional dependency.\n" @@ -8509,7 +8510,7 @@ msgstr "" #: src/memory-management/exercise.md msgid "\"4\"" -msgstr "" +msgstr "\"4\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the language. If not set, language defaults to None.\n" @@ -8517,11 +8518,11 @@ msgstr "" #: src/memory-management/exercise.md msgid "\"5\"" -msgstr "" +msgstr "\"5\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64\"" -msgstr "" +msgstr "\"base64: {base64:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.13\"" @@ -8529,11 +8530,11 @@ msgstr "" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64: {base64:?}\"" -msgstr "" +msgstr "\"base64: {base64:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log\"" -msgstr "" +msgstr "\"log\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.4\"" @@ -8541,7 +8542,7 @@ msgstr "" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log: {log:?}\"" -msgstr "" +msgstr "\"log: {log:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" @@ -8549,11 +8550,11 @@ msgstr "" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"djmitche\"" -msgstr "" +msgstr "\"djmitche\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"4.0\"" -msgstr "" +msgstr "\"4.0\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde: {serde:?}\"" @@ -8581,7 +8582,7 @@ msgstr "" #: src/smart-pointers/box.md msgid "\"five: {}\"" -msgstr "" +msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" @@ -8612,7 +8613,7 @@ msgstr "" #: src/smart-pointers/box.md msgid "\"{list:?}\"" -msgstr "" +msgstr "\"{list:?}\"" #: src/smart-pointers/box.md msgid "" @@ -8996,7 +8997,7 @@ msgstr "" #: src/smart-pointers/solution.md src/android/testing/googletest.md msgid "\"bar\"" -msgstr "" +msgstr "\"bar\"" #: src/welcome-day-3-afternoon.md msgid "" @@ -9251,7 +9252,7 @@ msgstr "" #: src/borrowing/interior-mutability.md msgid "\"{cell:?}\"" -msgstr "" +msgstr "\"{cell:?}\"" #: src/borrowing/interior-mutability.md msgid "" @@ -9342,11 +9343,11 @@ msgstr "" #: src/android/build-rules/library.md #: src/android/aidl/example-service/client.md msgid "\"Bob\"" -msgstr "" +msgstr "\"Bob\"" #: src/borrowing/exercise.md src/borrowing/solution.md msgid "\"I'm {} and my age is {}\"" -msgstr "" +msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9392,7 +9393,7 @@ msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "\"p3: {p3:?}\"" -msgstr "" +msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9520,7 +9521,7 @@ msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" -msgstr "" +msgstr "\"Bye {text}!\"" #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" @@ -9532,11 +9533,11 @@ msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "\"{fox:?}\"" -msgstr "" +msgstr "\"{fox:?}\"" #: src/lifetimes/struct-lifetimes.md msgid "\"{dog:?}\"" -msgstr "" +msgstr "\"{dog:?}\"" #: src/lifetimes/struct-lifetimes.md msgid "" @@ -9695,11 +9696,11 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid wire type: {value}\"" -msgstr "" +msgstr "\"نوع سیم نامعتبر: {value}\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected string to be a `Len` field\"" -msgstr "" +msgstr "\"انتظار می‌رود که رشته یک فیلد \"Len\" باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy @@ -9708,11 +9709,11 @@ msgstr "String" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected bytes to be a `Len` field\"" -msgstr "" +msgstr "\"بایت‌های مورد انتظار یک فیلد \"Len\" باشند\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected `u64` to be a `Varint` field\"" -msgstr "" +msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" @@ -9721,7 +9722,7 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" -msgstr "" +msgstr "\"بایت کافی برای varint نیست\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" @@ -9750,10 +9751,11 @@ msgid "" "\"Based on the wire type, build a Field, consuming as many bytes as " "necessary.\"" msgstr "" +"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" -msgstr "" +msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" @@ -9785,7 +9787,7 @@ msgstr "" #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" -msgstr "" +msgstr "\"لن یک \"استفاده\" معتبر نیست\"" #: src/lifetimes/solution.md msgid "\"Unexpected EOF\"" @@ -9807,15 +9809,15 @@ msgstr "\"سلام {name}\"" #: src/lifetimes/solution.md msgid "\"Evan\"" -msgstr "" +msgstr "\"Evan\"" #: src/lifetimes/solution.md msgid "\"+1234-777-9090\"" -msgstr "" +msgstr "\"+1234-777-9090\"" #: src/lifetimes/solution.md msgid "\"home\"" -msgstr "" +msgstr "\"خانه\"" #: src/welcome-day-4.md #, fuzzy @@ -9879,7 +9881,7 @@ msgstr "" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" -msgstr "" +msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" @@ -9908,7 +9910,7 @@ msgstr "" #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" -msgstr "" +msgstr "\"point = {x}, {y}\"" #: src/iterators/intoiterator.md msgid "" @@ -9962,8 +9964,9 @@ msgid "" msgstr "" #: src/iterators/fromiterator.md +#, fuzzy msgid "\"prime_squares: {prime_squares:?}\"" -msgstr "" +msgstr "\"prime_squares: {prime_squares:?}\"" #: src/iterators/fromiterator.md msgid "`Iterator` implements" @@ -10030,11 +10033,11 @@ msgstr "" #: src/modules/modules.md msgid "\"In the foo module\"" -msgstr "" +msgstr "\"در ماژول foo\"" #: src/modules/modules.md msgid "\"In the bar module\"" -msgstr "" +msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" @@ -10154,19 +10157,19 @@ msgstr "" #: src/modules/visibility.md msgid "\"outer::private\"" -msgstr "" +msgstr "\"outer::private\"" #: src/modules/visibility.md msgid "\"outer::public\"" -msgstr "" +msgstr "\"outer::public\"" #: src/modules/visibility.md msgid "\"outer::inner::private\"" -msgstr "" +msgstr "\"outer::inner::private\"" #: src/modules/visibility.md msgid "\"outer::inner::public\"" -msgstr "" +msgstr "\"outer::inner::public\"" #: src/modules/visibility.md msgid "Use the `pub` keyword to make modules public." @@ -10316,7 +10319,7 @@ msgstr "" #: src/modules/exercise.md src/modules/solution.md msgid "\"{buffer}\"" -msgstr "" +msgstr "\"{buffer}\"" #: src/modules/exercise.md msgid "// Add 4 paddings for borders\n" @@ -10331,19 +10334,19 @@ msgstr "" #: src/modules/exercise.md src/modules/solution.md msgid "\"+-{:-\\n\"" -msgstr "" +msgstr "\"\\n\"" #: src/unsafe-rust/solution.md msgid "\"crab.rs\"" -msgstr "" +msgstr "\"crab.rs\"" #: src/unsafe-rust/solution.md msgid "\"//! Crab\\n\"" -msgstr "" +msgstr "\"//! Crab\\n\"" #: src/android.md msgid "Welcome to Rust in Android" @@ -14000,7 +14005,7 @@ msgstr "" #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" -msgstr "\"fallible1 requires depth > 0\"" +msgstr "\"fallible1 به عمق > 0 نیاز دارد\"" #: src/android/interoperability/cpp/rust-result.md msgid "\"Success!\"" @@ -17750,7 +17755,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "\"Real-Time Interrupt-driven Concurrency\"" -msgstr "" +msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -17777,7 +17782,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" -msgstr "" +msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -17952,7 +17957,7 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md msgid "\"Ready.\"" -msgstr "" +msgstr "\"آماده.\"" #: src/exercises/bare-metal/solutions-morning.md msgid "// Read compass data and log it to the serial port.\n" @@ -17960,7 +17965,7 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md msgid "\"{},{},{}\\t{},{},{}\"" -msgstr "" +msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md msgid "" @@ -19959,7 +19964,7 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" -msgstr "" +msgstr "\"دریافت شد: {:؟}\"" #: src/concurrency/channels/senders-receivers.md msgid "" @@ -19980,19 +19985,19 @@ msgstr "" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Message {i}\"" -msgstr "" +msgstr "\"Message {i}\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: sent Message {i}\"" -msgstr "" +msgstr "\"{thread_id:?}: sent Message {i}\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: done\"" -msgstr "" +msgstr "\"{thread_id:?}: انجام شد\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Main: got {msg}\"" -msgstr "" +msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md msgid "" @@ -21072,9 +21077,8 @@ msgid "A large ecosystem of libraries." msgstr "اکوسیستم بزرگی از کتابخانه‌ها." #: src/concurrency/async/runtimes/tokio.md -#, fuzzy msgid "\"Count in task: {i}!\"" -msgstr "\"connection from {addr:?}\"" +msgstr "\"شمارش task: {i}!\"" #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21376,7 +21380,7 @@ msgstr "\"Failed to send ping.\"" #: src/concurrency/async-control-flow/select.md msgid "\"Listener failed\"" -msgstr "" +msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" From d82e18ae104ce61a81f7a0544f0622cec05bb4b4 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Sep 2024 23:14:02 +0330 Subject: [PATCH 71/92] fa: fix msgid 606 --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 03d86dc14d5..a70ad4a0c67 100644 --- a/po/fa.po +++ b/po/fa.po @@ -603,8 +603,8 @@ msgid "Test Modules" msgstr "تست‌ ماژول‌ها" #: src/SUMMARY.md src/testing.md src/testing/other.md -msgid "انواع دیگر تست‌ها" -msgstr "" +msgid "Other Types of Tests" +msgstr "انواع دیگر تست‌ها" #: src/SUMMARY.md src/testing.md src/testing/lints.md msgid "Compiler Lints and Clippy" From f2ccd40124c60f49c951a648d104d75acb43f9e3 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Sep 2024 23:37:45 +0330 Subject: [PATCH 72/92] fa: fixL question mark LTR --- po/fa.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/fa.po b/po/fa.po index a70ad4a0c67..f6b0825e00e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -5386,7 +5386,7 @@ msgstr "" #: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md msgid "\"result: {:?}\"" -msgstr "\"نتیجه: {:؟}\"" +msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md #: src/smart-pointers/solution.md src/testing/solution.md @@ -5989,7 +5989,7 @@ msgstr "" #: src/generics/generic-functions.md msgid "\"picked a number: {:?}\"" -msgstr "\"شماره ای را انتخاب کرد: {:؟}\"" +msgstr "\"شماره ای را انتخاب کرد: {:?}\"" #: src/generics/generic-functions.md msgid "\"picked a tuple: {:?}\"" @@ -11825,7 +11825,7 @@ msgstr "" #: src/unsafe-rust/solution.md msgid "\"Could not open {:?}\"" -msgstr "\"نمی‌توان {:؟} را باز کرد\"" +msgstr "\"نمی‌توان {:?} را باز کرد\"" #: src/unsafe-rust/solution.md msgid "" @@ -11849,7 +11849,7 @@ msgstr "" #: src/unsafe-rust/solution.md msgid "\"Could not close {:?}\"" -msgstr "\"نمی‌توان {:؟} را ببندد\"" +msgstr "\"نمی‌توان {:?} را ببندد\"" #: src/unsafe-rust/solution.md msgid "\"no-such-directory\"" @@ -19964,7 +19964,7 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" -msgstr "\"دریافت شد: {:؟}\"" +msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" From 5d30c50faa94538f6f4225f981155c5b5786b7f3 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 12 Sep 2024 23:50:09 +0330 Subject: [PATCH 73/92] fa: fix: resolve --- po/fa.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index f6b0825e00e..19d9e1fcdb6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -5597,7 +5597,7 @@ msgstr "\"مسابقه {} به پایان رسید، کل زمان دور: {}\"" #: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" -msgstr "«جایزه بزرگ موناکو»" +msgstr "جایزه بزرگ موناکو" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" @@ -7120,7 +7120,7 @@ msgstr "\"سیب\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"orange\"" -msgstr "نارنجی" +msgstr "\"orange\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"got {} apples\"" @@ -9700,7 +9700,7 @@ msgstr "\"نوع سیم نامعتبر: {value}\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected string to be a `Len` field\"" -msgstr "\"انتظار می‌رود که رشته یک فیلد \"Len\" باشد\"" +msgstr "\"انتظار می‌رود که رشته یک فیلد Len باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy From 6367212d6f3159465cf64ab66f36e7d2160b7bc5 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 13 Sep 2024 00:14:47 +0330 Subject: [PATCH 74/92] fa: fix resolve error --- po/fa.po | 15487 +++++++++++++++++++++++------------------------------ 1 file changed, 6689 insertions(+), 8798 deletions(-) diff --git a/po/fa.po b/po/fa.po index 19d9e1fcdb6..ce2fcfae5e3 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-12 23:03+0330\n" +"PO-Revision-Date: 2024-09-13 00:14+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -52,15 +52,14 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md +#: src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md -#: src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -76,8 +75,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -101,21 +100,19 @@ msgstr "تعیین تایپ ضمنی" msgid "Exercise: Fibonacci" msgstr "تمرین: دنباله فیبوناچی" -#: src/SUMMARY.md src/types-and-values/solution.md -#: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md -#: src/references/solution.md src/user-defined-types/solution.md -#: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md -#: src/std-traits/solution.md src/memory-management/solution.md -#: src/smart-pointers/solution.md src/borrowing/solution.md -#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md -#: src/testing/solution.md src/error-handling/solution.md +#: src/SUMMARY.md src/types-and-values/solution.md src/control-flow-basics/solution.md +#: src/tuples-and-arrays/solution.md src/references/solution.md +#: src/user-defined-types/solution.md src/pattern-matching/solution.md +#: src/methods-and-traits/solution.md src/generics/solution.md src/std-types/solution.md +#: src/std-traits/solution.md src/memory-management/solution.md src/smart-pointers/solution.md +#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md +#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -143,8 +140,7 @@ msgstr "`break` و `continue`" msgid "Labels" msgstr "برچسب‌ها" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/blocks-and-scopes.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/blocks-and-scopes.md msgid "Blocks and Scopes" msgstr "بلوک‌ها و محدوده‌ها" @@ -152,8 +148,7 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -161,8 +156,7 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -170,8 +164,8 @@ msgstr "تمرین: دنباله Collatz" msgid "Day 1: Afternoon" msgstr "روز ۱: بعد از ظهر" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "تاپل ها و آرایه ها" @@ -187,8 +181,7 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -196,8 +189,8 @@ msgstr "الگو‌ها و ضدِ ساختارها" msgid "Exercise: Nested Arrays" msgstr "تمرین: آرایه‌های تو در تو" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1-afternoon.md src/references.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/references.md msgid "References" msgstr "مراجع" @@ -221,18 +214,16 @@ msgstr "رشته‌ها" msgid "Exercise: Geometry" msgstr "تمرین: هندسه" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1-afternoon.md src/user-defined-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/user-defined-types.md msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -261,8 +252,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -279,8 +270,7 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md -#: src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -288,8 +278,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -325,8 +315,8 @@ msgstr "تمرین: توابع Generic" msgid "Day 2: Afternoon" msgstr "روز دوم: عصر" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2-afternoon.md src/generics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/generics.md msgid "Generics" msgstr "Generics" @@ -358,8 +348,8 @@ msgstr "`dyn Trait`" msgid "Exercise: Generic `min`" msgstr "تمرین: Generic `min`" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2-afternoon.md src/std-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/std-types.md msgid "Standard Library Types" msgstr "کتابخانه‌ استاندارد تایپ‌ها" @@ -396,8 +386,8 @@ msgstr "`HashMap`" msgid "Exercise: Counter" msgstr "تمرین: شمارنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2-afternoon.md src/std-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/std-traits.md msgid "Standard Library Traits" msgstr "کتابخانه استاندارد Traits" @@ -438,8 +428,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -475,13 +465,12 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" -#: src/SUMMARY.md src/smart-pointers/box.md -#: src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/smart-pointers/box.md src/android/interoperability/cpp/type-mapping.md msgid "`Box`" msgstr "`. If you are reading somewhere else, please check there " -"for updates." +"The latest version of the course can be found at . If you are reading somewhere else, please check there for updates." msgstr "" -"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " -"نیز بررسی کنید." +"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر " +"از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language " -"in the top right corner of the page or check the [Translations](running-the-" -"course/translations.md) page for a list of all available translations." +"The course is available in other languages. Select your preferred language in the top right " +"corner of the page or check the [Translations](running-the-course/translations.md) page for a " +"list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " -"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " -"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای صفحه انتخاب " +"کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای فهرستی از تمام ترجمه‌های " +"موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1392,11 +1361,9 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know " -"anything about Rust and hope to:" -msgstr "" -"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " -"نمی دانید :" +"The goal of the course is to teach you Rust. We assume you don't know anything about Rust and " +"hope to:" +msgstr "هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1405,8 +1372,7 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " -"در Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1417,51 +1383,44 @@ msgid "We call the first four course days Rust Fundamentals." msgstr "ما چهار روز اول دوره را اصول Rust می نامیم." #: src/index.md -msgid "" -"Building on this, you're invited to dive into one or more specialized topics:" -msgstr "" -"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgid "Building on this, you're invited to dive into one or more specialized topics:" +msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" -"[Android](android.md): a half-day course on using Rust for Android platform " -"development (AOSP). This includes interoperability with C, C++, and Java." +"[Android](android.md): a half-day course on using Rust for Android platform development " +"(AOSP). This includes interoperability with C, C++, and Java." msgstr "" -"[Android](android.md): یک دوره نیم روزه استفاده از Rust برای توسعه پلت فرم " -"اندروید (AOSP). این شامل قابلیت همکاری با C، C ++و Java است." +"[Android](android.md): یک دوره نیم روزه استفاده از Rust برای توسعه پلت فرم اندروید (AOSP). " +"این شامل قابلیت همکاری با C، C ++و Java است." #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium " -"based browsers. This includes interoperability with C++ and how to include " -"third-party crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium based browsers. This " +"includes interoperability with C++ and how to include third-party crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " -"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " -"جعبه های(crates) شخص ثالث در کروم است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای مبتنی بر " +"Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه های(crates) شخص ثالث در کروم " +"است." #: src/index.md msgid "" -"[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal " -"(embedded) development. Both microcontrollers and application processors are " -"covered." +"[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal (embedded) " +"development. Both microcontrollers and application processors are covered." msgstr "" -"[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " -"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " -"داده شده اند." +"[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای توسعهbare-metal " +"(تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " -"Rust. We cover both classical concurrency (preemptively scheduling using " -"threads and mutexes) and async/await concurrency (cooperative multitasking " -"using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. We cover both " +"classical concurrency (preemptively scheduling using threads and mutexes) and async/await " +"concurrency (cooperative multitasking using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " -"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " -"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " -"استفاده از futures را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. ما هر دو " +"مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و mutexها ) و async/" +"await concurrency (multitasking مشارکتی) با استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1469,21 +1428,21 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few " -"days. Some non-goals of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few days. Some non-goals " +"of this course are:" msgstr "" -"زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." -"چندتا از اهداف خارج از این دوره عبارتند از:" +"زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم.چندتا از اهداف " +"خارج از این دوره عبارتند از:" #: src/index.md msgid "" -"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) instead." +"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book](https://doc.rust-" +"lang.org/book/ch19-06-macros.html) and [Rust by Example](https://doc.rust-lang.org/rust-by-" +"example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://doc.rust-lang." +"org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-lang.org/rust-by-example/" +"macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1491,32 +1450,32 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"The course assumes that you already know how to program. Rust is a statically-typed language " +"and we will sometimes make comparisons with C and C++ to better explain or contrast the Rust " +"approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " -"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا رویکرد‌های Rust " +"را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" -"If you know how to program in a dynamically-typed language such as Python or " -"JavaScript, then you will be able to follow along just fine too." +"If you know how to program in a dynamically-typed language such as Python or JavaScript, then " +"you will be able to follow along just fine too." msgstr "" -"اگر می‌دانید چگونه به زبانی با دینامیک تایپ مانند پایتون یا جاوا اسکریپت " -"برنامه‌نویسی کنید می‌توانید به خوبی این روش را دنبال کنید." +"اگر می‌دانید چگونه به زبانی با دینامیک تایپ مانند پایتون یا جاوا اسکریپت برنامه‌نویسی کنید " +"می‌توانید به خوبی این روش را دنبال کنید." #: src/index.md msgid "" -"This is an example of a _speaker note_. We will use these to add additional " -"information to the slides. This could be key points which the instructor " -"should cover as well as answers to typical questions which come up in class." +"This is an example of a _speaker note_. We will use these to add additional information to the " +"slides. This could be key points which the instructor should cover as well as answers to " +"typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " -"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " -"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات بیشتری را " +"ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و همچنین پاسخ به سوالات رایجی " +"که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1524,24 +1483,21 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the " -"course internally at Google." -msgstr "" -"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the course internally at " +"Google." +msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " -"in the middle. This leaves 3 hours for the morning class and 3 hours for the " -"afternoon class. Both sessions contain multiple breaks and time for students " -"to work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in the middle. " +"This leaves 3 hours for the morning class and 3 hours for the afternoon class. Both sessions " +"contain multiple breaks and time for students to work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " -"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " -"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " -"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " -"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " -"ظهر خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت ناهار در میانه " +"روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته " +"باشید که این فقط یک توصیه است: شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد " +"کنید. نکته منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر " +"خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1549,103 +1505,91 @@ msgstr "قبل از اجرای دوره، شما می خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker " -"notes to help highlight the key points (please help us by contributing more " -"speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"Make yourself familiar with the course material. We've included speaker notes to help " +"highlight the key points (please help us by contributing more speaker notes!). When " +"presenting, you should make sure to open the speaker notes in a popup (click the link with a " +"little arrow next to \"Speaker Notes\"). This way you have a clean screen to present to the " +"class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " -"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " -"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " -"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " -"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات کلیدی " +"گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). هنگام ارائه، باید " +"مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در " +"کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید " +"داشت." #: src/running-the-course.md msgid "" -"Decide on the dates. Since the course takes four days, we recommend that you " -"schedule the days over two weeks. Course participants have said that they " -"find it helpful to have a gap in the course since it helps them process all " -"the information we give them." +"Decide on the dates. Since the course takes four days, we recommend that you schedule the days " +"over two weeks. Course participants have said that they find it helpful to have a gap in the " +"course since it helps them process all the information we give them." msgstr "" -"در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " -"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " -"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " -"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول می‌کشد، توصیه " +"می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره گفته‌اند که داشتن فاصله‌ای در " +"دوره مفید است، زیرا به آنها کمک می‌کند تا تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a " -"class size of 15-25 people. That's small enough that people are comfortable " -"asking questions --- it's also small enough that one instructor will have " -"time to answer the questions. Make sure the room has _desks_ for yourself " -"and for the students: you will all need to be able to sit and work with your " -"laptops. In particular, you will be doing a lot of live-coding as an " -"instructor, so a lectern won't be very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " -"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " -"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " -"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " -"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" -"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " -"نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a class size of 15-25 " +"people. That's small enough that people are comfortable asking questions --- it's also small " +"enough that one instructor will have time to answer the questions. Make sure the room has " +"_desks_ for yourself and for the students: you will all need to be able to sit and work with " +"your laptops. In particular, you will be doing a lot of live-coding as an instructor, so a " +"lectern won't be very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر را پیشنهاد " +"می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین مدرس وقت کافی برای پاسخ‌ " +"دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما " +"همگی نیاز دارید که بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی " +"live-coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things " -"up. We recommend presenting directly using `mdbook serve` running on your " -"laptop (see the [installation instructions](https://github.com/google/" -"comprehensive-rust#building)). This ensures optimal performance with no lag " -"as you change pages. Using your laptop will also allow you to fix typos as " -"you or the course participants spot them." +"On the day of your course, show up to the room a little early to set things up. We recommend " +"presenting directly using `mdbook serve` running on your laptop (see the [installation " +"instructions](https://github.com/google/comprehensive-rust#building)). This ensures optimal " +"performance with no lag as you change pages. Using your laptop will also allow you to fix " +"typos as you or the course participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " -"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " -"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " -"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " -"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " -"شما یا شرکت کنندگان در دوره اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه می کنیم " +"مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای نصب](https://github." +"com/google/comprehensive-rust#building) را ببنیید). با این کار عملکرد بدون تاخیر در هنگام " +"تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در " +"صورت مشاهده شما یا شرکت کنندگان در دوره اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We " -"typically spend 30-45 minutes on exercises in the morning and in the " -"afternoon (including time to review the solutions). Make sure to ask people " -"if they're stuck or if there is anything you can help with. When you see " -"that several people have the same problem, call it out to the class and " -"offer a solution, e.g., by showing people where to find the relevant " -"information in the standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " -"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " -"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " -"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " -"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " -"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " -"کنند." +"Let people solve the exercises by themselves or in small groups. We typically spend 30-45 " +"minutes on exercises in the morning and in the afternoon (including time to review the " +"solutions). Make sure to ask people if they're stuck or if there is anything you can help " +"with. When you see that several people have the same problem, call it out to the class and " +"offer a solution, e.g., by showing people where to find the relevant information in the " +"standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ الی ۴۵ دقیقه را " +"برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) صرف می‌کنیم. حتما از افراد " +"بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که می‌توانید به آنها کمک کنید. وقتی که می‌بینید " +"چندین نفر مشکل یکسانی دارند, خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن " +"جایی که می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun " -"for you as it has been for us!" +"That is all, good luck running the course! We hope it will be as much fun for you as it has " +"been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " -"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه که برای ما " +"لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" -"Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We " -"would love to hear what worked well for you and what can be made better. " -"Your students are also very welcome to [send us feedback](https://github.com/" -"google/comprehensive-rust/discussions/100)!" +"Please [provide feedback](https://github.com/google/comprehensive-rust/discussions/86) " +"afterwards so that we can keep improving the course. We would love to hear what worked well " +"for you and what can be made better. Your students are also very welcome to [send us feedback]" +"(https://github.com/google/comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" -"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " -"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " -"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" -"github.com/google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/discussions/86) " +"تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم بشنویم چه چیزی برای شما خوب بوده و " +"چه چیزی می تواند بهتر شود. همینطور شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال " +"کنید](https://github.com/google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1653,11 +1597,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " -"days are fast paced and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days are fast paced " +"and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " -"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز با سرعت " +"بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1667,54 +1611,46 @@ msgstr "مباحث دوره:" msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" msgstr "روز ۱ صبح (۲ ساعت و ۵ دقیقه با احتساب استراحت)" -#: src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/welcome-day-1-afternoon.md src/welcome-day-2.md -#: src/welcome-day-2-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4.md -#: src/welcome-day-4-afternoon.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md src/welcome-day-1-afternoon.md +#: src/welcome-day-2.md src/welcome-day-2-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4.md src/welcome-day-4-afternoon.md +#: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "Segment" msgstr "بخش" -#: src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md -#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md -#: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md -#: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md -#: src/std-types.md src/std-traits.md src/welcome-day-3.md -#: src/memory-management.md src/smart-pointers.md -#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md -#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md src/hello-world.md +#: src/types-and-values.md src/control-flow-basics.md src/welcome-day-1-afternoon.md +#: src/tuples-and-arrays.md src/references.md src/user-defined-types.md src/welcome-day-2.md +#: src/pattern-matching.md src/methods-and-traits.md src/welcome-day-2-afternoon.md +#: src/generics.md src/std-types.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md +#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md #: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/welcome.md src/concurrency/threads.md -#: src/concurrency/channels.md src/concurrency/send-sync.md -#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome.md src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md msgid "Duration" msgstr "مدت زمان" -#: src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md -#: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/lifetimes.md -#: src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/shared-state.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md src/types-and-values.md +#: src/control-flow-basics.md src/tuples-and-arrays.md src/user-defined-types.md src/generics.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md +#: src/lifetimes.md src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md -#: src/references.md src/user-defined-types.md src/methods-and-traits.md -#: src/modules.md src/concurrency/welcome.md src/concurrency/threads.md -#: src/concurrency/shared-state.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md src/types-and-values.md +#: src/control-flow-basics.md src/tuples-and-arrays.md src/references.md +#: src/user-defined-types.md src/methods-and-traits.md src/modules.md src/concurrency/welcome.md +#: src/concurrency/threads.md src/concurrency/shared-state.md msgid "15 minutes" msgstr "۱۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/welcome-day-4.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md src/welcome-day-4.md msgid "40 minutes" msgstr "۴۰ دقیقه" @@ -1726,14 +1662,13 @@ msgstr "روز ۱ بعد از ظهر (۲ ساعت و ۳۵ دقیقه،شامل msgid "35 minutes" msgstr "۳۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md -#: src/welcome-day-3.md src/welcome-day-3-afternoon.md -#: src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/concurrency/welcome-async.md msgid "55 minutes" msgstr "۵۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md -#: src/welcome-day-2.md src/welcome-day-3-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: src/welcome-day-3-afternoon.md msgid "50 minutes" msgstr "۵۰ دقیقه" @@ -1741,17 +1676,15 @@ msgstr "۵۰ دقیقه" msgid "Day 2 Morning (2 hours and 10 minutes, including breaks)" msgstr "روز ۲ صبح (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md src/hello-world.md -#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md -#: src/welcome-day-2.md src/methods-and-traits.md src/std-types.md -#: src/welcome-day-3.md src/borrowing.md src/welcome-day-4.md src/modules.md -#: src/testing.md src/error-handling.md +#: src/running-the-course/course-structure.md src/hello-world.md src/types-and-values.md +#: src/control-flow-basics.md src/tuples-and-arrays.md src/welcome-day-2.md +#: src/methods-and-traits.md src/std-types.md src/welcome-day-3.md src/borrowing.md +#: src/welcome-day-4.md src/modules.md src/testing.md src/error-handling.md msgid "3 minutes" msgstr "۳ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/welcome-day-2-afternoon.md src/welcome-day-3.md -#: src/welcome-day-4-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-2.md src/welcome-day-2-afternoon.md +#: src/welcome-day-3.md src/welcome-day-4-afternoon.md msgid "1 hour" msgstr "۱ ساعت" @@ -1759,8 +1692,7 @@ msgstr "۱ ساعت" msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" msgstr "روز ۲ بعد از ظهر (۴ ساعت و ۵ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md -#: src/welcome-day-4.md +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md src/welcome-day-4.md msgid "45 minutes" msgstr "۴۵ دقیقه" @@ -1795,11 +1727,8 @@ msgstr "عمیق تر شدن" #: src/running-the-course/course-structure.md msgid "" -"In addition to the 4-day class on Rust Fundamentals, we cover some more " -"specialized topics:" -msgstr "" -"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " -"دهیم:" +"In addition to the 4-day class on Rust Fundamentals, we cover some more specialized topics:" +msgstr "علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1807,38 +1736,34 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using " -"Rust for Android platform development. This includes interoperability with " -"C, C++, and Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust for Android " +"platform development. This includes interoperability with C, C++, and Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " -"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " -"با C، C++ و جاوا می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده از Rust برای " +"توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا " +"می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/" -"download/downloading). Make a checkout of the [course repository](https://" -"github.com/google/comprehensive-rust) on the same machine and move the `src/" -"android/` directory into the root of your AOSP checkout. This will ensure " -"that the Android build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/downloading). " +"Make a checkout of the [course repository](https://github.com/google/comprehensive-rust) on " +"the same machine and move the `src/android/` directory into the root of your AOSP checkout. " +"This will ensure that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" -"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" -"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" -"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " -"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/download/" +"downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/google/comprehensive-" +"rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن ASOP قرار دهید. با این کار طمینان " +"حاصل می‌کنید که سیستم build اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build " -"all Android examples using `src/android/build_all.sh`. Read the script to " -"see the commands it runs and make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build all Android " +"examples using `src/android/build_all.sh`. Read the script to see the commands it runs and " +"make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " -"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " -"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " -"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه نمونه‌های " +"Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. اسکریپت را بخوانید تا " +"دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1846,25 +1771,23 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " -"using Rust as part of the Chromium browser. It includes using Rust in " -"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " -"and C++ interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using Rust as part of " +"the Chromium browser. It includes using Rust in Chromium's `gn` build system, bringing in " +"third-party libraries (\"crates\") and C++ interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " -"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " -"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" -"+C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به عنوان بخشی از " +"مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` Chromium، آوردن کتابخانه‌های " +"شخص ثالث (\"crates\") و قابلیت همکاری ++C است." #: src/running-the-course/course-structure.md msgid "" -"You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. " -"Ensure that you can run the Chromium browser that you've built." +"You will need to be able to build Chromium --- a debug, component build is [recommended](../" +"chromium/setup.md) for speed but any build will work. Ensure that you can run the Chromium " +"browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " -"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " -"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت [توصیه می شود] " +"(../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که می‌توانید مرورگر Chromium را " +"که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1872,25 +1795,22 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " -"using Rust for bare-metal (embedded) development. Both microcontrollers and " -"application processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using Rust for bare-" +"metal (embedded) development. Both microcontrollers and application processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " -"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " -"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " -"کارایی خاص را پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک روزه با تمرکز " +"بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل (embedded) است. این دوره هم " +"میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit]" -"(https://microbit.org/) v2 development board ahead of time. Everybody will " -"need to install a number of packages as described on the [welcome page](../" -"bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit](https://microbit.org/) " +"v2 development board ahead of time. Everybody will need to install a number of packages as " +"described on the [welcome page](../bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " -"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" -"(../bare-metal.md) توضیح داده شده نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 را خریداری " +"کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-metal.md) توضیح داده شده " +"نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1899,39 +1819,35 @@ msgstr "همزمانی در Rust" #: src/running-the-course/course-structure.md #, fuzzy msgid "" -"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " -"class on classical as well as `async`/`await` concurrency." +"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day class on " +"classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " -"شامل همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل همزمانی " +"کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready " -"to go. You can then copy/paste the examples into `src/main.rs` to experiment " -"with them:" +"You will need a fresh crate set up and the dependencies downloaded and ready to go. You can " +"then copy/paste the examples into `src/main.rs` to experiment with them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " -"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " -"آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. سپس می‌توانید " +"نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md src/pattern-matching.md -#: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md -#: src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/running-the-course/course-structure.md src/pattern-matching.md src/std-traits.md +#: src/smart-pointers.md src/lifetimes.md src/iterators.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async-exercises.md msgid "30 minutes" msgstr "۳۰ دقیقه" -#: src/running-the-course/course-structure.md src/methods-and-traits.md -#: src/std-types.md src/memory-management.md src/borrowing.md -#: src/concurrency/welcome.md src/concurrency/sync-exercises.md -#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-exercises.md +#: src/running-the-course/course-structure.md src/methods-and-traits.md src/std-types.md +#: src/memory-management.md src/borrowing.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md +#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md msgid "20 minutes" msgstr "۲۰ دقیقه" @@ -1949,11 +1865,10 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the " -"questions drive the exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the questions drive the " +"exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " -"Rust را هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1980,101 +1895,85 @@ msgid "s: Activate the search bar." msgstr "s: نوار جستجو را فعال می کند." #: src/running-the-course/translations.md -msgid "" -"The course has been translated into other languages by a set of wonderful " -"volunteers:" -msgstr "" -"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " -"است:" +msgid "The course has been translated into other languages by a set of wonderful volunteers:" +msgstr "این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " -"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " -"[@henrif75](https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by [@rastringer]" +"(https://github.com/rastringer), [@hugojacob](https://github.com/hugojacob), [@joaovicmendes]" +"(https://github.com/joaovicmendes), and [@henrif75](https://github.com/henrif75)." msgstr "" -"[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " -"[@henrif75](https://github.com/henrif75)." +"[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط [@rastringer]" +"(https://github.com/rastringer), [@hugojacob](https://github.com/hugojacob), [@joaovicmendes]" +"(https://github.com/joaovicmendes) و [@henrif75](https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " -"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" -"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" -"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by [@suetfei]" +"(https://github.com/suetfei), [@wnghl](https://github.com/wnghl), [@anlunx](https://github.com/" +"anlunx), [@kongy](https://github.com/kongy), [@noahdragon](https://github.com/noahdragon), " +"[@superwhd](https://github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" -"[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " -"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " -"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " -"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." -"com/nodmp)." +"[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط [@suetfei](https://" +"github.com/suetfei), [@wnghl](https://github.com/wnghl), [@anlunx](https://github.com/anlunx), " +"[@kongy](https://github.com/kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd]" +"(https://github.com/superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://" +"github.com/nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " -"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen), and [@johnathan79717](https://github.com/" -"johnathan79717)." +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by [@hueich]" +"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://" +"github.com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen), and [@johnathan79717]" +"(https://github.com/johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich](https://" +"github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://github." +"com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen) و [@johnathan79717](https://" +"github.com/johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" -"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " -"and [@kantasv](https://github.com/kantasv)." +"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN](https://github." +"com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), [@HidenoriKobayashi](https://" +"github.com/HidenoriKobayashi) and [@kantasv](https://github.com/kantasv)." msgstr "" -"[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" -"momotaro1105)." +"[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN](https://github.com/" +"CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " -"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." -"com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://github.com/" +"keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan](https://github.com/" +"jooyunghan), and [@namhyung](https://github.com/namhyung)." msgstr "" -"[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " -"[@jooyunghan](https://github.com/jooyunghan)." +"[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace](https://github.com/" +"keispace), [@jiyongp](https://github.com/jiyongp) و [@jooyunghan](https://github.com/" +"jooyunghan)." #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" -"(https://github.com/deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://github.com/" +"deavid)." msgstr "" -"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" -"(https://github.com/deavid)." +"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid](https://github.com/" +"deavid)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" -"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" -"yaremam) and [@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp](https://github." +"com/git-user-cpp), [@yaremam](https://github.com/yaremam) and [@reta](https://github.com/reta)." msgstr "" -"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" -"(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." +"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS](https://github.com/" +"KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "" -"Use the language picker in the top-right corner to switch between languages." -msgstr "" -"از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." +msgid "Use the language picker in the top-right corner to switch between languages." +msgstr "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." #: src/running-the-course/translations.md msgid "Incomplete Translations" @@ -2082,103 +1981,96 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most " -"recently updated translations:" +"There is a large number of in-progress translations. We link to the most recently updated " +"translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " -"پیوند می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" -"(https://github.com/younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://github.com/" +"younies)" msgstr "" -"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" -"(https://github.com/deavid)." +"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid](https://github.com/" +"deavid)." #: src/running-the-course/translations.md msgid "" -"[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" -"(https://github.com/raselmandol)." +"[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol](https://github." +"com/raselmandol)." msgstr "" -"[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol]" -"(https://github.com/raselmandol)." +"[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol](https://github." +"com/raselmandol)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" -"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " -"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" -"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" -"moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://github.com/" +"alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp](https://github.com/" +"hamidrezakp), [@javad-jafari](https://github.com/javad-jafari) and [@moaminsharifi](https://" +"github.com/moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich](https://" +"github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://github." +"com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen) و [@johnathan79717](https://" +"github.com/johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " -"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://github.com/" +"KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont](https://github.com/" +"AdrienBaudemont)." msgstr "" -"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" -"(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." +"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS](https://github.com/" +"KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" -"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://github.com/" +"Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" -"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://github.com/" +"Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by " -"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" -"github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder](https://" +"github.com/henrythebuilder) and [@detro](https://github.com/detro)." msgstr "" -"[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" -"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://github.com/" +"Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available " -"either [as of their last update](https://google.github.io/comprehensive-rust/" -"translation-report.html) or [synced to the latest version of the course]" -"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." +"The full list of translations with their current status is also available either [as of their " +"last update](https://google.github.io/comprehensive-rust/translation-report.html) or [synced " +"to the latest version of the course](https://google.github.io/comprehensive-rust/synced-" +"translation-report.html)." msgstr "" #: src/running-the-course/translations.md msgid "" -"If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " -"get going. Translations are coordinated on the [issue tracker](https://" -"github.com/google/comprehensive-rust/issues/282)." +"If you want to help with this effort, please see [our instructions](https://github.com/google/" +"comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get going. Translations are " +"coordinated on the [issue tracker](https://github.com/google/comprehensive-rust/issues/282)." msgstr "" -"اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" -"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " -"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" -"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." +"اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/google/" +"comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار ببینید. ترجمه ها در " +"[issue tracker](https://github.com/google/comprehensive-rust/issues/282) هماهنگ و کنترل می " +"شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc." -"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " -"and run Rust applications. Here we want to give a brief overview of what " -"Cargo is and how it fits into the wider ecosystem and how it fits into this " -"training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-lang.org/" +"cargo/), the standard tool used in the Rust ecosystem to build and run Rust applications. Here " +"we want to give a brief overview of what Cargo is and how it fits into the wider ecosystem and " +"how it fits into this training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." -"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " -"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " -"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " -"را در این آموزش ارائه دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-lang.org/" +"cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه های Rust استفاده می " +"شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در مورد کارگو و نحوه انطباق آن با " +"اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه دهیم." #: src/cargo.md msgid "Installation" @@ -2190,49 +2082,44 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will " -"pass them to `rustc` when building your project. Cargo also comes with a " -"built-in test runner which is used to execute unit tests." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to download dependencies, " +"usually hosted on , and it will pass them to `rustc` when building your " +"project. Cargo also comes with a built-in test runner which is used to execute unit tests." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " -"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " -"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " -"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها را که معمولاً " +"در میزبانی می شوند دانلود کند و هنگام ساخت پروژه آنها را به `rustc` منتقل " +"می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to " -"install and update `rustc` and `cargo` when new versions of Rust are " -"released. In addition, `rustup` can also download documentation for the " -"standard library. You can have multiple versions of Rust installed at once " -"and `rustup` will let you switch between them as needed." -msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " -"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " -"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " -"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " -"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." - -#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md -#: src/references/exclusive.md src/memory-management/move.md -#: src/error-handling/try.md src/android/setup.md +"`rustup`: the Rust toolchain installer and updater. This tool is used to install and update " +"`rustc` and `cargo` when new versions of Rust are released. In addition, `rustup` can also " +"download documentation for the standard library. You can have multiple versions of Rust " +"installed at once and `rustup` will let you switch between them as needed." +msgstr "" +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز رسانی " +"\"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. علاوه بر این، " +"\"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود کند. شما می توانید چندین " +"نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها " +"تغییر دهید." + +#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md src/references/exclusive.md +#: src/memory-management/move.md src/error-handling/try.md src/android/setup.md #: src/concurrency/async/async-await.md msgid "Key points:" msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six " -"weeks. New releases maintain backwards compatibility with old releases --- " -"plus they enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six weeks. New releases " +"maintain backwards compatibility with old releases --- plus they enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " -"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " -"علاوه قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر می شود. " +"نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "" -"There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes " -"\"stable\" every six weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" every six " +"weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " -"هفته \"stable\" می شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته \"stable\" می " +"شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc." -"rust-lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc.rust-lang.org/" +"cargo/reference/registries.html), git, folders, and more." msgstr "" -"همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" -"reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." +"همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/reference/" +"registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current edition is " +"Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " -"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه فعلی Rust " +"2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md -msgid "" -"The editions are allowed to make backwards incompatible changes to the " -"language." +msgid "The editions are allowed to make backwards incompatible changes to the language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for " -"your crate via the `Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for your crate via the " +"`Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " -"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد نظر برای crate " +"خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" -"To avoid splitting the ecosystem, Rust compilers can mix code written for " -"different editions." +"To avoid splitting the ecosystem, Rust compilers can mix code written for different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " -"برای نسخه های مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای نسخه های " +"مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" -"Mention that it is quite rare to ever use the compiler directly not through " -"`cargo` (most users never do)." +"Mention that it is quite rare to ever use the compiler directly not through `cargo` (most " +"users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " -"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` بسیار " +"غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" -"It might be worth alluding that Cargo itself is an extremely powerful and " -"comprehensive tool. It is capable of many advanced features including but " -"not limited to:" +"It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool. " +"It is capable of many advanced features including but not limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " -"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است که قادر به " +"بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2370,42 +2242,31 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "" -"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" msgstr "وابستگی های Dev و وابستگی‌های Runtime Management/Caching" #: src/cargo/rust-ecosystem.md -msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" -msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +msgid "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +msgstr "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" #: src/cargo/rust-ecosystem.md -msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" -msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +msgid "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +msgstr "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo " -"clippy](https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo clippy](https://github." +"com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" -"lang/rust-clippy)) قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/rust-clippy)) " +"قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "" -"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "" -"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2413,23 +2274,23 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" -"For this training, we will mostly explore the Rust language through examples " -"which can be executed through your browser. This makes the setup much easier " -"and ensures a consistent experience for everyone." +"For this training, we will mostly explore the Rust language through examples which can be " +"executed through your browser. This makes the setup much easier and ensures a consistent " +"experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " -"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " -"کند و تجربه ای ثابت را برای همه تضمین می کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر شما اجرا کرد، " +"بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه ای ثابت را برای همه تضمین می " +"کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do " -"the exercises. On the last day, we will do a larger exercise which shows you " -"how to work with dependencies and for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do the exercises. On " +"the last day, we will do a larger exercise which shows you how to work with dependencies and " +"for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " -"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " -"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. در روز آخر، " +"تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با وابستگی ها کار کنید و برای " +"این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2441,36 +2302,34 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy -msgid "" -"You can use Ctrl + Enter to execute the code when focus is in the " -"text box." +msgid "You can use Ctrl + Enter to execute the code when focus is in the text box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md msgid "" -"Most code samples are editable like shown above. A few code samples are not " -"editable for various reasons:" +"Most code samples are editable like shown above. A few code samples are not editable for " +"various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " -"کد به دلایل مختلف قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به دلایل مختلف " +"قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " -"open it in the real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open it in the " +"real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " -"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و آن را در " +"Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from " -"the page! This is the reason that the students should solve the exercises " -"using a local Rust installation or via the Playground." +"The embedded playgrounds lose their state the moment you navigate away from the page! This is " +"the reason that the students should solve the exercises using a local Rust installation or via " +"the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " -"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " -"استفاده از local Rust installation یا از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را از دست می " +"دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از local Rust installation یا " +"از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2478,60 +2337,48 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will " -"need to first install Rust. Do this by following the [instructions in the " -"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " -"should give you a working `rustc` and `cargo`. At the time of writing, the " -"latest stable Rust release has these version numbers:" +"If you want to experiment with the code on your own system, then you will need to first " +"install Rust. Do this by following the [instructions in the Rust Book](https://doc.rust-lang." +"org/book/ch01-01-installation.html). This should give you a working `rustc` and `cargo`. At " +"the time of writing, the latest stable Rust release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " -"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" -"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " -"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " -"این version numberها است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این کار را با " +"دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/book/ch01-01-installation." +"html) انجام دهید. این باید به شما یک `rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه " +"پایدار Rust دارای این version numberها است:" #: src/cargo/running-locally.md -msgid "" -"You can use any later version too since Rust maintains backwards " -"compatibility." +msgid "You can use any later version too since Rust maintains backwards compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " -"های قبلی را حفظ می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های قبلی را حفظ " +"می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of " -"the examples in this training:" +"With this in place, follow these steps to build a Rust binary from one of the examples in this " +"training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " -"باینری Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "" -"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md -msgid "" -"Use `cargo new exercise` to create a new `exercise/` directory for your code:" -msgstr "" -"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " -"استفاده کنید:" +msgid "Use `cargo new exercise` to create a new `exercise/` directory for your code:" +msgstr "از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده کنید:" #: src/cargo/running-locally.md -msgid "" -"Navigate into `exercise/` and use `cargo run` to build and run your binary:" -msgstr "" -"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " -"کنید:" +msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgstr "به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For " -"example, using the example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For example, using the " +"example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " -"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از مثال در صفحه " +"قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2539,55 +2386,47 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo " -"build` to compile it without running it. You will find the output in `target/" -"debug/` for a normal debug build. Use `cargo build --release` to produce an " -"optimized release build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo build` to compile it " +"without running it. You will find the output in `target/debug/` for a normal debug build. Use " +"`cargo build --release` to produce an optimized release build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " -"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" -"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " -"شده در `target/release/` از `cargo build --release` استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo build` برای " +"کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای ساخت اشکال زدایی معمولی " +"خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/release/` از `cargo build --release` " +"استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you " -"run `cargo` commands, it will automatically download and compile missing " -"dependencies for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you run `cargo` " +"commands, it will automatically download and compile missing dependencies for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " -"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " -"نیاز را برای شما دانلود و کامپایل می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که دستورات " +"`cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما دانلود و کامپایل " +"می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local " -"editor. It will make their life easier since they will have a normal " -"development environment." +"Try to encourage the class participants to install Cargo and use a local editor. It will make " +"their life easier since they will have a normal development environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " -"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " -"محیط توسعه عادی خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر محلی استفاده " +"کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md -msgid "" -"This is the first day of Rust Fundamentals. We will cover a lot of ground " -"today:" -msgstr "" -"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " -"داد:" +msgid "This is the first day of Rust Fundamentals. We will cover a lot of ground today:" +msgstr "این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" #: src/welcome-day-1.md msgid "" -"Basic Rust syntax: variables, scalar and compound types, enums, structs, " -"references, functions, and methods." +"Basic Rust syntax: variables, scalar and compound types, enums, structs, references, " +"functions, and methods." msgstr "" -" سینتکس‌های مقدماتی: متغیرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, " -"مراجع, توابع, و متدها." +" سینتکس‌های مقدماتی: متغیرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, مراجع, توابع, و " +"متدها." #: src/welcome-day-1.md msgid "Types and type inference." @@ -2605,136 +2444,113 @@ msgstr "تایپ های تعریف شده توسط کاربر: ساختارها msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." -#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md +#: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 " -"minutes. It contains:" -msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. It contains:" +msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "" -"They should ask questions when they get them, don't save them to the end." -msgstr "" -"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "They should ask questions when they get them, don't save them to the end." +msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md -msgid "" -"The class is meant to be interactive and discussions are very much " -"encouraged!" +msgid "The class is meant to be interactive and discussions are very much encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., " -"keep the discussions related to how Rust does things vs some other language. " -"It can be hard to find the right balance, but err on the side of allowing " -"discussions since they engage people much more than one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., keep the discussions " +"related to how Rust does things vs some other language. It can be hard to find the right " +"balance, but err on the side of allowing discussions since they engage people much more than " +"one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " -"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " -"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " -"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های مرتبط با نحوه " +"انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا کردن تعادل مناسب می تواند " +"سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد " +"را درگیر می کنند." #: src/welcome-day-1.md -msgid "" -"The questions will likely mean that we talk about things ahead of the slides." -msgstr "" -"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " -"کنیم." +msgid "The questions will likely mean that we talk about things ahead of the slides." +msgstr "احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. " -"Remember that the slides are just a support and you are free to skip them as " -"you like." +"This is perfectly okay! Repetition is an important part of learning. Remember that the slides " +"are just a support and you are free to skip them as you like." msgstr "" -"این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " -"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " -"صرف نظر کنید." +"این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که اسلایدها فقط یک " +"پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that " -"should have immediate parallels in other languages. The more advanced parts " -"of Rust come on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that should have immediate " +"parallels in other languages. The more advanced parts of Rust come on the subsequent days." msgstr "" -"ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " -"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " -"شوند." +"ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر مشابهت های فوری " +"داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." #: src/welcome-day-1.md msgid "" -"If you're teaching this in a classroom, this is a good place to go over the " -"schedule. Note that there is an exercise at the end of each segment, " -"followed by a break. Plan to cover the exercise solution after the break. " -"The times listed here are a suggestion in order to keep the course on " -"schedule. Feel free to be flexible and adjust as necessary!" +"If you're teaching this in a classroom, this is a good place to go over the schedule. Note " +"that there is an exercise at the end of each segment, followed by a break. Plan to cover the " +"exercise solution after the break. The times listed here are a suggestion in order to keep the " +"course on schedule. Feel free to be flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " -"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " -"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " -"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " -"باشید و در صورت لزوم تنظیم کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه داشته باشید " +"که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن محلول تمرین بعد از " +"استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با " +"خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شامل:" -#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md -#: src/tuples-and-arrays.md src/references.md src/user-defined-types.md -#: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md -#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/threads.md src/concurrency/channels.md -#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/user-defined-types.md src/pattern-matching.md src/methods-and-traits.md +#: src/generics.md src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md +#: src/testing.md src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md src/concurrency/shared-state.md #: src/concurrency/sync-exercises.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" -#: src/hello-world.md src/references.md src/user-defined-types.md -#: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md -#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md -#: src/concurrency/shared-state.md src/concurrency/async.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/hello-world.md src/references.md src/user-defined-types.md src/pattern-matching.md +#: src/methods-and-traits.md src/generics.md src/std-types.md src/std-traits.md +#: src/memory-management.md src/smart-pointers.md src/borrowing.md src/lifetimes.md +#: src/modules.md src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/async.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md -#: src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015](https://blog.rust-lang." +"org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://blog.rust-lang." +"org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" -msgstr "" -"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." +msgstr "زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2742,11 +2558,11 @@ msgstr "`rustc` از `LLVM` به عنوان بک‌اند خود استفاده #: src/hello-world/what-is-rust.md msgid "" -"Rust supports many [platforms and architectures](https://doc.rust-lang.org/" -"nightly/rustc/platform-support.html):" +"Rust supports many [platforms and architectures](https://doc.rust-lang.org/nightly/rustc/" +"platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" -"rustc/platform-support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/platform-" +"support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2793,8 +2609,7 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "" -"Can be scaled down to very constrained devices such as microcontrollers." +msgid "Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2810,12 +2625,8 @@ msgid "Some unique selling points of Rust:" msgstr "برخی از نقاط قوت منحصر به فرد زبان Rust:" #: src/hello-world/benefits.md -msgid "" -"_Compile time memory safety_ - whole classes of memory bugs are prevented at " -"compile time" -msgstr "" -"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " -"می شود" +msgid "_Compile time memory safety_ - whole classes of memory bugs are prevented at compile time" +msgstr "_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2846,12 +2657,9 @@ msgid "No iterator invalidation." msgstr "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." #: src/hello-world/benefits.md -msgid "" -"_No undefined runtime behavior_ - what a Rust statement does is never left " -"unspecified" +msgid "_No undefined runtime behavior_ - what a Rust statement does is never left unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " -"نامشخص باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2862,11 +2670,8 @@ msgid "Integer overflow is defined (panic or wrap-around)." msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wrap-around`)." #: src/hello-world/benefits.md -msgid "" -"_Modern language features_ - as expressive and ergonomic as higher-level " -"languages" -msgstr "" -"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +msgid "_Modern language features_ - as expressive and ergonomic as higher-level languages" +msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2901,111 +2706,92 @@ msgid "Excellent Language Server Protocol support." msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md -msgid "" -"Do not spend much time here. All of these points will be covered in more " -"depth later." -msgstr "" -"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " -"خواهد شد." +msgid "Do not spend much time here. All of these points will be covered in more depth later." +msgstr "وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. " -"Depending on the answer you can highlight different features of Rust:" +"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 را برجسته کنید::" +"حتما از کلاس بپرسید که با چه زبان‌هایی تجربه دارند. بسته به پاسخ، می توانید ویژگی‌های مختلف Rust " +"را برجسته کنید::" #: src/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " -"via the borrow checker. You get performance like in C and C++, but you don't " -"have the memory unsafety issues. In addition, you get a modern language with " -"constructs like pattern matching and built-in dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via the borrow " +"checker. You get performance like in C and C++, but you don't 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++ را " -"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " -"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"تجربه با C یا C++ : زبان Rust با استفاده از بررسی کننده قرض‌گیری (اشاره به " +"مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای زمان اجرا_ را از بین می‌برد .t عملکردی " +"مانند C و C++ را دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر " +"این، شما یک زبان مدرن با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory " -"safety as in those languages, plus a similar high-level language feeling. In " -"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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory safety as in those " +"languages, plus a similar high-level language feeling. In 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++ (بدون " -"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " -"می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن زبان‌ها دریافت " +"می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، شما عملکرد سریع و قابل پیش‌بینی " +"مانند C و C++ (بدون جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین " +"(در صورت نیاز) دریافت می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " -"run short Rust programs, and is the basis for the examples and exercises in " -"this course. Try running the \"hello-world\" program it starts with. It " -"comes with a few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run short Rust " +"programs, and is the basis for the examples and exercises in this course. Try running the " +"\"hello-world\" program it starts with. It comes with a few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " -"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " -"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " -"مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های Rust کوتاه " +"ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه \"Hello-world\" را که با " +"آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" #: src/hello-world/playground.md -msgid "" -"Under \"Tools\", use the `rustfmt` option to format your code in the " -"\"standard\" way." +msgid "Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" way." msgstr "" -"در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " -"\"استاندارد\" استفاده کنید." +"در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش \"استاندارد\" استفاده " +"کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime " -"checks, less optimization) and Release (fewer runtime checks, lots of " -"optimization). These are accessible under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, less " +"optimization) and Release (fewer runtime checks, lots of optimization). These are accessible " +"under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " -"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " -"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، بهینه سازی " +"کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در قسمت «اشکال‌زدایی» در " +"بالا قابل دسترسی هستند." #: src/hello-world/playground.md -msgid "" -"If you're interested, use \"ASM\" under \"...\" to see the generated " -"assembly code." +msgid "If you're interested, use \"ASM\" under \"...\" to see the generated assembly code." msgstr "" -"اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " -"استفاده کنید." +"اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground " -"and experiment a little. Encourage them to keep the tab open and try things " -"out during the rest of the course. This is particularly helpful for advanced " -"students who want to know more about Rust's optimizations or generated " -"assembly." +"As students head into the break, encourage them to open up the playground and experiment a " +"little. Encourage them to keep the tab open and try things out during the rest of the course. " +"This is particularly helpful for advanced students who want to know more about Rust's " +"optimizations or generated assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " -"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " -"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " -"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " -"بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground را باز کنند و " +"کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در بقیه دوره چیزهایی را امتحان " +"کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید " +"شده بیشتر بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" msgstr "این بخش باید حدود ۴۰ دقیقه طول بکشد. آن شامل:" #: src/types-and-values/hello-world.md -msgid "" -"Let us jump into the simplest possible Rust program, a classic Hello World " -"program:" -msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " -"بپردازیم:" +msgid "Let us jump into the simplest possible Rust program, a classic Hello World program:" +msgstr "بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -3021,9 +2807,7 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." -msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " -"می‌شوند." +msgstr "بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -3032,32 +2816,27 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک " -"نمونه از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." -msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " -"باشند." +msgstr "رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will " -"see a ton of it over the next four days so we start small with something " -"familiar." +"This slide tries to make the students comfortable with Rust code. They will see a ton of it " +"over the next four days so we start small with something familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " -"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده خیلی از این " +"کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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." +"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) و سعی نمی‌کند چیزی را مگر اینکه " -"کاملاً ضروری باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان " +"امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -3065,46 +2844,40 @@ msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل ا #: src/types-and-values/hello-world.md msgid "" -"Rust uses macros for situations where you want to have a variable number of " -"arguments (no function [overloading](../control-flow-basics/functions.md))." +"Rust uses macros for situations where you want to have a variable number of arguments (no " +"function [overloading](../control-flow-basics/functions.md))." msgstr "" -"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از " -"آرگومان‌ها داشته باشید (بدون [اورلودینگ](../control-flow-basics/functions.md) " -"تابع)." +"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از آرگومان‌ها داشته " +"باشید (بدون [اورلودینگ](../control-flow-basics/functions.md) تابع)." #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers " -"from the scope they are used in. Rust macros are actually only [partially " -"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." -"html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers from the scope they " +"are used in. Rust macros are actually only [partially hygienic](https://veykril.github.io/" +"tlborm/decl-macros/minutiae/hygiene.html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " -"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " -"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" -"minutiae/hygiene.html هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را از اسکوپ‌ای " +"که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا حدی هاجنیک](https://" +"veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented " -"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " -"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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented programming features]" +"(https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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) " -"است." +"زبان Rust, یک زبان چند پارادایمی است. به عنوان مثال، دارای ویژگی‌های قدرتمند [برنامه نویسی " +"شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و در حالی که یک زبان " +"فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم فانکشنال](https://doc.rust-lang.org/" +"book/ch13-00-functional-features.html) است." #: src/types-and-values/variables.md -msgid "" -"Rust provides type safety via static typing. Variable bindings are made with " -"`let`:" +msgid "Rust provides type safety via static typing. Variable bindings are made with `let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " -"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض تعریف متغییر " +"ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -3121,29 +2894,23 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by " -"default. Add the `mut` keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by default. Add the `mut` " +"keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " -"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را حذف کنید. " +"برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile " -"time, but type inference (covered later) allows the programmer to omit it in " -"many cases." +"The `i32` here is the type of the variable. This must be known at compile time, but type " +"inference (covered later) allows the programmer to omit it in many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " -"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " -"بسیاری از موارد آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج نوع (که بعداً " +"پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد آن را حذف کند." #: src/types-and-values/values.md -msgid "" -"Here are some basic built-in types, and the syntax for literal values of " -"each type." -msgstr "" -"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " -"است." +msgid "Here are some basic built-in types, and the syntax for literal values of each type." +msgstr "در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3164,8 +2931,8 @@ msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" #: src/types-and-values/values.md msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "" -"-10, 0, 1_000, 123_i64" +"-10, 0, 1_000, 123_i64" #: src/types-and-values/values.md msgid "Unsigned integers" @@ -3178,8 +2945,8 @@ msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" #: src/types-and-values/values.md msgid "`0`, `123`, `10_u16`" msgstr "" -"0, 123, 10_u16" +"0, 123, 10_u16" #: src/types-and-values/values.md msgid "Floating point numbers" @@ -3192,8 +2959,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, 2_f32" +"3.14, -10.0e20, 2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3245,14 +3012,13 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" -"All underscores in numbers can be left out, they are for legibility only. So " -"`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " -"as `123i64`." +"All underscores in numbers can be left out, they are for legibility only. So `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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3260,13 +3026,12 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the " -"meaning should be clear: it takes three integers, and returns an integer. " -"Functions will be covered in more detail later." +"This is the first time we've seen a function other than `main`, but the meaning should be " +"clear: it takes three integers, and returns an integer. Functions will be covered in more " +"detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " -"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " -"بیشتر پوشش داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: سه عدد صحیح " +"می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3275,34 +3040,31 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #: src/types-and-values/arithmetic.md #, fuzzy msgid "" -"What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do unknown things at runtime. In Rust, it's " -"defined." +"What about integer overflow? In C and C++ overflow of _signed_ integers is actually undefined, " +"and might do unknown things at runtime. In Rust, it's defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " -"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " -"مختلف انجام دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف نشده است و " +"ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics " -"(checked) in a debug build and wraps in a release build. There are other " -"options, such as overflowing, saturating, and carrying. These are accessed " -"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " -"a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in a debug " +"build and wraps in a release build. There are other options, such as overflowing, saturating, " +"and carrying. These are accessed with method syntax, e.g., `(a * b).saturating_add(b * c)." +"saturating_add(c * a)`." msgstr "" -"«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " -"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " -"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " -"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." +"«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت اشکال‌زدایی وحشت " +"می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری مانند سرریز، اشباع و حمل وجود " +"دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان مثال، `(a * b).saturating_add(b * c)." +"saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is " -"why the example requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is why the example " +"requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " -"مثال به یک تابع جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به یک تابع " +"جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3310,35 +3072,32 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on " -"constraints given by variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on constraints given by " +"variable declarations and usages." msgstr "" -"این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " -"متغیر، انواع را استنتاج می‌کند. " +"این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های متغیر، انواع را " +"استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not " -"of some sort of dynamic \"any type\" that can hold any data. The machine " -"code generated by such declaration is identical to the explicit declaration " -"of a type. The compiler does the job for us and helps us write more concise " -"code." +"It is very important to emphasize that variables declared like this are not of some sort of " +"dynamic \"any type\" that can hold any data. The machine code generated by such declaration is " +"identical to the explicit declaration of a type. The compiler does the job for us and helps us " +"write more concise code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " -"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " -"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " -"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " -"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده پویای `any`» " +"نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** استفاده می‌کنیم در واقع مشابه " +"زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط " +"با استفاده از تعیین تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to " -"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " -"floating-point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to `i32`. This sometimes " +"appears as `{integer}` in error messages. Similarly, floating-point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " -"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " -"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» قرار می " +"گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به طور مشابه، تایپ ممیز " +"شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3346,20 +3105,18 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " -"number is calculated recursively as the sum of the n-1'th and n-2'th " -"Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is calculated " +"recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " -"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی به عنوان " +"مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " -"will this function panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will this function " +"panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " -"panic می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3397,11 +3154,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" -"if-expr.html#if-expressions) exactly like `if` statements in other languages:" +"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) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-expressions) " +"رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3417,11 +3174,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each " -"block becomes the value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار هم استفاده کنید. " +"آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3437,30 +3194,26 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its " -"branch blocks must have the same type. Show what happens if you add `;` " -"after `\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its branch blocks must " +"have the same type. Show what happens if you add `;` after `\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " -"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " -"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و `else`) باید از " +"نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` در مثال دوم `;` اضافه کنید، چه " +"اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. " -"For example, when it is used in a `let` statement, the statement must be " -"terminated with a `;` as well. Remove the `;` before `println!` to see the " -"compiler error." +"An `if` expression should be used in the same way as the other expressions. For example, when " +"it is used in a `let` statement, the statement must be terminated with a `;` as well. Remove " +"the `;` before `println!` to see the compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " -"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " -"کامپایلر را ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از عبارت بعدی " +"جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "" -"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3468,12 +3221,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) works much like in other languages, executing the " -"loop body as long as the condition is true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-" +"loops) works much like in other languages, executing the loop body as long as the condition is " +"true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-" +"loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3481,11 +3234,11 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " -"over ranges of values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over ranges of " +"values or the items in a collection:" msgstr "" -"حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " -"مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" +"حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از مقادیر یا موارد " +"موجود در یک مجموعه تکرار می‌شود:" #: src/control-flow-basics/loops/for.md msgid "\"elem: {elem}\"" @@ -3493,30 +3246,28 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle " -"iterating over different kinds of ranges/collections. Iterators will be " -"discussed in more detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle iterating over " +"different kinds of ranges/collections. Iterators will be discussed in more detail later." msgstr "" -"حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " -"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " -"قرار خواهند گرفت." +"حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع مختلف محدوده/" +"مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " -"for an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for an inclusive " +"range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " -"یک محدوده فراگیر نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک محدوده فراگیر " +"نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" -"The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " -"loops forever, until a `break`." +"The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just loops forever, " +"until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " -"زمانی که یک «break» ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که یک «break» " +"ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3524,29 +3275,26 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://" -"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +"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) " -"استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc.rust-lang.org/" +"reference/expressions/loop-expr.html#continue-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). With " -"`loop`, this can take an optional expression that becomes the value of the " -"`loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang.org/reference/" +"expressions/loop-expr.html#break-expressions). With `loop`, this can take an optional " +"expression that becomes the value of the `loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/reference/" +"expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md -#: src/borrowing/interior-mutability.md src/modules/exercise.md -#: src/modules/solution.md src/android/build-rules/library.md -#: src/android/interoperability/cpp/rust-bridge.md +#: src/borrowing/interior-mutability.md src/modules/exercise.md src/modules/solution.md +#: src/android/build-rules/library.md src/android/interoperability/cpp/rust-bridge.md #: src/concurrency/async-pitfalls/cancellation.md msgid "\"{}\"" msgstr "\"{}\"" @@ -3554,22 +3302,20 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-" -"trivial value. This is because it's guaranteed to only return at a `break` " -"statement (unlike `while` and `for` loops, which can also return when the " -"condition fails)." +"Note that `loop` is the only looping construct which can return a non-trivial value. This is " +"because it's guaranteed to only return at a `break` statement (unlike `while` and `for` loops, " +"which can also return when the condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " -"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " -"(برخلاف حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را برمی‌گرداند. این " +"به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is " -"used to break out of nested loops:" +"Both `continue` and `break` can optionally take a label argument which is used to break out of " +"nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " -"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب (label) " +"بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3581,43 +3327,38 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " -"Each block has a value and a type, which are those of the last expression of " -"the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each block has a " +"value and a type, which are those of the last expression of the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " -"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. هر بلوک دارای " +"یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"If the last expression ends with `;`, then the resulting value and type is " -"`()`." +msgid "If the last expression ends with `;`, then the resulting value and type is `()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر می‌کند. به عنوان " +"مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید واژه `return` تغییرات را اعمال " +"کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محاصره‌کننده آن است." #: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"You can shadow variables, both those from outer scopes and variables from " -"the same scope:" +msgid "You can shadow variables, both those from outer scopes and variables from the same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " -"هم متغیرهایی که از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم متغیرهایی که " +"از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3642,22 +3383,21 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block " -"in the last example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block in the last " +"example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " -"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در خارج از بلوک، " +"نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both " -"variables' memory locations exist at the same time. Both are available under " -"the same name, depending where you use it in the code." +"Shadowing is different from mutation, because after shadowing both variables' memory locations " +"exist at the same time. Both are available under the same name, depending where you use it in " +"the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " -"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " -"کد استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور همزمان وجود " +"دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3665,107 +3405,93 @@ msgstr "یک متغیر سایه‌دار می تواند انواع داده‌ #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Shadowing looks obscure at first, but is convenient for holding on to values " -"after `.unwrap()`." +"Shadowing looks obscure at first, but is convenient for holding on to values after `.unwrap()`." msgstr "" -"سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `.unwrap()` مناسب است." +"سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `." +"unwrap()` مناسب است." #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some " -"programming languages), then a return type." +"Declaration parameters are followed by a type (the reverse of some programming languages), " +"then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " -"برخی از زبان‌های برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی از زبان‌های " +"برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return " -"value. Simply omit the `;` at the end of the expression. The `return` " -"keyword can be used for early return, but the \"bare value\" form is " -"idiomatic at the end of a function (refactor `gcd` to use a `return`)." +"The last expression in a function body (or any block) becomes the return value. Simply omit " +"the `;` at the end of the expression. The `return` keyword can be used for early return, but " +"the \"bare value\" form is idiomatic at the end of a function (refactor `gcd` to use a " +"`return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " -"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " -"عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته می‌شود. به همین " +"سادگی `;` را میتوان در انتهای عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy msgid "" -"Some functions have no return value, and return the 'unit type', `()`. The " -"compiler will infer this if the return type is omitted." +"Some functions have no return value, and return the 'unit type', `()`. The compiler will infer " +"this if the return type is omitted." msgstr "" -"برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` " -"را برمی‌گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " -"کامپایلر این را استنتاج خواهد کرد که هیچ نوع برگشتی وجود ندارد." +"برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` را برمی‌گردانند. " +"اگر `-> ()` از بخش نوع برگشتی حذف شود، کامپایلر این را استنتاج خواهد کرد " +"که هیچ نوع برگشتی وجود ندارد." #: src/control-flow-basics/functions.md -msgid "" -"Overloading is not supported -- each function has a single implementation." -msgstr "" -"بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." +msgid "Overloading is not supported -- each function has a single implementation." +msgstr "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not " -"supported. Macros can be used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not supported. Macros can be " +"used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " -"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. ماکروها را " +"می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, " -"which will be covered later." +"Always takes a single set of parameter types. These types can be generic, which will be " +"covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a " -"variable number of arguments. They are distinguished by a `!` at the end. " -"The Rust standard library includes an assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a variable number of " +"arguments. They are distinguished by a `!` at the end. The Rust standard library includes an " +"assortment of useful macros." msgstr "" -"ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " -"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " -"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." +"ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از آرگومان‌ها را " +"بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد Rust شامل مجموعه ای از " +"ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" -"`println!(format, ..)` prints a line to standard output, applying formatting " -"described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." +"`println!(format, ..)` prints a line to standard output, applying formatting described in " +"[`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " -"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " -"را اعمال می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح داده شده در " +"[`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال می کند. ." #: src/control-flow-basics/macros.md -msgid "" -"`format!(format, ..)` works just like `println!` but returns the result as a " -"string." +msgid "`format!(format, ..)` works just like `println!` but returns the result as a string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " -"یک رشته برمی گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک رشته برمی " +"گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن را برمی گرداند." #: src/control-flow-basics/macros.md -msgid "" -"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " -"panic." -msgstr "" -"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " -"panic می کند." +msgid "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." +msgstr "`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می کند." #: src/control-flow-basics/macros.md -msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will " -"panic." +msgid "`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " -"اعدام شود وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3773,49 +3499,40 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and " -"how to use them. Why they are defined as macros, and what they expand to, is " -"not especially critical." +"The takeaway from this section is that these common conveniences exist, and how to use them. " +"Why they are defined as macros, and what they expand to, is not especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " -"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " -"یابند، بسیار مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. اینکه چرا آنها " +"به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe " -"use of derive macros." +"The course does not cover defining macros, but a later section will describe use of derive " +"macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " -"مشتق شده توضیح داده خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده توضیح داده " +"خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy msgid "" -"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " -"defined as follows, for an arbitrary n1 greater than zero:" +"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is defined as " +"follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " -"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر تعریف می‌شود، " +"برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is 1, then the sequence terminates at _ni_." -msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " -"می‌یابد." +msgid "If _ni_ is 1, then the sequence terminates at _ni_." +msgstr "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "" -"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." -msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " -"+ ۱." +msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgstr "اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3854,11 +3571,8 @@ msgid "the sequence terminates." msgstr "دنباله به پایان می‌رسد." #: src/control-flow-basics/exercise.md -msgid "" -"Write a function to calculate the length of the collatz sequence for a given " -"initial `n`." -msgstr "" -"یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." +msgid "Write a function to calculate the length of the collatz sequence for a given initial `n`." +msgstr "یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." #: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" @@ -3868,18 +3582,15 @@ msgstr "/// Determine the length of the collatz sequence beginning at `n`.\n" msgid "\"Length: {}\"" msgstr "\"Length: {}\"" -#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md src/welcome-day-3-afternoon.md +#: src/welcome-day-4-afternoon.md msgid "Welcome Back" msgstr "خوش آمد" #: src/welcome-day-1-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 35 " -"minutes. It contains:" -msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " -"آن شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 35 minutes. It contains:" +msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3887,27 +3598,24 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) " -"elements of the same type `T`. Note that the length of the array is _part of " -"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " -"different types. Slices, which have a size determined at runtime, are " -"covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements of the same " +"type `T`. Note that the length of the array is _part of its type_, which means that `[u8; 3]` " +"and `[u8; 4]` are considered two different types. Slices, which have a size determined at " +"runtime, are covered later." msgstr "" -"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " -"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " -"نظر گرفته می‌شوند." +"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت " +"زمان کامپایل) عنصر از نوع یکسان `T` است. توجه داشته باشید که طول آرایه " +"بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" -"Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be " -"avoided using unsafe Rust." +"Try accessing an out-of-bounds array element. Array accesses are checked at runtime. Rust can " +"usually optimize these checks away, and they can be avoided using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " -"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " -"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در زمان اجرا " +"بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با استفاده از Rust ناایمن از " +"آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3915,26 +3623,23 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" -"The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. " -"Types such as integers and strings implement the default output, but arrays " -"only implement the debug output. This means that we must use debug output " -"here." +"The `println!` macro asks for the debug implementation with the `?` format parameter: `{}` " +"gives the default output, `{:?}` gives the debug output. Types such as integers and strings " +"implement the default output, but arrays only implement the debug output. This means that we " +"must use debug output here." msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " -"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " -"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " -"خروجی دیباگ استفاده کنیم." +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده " +"سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، `{:?}` " +"خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، " +"اما آرایه‌ها فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی " +"دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" -"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " -"easier to read." +"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک " -"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت «چاپ زیبا» " +"را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3946,52 +3651,46 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, " -"e.g. `t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند `t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies " -"absence of a return value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of a return " +"value, akin to `void` in other languages." msgstr "" -"تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " -"بازگشتی است، مشابه `void` در زبان‌های دیگر." +"تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار بازگشتی است، مشابه " +"`void` در زبان‌های دیگر." #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه تاپل ها) پشتیبانی می کند." #: src/tuples-and-arrays/iteration.md -msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered " -"that yet." -msgstr "" -"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " -"پرداخته‌ایم." +msgid "This functionality uses the `IntoIterator` trait, but we haven't covered that yet." +msgstr "این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked, while debug-only variants like " -"`debug_assert!` compile to nothing in release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` macros. These " +"are always checked, while debug-only variants like `debug_assert!` compile to nothing in " +"release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" -"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " -"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` وجود دارد. " +"این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند `debug_assert!` در نسخه‌های " +"ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" -"When working with tuples and other structured values it's common to want to " -"extract the inner values into local variables. This can be done manually by " -"directly accessing the inner values:" +"When working with tuples and other structured values it's common to want to extract the inner " +"values into local variables. This can be done manually by directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " -"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " -"دسترسی مستقیم به مقادیر داخلی انجام داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی را در " +"متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به مقادیر داخلی انجام " +"داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -3999,47 +3698,45 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger " -"value into its constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger value into its " +"constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " -"در بخش های تشکیل دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در بخش های تشکیل " +"دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" -"The patterns used here are \"irrefutable\", meaning that the compiler can " -"statically verify that the value on the right of `=` has the same structure " -"as the pattern." +"The patterns used here are \"irrefutable\", meaning that the compiler can statically verify " +"that the value on the right of `=` has the same structure as the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " -"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " -"دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می تواند به طور " +"ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, " -"hence why we can also use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, hence why we can also " +"use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " -"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو می‌توانیم از " +"«let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" -"Rust also supports using patterns in conditionals, allowing for equality " -"comparison and destructuring to happen at the same time. This form of " -"pattern matching will be discussed in more detail later." +"Rust also supports using patterns in conditionals, allowing for equality comparison and " +"destructuring to happen at the same time. This form of pattern matching will be discussed in " +"more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " -"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " -"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و تخریب ساختار " +"را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات بیشتری مورد بحث قرار خواهد " +"گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't " -"match the value being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't match the value " +"being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " -"مطابقت‌شده مطابقت ندارد نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده مطابقت ندارد " +"نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -4051,22 +3748,21 @@ msgstr "نوع این متغیر چیست؟" #: src/tuples-and-arrays/exercise.md msgid "" -"Use an array such as the above to write a function `transpose` which will " -"transpose a matrix (turn rows into columns):" +"Use an array such as the above to write a function `transpose` which will transpose a matrix " +"(turn rows into columns):" msgstr "" -"از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` " -"استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" +"از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` استفاده کنید که یک " +"ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the " -"function. This function only operates on 3x3 matrices." +"Copy the code below to and implement the function. This function " +"only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و توابع را پیاده‌سازی " +"کنید:" -#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md -#: src/unsafe-rust/exercise.md +#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md src/unsafe-rust/exercise.md msgid "// TODO: remove this when you're done with your implementation.\n" msgstr "// TODO: این را زمانی که پیاده‌سازی‌تان تمام شد حذف کنید.\n" @@ -4086,31 +3782,27 @@ msgstr "\"matrix: {:#?}\"" msgid "\"transposed: {:#?}\"" msgstr "\"transposed: {:#?}\"" -#: src/references.md src/smart-pointers.md src/borrowing.md -#: src/concurrency/async-pitfalls.md +#: src/references.md src/smart-pointers.md src/borrowing.md src/concurrency/async-pitfalls.md msgid "This segment should take about 55 minutes. It contains:" msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن شامل:" #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership " -"of the value, and is also called \"borrowing\". Shared references are read-" -"only, and the referenced data cannot change." +"A reference provides a way to access another value without taking ownership of the value, and " +"is also called \"borrowing\". Shared references are read-only, and the referenced data cannot " +"change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " -"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " -"نمی توانند تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن «قرض» نیز می " +"گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made " -"with the `&` operator. The `*` operator \"dereferences\" a reference, " -"yielding its value." +"A shared reference to a type `T` has type `&T`. A reference value is made with the `&` " +"operator. The `*` operator \"dereferences\" a reference, yielding its value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " -"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " -"دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته می شود. عملگر " +"`*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -4118,116 +3810,101 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) #: src/references/shared.md msgid "" -"A reference is said to \"borrow\" the value it refers to, and this is a good " -"model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The " -"course will get into more detail on ownership in day 3." +"A reference is said to \"borrow\" the value it refers to, and this is a good model for " +"students not familiar with pointers: code can use the reference to access the value, but is " +"still \"owned\" by the original variable. The course will get into more detail on ownership in " +"day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " -"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " -"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " -"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و این مدل خوبی " +"برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع برای دسترسی به مقدار " +"استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در روز 3 به جزئیات بیشتری در مورد " +"مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can " -"be much smaller than the thing they point to. Students familiar with C or C+" -"+ will recognize references as pointers. Later parts of the course will " -"cover how Rust prevents the memory-safety bugs that come from using raw " -"pointers." +"References are implemented as pointers, and a key advantage is that they can be much smaller " +"than the thing they point to. Students familiar with C or C++ will recognize references as " +"pointers. Later parts of the course will cover how Rust prevents the memory-safety bugs that " +"come from using raw pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " -"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " -"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " -"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " -"استفاده از نشانگرهای خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند بسیار کوچکتر " +"از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ آشنا هستند، مراجع را به " +"عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات " +"ایمنی حافظه ناشی از استفاده از نشانگرهای خام جلوگیری می‌کند." #: src/references/shared.md -msgid "" -"Rust does not automatically create references for you - the `&` is always " -"required." -msgstr "" -"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgid "Rust does not automatically create references for you - the `&` is always required." +msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"Rust will auto-dereference in some cases, in particular when invoking methods (try `r." +"is_ascii()`). There is no need for an `->` operator like in C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " -"متدها (`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " -"Note that this re-binds `r`, so that it refers to something else. This is " -"different from C++, where assignment to a reference changes the referenced " -"value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note that this re-" +"binds `r`, so that it refers to something else. This is different from C++, where assignment " +"to a reference changes the referenced value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " -"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " -"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " -"تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه داشته باشید " +"که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می کند. این با C++ متفاوت است، " +"جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if " -"that value was mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if that value was " +"mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " -"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن مقدار قابل " +"تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long enough. Dangling " +"references cannot occur in safe Rust. `x_axis` would return a reference to `point`, but " +"`point` will be deallocated when the function returns, so this will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " -"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " -"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " -"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه کافی عمر می " +"کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک ارجاع به `point` برمی‌گرداند، " +"اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." -msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " -"خواهیم کرد." +msgstr "هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the " -"value they refer to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the value they refer " +"to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " -"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند مقداری را که به " +"آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the " -"value. No other references (shared or exclusive) can exist at the same time, " -"and the referenced value cannot be accessed while the exclusive reference " -"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " -"alive." +"\"Exclusive\" means that only this reference can be used to access the value. No other " +"references (shared or exclusive) can exist at the same time, and the referenced value cannot " +"be accessed while the exclusive reference exists. Try making an `&point.0` or changing " +"`point.0` while `x_coord` is alive." msgstr "" -"\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " -"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " -"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " -"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " -"`point.0` را تغییر دهید." +"\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار استفاده کرد. هیچ " +"مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود داشته باشد، و تا زمانی که مرجع " +"انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، " +"`&point.0` بسازید یا `point.0` را تغییر دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let " -"x_coord: &mut i32`. The first one represents a shared reference which can be " -"bound to different values, while the second represents an exclusive " -"reference to a mutable value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: &mut i32`. " +"The first one represents a shared reference which can be bound to different values, while the " +"second represents an exclusive reference to a mutable value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " -"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " -"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. مورد اول یک " +"مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در حالی که دومی نشان دهنده یک " +"مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -4240,76 +3917,65 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید " +"چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending " -"indexes in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending indexes in brackets." msgstr "" -"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " -"براکت‌ها، برش (slice) ایجاد می‌کنیم." +"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در براکت‌ها، برش " +"(slice) ایجاد می‌کنیم." #: src/references/slices.md msgid "" -"If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " -"identical." +"If the slice starts at index 0, Rust’s range syntax allows us to drop the 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/references/slices.md -msgid "" -"The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " -"identical." +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/references/slices.md -msgid "" -"To easily create a slice of the full array, we can therefore use `&a[..]`." -msgstr "" -"یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " -"استفاده کنیم." +msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." +msgstr "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " -"(`&[i32]`) no longer mentions the array length. This allows us to perform " -"computation on slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) no longer " +"mentions the array length. This allows us to perform computation on slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " -"`s` (`&[i32]`) دیگر طول آرایه را " -"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " -"انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. این به ما امکان می‌دهد " +"محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." #: src/references/slices.md 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." +"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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but the answer is " +"that for memory safety reasons you cannot do it through `a` at this point in the execution, " +"but you can read the data from both `a` and `s` safely. It works before you created the slice, " +"and again after the `println`, when the slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " -"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " -"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " -"داده‌ها را از هر دو `a` و `s` به " -"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، اما پاسخ‌اش " +"این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این " +"مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر دو `a` و `s` به طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش " +"بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -4321,8 +3987,7 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "" -"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4347,107 +4012,94 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" -"`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"`&str` introduces a string slice, which is an immutable reference to UTF-8 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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a " -"`Vec`, it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " -"بایت‌هاست. مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string " -"literal; `String::new()` creates a new empty string, to which string data " -"can be added using the `push()` and `push_str()` methods." +"As with many other types `String::from()` creates a string from a string 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()` به آن اضافه شوند." +"مانند بسیاری از انواع دیگر، `String::from()` یک رشته از یک لیترال رشته " +"ایجاد می‌کند. `String::new()` که رشته خالی جدید ایجاد می‌کند که داده های " +"رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md msgid "" -"The `format!()` macro is a convenient way to generate an owned string from " -"dynamic values. It accepts the same format specification as `println!()`." +"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!()` یک راه راحت برای ایجاد یک رشته Owned " -"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" -"()` است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned از مقادیر پویا " +"است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` است." #: src/references/strings.md msgid "" -"You can borrow `&str` slices from `String` via `&` and optionally range " -"selection. If you select a byte range that is not aligned to character " -"boundaries, the expression will panic. The `chars` iterator iterates over " -"characters and is preferred over trying to get character boundaries right." +"You can borrow `&str` slices from `String` via `&` and optionally range selection. If you " +"select a byte range that is not aligned to character boundaries, the expression will panic. " +"The `chars` iterator iterates over characters and is preferred over trying to get character " +"boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " -"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " -"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " -"درست کردن مرزهای کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. اگر محدوده " +"بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. تکرار کننده `chars` روی " +"کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " -"one that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain " -"UTF-8 encoded bytes and will never use a small-string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one that always " +"points to a valid string in memory. Rust `String` is a rough 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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `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\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " -"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با " +"غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" == \"\\\\n\"`.شما می‌توانید با استفاده از تعداد " +"برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, " -"representing a point as `[f64;3]`. It is up to you to determine the function " -"signatures." +"We will create a few utility functions for 3-dimensional geometry, representing a point as " +"`[f64;3]`. It is up to you to determine the function signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " -"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان `[f64;3]` نشان " +"می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" +"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " -"`v.sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v.sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4478,9 +4130,7 @@ msgid "/// Calculate the magnitude of the given vector.\n" msgstr "/// اندازه‌ی بردار داده شده را محاسبه کنید.\n" #: src/references/solution.md -msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its " -"direction.\n" +msgid "/// Change the magnitude of the vector to 1.0 without changing its direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4495,8 +4145,7 @@ msgstr "‏مانند C و C++، زبان Rust از ساختارهای سفار msgid "\"{} is {} years old\"" msgstr "‏\"{} {} ساله است\"" -#: src/user-defined-types/named-structs.md -#: src/android/interoperability/with-c/bindgen.md +#: src/user-defined-types/named-structs.md src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" msgstr "\"پیتر\"" @@ -4526,47 +4175,38 @@ msgid "Unlike in C++, there is no inheritance between structs." msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری وجود ندارد." #: src/user-defined-types/named-structs.md -msgid "" -"This may be a good time to let people know there are different types of " -"structs." -msgstr "" -"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " -"دارد." +msgid "This may be a good time to let people know there are different types of structs." +msgstr "این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " -"trait on some type but don’t have any data that you want to store in the " -"value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait on some type " +"but don’t have any data that you want to store in the value itself." msgstr "" -"ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " -"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " -"که بخواهید در خود مقدار ذخیره کنید." +"ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که می‌خواهید یک صفت " +"(trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md -msgid "" -"The next slide will introduce Tuple structs, used when the field names are " -"not important." +msgid "The next slide will introduce Tuple structs, used when the field names are not important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " -"استفاده می‌شوند که نام فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده می‌شوند که نام " +"فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" -"If you already have variables with the right names, then you can create the " -"struct using a shorthand." +"If you already have variables with the right names, then you can create the struct using a " +"shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " -"یک روش میانبر ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک روش میانبر " +"ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the " -"old struct without having to explicitly type it all out. It must always be " -"the last element." +"The syntax `..avery` allows us to copy the majority of the fields from the old struct without " +"having to explicitly type it all out. It must always be the last element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " -"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم بدون اینکه همه " +"آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" @@ -4584,17 +4224,15 @@ msgstr "" msgid "\"Ask a rocket scientist at NASA\"" msgstr "\"از یک دانشمند حوزه موشک در ناسا بپرس\"" -#: src/user-defined-types/tuple-structs.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/bare-metal/microcontrollers/type-state.md -#: src/concurrency/async-pitfalls/cancellation.md +#: src/user-defined-types/tuple-structs.md src/android/interoperability/cpp/cpp-bridge.md +#: src/bare-metal/microcontrollers/type-state.md src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in " -"a primitive type, for example:" +"Newtypes are a great way to encode additional information about the value in a primitive type, " +"for example:" msgstr "" #: src/user-defined-types/tuple-structs.md @@ -4603,20 +4241,20 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have " -"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have to validate it " +"again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " -"single field in the newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single field in the " +"newtype." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " -"for instance using booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for instance using " +"booleans as integers." msgstr "" #: src/user-defined-types/tuple-structs.md @@ -4625,17 +4263,13 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The example is a subtle reference to the [Mars Climate Orbiter](https://en." -"wikipedia.org/wiki/Mars_Climate_Orbiter) failure." +"The example is a subtle reference to the [Mars Climate Orbiter](https://en.wikipedia.org/wiki/" +"Mars_Climate_Orbiter) failure." msgstr "" #: src/user-defined-types/enums.md -msgid "" -"The `enum` keyword allows the creation of a type which has a few different " -"variants:" -msgstr "" -"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " -"است:" +msgid "The `enum` keyword allows the creation of a type which has a few different variants:" +msgstr "کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" #: src/user-defined-types/enums.md msgid "// Simple variant\n" @@ -4656,20 +4290,19 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " -"تحت یک نوع جمع آوری کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک نوع جمع آوری " +"کنید." #: src/user-defined-types/enums.md msgid "" -"`Direction` is a type with variants. There are two values of `Direction`: " -"`Direction::Left` and `Direction::Right`." +"`Direction` is a type with variants. There are two values of `Direction`: `Direction::Left` " +"and `Direction::Right`." msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, " -"Rust will store a discriminant so that it knows at runtime which variant is " -"in a `PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, Rust will store a " +"discriminant so that it knows at runtime which variant is in a `PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4678,21 +4311,19 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one " -"with different types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع مختلف فیلد (variant " +"payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate " -"structs but then they wouldn’t be the same type as they would if they were " -"all defined in an enum." +"You could even implement the different variants of an enum with separate structs but then they " +"wouldn’t be the same type as they would if they were all defined in an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " -"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " -"نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، اما در آن " +"صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." @@ -4704,61 +4335,50 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"If the allowed variant values do not cover all bit patterns, it will use invalid bit patterns " +"to encode the discriminant (the \"niche optimization\"). For example, `Option<&u8>` stores " +"either a pointer to an integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md -msgid "" -"You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " -"را کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را کنترل کنید:" #: src/user-defined-types/enums.md -msgid "" -"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " -"bytes." -msgstr "" -"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " -"بایت جا می‌شود." +msgid "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." +msgstr "بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md -#: src/memory-management/copy-types.md src/smart-pointers/box.md -#: src/borrowing/shared.md src/error-handling/result.md +#: src/memory-management/copy-types.md src/smart-pointers/box.md src/borrowing/shared.md +#: src/error-handling/result.md msgid "More to Explore" msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md -msgid "" -"Rust has several optimizations it can employ to make enums take up less " -"space." +msgid "Rust has several optimizations it can employ to make enums take up less space." msgstr "" -"زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " -"توسط`Enum`ها استفاده کند." +"زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده توسط`Enum`ها استفاده " +"کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" -"option/#representation), Rust guarantees that `size_of::()` equals " -"`size_of::>()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" +"#representation), Rust guarantees that `size_of::()` equals `size_of::>()`." msgstr "" -"بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" -">()` است." +"بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::" +"()` برابر با `size_of::>()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look " -"like in practice. It's important to note that the compiler provides no " -"guarantees regarding this representation, therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look like in practice. " +"It's important to note that the compiler provides no guarantees regarding this representation, " +"therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " -"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " -"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر برسد. مهم " +"است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، بنابراین این کاملاً " +"ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4767,44 +4387,41 @@ msgstr "" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined " -"wherever they are used:" +"Constants are evaluated at compile time and their values are inlined wherever they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " -"استفاده می شوند، درج می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده می شوند، درج " +"می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." +"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)، این موارد هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static.html)، این موارد " +"هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate " -"`const` values. `const` functions can however be called at runtime." +"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` را می توان در " -"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای تولید مقادیر " +"`const` فراخوانی شوند. با این حال، توابع `const` را می توان در زمان اجرا فراخوانی کرد (بر خلاف " +"تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but " -"it is helpful and safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا ارزیابی می‌شود از " +"`const` استفاده کند اما مفید تر و ایمن تر از استفاده `static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4812,11 +4429,9 @@ msgstr "" #: src/user-defined-types/static.md msgid "" -"Static variables will live during the whole execution of the program, and " -"therefore will not move:" -msgstr "" -"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " -"نمی‌شوند:" +"Static variables will live during the whole execution of the program, and therefore will not " +"move:" +msgstr "متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" #: src/user-defined-types/static.md #, fuzzy @@ -4830,60 +4445,54 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html), these are not inlined upon use and have an actual " -"associated memory location. This is useful for unsafe and embedded code, and " -"the variable lives through the entirety of the program execution. When a " -"globally-scoped value does not have a reason to need object identity, " +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-static.html), " +"these are not inlined upon use and have an actual associated memory location. This is useful " +"for unsafe and embedded code, and the variable lives through the entirety of the program " +"execution. When a 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` ترجیح داده می‌شود." +"همانطور که در [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static.html) ذکر " +"شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان حافظه واقعی هستند. این برای کدهای " +"ناایمن و `embedded` مفید است و متغیر در کل اجرای برنامه زنده می ماند. هنگامی که یک مقدار با " +"اسکوپ گلوبال نیاز نیست, استفاده از `const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " -"`C++` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C+" +"+` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as " -"required by types with interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as required by types with " +"interior mutability such as `Mutex`." msgstr "" -"`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " -"تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." +"`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با تغییرپذیری داخلی " +"مانند `Mutex` را نیاز دارد." #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be " -"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be `Sync`. Interior " +"mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex." +"html), atomic or similar." 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) نگاه خواهیم کرد." +"از آنجایی که متغیرهای `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/user-defined-types/static.md #, fuzzy msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" -"داده‌های `thread_local` را با ماکروی `std::thread_local` " -"می‌توان ایجاد کرد." +"داده‌های `thread_local` را با ماکروی `std::thread_local` می‌توان ایجاد کرد." #: src/user-defined-types/aliases.md -msgid "" -"A type alias creates a name for another type. The two types can be used " -"interchangeably." +msgid "A type alias creates a name for another type. The two types can be used interchangeably." msgstr "" #: src/user-defined-types/aliases.md @@ -4896,22 +4505,19 @@ msgstr "" #: src/user-defined-types/exercise.md msgid "" -"We will create a data structure to represent an event in an elevator control " -"system. It is up to you to define the types and functions to construct " -"various events. Use `#[derive(Debug)]` to allow the types to be formatted " -"with `{:?}`." +"We will create a data structure to represent an event in an elevator control system. It is up " +"to you to define the types and functions to construct various events. Use `#[derive(Debug)]` " +"to allow the types to be formatted with `{:?}`." msgstr "" #: src/user-defined-types/exercise.md msgid "" -"This exercise only requires creating and populating data structures so that " -"`main` runs without errors. The next part of the course will cover getting " -"data out of these structures." +"This exercise only requires creating and populating data structures so that `main` runs " +"without errors. The next part of the course will cover getting data out of these structures." msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "" -"/// An event in the elevator system that the controller must react to.\n" +msgid "/// An event in the elevator system that the controller must react to.\n" msgstr "" #: src/user-defined-types/exercise.md @@ -4935,9 +4541,7 @@ msgid "/// The car doors have closed.\n" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +msgid "/// A directional button was pressed in an elevator lobby on the given floor.\n" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md @@ -5006,12 +4610,8 @@ msgid "Welcome to Day 2" msgstr "به روز ۲ خوش آمدید" #: src/welcome-day-2.md -msgid "" -"Now that we have seen a fair amount of Rust, today will focus on Rust's type " -"system:" -msgstr "" -"اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز " -"خواهیم کرد:" +msgid "Now that we have seen a fair amount of Rust, today will focus on Rust's type system:" +msgstr "اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز خواهیم کرد:" #: src/welcome-day-2.md msgid "Pattern matching: extracting data from structures." @@ -5030,31 +4630,25 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "" -"Standard library types and traits: a tour of Rust's rich standard library." -msgstr "" -"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "Standard library types and traits: a tour of Rust's rich standard library." +msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 10 " -"minutes. It contains:" -msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " -"این شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 10 minutes. It contains:" +msgstr "با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این شامل:" -#: src/pattern-matching.md src/std-types.md src/memory-management.md -#: src/error-handling.md +#: src/pattern-matching.md src/std-types.md src/memory-management.md src/error-handling.md msgid "This segment should take about 1 hour. It contains:" msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شامل:" #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " -"دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." +"کلمه کلیدی `match` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت دهید. مقایسه‌ها از " +"بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." #: src/pattern-matching/match.md msgid "The patterns can be simple values, similarly to `switch` in C and C++:" @@ -5072,9 +4666,8 @@ msgstr "" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md -#: src/generics/solution.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md +#: src/std-traits/solution.md src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" msgstr "" @@ -5094,13 +4687,11 @@ msgstr "" msgid "\"Moving around\"" msgstr "\"حرکت در اطراف\"" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md src/error-handling/exercise.md src/error-handling/solution.md msgid "'0'" msgstr "" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md src/error-handling/exercise.md src/error-handling/solution.md msgid "'9'" msgstr "" @@ -5118,44 +4709,40 @@ msgstr "" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be exhaustive, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." +"The `_` pattern is a wildcard pattern which matches any value. The expressions _must_ be " +"exhaustive, meaning that it covers every possibility, so `_` is often used as the final catch-" +"all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " -"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " -"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید جامع باشند، به " +"این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان آخرین حالت برای پوشش تمامی " +"موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " -"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " -"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match باید از یک تایپ " +"باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته باشد. در مثال بالا، تایپ " +"بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that can be used " +"within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " -"بخش مطابقت استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش مطابقت " +"استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " -"باشد که شرط برقرار باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد که شرط برقرار " +"باشد." #: src/pattern-matching/match.md -msgid "" -"You might point out how some specific characters are being used when in a " -"pattern" -msgstr "" -"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +msgid "You might point out how some specific characters are being used when in a pattern" +msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -5167,8 +4754,7 @@ msgstr "`..` برای تعیین همه محدوده یا تا جایی که م #: src/pattern-matching/match.md msgid "`1..=5` represents an inclusive range" -msgstr "" -"1..=5 نمایانگر یک محدوده خاص است" +msgstr "1..=5 نمایانگر یک محدوده خاص است" #: src/pattern-matching/match.md msgid "`_` is a wild card" @@ -5176,29 +4762,25 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when " -"we wish to concisely express more complex ideas than patterns alone would " -"allow." +"Match guards as a separate syntax feature are important and necessary when we wish to " +"concisely express more complex ideas than patterns alone would allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " -"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و ضروری هستند که " +"بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"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." +"They are not the same as separate `if` expression inside of the match arm. An `if` expression " +"inside of the branch block (after `=>`) happens after the 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` اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک عبارت `if` در داخل " +"بلاک شاخه (پس از `=>`) پس از ورود به اون شاخه خاص صدا زده میشود. اگر شرط " +"`if` برقرار نباشد کاری به سایر شاخه های عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md -msgid "" -"The condition defined in the guard applies to every expression in a pattern " -"with an `|`." +msgid "The condition defined in the guard applies to every expression in a pattern with an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -5231,13 +4813,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to " -"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." +"The distinction between a capture and a constant expression can be hard to 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` تغییر دهید و خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍`2` را در شاخه " +"دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را به یک `const` تغییر دهید و " +"خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -5245,13 +4827,11 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is " -"how you inspect the structure of your types. Let us start with a simple " -"`enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is how you inspect " +"the structure of your types. Let us start with a simple `enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " -"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " -"بیایید با یک نوع ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده شوند. این روش " +"به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -5267,72 +4847,61 @@ msgstr "" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first " -"arm, `half` is bound to the value inside the `Ok` variant. In the second " -"arm, `msg` is bound to the error message." +"Here we have used the arms to _destructure_ the `Result` value. In the first arm, `half` is " +"bound to the value inside the `Ok` variant. In the second arm, `msg` is bound to the error " +"message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " -"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " -"`msg` به پیام خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` به مقداری که " +"درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md -msgid "" -"The `if`/`else` expression is returning an enum that is later unpacked with " -"a `match`." -msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " -"هم باز می‌شود." +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 msgid "" -"You can try adding a third variant to the enum definition and displaying the " -"errors when running the code. Point out the places where your code is now " -"inexhaustive and how the compiler tries to give you hints." +"You can try adding a third variant to the enum definition and displaying the 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` اضافه کنید و نمایش " -"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " -"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش خطاها هنگام اجرای " +"کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش کامپایلر برای ارائه نکاتی " +"به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md -msgid "" -"The values in the enum variants can only be accessed after being pattern " -"matched." +msgid "The values in the enum variants can only be accessed after being pattern matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage " -"the Rust compiler provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage the Rust compiler " +"provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " -"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " -"شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر Rust فراهم " +"می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it " -"in a loop. That won't compile because `msg` is consumed when matched. To fix " -"it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " -"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " -"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " -"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " -"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" -"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " -"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " -"msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it in a loop. That " +"won't compile because `msg` is consumed when matched. To fix it, match `&result` instead of " +"`result`. That will make `msg` a reference so it won't be consumed. This [\"match ergonomics\"]" +"(https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you " +"want to support older Rust, replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با استفاده از " +"`match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف می‌شود. برای رفع این " +"مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع " +"باشد و مصرف نشود. این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" +"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از " +"نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. " -"They are used for pattern matching:" +"Rust has a few control flow constructs which differ from other languages. They are used for " +"pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " -"ساختارها برای مطابقت الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها برای مطابقت " +"الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5348,13 +4917,12 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-let-expressions) lets you execute different code depending on " -"whether a value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " -"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-let-" +"expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت دارد، کدهای " +"مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md msgid "\"slept for {:?}\"" @@ -5362,15 +4930,13 @@ msgstr "" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " -"- anything but falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, use [`let else`]" +"(https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html). The \"else\" case must " +"diverge (`return`, `break`, or panic - anything but falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" -"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " -"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " -"- به غیر از اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc.rust-lang.org/" +"rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، حالت \"else\" باید منحرف " +"شود (مانند `return`، `break`، یا `panic` - به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -5389,32 +4955,31 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md -#: src/android/testing.md src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md +#: src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " -"repeatedly tests a value against a pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/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) وجود دارد که مقادیر " -"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" +"مانند `if let`، یک دستور [`while let`](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-pattern-loops) وجود دارد که مقادیر مقابل الگو به طور مکرر (تکرار شونده‌ای) " +"بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) returns `Some(c)` until the string is empty, after " -"which it will return `None`. The `while let` lets us keep iterating through " -"all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method." +"pop) returns `Some(c)` until the string is empty, after which it will return `None`. The " +"`while let` lets us keep iterating through all items." msgstr "" -"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " -"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " -"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." +"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method." +"pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و پس از آن `None` را باز " +"می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد که به طور مداوم از میان همه موارد " +"عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -5422,25 +4987,21 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make " -"it more concise than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make it more concise " +"than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " -"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " -"کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی نمیکند. اگر " +"می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." -msgstr "" -"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " -"`Option` است:" +msgstr "یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` است:" #: src/pattern-matching/let-control-flow.md -msgid "" -"Unlike `match`, `if let` does not support guard clauses for pattern matching." +msgid "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " -"الگو استفاده نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو استفاده " +"نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5448,14 +5009,12 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports " -"flattening this nested code. Rewrite the awkward version for students, so " -"they can see the transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports flattening this nested " +"code. Rewrite the awkward version for students, so they can see the transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " -"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " -"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " -"مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده شده است. " +"ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی پیچیده را برای " +"دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5467,22 +5026,20 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value " -"matches the pattern." +"Point out that the `while let` loop will keep going as long as the value matches the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " -"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته باشد (شرط برقرار " +"باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if " -"statement that breaks when there is no value to unwrap for `name.pop()`. The " -"`while let` provides syntactic sugar for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if statement that breaks " +"when there is no value to unwrap for `name.pop()`. The `while let` provides syntactic sugar " +"for the above scenario." msgstr "" -"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." -"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " -"می‌دهد." +"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` بازنویسی کنید که در " +"صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، شکسته می‌شود. `while let` یک " +"Syntactic sugar برای این سناریو ارائه می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5490,49 +5047,44 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later " -"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " -"tests. To evaluate a boxed expression, use the deref operator (`*`) to " -"\"unbox\" it: `eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later in the course. An " +"expression can be \"boxed\" with `Box::new` as seen in the tests. To evaluate a boxed " +"expression, use the deref operator (`*`) to \"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " -"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " -"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " -"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی قرار خواهد " +"گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور که در تست‌ها مشاهده " +"می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) برای \"باز کردن باکس\" استفاده " +"کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" -"Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." +"Some expressions cannot be evaluated and will return an error. The standard [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) type is an enum that " +"represents either a successful value (`Ok(Value)`) or an error (`Err(String)`). We will cover " +"this type in detail later." msgstr "" -"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " -"(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." +"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) یک enum است که یا نمایانگر یک " +"مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا (`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در " +"آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing " -"`eval`. The final product should pass the tests. It may be helpful to use " -"`todo!()` and get the tests to pass one-by-one. You can also skip a test " -"temporarily with `#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing `eval`. The final " +"product should pass the tests. It may be helpful to use `todo!()` and get the tests to pass " +"one-by-one. You can also skip a test temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " -"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " -"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " -"را با استفاده از `[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. محصول نهایی " +"باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها به صورت تک به تک مفید " +"باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از `[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" -"If you finish early, try writing a test that results in division by zero or " -"integer overflow. How could you handle this with `Result` instead of a panic?" +"If you finish early, try writing a test that results in division by zero or integer overflow. " +"How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " -"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " -"panic مدیریت کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز عدد صحیح شود. " +"چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation to perform on two subexpressions.\n" @@ -5560,11 +5112,10 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with " -"an `impl` block:" +"Rust allows you to associate functions with your new types. You do this with an `impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " -"کار را با استفاده از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار را با استفاده " +"از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md msgid "// No receiver, a static method\n" @@ -5597,7 +5148,7 @@ msgstr "\"مسابقه {} به پایان رسید، کل زمان دور: {}\"" #: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" -msgstr "جایزه بزرگ موناکو" +msgstr "\"جایزه بزرگ موناکو\"" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" @@ -5605,39 +5156,38 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts " -"on. There are several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts on. There are " +"several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " -"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. چندین گیرنده " +"رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" -"`&self`: borrows the object from the caller using a shared and immutable " -"reference. The object can be used again afterwards." +"`&self`: borrows the object from the caller using a shared and immutable reference. The object " +"can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " -"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض می‌گیرد. شیء " +"می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"`&mut self`: borrows the object from the caller using a unique and mutable " -"reference. The object can be used again afterwards." +"`&mut self`: borrows the object from the caller using a unique and mutable reference. The " +"object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " -"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " -"به پایان برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر قرض می‌گیرد. " +"شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان برسد." #: src/methods-and-traits/methods.md msgid "" -"`self`: takes ownership of the object and moves it away from the caller. The " -"method becomes the owner of the object. The object will be dropped " -"(deallocated) when the method returns, unless its ownership is explicitly " -"transmitted. Complete ownership does not automatically mean mutability." +"`self`: takes ownership of the object and moves it away from the caller. The method becomes " +"the owner of the object. The object will be dropped (deallocated) when the method returns, " +"unless its ownership is explicitly transmitted. Complete ownership does not automatically mean " +"mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " -"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " -"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک شیء می‌شود. " +"شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور صریح منتقل شود. مالکیت " +"کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5645,11 +5195,11 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to " -"create constructors which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to create constructors " +"which are called `new` by convention." msgstr "" -"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " -"سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." +"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد سازنده‌ها استفاده " +"می‌شود که به‌طور معمول `new` نامیده می‌شوند." #: src/methods-and-traits/methods.md msgid "It can be helpful to introduce methods by comparing them to functions." @@ -5657,76 +5207,73 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the " -"first parameter represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the first parameter " +"represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " -"پارامتر اول نمونه را به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر اول نمونه را " +"به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver " -"syntax and to help keep them more organized. By using methods we can keep " -"all the implementation code in one predictable place." +"Developers may choose to use methods to take advantage of method receiver syntax and to help " +"keep them more organized. By using methods we can keep all the implementation code in one " +"predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " -"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " -"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد بهره‌برداری کنند " +"و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم تمامی کدهای پیاده‌سازی را در یک " +"مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." -msgstr "" -"استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." +msgstr "استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how " -"the struct name could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how the struct name " +"could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " -"دهید که چگونه نام struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که چگونه نام " +"struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and " -"can be used elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and can be used " +"elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " -"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار دارد و می‌تواند " +"در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to " -"refer to individual fields." +"Note how `self` is used like other structs and dot notation can be used to refer to individual " +"fields." msgstr "" -"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " -"می‌تواند برای ارجاع به فیلدهای فردی به کار رود." +"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation می‌تواند برای ارجاع " +"به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` " -"by trying to run `finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` by trying to run " +"`finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " -"تلاش برای اجرای متد `finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش برای اجرای متد " +"`finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://" -"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " -"receiver types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://doc.rust-lang.org/" +"reference/special-types-and-traits.html) allowed to be receiver types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " -"به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " -"redundant?" -msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point Point {}`? Isn't that redundant?" +msgstr "_سوال:_ چرا `T` در عبارت `{} Point`, but methods in this " -"block will only be available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this block will only be " +"available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type parameters. Here, `Foo::" +"from(\"hello\")` would not compile because there is no `From<&str>` implementation for `Foo`." msgstr "" -"پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can be arbitrary, " +"like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " -"باشد، مانند `() -> B` can return any " -"type satisfying `B`, and the caller may need to choose one, such as with " -"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" -">()`." +"Inference is hard in return position. A function returning `impl Foo` picks the concrete type " +"it returns, without writing it out in the source. A function returning a generic type like " +"`collect() -> B` can return any type satisfying `B`, and the caller may need to choose one, " +"such as with `let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::>()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " -"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " -"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " -"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " -"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " -"یا با استفاده از ()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ مشخصی را که " +"برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. تابعی که تایپ generic " +"مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و " +"ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo." +"collect()` یا با استفاده از ()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " -"the error message shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the error message " +"shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " -"ببینید پیام خطا چه چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید پیام خطا چه " +"چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also " -"supports using them for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also supports using them " +"for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " -"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " -"اشیاء trait پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین از استفاده از " +"آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -6317,86 +5812,77 @@ msgstr "" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a " -"specialized instance of the function for each different type that the " -"generic is instantiated with. This means that calling a trait method from " -"within a generic function still uses static dispatch, as the compiler has " -"full type information and can resolve which type's trait implementation to " -"use." +"Generics, including `impl Trait`, use monomorphization to create a specialized instance of the " +"function for each different type that the generic is instantiated with. This means that " +"calling a trait method from within a generic function still uses static dispatch, as the " +"compiler has full type information and can resolve which type's trait implementation to use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " -"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " -"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " -"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " -"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از تابع برای هر " +"تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست که فراخوانی یک متد trait از " +"درون یک تابع generic همچنان از فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ " +"را دارد و می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" -"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " -"This means that there's a single version of `fn dynamic` that is used " -"regardless of what type of `Pet` is passed in." +"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual method table]" +"(https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This means that there's a " +"single version of `fn dynamic` that is used regardless of what type of `Pet` is passed in." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " -"یک [virtual method table](https://en.wikipedia.org/wiki/" -"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " -"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " -"استفاده می‌شود." +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک [virtual " +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable) استفاده می‌کند. این " +"بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد " +"می‌شود، استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" -"When using `dyn Trait`, the trait object needs to be behind some kind of " -"indirection. In this case it's a reference, though smart pointer types like " -"`Box` can also be used (this will be demonstrated on day 3)." +"When using `dyn Trait`, the trait object needs to be behind some kind of indirection. In this " +"case it's a reference, though smart pointer types like `Box` can also be used (this will be " +"demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " -"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " -"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " -"سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته باشد. در این " +"مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند " +"استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " -"two pointers: One pointer points to the concrete object that implements " -"`Pet`, and the other points to the vtable for the trait implementation for " -"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " -"up the function pointer for `talk` in the vtable and then invokes the " -"function, passing the pointer to the `Dog` or `Cat` into that function. The " -"compiler doesn't need to know the concrete type of the `Pet` in order to do " -"this." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two pointers: One " +"pointer points to the concrete object that implements `Pet`, and the other points to the " +"vtable for the trait implementation for that type. When calling the `talk` method on `&dyn " +"Pet` the compiler looks up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The compiler doesn't " +"need to know the concrete type of the `Pet` in order to do this." msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " -"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " -"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " -"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " -"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " -"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " -"`Pet` برای انجام این کار ندارد." +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، یعنی یک جفت " +"از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی می‌کند اشاره دارد و دیگری به " +"vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، " +"کامپایلر آدرس تابع `talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " +"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام " +"این کار ندارد." #: src/generics/dyn-trait.md msgid "" -"A `dyn Trait` is considered to be \"type-erased\", because we no longer have " -"compile-time knowledge of what the concrete type is." +"A `dyn Trait` is considered to be \"type-erased\", because we no longer have compile-time " +"knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " -"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا دیگر در زمان " +"کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" -"In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using the [`Ord`](https://doc.rust-" -"lang.org/stable/std/cmp/trait.Ord.html) trait." +"In this short exercise, you will implement a generic `min` function that determines the " +"minimum of two values, using the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." +"html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " -"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." -"rust-lang.org/stable/std/cmp/trait.Ord.html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از دو مقدار را " +"تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." +"html)." #: src/generics/exercise.md msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "" -#: src/generics/exercise.md src/generics/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'z'" msgstr "" @@ -6410,7 +5896,7 @@ msgstr "" #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" -msgstr "\"خداحافظ\"" +msgstr "\"goodbye\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"bat\"" @@ -6422,13 +5908,11 @@ msgstr "\"آرمادیلو\"" #: src/generics/exercise.md msgid "" -"Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." -"html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." -"Ordering.html) enum." +"Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait and " +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum." msgstr "" -"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " -"enum را به دانش‌آموزان نشان دهید." +"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و [`Ordering`](https://" +"doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -6452,53 +5936,44 @@ msgstr "HashMap" #: src/std-types.md msgid "" -"For each of the slides in this section, spend some time reviewing the " -"documentation pages, highlighting some of the more common methods." +"For each of the slides in this section, spend some time reviewing the documentation pages, " +"highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " -"از متدهای رایج‌تر را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از متدهای رایج‌تر " +"را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common " -"types used by Rust libraries and programs. This way, two libraries can work " -"together smoothly because they both use the same `String` type." +"Rust comes with a standard library which helps establish a set of common types used by Rust " +"libraries and programs. This way, two libraries can work together smoothly because they both " +"use the same `String` type." msgstr "" -"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " -"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " -"استفاده می‌کنند." +"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج استفاده‌شده توسط " +"کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه می‌توانند به‌راحتی با هم کار " +"کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." #: src/std-types/std.md -msgid "" -"In fact, Rust contains several layers of the Standard Library: `core`, " -"`alloc` and `std`." -msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " -"`std`." +msgid "In fact, Rust contains several layers of the Standard Library: `core`, `alloc` and `std`." +msgstr "در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on " -"`libc`, allocator or even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on `libc`, allocator or " +"even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " -"حتی وجود یک سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی وجود یک " +"سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" -"`alloc` includes types which require a global heap allocator, such as `Vec`, " -"`Box` and `Arc`." +"`alloc` includes types which require a global heap allocator, such as `Vec`, `Box` and `Arc`." msgstr "" -"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند " -"`Vec`، `Box` و `Arc`." +"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند `Vec`، `Box` و " +"`Arc`." #: src/std-types/std.md -msgid "" -"Embedded Rust applications often only use `core`, and sometimes `alloc`." -msgstr "" -"برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " -"می‌کنند." +msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgstr "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده می‌کنند." #: src/std-types/docs.md msgid "Rust comes with extensive documentation. For example:" @@ -6506,29 +5981,25 @@ msgstr "Rust دارای مستندات گسترده‌ای است. به عنوا #: src/std-types/docs.md msgid "" -"All of the details about [loops](https://doc.rust-lang.org/stable/reference/" -"expressions/loop-expr.html)." +"All of the details about [loops](https://doc.rust-lang.org/stable/reference/expressions/loop-" +"expr.html)." msgstr "" -"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/" -"expressions/loop-expr.html)." +"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/expressions/loop-expr." +"html)." #: src/std-types/docs.md -msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." -msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +msgid "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html)." +msgstr "تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html)." #: src/std-types/docs.md msgid "" -"Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" -"std/collections/struct.BinaryHeap.html)." +"Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/option/enum.Option." +"html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap." +"html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" -"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" -"stable/std/collections/struct.BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/option/enum." +"Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct." +"BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6536,57 +6007,48 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md msgid "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" +"/// Determine whether the first argument is divisible by the second argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" #: src/std-types/docs.md msgid "" -"The contents are treated as Markdown. All published Rust library crates are " -"automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " -"idiomatic to document all public items in an API using this pattern." +"The contents are treated as Markdown. All published Rust library crates are automatically " +"documented at [`docs.rs`](https://docs.rs) using the [rustdoc](https://doc.rust-lang.org/" +"rustdoc/what-is-rustdoc.html) tool. It is idiomatic to document all public items in an API " +"using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " -"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " -"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " -"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " -"رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust به‌طور خودکار در " +"[`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc](https://doc.rust-lang.org/rustdoc/" +"what-is-rustdoc.html) مستند می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این " +"الگو به‌طور رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!" -"` or `/*! .. */`, called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!` or `/*! .. */`, " +"called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " -"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/* .. !*/` " +"استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md -msgid "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +msgid "//! This module contains functionality relating to divisibility of integers.\n" msgstr "" #: src/std-types/docs.md -msgid "" -"Show students the generated docs for the `rand` crate at ." -msgstr "" -"مستندات تولیدشده برای `rand` crate را در به " -"دانش‌آموزان نشان دهید." +msgid "Show students the generated docs for the `rand` crate at ." +msgstr "مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of " -"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" -"stable/std/string/struct.String.html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of type `T` or nothing. " +"For example, [`String::find`](https://doc.rust-lang.org/stable/std/string/struct.String." +"html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in " -"memory as `T`." -msgstr "" -"بهینه‌سازی niche به این معناست که `` often has the same size in memory as `T`." +msgstr "بهینه‌سازی niche به این معناست که `` " -"where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." +"`Result` is similar to `Option`, but indicates the success or failure of an operation, each " +"with a different enum variant. It is generic: `Result` where `T` is used in the `Ok` " +"variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، " -"هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str), which means that you can call " -"all `str` methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/string/struct.String." +"html#deref-methods-str), which means that you can call all `str` methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" -"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " -"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/string/struct." +"String.html#deref-methods-str) است، که به این معناست که می‌توانید تمام متدهای `str` را بر روی " +"`String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when " -"you know how much data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when you know how much " +"data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " -"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده کنید زمانی که " +"می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be " -"different from its length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be different from its " +"length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " -"طول آن به‌صورت کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول آن به‌صورت " +"کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" -"`String::chars` returns an iterator over the actual characters. Note that a " -"`char` can be different from what a human will consider a \"character\" due " -"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" -"unicode_segmentation/struct.Graphemes.html)." +"`String::chars` returns an iterator over the actual characters. Note that a `char` can be " +"different from what a human will consider a \"character\" due to [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " -"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." -"html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه داشته باشید که " +"یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل " +"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/unicode_segmentation/struct." +"Graphemes.html)." #: src/std-types/string.md -msgid "" -"When people refer to strings they could either be talking about `&str` or " -"`String`." -msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " -"باشد." +msgid "When people refer to strings they could either be talking about `&str` or `String`." +msgstr "زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." #: src/std-types/string.md msgid "" -"When a type implements `Deref`, the compiler will let you " -"transparently call methods from `T`." +"When a type implements `Deref`, the compiler will let you transparently call " +"methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it " -"access to `str`'s methods." +"`String` implements `Deref` which transparently gives it access to `str`'s " +"methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " -"methods on a `Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/struct.Vec." +"html#deref-methods-%5BT%5D), which means that you can call slice methods on a `Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" -"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " -"متدهای برش را بر روی یک `Vec` فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/struct.Vec." +"html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را بر روی یک `Vec` " +"فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data " -"it contains is stored on the heap. This means the amount of data doesn't " -"need to be known at compile time. It can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data it contains is " +"stored on the heap. This means the amount of data doesn't need to be known at compile time. It " +"can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " -"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " -"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap ذخیره می‌شود. به " +"این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و می‌تواند در زمان اجرا رشد یا " +"کوچک شود." #: src/std-types/vec.md msgid "" -"Notice how `Vec` is a generic type too, but you don't have to specify `T` " -"explicitly. As always with Rust type inference, the `T` was established " -"during the first `push` call." +"Notice how `Vec` is a generic type too, but you don't have to specify `T` explicitly. As " +"always with Rust type inference, the `T` was established during the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://doc.rust-lang.org/" +"std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V," +"+RandomState%3E), which allows us to easily initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" -"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " -"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://doc.rust-lang." +"org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);+N%5D%3E-for-" +"HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه " +"مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md -msgid "" -"Alternatively HashMap can be built from any `Iterator` which yields key-" -"value tuples." +msgid "Alternatively HashMap can be built from any `Iterator` which yields key-value tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " -"تولید می‌کند، ساخته شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید می‌کند، ساخته " +"شود." #: src/std-types/hashmap.md msgid "" -"We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, " -"but it can lead into complications with the borrow checker." +"We are showing `HashMap`, and avoid using `&str` as key to make examples easier. " +"Using references in collections can, of course, be done, but it can lead into complications " +"with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is used to implement " +"the `<`, `<=`, `>=`, and `>` operators." msgstr "" -"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " -"ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." +"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این ویژگی برای " +"پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "" -"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, " -"because it is reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, because it is " +"reflexive:" msgstr "" -"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " -"بازتابی است:" +"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا بازتابی است:" #: src/std-traits/comparisons.md -msgid "" -"In practice, it's common to derive these traits, but uncommon to implement " -"them." +msgid "In practice, it's common to derive these traits, but uncommon to implement them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " -"آن‌ها به‌طور دستی پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها به‌طور دستی " +"پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc." -"rust-lang.org/std/ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-lang.org/std/" +"ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." -"org/std/ops/index.html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/std/ops/index." +"html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -7237,66 +6645,57 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "" -"You could implement `Add` for `&Point`. In which situations is that useful?" -msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " -"مفید است؟" +msgid "You could implement `Add` for `&Point`. In which situations is that useful?" +msgstr "می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " -"the operator is not `Copy`, you should consider overloading the operator for " -"`&T` as well. This avoids unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the operator is " +"not `Copy`, you should consider overloading the operator for `&T` as well. This avoids " +"unnecessary cloning on the call site." msgstr "" -"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " -"بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " -"بگیرید. این کار از ایجاد کپی‌های غیرضروری در محل فراخوانی جلوگیری می‌کند." +"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را بارگذاری می‌کنید، " +"`Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر بگیرید. این کار از ایجاد کپی‌های " +"غیرضروری در محل فراخوانی جلوگیری می‌کند." #: src/std-traits/operators.md -msgid "" -"Why is `Output` an associated type? Could it be made a type parameter of the " -"method?" +msgid "Why is `Output` an associated type? Could it be made a type parameter of the method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " -"متد تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد تعریف کرد؟" #: src/std-traits/operators.md msgid "" -"Short answer: Function type parameters are controlled by the caller, but " -"associated types (like `Output`) are controlled by the implementer of a " -"trait." +"Short answer: Function type parameters are controlled by the caller, but associated types " +"(like `Output`) are controlled by the implementer of a trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " -"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های مرتبط (مانند " +"`Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, " -"i32)> for Point` would add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for Point` would " +"add a tuple to a `Point`." msgstr "" -"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " -"Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." +"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl Add<(i32, i32)> " +"for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." #: src/std-traits/operators.md msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " -"like the same operator in C-family languages; instead, for integer types it " -"negates each bit of the number, which arithmetically is equivalent to " -"subtracting it from -1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like the same " +"operator in C-family languages; instead, for integer types it negates each bit of the number, " +"which arithmetically is equivalent to subtracting it from -1: `!5 == -6`." msgstr "" #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions. Unlike `as`, these traits correspond to " -"lossless, infallible conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]" +"(https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate type conversions. Unlike " +"`as`, these traits correspond to lossless, infallible conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " -"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) و " +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای تسهیل تبدیل تایپ " +"پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -7304,41 +6703,37 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " -"automatically implemented when [`From`](https://doc.rust-lang.org/std/" -"convert/trait.From.html) is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically implemented " +"when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) is implemented:" msgstr "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" -"trait.From.html) پیاده‌سازی شده باشد:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار زمانی پیاده‌سازی " +"می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get " -"`Into` implementation too." +"That's why it is common to only implement `From`, as your type will get `Into` implementation " +"too." msgstr "" -"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " -"پیاده‌سازی `Into` را نیز دریافت می‌کند." +"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار پیاده‌سازی `Into` " +"را نیز دریافت می‌کند." #: src/std-traits/from-and-into.md msgid "" -"When declaring a function argument input type like \"anything that can be " -"converted into a `String`\", the rule is opposite, you should use `Into`. " -"Your function will accept types that implement `From` and those that _only_ " -"implement `Into`." +"When declaring a function argument input type like \"anything that can be converted into a " +"`String`\", the rule is opposite, you should use `Into`. Your function will accept types that " +"implement `From` and those that _only_ implement `Into`." msgstr "" -"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " -"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " -"پیاده‌سازی کرده‌اند." +"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل شود\"، قاعده " +"برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول می‌کند که پیاده‌سازی `From` " +"دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts " -"with `as`. These generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts with `as`. These " +"generally follow C semantics where those are defined." msgstr "" -"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " -"می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." +"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی می‌کند. این تبدیل‌ها " +"معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." #: src/std-traits/casting.md msgid "\"as u16: {}\"" @@ -7354,42 +6749,38 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across " -"platforms. This might not match your intuition for changing sign or casting " -"to a smaller type -- check the docs, and comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across platforms. This might " +"not match your intuition for changing sign or casting to a smaller type -- check the docs, and " +"comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " -"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " -"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. این ممکن است " +"با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته باشد -- مستندات را بررسی " +"کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use " -"incorrectly, and can be a source of subtle bugs as future maintenance work " -"changes the types that are used or the ranges of values in types. Casts are " -"best used only when the intent is to indicate unconditional truncation (e.g. " -"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " -"was in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and can be a " +"source of subtle bugs as future maintenance work changes the types that are used or the ranges " +"of values in types. Casts are best used only when the intent is to indicate unconditional " +"truncation (e.g. selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what was " +"in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " -"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " -"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " -"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " -"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " -"بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان است و می‌تواند " +"منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث تغییر تایپ‌های مورد استفاده " +"یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن " +"برش بدون قید و شرط باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه " +"در بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " -"over `as` to confirm that the cast is in fact infallible. For fallible " -"casts, `TryFrom` and `TryInto` are available when you want to handle casts " -"that fit differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over `as` to confirm " +"that the cast is in fact infallible. For fallible casts, `TryFrom` and `TryInto` are available " +"when you want to handle casts that fit differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " -"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " -"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " -"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " -"کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` بر `as` ارجح " +"است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با احتمال خطا، `TryFrom` و " +"`TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت " +"ندارند، مدیریت کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -7397,29 +6788,23 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might " -"be lost is generally discouraged, or at least deserves an explanatory " -"comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might be lost is " +"generally discouraged, or at least deserves an explanatory comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " -"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " -"دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است داده‌ها از دست " +"برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." -msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " -"است." +msgstr "این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " -"abstract over `u8` sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`](https://doc." +"rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` sources:" msgstr "" -"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " -"بر روی منابع `u8` انتزاع کنید:" +"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و [`BufRead`](https://" +"doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -7435,11 +6820,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " -"you abstract over `u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you abstract over " +"`u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " -"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما امکان می‌دهد " +"که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -7455,11 +6840,11 @@ msgstr "The `Default` Trait" #: src/std-traits/default.md msgid "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " -"produces a default value for a type." +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait produces a default " +"value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک مقدار پیش‌فرض " +"برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -7477,39 +6862,33 @@ msgstr "\"Y is set!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md -#: src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" #: src/std-traits/default.md -msgid "" -"It can be implemented directly or it can be derived via `#[derive(Default)]`." +msgid "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" -"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق " -"`[derive(Default)]#` به صورت خودکار تولید شود." +"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق `[derive(Default)]#` به صورت " +"خودکار تولید شود." #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to " -"their default values." +"A derived implementation will produce a value where all fields are set to their default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " -"پیش‌فرض خود تنظیم شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض خود تنظیم " +"شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." -msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " -"پیاده‌سازی کنند." +msgstr "این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. " -"`0`, `\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, `\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " -"(مثل `0`، `\"\"` و غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل `0`، `\"\"` و " +"غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -7517,34 +6896,31 @@ msgstr "مقداردهی جزئی ساختارها با `Default` به خوبی #: src/std-traits/default.md msgid "" -"The Rust standard library is aware that types can implement `Default` and " -"provides convenience methods that use it." +"The Rust standard library is aware that types can implement `Default` and provides convenience " +"methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " -"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی کنند و " +"روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" -"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" -"with-struct-update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/ch05-01-" +"defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax)." msgstr "" -"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" -"struct-update-syntax) شناخته می‌شود." +"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/ch05-01-defining-" +"structs.html#creating-instances-from-other-instances-with-struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, they implement " +"special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc.rust-" +"lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://doc.rust-lang.org/std/ops/trait." +"FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " -"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" -"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." -"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " -"هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها پیاده‌سازی‌های " +"ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html)، [`FnMut`](https://doc." +"rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait." +"FnOnce.html) هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -7568,82 +6944,74 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " -"be called needing only a shared reference to the closure, which means the " -"closure can be executed repeatedly and even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be called needing " +"only a shared reference to the closure, which means the closure can be executed repeatedly and " +"even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " -"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " -"چندین بار فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر می‌دهد، یا " +"شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " -"object is accessed via exclusive reference, so it can be called repeatedly " -"but not concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object is accessed " +"via exclusive reference, so it can be called repeatedly but not concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " -"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما می‌توانید آن را " +"چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " -"Doing so consumes the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing so consumes " +"the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " -"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار فراخوانی " +"کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. you can use " +"an `FnMut` wherever an `FnOnce` is called for, and you can use an `Fn` wherever an `FnMut` or " +"`FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " -"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " -"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " -"کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` است. به عبارت " +"دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید و از `Fn` در جایی که " +"`FnMut` یا `FnOnce` نیاز است استفاده کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if you can (i.e. you " +"call it once), or `FnMut` else, and last `Fn`. This allows the most flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " -"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " -"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " -"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده کنید اگر فقط یک " +"بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از `FnMut` در غیر این صورت، و در " +"نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" -"In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then " -"`FnMut`, and lastly `FnOnce`." +"In contrast, when you have a closure, the most flexible you can have is `Fn` (which can be " +"passed to a consumer of any of the 3 closure traits), then `FnMut`, and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " -"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " -"`FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید `Fn` است (که " +"می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." #: src/std-traits/closures.md #, fuzzy msgid "" -"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " -"`multiply_sum`), depending on what the closure captures. Function pointers " -"(references to `fn` items) implement `Copy` and `Fn`." +"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. `multiply_sum`), " +"depending on what the closure captures. Function pointers (references to `fn` items) implement " +"`Copy` and `Fn`." msgstr "" -"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال " -"`multiply_sum`) را بر اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." +"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال `multiply_sum`) را بر " +"اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the " -"least demanding form of access they can (by shared reference if possible, " -"then exclusive reference, then by move). The `move` keyword forces capture " -"by value." +"By default, closures will capture each variable from an outer scope by the least demanding " +"form of access they can (by shared reference if possible, then exclusive reference, then by " +"move). The `move` keyword forces capture by value." msgstr "" #: src/std-traits/closures.md src/smart-pointers/trait-objects.md @@ -7660,15 +7028,13 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://" -"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " -"implement the missing bits. Only rotate ASCII alphabetic characters, to " -"ensure the result is still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://en.wikipedia.org/" +"wiki/ROT13). Copy this code to the playground, and implement the missing bits. Only rotate " +"ASCII alphabetic characters, to ensure the result is still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." -"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " -"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " -"تا نتیجه همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/wiki/ROT13) را " +"پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و بخش‌های ناقص آن را پیاده‌سازی " +"کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7684,11 +7050,10 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating " -"by 13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating by 13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " -"۱۳ کاراکتر را بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ کاراکتر را " +"بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7703,12 +7068,10 @@ msgid "Today, we will cover:" msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md -msgid "" -"Memory management, lifetimes, and the borrow checker: how Rust ensures " -"memory safety." +msgid "Memory management, lifetimes, and the borrow checker: how Rust ensures memory safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " -"Rust از ایمنی حافظه اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از ایمنی حافظه " +"اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7716,11 +7079,9 @@ msgstr "اشاره‌گر هوشمند: تایپ‌های اشاره‌گر در #: src/welcome-day-3.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 20 " -"minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 20 minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " -"بکشد. این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7736,9 +7097,7 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." -msgstr "" -"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " -"می‌شود." +msgstr "Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7774,41 +7133,39 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically " -"sized data, the actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized data, the " +"actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " -"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، یعنی رشته واقعی، " +"را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " -"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " -"کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول است و در صورت " +"تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." #: src/memory-management/review.md msgid "" -"If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" -"struct.System.html) and custom allocators can be implemented using the " -"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" +"If students ask about it, you can mention that the underlying memory is heap allocated using " +"the [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) and custom " +"allocators can be implemented using the [Allocator API](https://doc.rust-lang.org/std/alloc/" +"index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " -"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." -"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " -"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " -"پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده از [System " +"Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر روی heap اختصاص داده شده " +"و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator API](https://doc.rust-lang.org/std/" +"alloc/index.html) پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should " -"point out that this is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should point out that this " +"is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " -"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با این حال، باید " +"اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7821,13 +7178,11 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7847,46 +7202,34 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "" -"Programmer must determine whether a pointer still points to valid memory." -msgstr "" -"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " -"یا نه." +msgid "Programmer must determine whether a pointer still points to valid memory." +msgstr "برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." msgstr "مطالعات نشان می‌دهد که برنامه‌نویسان اشتباهاتی مرتکب می‌شوند." #: src/memory-management/approaches.md -msgid "" -"Full safety via automatic memory management at runtime: Java, Python, Go, " -"Haskell, ..." -msgstr "" -"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " -"هسکل، ..." +msgid "Full safety via automatic memory management at runtime: Java, Python, Go, Haskell, ..." +msgstr "ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." #: src/memory-management/approaches.md -msgid "" -"A runtime system ensures that memory is not freed until it can no longer be " -"referenced." +msgid "A runtime system ensures that memory is not freed until it can no longer be referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " -"ارجاع داده شود، آزاد نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع داده شود، آزاد " +"نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "" -"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" msgstr "Rust یک ترکیب جدید ارائه می‌دهد:" #: src/memory-management/approaches.md -msgid "" -"Full control _and_ safety via compile time enforcement of correct memory " -"management." +msgid "Full control _and_ safety via compile time enforcement of correct memory management." msgstr "کنترل کامل و ایمنی از طریق اجرای صحیح مدیریت حافظه در زمان کامپایل." #: src/memory-management/approaches.md @@ -7895,98 +7238,89 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put " -"Rust in context." +"This slide is intended to help students coming from other languages to put Rust in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " -"را در زمینه مناسب قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را در زمینه مناسب " +"قرار دهند." #: src/memory-management/approaches.md msgid "" -"C must manage heap manually with `malloc` and `free`. Common errors include " -"forgetting to call `free`, calling it multiple times for the same pointer, " -"or dereferencing a pointer after the memory it points to has been freed." +"C must manage heap manually with `malloc` and `free`. Common errors include forgetting to call " +"`free`, calling it multiple times for the same pointer, or dereferencing a pointer after the " +"memory it points to has been freed." msgstr "" -"C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " -"خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " -"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " -"اشاره می‌کند." +"C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. خطاهای رایج شامل " +"فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک اشاره‌گر، یا dereference کردن یک " +"اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره می‌کند." #: src/memory-management/approaches.md msgid "" -"C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " -"advantage of language guarantees about calling destructors to ensure memory " -"is freed when a function returns. It is still quite easy to mis-use these " -"tools and create similar bugs to C." +"C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take advantage of language " +"guarantees about calling destructors to ensure memory is freed when a function returns. It is " +"still quite easy to mis-use these tools and create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " -"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " -"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " -"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " -"ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از تضمین‌های زبانی " +"درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن حافظه هنگام بازگشت از تابع " +"استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و " +"باگ‌هایی مشابه به C ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that " -"is no longer reachable and discard it. This guarantees that any pointer can " -"be dereferenced, eliminating use-after-free and other classes of bugs. But, " -"GC has a runtime cost and is difficult to tune properly." +"Java, Go, and Python rely on the garbage collector to identify memory that is no longer " +"reachable and discard it. This guarantees that any pointer can be dereferenced, eliminating " +"use-after-free and other classes of bugs. But, GC has a runtime cost and is difficult to tune " +"properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " -"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " -"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " -"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " -"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای که دیگر در " +"دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر اشاره‌گری می‌تواند dereference " +"شود و از بروز خطاهای استفاده پس از آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. " +"اما، GC هزینه‌ای در زمان اجرا دارد و تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance " -"of C, with alloc and free operations precisely where they are required -- " -"zero cost. It also provides tools similar to C++'s smart pointers. When " -"required, other options such as reference counting are available, and there " -"are even third-party crates available to support runtime garbage collection " -"(not covered in this class)." -msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " -"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " -"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" -"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " -"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " +"Rust's ownership and borrowing model can, in many cases, get the performance of C, with alloc " +"and free operations precisely where they are required -- zero cost. It also provides tools " +"similar to C++'s smart pointers. When required, other options such as reference counting are " +"available, and there are even third-party crates available to support runtime garbage " +"collection (not covered in this class)." +msgstr "" +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد عملکرد C را با " +"عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه صفر -- به دست آورد. همچنین " +"ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند " +"شمارش ارجاع نیز در دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " "اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error " -"to use a variable outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error to use a variable " +"outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " -"از متغیر خارج از دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از متغیر خارج از " +"دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely " -"one owner at all times." -msgstr "" -"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " -"دارد." +"We say that the variable _owns_ the value. Every Rust value has precisely one owner at all " +"times." +msgstr "می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." #: src/memory-management/ownership.md msgid "" -"At the end of the scope, the variable is _dropped_ and the data is freed. A " -"destructor can run here to free up resources." +"At the end of the scope, the variable is _dropped_ and the data is freed. A destructor can run " +"here to free up resources." msgstr "" -"در پایان دامنه، متغیر **حذف** می‌شود و داده‌ها آزاد می‌شوند. یک ویرایشگر " -"(destructor) می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." +"در پایان دامنه، متغیر **حذف** می‌شود و داده‌ها آزاد می‌شوند. یک ویرایشگر (destructor) می‌تواند در " +"اینجا اجرا شود تا منابع را آزاد کند." #: src/memory-management/ownership.md msgid "" -"Students familiar with garbage-collection implementations will know that a " -"garbage collector starts with a set of \"roots\" to find all reachable " -"memory. Rust's \"single owner\" principle is a similar idea." +"Students familiar with garbage-collection implementations will know that a garbage collector " +"starts with a set of \"roots\" to find all reachable memory. Rust's \"single owner\" principle " +"is a similar idea." msgstr "" -"دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " -"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " -"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." +"دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک جمع‌آوری‌کننده زباله " +"با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی شروع می‌کند. اصول \"مالکیت " +"تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -8006,9 +7340,7 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." -msgstr "" -"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " -"نیست." +msgstr "زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -8048,11 +7380,11 @@ msgstr "" #: src/memory-management/move.md msgid "" -"When you pass a value to a function, the value is assigned to the function " -"parameter. This transfers ownership:" +"When you pass a value to a function, the value is assigned to the function parameter. This " +"transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " -"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده می‌شود. به این " +"شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -8069,29 +7401,25 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` " -"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ است که در ان مقدار " +"کپی میشود مگر که از `std::move` استفاده کنیم ( تا یک مقدار را جا به جا " +"کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated " -"to manipulate the data itself is a matter of optimization, and such copies " -"are aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated to manipulate the " +"data itself is a matter of optimization, and such copies are aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " -"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " -"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود داده‌ها تولید " +"می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی (aggressively) بهینه‌سازی " +"می‌شوند." #: src/memory-management/move.md -msgid "" -"Simple values (such as integers) can be marked `Copy` (see later slides)." -msgstr "" -"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " -"ببینید)." +msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." +msgstr "مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -8103,45 +7431,40 @@ msgstr "در مثال `say_hello`:" #: src/memory-management/move.md msgid "" -"With the first call to `say_hello`, `main` gives up ownership of `name`. " -"Afterwards, `name` cannot be used anymore within `main`." +"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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس از آن، `name` " +"دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the " -"`say_hello` function." -msgstr "" -"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " -"خواهد شد." +"The heap memory allocated for `name` will be freed at the end of the `say_hello` function." +msgstr "حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and " -"if `say_hello` accepts a reference as a parameter." +"`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` یک مرجع " -"را به عنوان پارامتر باید بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع (`&name`) منتقل کند و صد البته که `say_hello` یک مرجع را به عنوان پارامتر باید " +"بپذیرد." #: src/memory-management/move.md -msgid "" -"Alternatively, `main` can pass a clone of `name` in the first call (`name." -"clone()`)." +msgid "Alternatively, `main` can pass a clone of `name` in the first call (`name.clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " -"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع ای که در نظر " +"داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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." +"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++ است که سهوا کپی ایجاد کنیم, " -"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " -"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, زیر به صورت پیش‌فرض " +"از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که لازم هست به صورت صریح کلون " +"را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -8160,17 +7483,16 @@ msgid "// Duplicate the data in s1.\n" msgstr "// Duplicate the data in s1.\n" #: src/memory-management/move.md -msgid "" -"The heap data from `s1` is duplicated and `s2` gets its own independent copy." +msgid "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " -"این کپی به صورت مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این کپی به صورت " +"مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " -"جداگانه‌ای حافظه خود را آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای حافظه خود را " +"آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -8182,84 +7504,74 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, " -"the string data has to be cloned. Otherwise we would get a double-free when " -"either string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, the string data " +"has to be cloned. Otherwise we would get a double-free when either string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " -"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " -"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " -"آزادسازی مجدد حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده است. زیرا `=` " +"داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، هر موقع از اسکوپ یکی از " +"آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " -"which is used to indicate when a value may be moved from. If the example had " -"been `s2 = std::move(s1)`, no heap allocation would take place. After the " -"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++ " +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which is used to " +"indicate when a value may be moved from. If the example had been `s2 = std::move(s1)`, no heap " +"allocation would take place. After the 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/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " -"which is being copied or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is being copied " +"or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " -"انتقال دادن استفاده شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال دادن استفاده " +"شود." #: src/memory-management/clone.md -msgid "" -"Sometimes you _want_ to make a copy of a value. The `Clone` trait " -"accomplishes this." -msgstr "" -"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " -"انجام می‌دهد." +msgid "Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes this." +msgstr "گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام می‌دهد." #: src/memory-management/clone.md msgid "" -"The idea of `Clone` is to make it easy to spot where heap allocations are " -"occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." +"The idea of `Clone` is to make it easy to spot where heap allocations are occurring. Look for " +"`.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " -"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال `()clone.` و " +"چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, " -"and return later to try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, and return later to " +"try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " -"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن استفاده می‌شود و " +"سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e." -"g. clone an array, all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e.g. clone an array, " +"all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " -"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان مثال یک آرایه " +"را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning " -"logic if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning logic if needed." msgstr "" -"رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " -"کپی‌برداری سفارشی را اجرا کند." +"رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق کپی‌برداری سفارشی را " +"اجرا کند." #: src/memory-management/copy-types.md -msgid "" -"While move semantics are the default, certain types are copied by default:" +msgid "While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " -"صورت پیش‌فرض کپی می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت پیش‌فرض کپی " +"می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -8275,9 +7587,7 @@ msgstr "پس از انتساب، هر دو `p1` و `p2` داده‌های خود #: src/memory-management/copy-types.md msgid "We can also use `p1.clone()` to explicitly copy the data." -msgstr "" -"همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها " -"استفاده کنیم." +msgstr "همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها استفاده کنیم." #: src/memory-management/copy-types.md msgid "Copying and cloning are not the same thing:" @@ -8285,31 +7595,27 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on " -"arbitrary objects." +"Copying refers to bitwise copies of memory regions and does not work on arbitrary objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " -"تعریف شده توسط شما کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف شده توسط شما " +"کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "" -"Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" -"کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." +"کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." #: src/memory-management/copy-types.md msgid "" -"Cloning is a more general operation and also allows for custom behavior by " -"implementing the `Clone` trait." +"Cloning is a more general operation and also allows for custom behavior by implementing the " +"`Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " -"رفتار سفارشی را فراهم می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار سفارشی را فراهم " +"می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "" -"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -8317,19 +7623,18 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` " -"is not a `Copy` type." +"Add a `String` field to `struct Point`. It will not compile because `String` is not a `Copy` " +"type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " -"یک نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" -"Remove `Copy` from the `derive` attribute. The compiler error is now in the " -"`println!` for `p1`." +"Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for " +"`p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " -"برای `p1` قرار دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای `p1` قرار " +"دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -8337,16 +7642,14 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is " -"because rust requires that mutable references be exclusive, so while it's " -"valid to make a copy of a shared reference, creating a copy of a mutable " -"reference would violate Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is because rust " +"requires that mutable references be exclusive, so while it's valid to make a copy of a shared " +"reference, creating a copy of a mutable reference would violate Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " -"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " -"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " -"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " -"قوانین قرض‌گیری Rust را نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات قابل تغییر " +"(`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز دارد که ارجاعات قابل " +"تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی " +"از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -8354,12 +7657,11 @@ msgstr "ویژگی `Drop`" #: src/memory-management/drop.md msgid "" -"Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." -"html) can specify code to run when they go out of scope:" +"Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) can specify " +"code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " -"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " -"شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را پیاده‌سازی " +"می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -8396,8 +7698,7 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "" -"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -8405,38 +7706,34 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" -"drop` implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " +"implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " -"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی کرده باشد، " +"پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md -msgid "" -"All its fields will then be dropped too, whether or not it implements `Drop`." +msgid "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " -"کرده باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The " -"significance is that it takes ownership of the value, so at the end of its " -"scope it gets dropped. This makes it a convenient way to explicitly drop " -"values earlier than they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The significance is that it " +"takes ownership of the value, so at the end of its scope it gets dropped. This makes it a " +"convenient way to explicitly drop values earlier than they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " -"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " -"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " -"دامنه خارج می‌شوند، تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که مالکیت مقدار " +"را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن را به روشی مناسب برای حذف " +"صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، تبدیل می‌کند." #: src/memory-management/drop.md msgid "" -"This can be useful for objects that do some work on `drop`: releasing locks, " -"closing files, etc." +"This can be useful for objects that do some work on `drop`: releasing locks, closing files, " +"etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " -"کردن قفل‌ها، بستن فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن قفل‌ها، بستن " +"فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -8444,12 +7741,11 @@ msgstr "چرا `Drop::drop` `self` را نمی‌گیرد؟" #: src/memory-management/drop.md msgid "" -"Short-answer: If it did, `std::mem::drop` would be called at the end of the " -"block, resulting in another call to `Drop::drop`, and a stack overflow!" +"Short-answer: If it did, `std::mem::drop` would be called at the end of the block, resulting " +"in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " -"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " -"می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر به فراخوانی " +"مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -8457,13 +7753,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its " -"data. We will use the \"builder pattern\" to support building a new value " -"piece-by-piece, using convenience functions." +"In this example, we will implement a complex data type that owns all of its data. We will use " +"the \"builder pattern\" to support building a new value piece-by-piece, using convenience " +"functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " -"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " -"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های خود است. ما از " +"\"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت قطعه‌قطعه، با استفاده از توابع " +"کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -8484,8 +7780,7 @@ msgid "\"1\"" msgstr "" #: src/memory-management/exercise.md src/memory-management/solution.md -msgid "" -"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" #: src/memory-management/exercise.md @@ -8574,11 +7869,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " -"pointer to data on the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer to data on " +"the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " -"به داده‌های روی heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به داده‌های روی " +"heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -8586,22 +7881,20 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call " -"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" -"trait.Deref.html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can [call methods from `T` " +"directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref.html#more-on-deref-" +"coercion)." msgstr "" -"`| Element | 2 | o--+--->| Nil | // " -"| // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" +": list : : :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " -"- - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" #: src/smart-pointers/box.md -msgid "" -"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " -"not null." +msgid "`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " -"هیچ‌گاه تهی (null) نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه تهی (null) " +"نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -8651,51 +7936,47 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust " -"compiler wants to know an exact size." +"have a type whose size that can't be known at compile time, but the Rust compiler wants to " +"know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " -"به دانستن اندازه دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به دانستن اندازه " +"دقیق آن دارد." #: src/smart-pointers/box.md msgid "" -"want to transfer ownership of a large amount of data. To avoid copying large " -"amounts of data on the stack, instead store the data on the heap in a `Box` " -"so only the pointer is moved." +"want to transfer ownership of a large amount of data. To avoid copying large amounts of data " +"on the stack, instead store the data on the heap in a `Box` so only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " -"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " -"کنید تا فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم زیادی از داده‌ها " +"در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" -"If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not be able to compute a fixed size for the " -"struct in memory (the `List` would be of infinite size)." +"If `Box` was not used and we attempted to embed a `List` directly into the `List`, the " +"compiler would not be able to compute a fixed size for the struct in memory (the `List` would " +"be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " -"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " -"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` قرار دهیم، " +"کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت " +"پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and " -"just points at the next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and just points at the " +"next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " -"به عنصر بعدی `List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به عنصر بعدی " +"`List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get " -"the message \"recursive without indirection\", because for data recursion, " -"we have to use indirection, a `Box` or reference of some kind, instead of " -"storing the value directly." +"Remove the `Box` in the List definition and show the compiler error. We get the message " +"\"recursive without indirection\", because for data recursion, we have to use indirection, a " +"`Box` or reference of some kind, instead of storing the value directly." msgstr "" -"`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " -"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " -"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " -"مستقیم مقدار استفاده کنیم." +"`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا \"recursive without " +"indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها باید از یک روش غیرمستقیم، مانند " +"`Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -8703,25 +7984,22 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " -"This makes `Box` one of the types that allow the compiler to optimize " -"storage of some enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This makes `Box` " +"one of the types that allow the compiler to optimize storage of some enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" -"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " -"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null باشد. این " +"ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه می‌دهد ذخیره‌سازی برخی از " +"`enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" -"For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit " -"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" -"#representation)):" +"For example, `Option>` has the same size, as just `Box`, because compiler uses NULL-" +"value to discriminate variants instead of using explicit tag ([\"Null Pointer Optimization\"]" +"(https://doc.rust-lang.org/std/option/#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn Pet`. However, we " +"can also use trait objects with smart pointers like `Box` to create an owned trait object: " +"`Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده " -"کرد، مثلاً `dyn Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای " -"هوشمند مانند `Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait " -"object) ایجاد کنیم: `\" : : \"data: Cat\" +----+----+----" -"+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" -": | len | 2 | : | : +-------+-------+ " -"^ :\n" -": | capacity | 2 | : | : ^ " -"| :\n" -": +-----------+-------+ : | : | " -"'-------. :\n" -": : | : | data:" -"\"Dog\"| :\n" -": : | : | +-------+--|-------" -"+ :\n" -"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " -"| :\n" -" `--+-->| o o | o o-|----->| age | 5 " -"| :\n" -" : +-|---+-|---+ +-------+----------" -"+ :\n" -" : | " -"| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----+ :\n" +": | len | 2 | : | : +-------+-------+ ^ :\n" +": | capacity | 2 | : | : ^ | :\n" +": +-----------+-------+ : | : | '-------. :\n" +": : | : | data:\"Dog\"| :\n" +": : | : | +-------+--|-------+ :\n" +"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 | :\n" +" `--+-->| o o | o o-|----->| age | 5 | :\n" +" : +-|---+-|---+ +-------+----------+ :\n" +" : | | :\n" +" `- - -| - - |- - - - - - - - - - - - - - - - -'\n" " | |\n" -" | | " -"\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" -" : | | " -"vtable :\n" -" : | | +----------------------" -"+ :\n" -" : | `----->| \"::" -"talk\" | :\n" -" : | +----------------------" -"+ :\n" -" : | " -"vtable :\n" -" : | +----------------------" -"+ :\n" -" : '----------->| \"::" -"talk\" | :\n" -" : +----------------------" -"+ :\n" +" | | \"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - - -.\n" +" : | | vtable :\n" +" : | | +----------------------+ :\n" +" : | `----->| \"::talk\" | :\n" +" : | +----------------------+ :\n" +" : | vtable :\n" +" : | +----------------------+ :\n" +" : '----------->| \"::talk\" | :\n" +" : +----------------------+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" '- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" #: src/smart-pointers/trait-objects.md msgid "" -"Types that implement a given trait may be of different sizes. This makes it " -"impossible to have things like `Vec` in the example above." +"Types that implement a given trait may be of different sizes. This makes it impossible to have " +"things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته " -"باشند. این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " -"method:" -msgstr "" -"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " -"کنید:" +msgid "Copy the code below to and fill in the missing method:" +msgstr "کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" #: src/borrowing/exercise.md -msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +msgid "\"Update a user's statistics based on measurements from a visit to the doctor\"" msgstr "" -#: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md +#: src/borrowing/exercise.md src/borrowing/solution.md src/android/build-rules/library.md #: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -9351,41 +8555,40 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers " -"to. This is verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. This is " +"verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " -"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع توسط بررسی‌کننده " +"قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes " -"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " -"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " -"`Point` which is valid for at least the lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes can also be " +"explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and `'a` is a typical " +"default name. Read `&'a Point` as \"a borrowed `Point` which is valid for at least the " +"lifetime `a`\"." msgstr "" -"طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " -"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " -"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " -"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." +"طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول عمرها می‌توانند " +"صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` شروع می‌شوند و `'a` نام پیش‌فرض " +"معمولی است. `&'a Point` را به عنوان \"یک `Point` قرضی که برای حداقل طول عمر `a` معتبر است\" " +"بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " -"yourself. Explicit lifetime annotations create constraints where there is " -"ambiguity; the compiler verifies that there is a valid solution." +"Lifetimes are always inferred by the compiler: you cannot assign a lifetime yourself. Explicit " +"lifetime annotations create constraints where there is ambiguity; the compiler verifies that " +"there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " -"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " -"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر را اختصاص " +"دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود ابهام است؛ کامپایلر " +"تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes become more complicated when considering passing values to and " -"returning values from functions." +"Lifetimes become more complicated when considering passing values to and returning values from " +"functions." msgstr "" -"طول عمرها وقتی که به عبور مقادیر به توابع و بازگشت مقادیر از توابع می‌پردازیم " -"پیچیده‌تر می‌شوند." +"طول عمرها وقتی که به عبور مقادیر به توابع و بازگشت مقادیر از توابع می‌پردازیم پیچیده‌تر می‌شوند." #: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" @@ -9397,16 +8600,14 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that " -"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " -"requires explicit annotations of lifetimes on function arguments and return " -"values." +"In this example, the compiler does not know what lifetime to infer for `p3`. Looking inside " +"the function body shows that it can only safely assume that `p3`'s lifetime is the shorter of " +"`p1` and `p2`. But just like types, Rust requires explicit annotations of lifetimes on " +"function arguments and return values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " -"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " -"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " -"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به بدنه تابع " +"نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر از `p1` و `p2` است. اما " +"مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -9414,18 +8615,16 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for at least `'a`." msgstr "" -"این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " -"می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" +"این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر می‌کنند، مقدار " +"بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +msgid "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " -"بعدی توضیح داده شده است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی توضیح داده شده " +"است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -9433,37 +8632,32 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, " -"but Rust allows lifetimes to be elided in most cases with [a few simple " -"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " -"inference -- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, but Rust allows " +"lifetimes to be elided in most cases with [a few simple rules](https://doc.rust-lang.org/" +"nomicon/lifetime-elision.html). This is not inference -- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " -"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." -"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " -"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما Rust اجازه " +"می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang.org/nomicon/lifetime-" +"elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه " +"است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." -msgstr "" -"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " -"می‌شود." +msgstr "هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md -msgid "" -"If there is only one argument lifetime, it is given to all un-annotated " -"return values." +msgid "If there is only one argument lifetime, it is given to all un-annotated return values." msgstr "" -"اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " -"حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، " +"اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, " -"that lifetime is given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, that lifetime is " +"given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " -"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام مقادیر " +"بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -9471,53 +8665,46 @@ msgstr "در این مثال، `cab_distance` به طور خودکار حذف م #: src/lifetimes/lifetime-elision.md msgid "" -"The `nearest` function provides another example of a function with multiple " -"references in its arguments that requires explicit annotation." +"The `nearest` function provides another example of a function with multiple references in its " +"arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " -"نیاز به حاشیه‌نویسی صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به حاشیه‌نویسی " +"صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" -msgstr "" -"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " -"داده می‌شوند:" +msgstr "امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for " -"validity by the compiler. Note that this is not the case for raw pointers " -"(unsafe), and this is a common source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for validity by the " +"compiler. Note that this is not the case for raw pointers (unsafe), and this is a common " +"source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " -"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " -"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " -"ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر برای " +"اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام (ناامن) صدق نمی‌کند " +"و این یکی از منابع رایج خطاها در Rust ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have " -"lifetimes. Most of the time, elision and type inference mean these don't " -"need to be written out. In more complicated cases, lifetime annotations can " -"help resolve ambiguity. Often, especially when prototyping, it's easier to " -"just work with owned data by cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. Most of the " +"time, elision and type inference mean these don't need to be written out. In more complicated " +"cases, lifetime annotations can help resolve ambiguity. Often, especially when prototyping, " +"it's easier to just work with owned data by cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " -"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " -"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " -"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " -"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " -"صورت لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، _همیشه_ برای " +"قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی است که نیازی به نوشتن این " +"طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، " +"به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت " +"لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "طول عمر در ساختمان داده" #: src/lifetimes/struct-lifetimes.md -msgid "" -"If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "" -"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -9541,31 +8728,28 @@ msgstr "\"{dog:?}\"" #: src/lifetimes/struct-lifetimes.md msgid "" -"In the above example, the annotation on `Highlight` enforces that the data " -"underlying the contained `&str` lives at least as long as any instance of " -"`Highlight` that uses that data." +"In the above example, the annotation on `Highlight` enforces that the data underlying the " +"contained `&str` lives at least as long as any instance of `Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " -"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " -"می‌کند، زنده بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` به مدت حداقل " +"برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker " +"throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " -"(borrow checker) خطا می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow checker) خطا " +"می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This " -"can be useful for creating lightweight views, but it generally makes them " -"somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This can be useful for " +"creating lightweight views, but it generally makes them somewhat harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " -"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " -"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های اصلی را نگه " +"دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً استفاده از آنها را تا حدی " +"دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -9573,39 +8757,35 @@ msgstr "در صورت امکان، داده‌های ساختارها را به #: src/lifetimes/struct-lifetimes.md msgid "" -"Some structs with multiple references inside can have more than one lifetime " -"annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime " -"of the struct itself. Those are very advanced use cases." +"Some structs with multiple references inside can have more than one lifetime annotation. This " +"can be necessary if there is a need to describe lifetime relationships between the references " +"themselves, in addition to the lifetime of the struct itself. Those are very advanced use " +"cases." msgstr "" -"برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " -"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " -"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " -"بسیار پیشرفته هستند." +"برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین نشانه‌گذاری عمر داشته " +"باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین ارجاعات مختلف را به علاوه عمر " +"ساختار خود توصیف کنید. این موارد بسیار پیشرفته هستند." #: src/lifetimes/exercise.md msgid "" -"In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " -"simpler than it seems! This illustrates a common parsing pattern, passing " -"slices of data. The underlying data itself is never copied." +"In this exercise, you will build a parser for the [protobuf binary encoding](https://protobuf." +"dev/programming-guides/encoding/). Don't worry, it's simpler than it seems! This illustrates a " +"common parsing pattern, passing slices of data. The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" -"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " -"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " -"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf.dev/" +"programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن است که به نظر " +"می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل عبور برش‌های داده است. " +"داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" -"Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` " -"file. In this exercise, we'll encode that information into `match` " -"statements in functions that get called for each field." +"Fully parsing a protobuf message requires knowing the types of the fields, indexed by their " +"field numbers. That is typically provided in a `proto` file. In this exercise, we'll encode " +"that information into `match` statements in functions that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " -"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " -"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " -"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس شماره‌های فیلد " +"ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. در این تمرین، ما این اطلاعات " +"را به صورت عبارات `match` در توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -9613,35 +8793,34 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each " -"is implemented as a \"tag\" followed by the value. The tag contains a field " -"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each is implemented as a " +"\"tag\" followed by the value. The tag contains a field number (e.g., `2` for the `id` field " +"of a `Person` message) and a wire type defining how the payload should be determined from the " +"byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " -"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " -"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " -"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر فیلد به صورت " +"یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد (مانند `2` برای فیلد `id` در " +"پیام `Person`) و wire type است که نحوه تعیین بار را از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" -"Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +"Integers, including the tag, are represented with a variable-length encoding called VARINT. " +"Luckily, `parse_varint` is defined for you below. The given code also defines callbacks to " +"handle `Person` and `PhoneNumber` fields, and to parse a message into a series of calls to " +"those callbacks." msgstr "" -"اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " -"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " -"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " -"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." +"اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی می‌شوند. " +"خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین بازخوانی‌هایی برای " +"مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به مجموعه‌ای از فراخوانی‌ها به آن " +"بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" -"What remains for you is to implement the `parse_field` function and the " -"`ProtoMessage` trait for `Person` and `PhoneNumber`." +"What remains for you is to implement the `parse_field` function and the `ProtoMessage` trait " +"for `Person` and `PhoneNumber`." msgstr "" -"برای شما باقی‌مانده است که تابع `parse_field` و ویژگی `ProtoMessage` را برای " -"`Person` و `PhoneNumber` پیاده‌سازی کنید." +"برای شما باقی‌مانده است که تابع `parse_field` و ویژگی `ProtoMessage` را برای `Person` و " +"`PhoneNumber` پیاده‌سازی کنید." #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" @@ -9654,19 +8833,16 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double " -"type.\n" +" /// little-endian order containing a 64-bit signed integer or double type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float " -"type.\n" +" // little-endian order containing a 32-bit signed integer or float type.\n" " //I32, -- not needed for this exercise\n" msgstr "" @@ -9709,15 +8885,14 @@ msgstr "String" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected bytes to be a `Len` field\"" -msgstr "\"بایت‌های مورد انتظار یک فیلد \"Len\" باشند\"" +msgstr "\"بایت‌های مورد انتظار یک فیلد `Len` باشند\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected `u64` to be a `Varint` field\"" msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -9747,11 +8922,8 @@ msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" #: src/lifetimes/exercise.md -msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as " -"necessary.\"" -msgstr "" -"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +msgid "\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" +msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -9759,8 +8931,7 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -9772,22 +8943,20 @@ msgstr "" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, " -"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " -"the data buffer. In normal Rust code we'd handle this with the `Result` " -"enum, but for simplicity in this exercise we panic if any errors are " -"encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, e.g. if you try to " +"parse an `i32` when there are fewer than 4 bytes left in the data buffer. In normal Rust code " +"we'd handle this with the `Result` enum, but for simplicity in this exercise we panic if any " +"errors are encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " -"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " -"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " -"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " -"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " -"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، مثلاً اگر " +"بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، تجزیه کنید. در کد " +"Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با " +"هرگونه خطا مواجه شویم، به جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در " +"روز چهارم، به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" -msgstr "\"لن یک \"استفاده\" معتبر نیست\"" +msgstr "\"استفاده از len در `usize` معتبر نیست\"" #: src/lifetimes/solution.md msgid "\"Unexpected EOF\"" @@ -9825,8 +8994,7 @@ msgid "Welcome to Day 4" msgstr "به روز ۱ خوش آمدید" #: src/welcome-day-4.md -msgid "" -"Today we will cover topics relating to building large-scale software in Rust:" +msgid "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" #: src/welcome-day-4.md @@ -9847,14 +9015,12 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "" #: src/welcome-day-4.md -msgid "" -"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 40 " -"minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 40 minutes. It contains:" msgstr "" #: src/iterators.md @@ -9873,10 +9039,10 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait supports " +"iterating over values in a collection. It requires a `next` method and provides lots of " +"methods. Many standard library types implement `Iterator`, and you can implement it yourself, " +"too:" msgstr "" #: src/iterators/iterator.md @@ -9885,27 +9051,25 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming " -"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"The `Iterator` trait implements many common functional programming operations over collections " +"(e.g. `map`, `filter`, `reduce`, etc). This is the trait where you can find all the " +"documentation about them. In Rust these functions should produce the code as efficient as " +"equivalent imperative implementations." msgstr "" #: src/iterators/iterator.md msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"`IntoIterator` is the trait that makes for loops work. It is implemented by collection types " +"such as `Vec` and references to them such as `&Vec` and `&[T]`. Ranges also implement " +"it. This is why you can iterate over a vector with `for i in some_vec { .. }` but `some_vec." +"next()` doesn't exist." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " -"It is used automatically by the `for` loop." +"The `Iterator` trait tells you how to _iterate_ once you have created an iterator. The related " +"trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html) defines how " +"to create an iterator for a type. It is used automatically by the `for` loop." msgstr "" #: src/iterators/intoiterator.md @@ -9914,8 +9078,8 @@ msgstr "\"point = {x}, {y}\"" #: src/iterators/intoiterator.md msgid "" -"Click through to the docs for `IntoIterator`. Every implementation of " -"`IntoIterator` must declare two types:" +"Click through to the docs for `IntoIterator`. Every implementation of `IntoIterator` must " +"declare two types:" msgstr "" #: src/iterators/intoiterator.md @@ -9928,8 +9092,8 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same " -"`Item` type, which means that it returns `Option`" +"Note that `IntoIter` and `Item` are linked: the iterator must have the same `Item` type, which " +"means that it returns `Option`" msgstr "" #: src/iterators/intoiterator.md @@ -9938,29 +9102,27 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Try iterating over the grid twice in `main`. Why does this fail? Note that " -"`IntoIterator::into_iter` takes ownership of `self`." +"Try iterating over the grid twice in `main`. Why does this fail? Note that `IntoIterator::" +"into_iter` takes ownership of `self`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference to the " +"`Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in " -"some_vector` will take ownership of `some_vector` and iterate over owned " -"elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in some_vector` will take " +"ownership of `some_vector` and iterate over owned elements from that vector. Use `for e in " +"&some_vector` instead, to iterate over references to elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets you build a " +"collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html)." msgstr "" #: src/iterators/fromiterator.md @@ -9978,42 +9140,39 @@ msgstr "" #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." +"With the \"turbofish\": `some_iterator.collect::()`, as shown. The `_` " +"shorthand used here lets Rust infer the type of the `Vec` elements." msgstr "" #: src/iterators/fromiterator.md msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"Rewrite the example to use this form." +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. Rewrite the " +"example to use this form." msgstr "" #: src/iterators/fromiterator.md msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. There are also " +"more specialized implementations which let you do cool things like convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods " -"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait to implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods in the " +"[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to implement a " +"complex calculation." msgstr "" #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests " -"pass. Use an iterator expression and `collect` the result to construct the " -"return value." +"Copy the following code to and make the tests pass. Use an " +"iterator expression and `collect` the result to construct the return value." msgstr "" #: src/iterators/exercise.md src/iterators/solution.md msgid "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -10041,14 +9200,14 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that " -"describes how to build a bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that describes how to build a " +"bundle of 1+ crates." msgstr "" #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and " -"a library crate compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and a library crate " +"compiles to a library." msgstr "" #: src/modules/modules.md @@ -10056,15 +9215,13 @@ msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md -msgid "" -"Omitting the module content will tell Rust to look for it in another file:" +msgid "Omitting the module content will tell Rust to look for it in another file:" msgstr "" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden." -"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" -"vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden.rs`. Similarly, a " +"`garden::vegetables` module can be found at `src/garden/vegetables.rs`." msgstr "" #: src/modules/filesystem.md @@ -10081,15 +9238,13 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments\". These document " +"the item that contains them -- in this case, a module." msgstr "" #: src/modules/filesystem.md msgid "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" msgstr "" @@ -10107,14 +9262,14 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " -"`module.rs`, and this is still a working alternative for editions after 2018." +"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of `module.rs`, and " +"this is still a working alternative for editions after 2018." msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod." -"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` was because " +"many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" #: src/modules/filesystem.md @@ -10122,9 +9277,7 @@ msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" #: src/modules/filesystem.md -msgid "" -"The place rust will look for modules can be changed with a compiler " -"directive:" +msgid "The place rust will look for modules can be changed with a compiler directive:" msgstr "" #: src/modules/filesystem.md @@ -10133,8 +9286,8 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module " -"in a file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module in a file named " +"`some_module_test.rs`, similar to the convention in Go." msgstr "" #: src/modules/visibility.md @@ -10151,8 +9304,8 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all " -"the descendants of `foo`." +"In other words, if an item is visible in module `foo`, it's visible in all the descendants of " +"`foo`." msgstr "" #: src/modules/visibility.md @@ -10177,14 +9330,14 @@ msgstr "" #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " -"of public visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public " +"visibility." msgstr "" #: src/modules/visibility.md msgid "" -"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" -"privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." +"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-" +"path-pubcrate-pubsuper-and-pubself)." msgstr "" #: src/modules/visibility.md @@ -10197,14 +9350,13 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of " -"its descendants)." +"In any case, visibility must be granted to an ancestor module (and all of its descendants)." msgstr "" #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You " -"will typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You will typically see " +"something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -10241,43 +9393,40 @@ msgstr "" #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the " -"top-level `lib.rs` in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the top-level `lib.rs` " +"in a crate might have" msgstr "" #: src/modules/paths.md msgid "" -"making `DiskStorage` and `NetworkStorage` available to other crates with a " -"convenient, short path." +"making `DiskStorage` and `NetworkStorage` available to other crates with a convenient, short " +"path." msgstr "" #: src/modules/paths.md msgid "" -"For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if " -"a type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to " -"`use std::io::Read`." +"For the most part, only items that appear in a module need to be `use`'d. However, a trait " +"must be in scope to call any methods on that trait, even if a type implementing that trait is " +"already in scope. For example, to use the `read_to_string` method on a type implementing the " +"`Read` trait, you need to `use std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is " -"discouraged because it is not clear which items are imported, and those " -"might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged because it is " +"not clear which items are imported, and those might change over time." msgstr "" #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. " -"This library defines a `Widget` trait and a few implementations of that " -"trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. This library defines " +"a `Widget` trait and a few implementations of that trait, as well as a `main` function." msgstr "" #: src/modules/exercise.md msgid "" -"It is typical to put each type or set of closely-related types into its own " -"module, so each widget type should get its own module." +"It is typical to put each type or set of closely-related types into its own module, so each " +"widget type should get its own module." msgstr "" #: src/modules/exercise.md @@ -10287,14 +9436,14 @@ msgstr "تنظیم" #: src/modules/exercise.md msgid "" -"The Rust playground only supports one file, so you will need to make a Cargo " -"project on your local filesystem:" +"The Rust playground only supports one file, so you will need to make a Cargo project on your " +"local filesystem:" msgstr "" #: src/modules/exercise.md msgid "" -"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " -"files in the `src` directory." +"Edit the resulting `src/main.rs` to add `mod` statements, and add additional files in the " +"`src` directory." msgstr "" #: src/modules/exercise.md @@ -10327,8 +9476,7 @@ msgstr "" #: src/modules/exercise.md msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" @@ -10374,9 +9522,9 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, " -"and get accustomed to the required `mod`, `use`, and `pub` declarations. " -"Afterward, discuss what organizations are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, and get accustomed " +"to the required `mod`, `use`, and `pub` declarations. Afterward, discuss what organizations " +"are most idiomatic." msgstr "" #: src/modules/solution.md @@ -10462,9 +9610,8 @@ msgstr "" #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested " -"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " -"building tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` module, using " +"`#[cfg(test)]` to conditionally compile them only when building tests." msgstr "" #: src/testing/unit-tests.md @@ -10532,9 +9679,7 @@ msgid "The code will be compiled and executed as part of `cargo test`." msgstr "" #: src/testing/other.md -msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/" -"run it." +msgid "Adding `#` in the code will hide it from the docs, but will still compile/run it." msgstr "" #: src/testing/other.md @@ -10545,9 +9690,9 @@ msgstr "" #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful " -"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " -"more lints, organized into groups that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful built-in lints. " +"[Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, organized into groups " +"that can be enabled per-project." msgstr "" #: src/testing/lints.md @@ -10556,22 +9701,21 @@ msgstr "" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints " -"visible here, but those will not be shown once the code compiles. Switch to " -"the Playground site to show those lints." +"Run the code sample and examine the error message. There are also lints visible here, but " +"those will not be shown once the code compiles. Switch to the Playground site to show those " +"lints." msgstr "" #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show " -"clippy warnings. Clippy has extensive documentation of its lints, and adds " -"new lints (including default-deny lints) all the time." +"After resolving the lints, run `clippy` on the playground site to show clippy warnings. Clippy " +"has extensive documentation of its lints, and adds new lints (including default-deny lints) " +"all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " -"or via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or via your editor." msgstr "" #: src/testing/exercise.md @@ -10580,14 +9724,13 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " -"to validate credit card numbers. The algorithm takes a string as input and " -"does the following to validate the credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used 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) برای " -"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " -"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " -"انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای اعتبارسنجی شماره‌های کارت " +"اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی دریافت می‌کند و برای اعتبارسنجی " +"شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -10596,21 +9739,19 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل " -"می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره `1234`، `3` و `1` را " +"دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل می‌کنیم." #: src/testing/exercise.md 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`." +"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` تبدیل می‌شود." +"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. بنابراین، دوبل " +"کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." #: src/testing/exercise.md msgid "Sum all the undoubled and doubled digits." @@ -10622,20 +9763,18 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, " -"along with two basic unit tests that confirm that most of the algorithm is " -"implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, along with two basic " +"unit tests that confirm that most of the algorithm is implemented correctly." msgstr "" #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional " -"tests to uncover bugs in the provided implementation, fixing any bugs you " -"find." +"Copy the code below to and write additional tests to uncover " +"bugs in the provided implementation, fixing any bugs you find." msgstr "" -"کد زیر را به کپی کنید و " -"تابع را پیاده‌سازی کنید." +"کد زیر را به کپی کنید و تابع را پیاده‌سازی " +"کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -10683,7 +9822,7 @@ msgstr "" #: src/testing/solution.md msgid "\"no\"" -msgstr "نه" +msgstr "\"نه\"" #: src/testing/solution.md msgid "\"foo 0 0\"" @@ -10712,11 +9851,8 @@ msgstr "" #: src/welcome-day-4-afternoon.md #, fuzzy msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 15 " -"minutes. It contains:" -msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 15 minutes. It contains:" +msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/error-handling.md #, fuzzy @@ -10764,20 +9900,15 @@ msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" #: src/error-handling/panics.md -msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions " -"had returned." +msgid "A panic will \"unwind\" the stack, dropping values just as if the functions had returned." msgstr "" #: src/error-handling/panics.md -msgid "" -"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" #: src/error-handling/panics.md -msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be " -"caught:" +msgid "By default, a panic will cause the stack to unwind. The unwinding can be caught:" msgstr "" #: src/error-handling/panics.md @@ -10793,15 +9924,11 @@ msgid "\"oh no!\"" msgstr "\"oh no!\"" #: src/error-handling/panics.md -msgid "" -"Catching is unusual; do not attempt to implement exceptions with " -"`catch_unwind`!" +msgid "Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" msgstr "" #: src/error-handling/panics.md -msgid "" -"This can be useful in servers which should keep running even if a single " -"request crashes." +msgid "This can be useful in servers which should keep running even if a single request crashes." msgstr "" #: src/error-handling/panics.md @@ -10810,38 +9937,36 @@ msgstr "" #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://" -"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " -"saw when discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://doc.rust-lang.org/" +"stable/std/result/enum.Result.html) enum, which we briefly saw when discussing standard " +"library types." msgstr "" #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` " -"which contains an error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` which contains an " +"error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's " -"type signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's type signature by " +"having the function return a `Result` value." msgstr "" #: src/error-handling/result.md msgid "" -"Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern " -"matching on the `Result` to check which variant you have. Methods like " -"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " -"error handling, but means that you can always see in your source code where " +"Like with `Option`, there is no way to forget to handle an error: You cannot access either the " +"success value or the error value without first pattern matching on the `Result` to check which " +"variant you have. Methods like `unwrap` make it easier to write quick-and-dirty code that " +"doesn't do robust error handling, but means that you can always see in your source code where " "proper error handling is being skipped." msgstr "" #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling " -"conventions that students may be familiar with from other programming " -"languages." +"It may be helpful to compare error handling in Rust to error handling conventions that " +"students may be familiar with from other programming languages." msgstr "" #: src/error-handling/result.md @@ -10850,17 +9975,15 @@ msgstr "" #: src/error-handling/result.md msgid "" -"In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means " -"that you can't tell when calling a function if it may throw an exception or " -"not." +"In most languages with exceptions, whether or not a function can throw an exception is not " +"visible as part of its type signature. This generally means that you can't tell when calling a " +"function if it may throw an exception or not." msgstr "" #: src/error-handling/result.md msgid "" -"Exceptions generally unwind the call stack, propagating upward until a `try` " -"block is reached. An error originating deep in the call stack may impact an " -"unrelated function further up." +"Exceptions generally unwind the call stack, propagating upward until a `try` block is reached. " +"An error originating deep in the call stack may impact an unrelated function further up." msgstr "" #: src/error-handling/result.md @@ -10869,24 +9992,21 @@ msgstr "" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error " -"value) separately from the successful return value of the function. Examples " -"include C and Go." +"Some languages have functions return an error number (or some other error value) separately " +"from the successful return value of the function. Examples include C and Go." msgstr "" #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error " -"value, in which case you may be accessing an uninitialized or otherwise " -"invalid success value." +"Depending on the language it may be possible to forget to check the error value, in which case " +"you may be accessing an uninitialized or otherwise invalid success value." msgstr "" #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with " -"the `Result` type, but matching this type on every call can be cumbersome. " -"The try-operator `?` is used to return errors to the caller. It lets you " -"turn the common" +"Runtime errors like connection-refused or file-not-found are handled with the `Result` type, " +"but matching this type on every call can be cumbersome. The try-operator `?` is used to return " +"errors to the caller. It lets you turn the common" msgstr "" #: src/error-handling/try.md @@ -10920,22 +10040,19 @@ msgstr "" #: src/error-handling/try.md msgid "" -"Use the `fs::write` call to test out the different scenarios: no file, empty " -"file, file with username." +"Use the `fs::write` call to test out the different scenarios: no file, empty file, file with " +"username." msgstr "" #: src/error-handling/try.md msgid "" -"Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. " -"The executable will print the `Err` variant and return a nonzero exit status " -"on error." +"Note that `main` can return a `Result<(), E>` as long as it implements `std::process::" +"Termination`. In practice, this means that `E` implements `Debug`. The executable will print " +"the `Err` variant and return a nonzero exit status on error." msgstr "" #: src/error-handling/try-conversions.md -msgid "" -"The effective expansion of `?` is a little more complicated than previously " -"indicated:" +msgid "The effective expansion of `?` is a little more complicated than previously indicated:" msgstr "" #: src/error-handling/try-conversions.md @@ -10944,9 +10061,8 @@ msgstr "" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function. This makes it easy to encapsulate errors into " -"higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the type returned by " +"the function. This makes it easy to encapsulate errors into higher-level errors." msgstr "" #: src/error-handling/try-conversions.md @@ -10963,31 +10079,29 @@ msgstr "" #: src/error-handling/try-conversions.md msgid "" -"The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. " -"A function that returns `Result` can only use `?` on a value " -"of type `Result` if `ErrorOuter` and `ErrorInner` are the " -"same type or if `ErrorOuter` implements `From`." +"The `?` operator must return a value compatible with the return type of the function. For " +"`Result`, it means that the error types have to be compatible. A function that returns " +"`Result` can only use `?` on a value of type `Result` if " +"`ErrorOuter` and `ErrorInner` are the same type or if `ErrorOuter` implements " +"`From`." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, " -"especially when the conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, especially when the " +"conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and " -"`U` types." +"There is no compatibility requirement for `Option`. A function returning `Option` can use " +"the `?` operator on `Option` for arbitrary `T` and `U` types." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " -"turns `Result` into `Option`." +"A function that returns `Result` cannot use `?` on `Option` and vice versa. However, `Option::" +"ok_or` converts `Option` to `Result` whereas `Result::ok` turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -10996,10 +10110,9 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing " -"our own enum covering all the different possibilities. The `std::error::" -"Error` trait makes it easy to create a trait object that can contain any " -"error." +"Sometimes we want to allow any type of error to be returned without writing our own enum " +"covering all the different possibilities. The `std::error::Error` trait makes it easy to " +"create a trait object that can contain any error." msgstr "" #: src/error-handling/error.md @@ -11020,44 +10133,41 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) " -"or `std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) or `std::num::" +"ParseIntError` (from `String::parse`)." msgstr "" #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle " -"different error cases differently in the program. As such it's generally not " -"a good idea to use `Box` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle different error cases " +"differently in the program. As such it's generally not a good idea to use `Box` in " +"the public API of a library, but it can be a good option in a program where you just want to " +"display the error message somewhere." msgstr "" #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom error type so it " +"can be boxed. But if you need to support the `no_std` attribute, keep in mind that the `std::" +"error::Error` trait is currently compatible with `no_std` in [nightly](https://github.com/rust-" +"lang/rust/issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" -"anyhow/) crates are widely used to simplify error handling." +"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/anyhow/) crates " +"are widely used to simplify error handling." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`thiserror` is often used in libraries to create custom error types that " -"implement `From`." +"`thiserror` is often used in libraries to create custom error types that implement `From`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in functions, including " +"adding contextual information to your errors." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -11090,8 +10200,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful " -"attributes to help define error types in a compact way." +"The `Error` derive macro is provided by `thiserror`, and has lots of useful attributes to help " +"define error types in a compact way." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -11108,9 +10218,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally " +"not a good choice for the public API of a library, but is widely used in applications." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -11118,37 +10227,33 @@ msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md -msgid "" -"Actual error type inside of it can be extracted for examination if necessary." +msgid "Actual error type inside of it can be extracted for examination if necessary." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides " +"similar usage patterns and ergonomics to `(T, error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` types. `use " +"anyhow::Context` is necessary to enable `.context()` and `.with_context()` on those types." msgstr "" #: src/error-handling/exercise.md msgid "" -"The following implements a very simple parser for an expression language. " -"However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"The following implements a very simple parser for an expression language. However, it handles " +"errors by panicking. Rewrite it to instead use idiomatic error handling and propagate errors " +"to a return from `main`. Feel free to use `thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." +"HINT: start by fixing error handling in the `parse` function. Once that is working correctly, " +"update `Tokenizer` to implement `Iterator>` and handle that " +"in the parser." msgstr "" #: src/error-handling/exercise.md src/error-handling/solution.md @@ -11244,21 +10349,17 @@ msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" #: src/unsafe-rust/unsafe.md -msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are " -"violated." +msgid "**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." msgstr "" #: src/unsafe-rust/unsafe.md -msgid "" -"We saw mostly safe Rust in this course, but it's important to know what " -"Unsafe Rust is." +msgid "We saw mostly safe Rust in this course, but it's important to know what Unsafe Rust is." msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe code is usually small and isolated, and its correctness should be " -"carefully documented. It is usually wrapped in a safe abstraction layer." +"Unsafe code is usually small and isolated, and its correctness should be carefully documented. " +"It is usually wrapped in a safe abstraction layer." msgstr "" #: src/unsafe-rust/unsafe.md @@ -11287,17 +10388,16 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"We will briefly cover unsafe capabilities next. For full details, please see [Chapter 19.1 in " +"the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) and the [Rustonomicon]" +"(https://doc.rust-lang.org/nomicon/)." msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers " -"have turned off some compiler safety features and have to write correct code " -"by themselves. It means the compiler no longer enforces Rust's memory-safety " -"rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers have turned off some " +"compiler safety features and have to write correct code by themselves. It means the compiler " +"no longer enforces Rust's memory-safety rules." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11311,8 +10411,7 @@ msgstr "\"مراقب باش!\"" #: src/unsafe-rust/dereferencing.md msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11344,15 +10443,15 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write " -"a comment for each `unsafe` block explaining how the code inside it " -"satisfies the safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write a comment for each " +"`unsafe` block explaining how the code inside it satisfies the safety requirements of the " +"unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"In the case of pointer dereferences, this means that the pointers must be " -"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" +"In the case of pointer dereferences, this means that the pointers must be [_valid_](https://" +"doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11360,9 +10459,7 @@ msgid "The pointer must be non-null." msgstr "" #: src/unsafe-rust/dereferencing.md -msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single " -"allocated object)." +msgid "The pointer must be _dereferenceable_ (within the bounds of a single allocated object)." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11375,8 +10472,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object " -"must be live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object must be live and no " +"reference may be used to access the memory." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11385,9 +10482,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has the `'static` " +"lifetime, so `r3` has type `&'static String`, and thus outlives `s`. Creating a reference from " +"a pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md @@ -11405,13 +10502,11 @@ msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"However, since data races can occur, it is unsafe to read and write mutable " -"static variables:" +"However, since data races can occur, it is unsafe to read and write mutable static variables:" msgstr "" #: src/unsafe-rust/mutable-static.md -msgid "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" #: src/unsafe-rust/mutable-static.md @@ -11420,17 +10515,16 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" -"The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"The program here is safe because it is single-threaded. However, the Rust compiler is " +"conservative and will assume the worst. Try removing the `unsafe` and see how the compiler " +"explains that it is undefined behavior to mutate a static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases where it might make " +"sense in low-level `no_std` code, such as implementing a heap allocator or working with some C " +"APIs." msgstr "" #: src/unsafe-rust/unions.md @@ -11452,16 +10546,15 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They " -"are occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally " +"needed for interacting with C library APIs." msgstr "" #: src/unsafe-rust/unions.md msgid "" -"If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." -"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" -"crates/zerocopy) crate." +"If you just want to reinterpret bytes as a different type, you probably want [`std::mem::" +"transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute.html) or a safe wrapper such " +"as the [`zerocopy`](https://crates.io/crates/zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -11470,17 +10563,15 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions you must uphold to " +"avoid undefined behaviour:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md -#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md -#: src/android/interoperability/with-c/rust.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/android/interoperability/with-c.md src/android/interoperability/with-c/rust.md +#: src/android/interoperability/cpp/cpp-bridge.md src/exercises/chromium/build-rules.md +#: src/bare-metal/aps/inline-assembly.md src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/solutions-afternoon.md msgid "\"C\"" msgstr "\"C\"" @@ -11526,8 +10617,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular conditions to avoid " +"undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -11549,32 +10640,30 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can create UB if the " +"range is incorrect. `abs` is incorrect for a different reason: it is an external function " +"(FFI). Calling external functions is usually only a problem when those functions do things " +"with pointers which might violate Rust's memory model, but in general any C function might " +"have undefined behaviour under any arbitrary circumstances." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too]" -"(https://doc.rust-lang.org/reference/items/external-blocks.html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://doc.rust-lang." +"org/reference/items/external-blocks.html)." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +"We wouldn't actually use pointers for a `swap` function - it can be done safely with " +"references." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"Note that unsafe code is allowed within an unsafe function without an `unsafe` block. We can " +"prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it and see what happens. This " +"will likely change in a future Rust edition." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -11583,14 +10672,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation " -"must guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation must guarantee " +"particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something like this](https://" +"docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -11606,14 +10695,12 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining " -"the requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining the requirements " +"for the trait to be safely implemented." msgstr "" #: src/unsafe-rust/unsafe-traits.md -msgid "" -"The actual safety section for `AsBytes` is rather longer and more " -"complicated." +msgid "The actual safety section for `AsBytes` is rather longer and more complicated." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -11626,9 +10713,9 @@ msgstr "امن بودن FFI Wrapper" #: src/unsafe-rust/exercise.md msgid "" -"Rust has great support for calling functions through a _foreign function " -"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " -"functions you would use from C to read the names of files in a directory." +"Rust has great support for calling functions through a _foreign function interface_ (FFI). We " +"will use this to build a safe wrapper for the `libc` functions you would use from C to read " +"the names of files in a directory." msgstr "" #: src/unsafe-rust/exercise.md @@ -11649,9 +10736,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" -"ffi/) module. There you find a number of string types which you need for the " -"exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) module. " +"There you find a number of string types which you need for the exercise:" msgstr "" #: src/unsafe-rust/exercise.md @@ -11664,8 +10750,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://doc.rust-lang." +"org/std/string/struct.String.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -11678,8 +10764,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" -"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" +"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`](https://doc.rust-" +"lang.org/std/ffi/struct.CString.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -11692,8 +10778,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " -"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`](https://doc." +"rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -11709,9 +10795,7 @@ msgid "You will convert between all these types:" msgstr "" #: src/unsafe-rust/exercise.md -msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` " -"character," +msgid "`&str` to `CString`: you need to allocate space for a trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md @@ -11719,39 +10803,36 @@ msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" #: src/unsafe-rust/exercise.md -msgid "" -"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " -"character," +msgid "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " -"unknown data\"," +"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some unknown data\"," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," +"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`](https://doc.rust-" +"lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " -"return it and call `readdir` again." +"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to return it and " +"call `readdir` again." msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " -"useful chapter about FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful chapter about " +"FFI." msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"Copy the code below to and fill in the missing " -"functions and methods:" +"Copy the code below to and fill in the missing functions and " +"methods:" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md @@ -11782,10 +10863,8 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md @@ -11893,102 +10972,96 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can " -"write new services, libraries, drivers or even firmware in Rust (or improve " -"existing code as needed)." +"Rust is supported for system software on Android. This means that you can write new services, " +"libraries, drivers or even firmware in Rust (or improve existing code as needed)." msgstr "" -"‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " -"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " -"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." +"‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می توانید سرویس‌ها، " +"کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا در صورت نیاز کدهای موجود را " +"بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to find a little " +"corner of your code base where we can move some lines of code to Rust. The fewer dependencies " +"and \"exotic\" types the better. Something that parses some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " -"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " -"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " -"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین سعی کنید " +"گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به Rust منتقل کنیم. هر چه " +"وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه " +"کند ایده آل خواهد بود." #: src/android.md -msgid "" -"The speaker may mention any of the following given the increased use of Rust " -"in Android:" +msgid "The speaker may mention any of the following given the increased use of Rust in Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " -"زیر اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-" +"android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-android." +"html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/rutabaga_gfx." +"html)" msgstr "" -"کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/appendix/" +"rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-" +"v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-" +"v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android." +"html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android." +"html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make " -"sure you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure you have " +"access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " -"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. مطمئن شوید " +"که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/" -"setup/start) for details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/start) for " +"details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" -"docs/setup/start) مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/setup/start) " +"مراجعه کنید." #: src/android/setup.md msgid "" -"Cuttlefish is a reference Android device designed to work on generic Linux " -"desktops. MacOS support is also planned." +"Cuttlefish is a reference Android device designed to work on generic Linux desktops. MacOS " +"support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " -"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی طراحی شده " +"است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is " -"the ideal emulator to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is the ideal emulator " +"to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " -"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل برای اجرای " +"بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "" -"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -12012,8 +11085,7 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "" -"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -12021,22 +11093,18 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static and shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " -"متغیرهای static و share را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای static و share " +"را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" msgstr "`rust_proc_macro`" #: src/android/build-rules.md -msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins." -msgstr "" -"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +msgid "Produces a `proc-macro` Rust library. These are analogous to compiler plugins." +msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -12044,9 +11112,7 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." -msgstr "" -"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " -"می‌کند." +msgstr "یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -12062,23 +11128,20 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for " -"a particular protobuf." +"Generates source and produces a Rust library that provides an interface for a particular " +"protobuf." msgstr "" -"یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " -"protobuf خاص فراهم می‌کند." +"یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک protobuf خاص " +"فراهم می‌کند." #: src/android/build-rules.md msgid "`rust_bindgen`" msgstr "`rust_bindgen`" #: src/android/build-rules.md -msgid "" -"Generates source and produces a Rust library containing Rust bindings to C " -"libraries." +msgid "Generates source and produces a Rust library containing Rust bindings to C libraries." msgstr "" -"یک source تولید می‌کند و یک کتابخانه Rust حاوی پیوندهای Rust به کتابخانه‌های C " -"تولید می‌کند." +"یک source تولید می‌کند و یک کتابخانه Rust حاوی پیوندهای Rust به کتابخانه‌های C تولید می‌کند." #: src/android/build-rules.md msgid "We will look at `rust_binary` and `rust_library` next." @@ -12090,28 +11153,25 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages " -"from the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages from the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " -"اینترنت دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must " -"also interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must also interop with C/" +"C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " -"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/C++/Java " +"همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the " -"open-source variant of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-source variant " +"of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " -"استفاده در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده در google3)." #: src/android/build-rules.md #, fuzzy @@ -12124,11 +11184,9 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, " -"create the following files:" -msgstr "" -"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " -"ایجاد کنید:" +"Let us start with a simple application. At the root of an AOSP checkout, create the following " +"files:" +msgstr "اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -12139,8 +11197,7 @@ msgstr "_hello_rust/Android.bp_:" msgid "\"hello_rust\"" msgstr "\"hello_rust\"" -#: src/android/build-rules/binary.md src/android/build-rules/library.md -#: src/android/logging.md +#: src/android/build-rules/binary.md src/android/build-rules/library.md src/android/logging.md msgid "\"src/main.rs\"" msgstr "\"src/main.rs\"" @@ -12185,9 +11242,7 @@ msgstr "کتابخانه‌های Rust" #: src/android/build-rules/library.md msgid "You use `rust_library` to create a new Rust library for Android." -msgstr "" -"شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده " -"می‌کنید." +msgstr "شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده می‌کنید." #: src/android/build-rules/library.md msgid "Here we declare a dependency on two libraries:" @@ -12200,13 +11255,11 @@ msgstr "‏ `libgreeting`, چیزی که در زیر تعریف می‌کنیم, #: src/android/build-rules/library.md #, fuzzy msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`](https://cs." +"android.com/android/platform/superproject/+/master:external/rust/crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/) عرضه شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://cs.android.com/" +"android/platform/superproject/+/master:external/rust/crates/) عرضه شده است." #: src/android/build-rules/library.md #, fuzzy @@ -12230,9 +11283,8 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md -#: src/android/aidl/example-service/service.md src/android/testing.md -#: src/android/interoperability/java.md +#: src/android/build-rules/library.md src/android/aidl/example-service/service.md +#: src/android/testing.md src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -12261,25 +11313,23 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android." -"com/guide/components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android.com/guide/" +"components/aidl) is supported in Rust:" msgstr "" -"‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" -"guide/components/aidl) در Rust پشتیبانی می‌شود:" +"‏[Android Interface Definition Language (AIDL)](https://developer.android.com/guide/components/" +"aidl) در Rust پشتیبانی می‌شود:" #: src/android/aidl.md msgid "Rust code can call existing AIDL servers," @@ -12291,13 +11341,13 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" -"To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement " -"the described service and write client code that talks to that service." +"To illustrate how to use Rust with Binder, we're going to walk through the process of creating " +"a Binder interface. We're then going to both implement the described service and write client " +"code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " -"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " -"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder را بررسی " +"کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را می‌نویسیم که با آن سرویس صحبت " +"می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -12309,10 +11359,8 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -12345,14 +11393,13 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match " -"the package name used in the AIDL file, i.e. the package is `com.example." -"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." +"Note that the directory structure under the `aidl/` directory needs to match the package name " +"used in the AIDL file, i.e. the package is `com.example.birthdayservice` and the file is at " +"`aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " -"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." -"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." -"aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package استفاده شده در " +"فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example.birthdayservice` و این فایل در " +"`aidl/com/example/IBirthdayService.aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -12360,11 +11407,9 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to " -"talk to the service." -msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " -"با سرویس" +"Binder generates a trait corresponding to the interface definition. trait to talk to the " +"service." +msgstr "‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -12372,35 +11417,28 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use " -"this trait to talk to the service." +"Your service will need to implement this trait, and your client will use this trait to talk to " +"the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " -"صحبت با سرویس‌ها استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با سرویس‌ها " +"استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md -msgid "" -"The generated bindings can be found at `out/soong/.intermediates//`." -msgstr "" -"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" -"` یافت." +msgid "The generated bindings can be found at `out/soong/.intermediates//`." +msgstr "پیوندهای تولید شده را می توان در `out/soong/.intermediates//` یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument " -"and return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument and return types, " +"correspond the interface definition." msgstr "" -"اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " -"بازگشتی، با تعریف interface مطابقت دارد." +"اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و بازگشتی، با تعریف " +"interface مطابقت دارد." #: src/android/aidl/example-service/service-bindings.md -msgid "" -"`String` for an argument results in a different Rust type than `String` as a " -"return type." +msgid "`String` for an argument results in a different Rust type than `String` as a return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " -"type برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -12426,51 +11464,45 @@ msgstr "/// The `IBirthdayService` implementation.\n" msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "\"Happy Birthday {name}, congratulations with the {years} years!\"" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "_birthday_service/Android.bp_:" msgstr "_birthday_service/Android.bp_:" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md msgid "\"libbirthdayservice\"" msgstr "\"libbirthdayservice\"" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md #, fuzzy msgid "\"birthdayservice\"" msgstr "\"birthdayservice\"" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"com.example.birthdayservice-rust\"" msgstr "\"com.example.birthdayservice-rust\"" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"libbinder_rs\"" msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain " -"why each of the segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain why each of the " +"segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " -"از بخش‌ها ضروری است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از بخش‌ها ضروری " +"است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to " -"override? Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to override? Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " -"برای override وجود دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای override وجود " +"دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -12507,24 +11539,22 @@ msgstr "\"birthday_server\"" msgid "\"src/server.rs\"" msgstr "سرورها" -#: src/android/aidl/example-service/server.md -#: src/android/aidl/example-service/client.md +#: src/android/aidl/example-service/server.md src/android/aidl/example-service/client.md msgid "// To avoid dynamic link error.\n" msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case " -"the `BirthdayService` type, which implements the `IBirthdayService`) and " -"starting it as a Binder service has multiple steps, and may appear more " -"complicated than students are used to if they've used Binder from C++ or " -"another language. Explain to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case the " +"`BirthdayService` type, which implements the `IBirthdayService`) and starting it as a Binder " +"service has multiple steps, and may appear more complicated than students are used to if " +"they've used Binder from C++ or another language. Explain to students why each step is " +"necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " -"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " -"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " -"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " -"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " +"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند مرحله دارد و ممکن " +"است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. اگر آن‌ها از Binder برای C++ یا " +"زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -12532,33 +11562,31 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " -"this case). This type is generated by Binder and provides the common Binder " -"functionality that would be provided by the `BnBinder` base class in C++. We " -"don't have inheritance in Rust, so instead we use composition, putting our " -"`BirthdayService` within the generated `BnBinderService`." +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this case). This " +"type is generated by Binder and provides the common Binder functionality that would be " +"provided by the `BnBinder` base class in C++. We don't have inheritance in Rust, so instead we " +"use composition, putting our `BirthdayService` within the generated `BnBinderService`." msgstr "" -"این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" -"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " -"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " -"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " -"`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." +"این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،`BnBirthdayService`). این " +"نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را ارائه می‌کند که توسط کلاس پایه `BnBinder` " +"در C++ ارائه می‌شود. ما در Rust ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب " +"composition می‌کنیم و `BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object " -"(the `BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object (the " +"`BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " -"(شی‏ «BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " +"«BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool " -"and start listening for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool and start listening " +"for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " -"اضافه کنید و شروع به گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه کنید و شروع به " +"گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -12568,16 +11596,14 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -12608,8 +11634,7 @@ msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md +#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -12644,67 +11669,60 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service " -"that the client has connected to." +"`Strong` is the trait object representing the service that the client " +"has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " -"که کلاینت به آن متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که کلاینت به آن " +"متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-" -"process ref count for the service trait object, and the global Binder ref " -"count that tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-process ref count " +"for the service trait object, and the global Binder ref count that tracks how many processes " +"have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " -"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " -"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " -"ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون فرآیندی (in-" +"process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global Binder را که تعداد " +"فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses " -"the exact same trait that the server implements. For a given Binder " -"interface, there is a single Rust trait generated that both client and " -"server use." +"Note that the trait object that the client uses to talk to the service uses the exact same " +"trait that the server implements. For a given Binder interface, there is a single Rust trait " +"generated that both client and server use." msgstr "" -"توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " -"دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " -"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " -"از آن استفاده می کنند." +"توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، دقیقاً از همان " +"ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder interface معین، یک trait یا ویژگی " +"Rust ایجاد شده است که هم کلاینت و هم سرور از آن استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This " -"should ideally be defined in a common crate that both the client and server " -"can depend on." +"Use the same service identifier used when registering the service. This should ideally be " +"defined in a common crate that both the client and server can depend on." msgstr "" -"از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " -"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " -"آن وابسته باشند." +"از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور ایده‌آل باید در یک " +"crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +"Let us extend the API with more functionality: we want to let clients specify a list of lines " +"for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " -"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم لیستی از خطوط را " +"برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -12712,13 +11730,11 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a " -"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " -"generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in Rust, i.e. " +"that idiomatic Rust types are used in the generated bindings wherever possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " -"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " -"شده تا جایی که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust ترجمه می‌شود، " +"به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -12756,10 +11772,8 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "" -"TODO: Move code snippets into project files where they'll actually be built?" -msgstr "" -"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "TODO: Move code snippets into project files where they'll actually be built?" +msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -12771,21 +11785,15 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "" -"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "" -"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md -msgid "" -"References to AIDL objects and file handles can be sent between clients and " -"services." -msgstr "" -"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " -"کرد." +msgid "References to AIDL objects and file handles can be sent between clients and services." +msgstr "ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -12794,8 +11802,7 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "" -"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -12870,12 +11877,11 @@ msgstr "`f64`" #: src/android/aidl/types/arrays.md msgid "" -"The array types (`T[]`, `byte[]`, and `List`) get translated to the " -"appropriate Rust array type depending on how they are used in the function " -"signature:" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the appropriate Rust array " +"type depending on how they are used in the function signature:" msgstr "" -"انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در " -"function signature، به Rust array type مناسب ترجمه می‌شوند:" +"انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در function signature، " +"به Rust array type مناسب ترجمه می‌شوند:" #: src/android/aidl/types/arrays.md #, fuzzy @@ -12902,22 +11908,19 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " -"array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes `[T; N]`. Fixed-" +"size arrays can have multiple dimensions (e.g. `int[3][4]`). In the Java backend, fixed-size " +"arrays are represented as array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " -"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " -"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " -"type نمایش داده می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به `[T; N]`. " +"آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3][4]`. در Java backend، " +"آرایه‌های با اندازه ثابت به عنوان array type نمایش داده می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -12925,26 +11928,20 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-" -"erased `IBinder` interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-erased `IBinder` " +"interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " -"interface پاک‌شده ارسال کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface پاک‌شده ارسال " +"کرد:" #: src/android/aidl/types/objects.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" -msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +msgstr "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" -msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgstr "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" #: src/android/aidl/types/objects.md msgid "/** The same thing, but using a binder object. */" @@ -12974,18 +11971,16 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " "`BnBirthdayService` that we saw previously." msgstr "" -"به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف " -"`BnBirthdayService` است که قبلاً دیدیم." +"به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف `BnBirthdayService` است که قبلاً " +"دیدیم." #: src/android/aidl/types/parcelables.md #, fuzzy @@ -12993,10 +11988,8 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -13004,12 +11997,10 @@ msgid "/** The same thing, but with a parcelable. */" msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md -msgid "" -"Files can be sent between Binder clients/servers using the " -"`ParcelFileDescriptor` type:" +msgid "Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" -"سرورهای Binder ارسال کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای Binder ارسال " +"کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -13046,13 +12037,11 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -13062,21 +12051,18 @@ msgstr "\"Invalid file handle\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " -"`File` (or any other type that wraps an `OwnedFd`), and can be used to " -"create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` (or any other " +"type that wraps an `OwnedFd`), and can be used to create a new `File` handle on the other side." msgstr "" -"‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " -"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " -"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک `File` (یا هر نوع " +"دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای ایجاد یک دسته `File` جدید در " +"طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md -msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " -"UNIX sockets." +msgid "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " -"سوکت های TCP، UDP و UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های TCP، UDP و " +"UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -13084,11 +12070,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests " -"work in AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests work in AOSP. Use the " +"`rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " -"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم پرداخت. از " +"ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -13156,8 +12142,7 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13167,8 +12152,7 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13176,19 +12160,19 @@ msgstr "" #: src/android/testing.md msgid "" -"Notice how you only mention the root of the library crate. Tests are found " -"recursively in nested modules." +"Notice how you only mention the root of the library crate. Tests are found recursively in " +"nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " -"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی در ماژول‌های " +"تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" -"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " -"assertions using _matchers_:" +"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test assertions using " +"_matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " -"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه می‌دهد تا " +"assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13200,55 +12184,46 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured error message pin-" +"pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " -"که خطا را pin-pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که خطا را pin-" +"pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this example in a local " +"environment. Use `cargo add googletest` to quickly add it to an existing Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " -"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " -"add googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local اجرا " +"کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used macros and types]" +"(https://docs.rs/googletest/latest/googletest/prelude/index.html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" -"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " -"می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://docs.rs/" +"googletest/latest/googletest/prelude/index.html) را وارد می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " -"Rust course: it provides a guided introduction to the library, with " -"exercises to help you get comfortable with `googletest` macros, its matchers " -"and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider going through the " +"first chapter of [\"Advanced testing for Rust applications\"](https://rust-exercises.com/" +"advanced-testing/), a self-guided Rust course: it provides a guided introduction to the " +"library, with exercises to help you get comfortable with `googletest` macros, its matchers and " +"its overall philosophy." msgstr "" -"این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " -"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" -"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " -"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " -"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." +"این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش پیشرفته برای برنامه " +"های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-workshop)، یک دوره آموزشی Rust " +"را در نظر بگیرید: این یک مقدمه راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با " +"ماکروهای `googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md -msgid "" -"A particularly nice feature is that mismatches in multi-line strings are " -"shown as a diff:" +msgid "A particularly nice feature is that mismatches in multi-line strings are shown as a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " -"نشان داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -13275,113 +12250,99 @@ msgid "shows a color-coded diff (colors not shown here):" msgstr "تفاوت رنگی را نشان می‌دهد (رنگ ها در اینجا نشان‌داده نمی‌شوند):" #: src/android/testing/googletest.md -msgid "" -"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" -"googletest/)." +msgid "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " -"در Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You need to " +"refactor your code to use traits, which you can then quickly mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " -"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " -"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده استفاده شده " +"است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس می‌توانید به سرعت آنها را " +"mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are " -"other [mocking libraries available on crates.io](https://crates.io/keywords/" -"mock), in particular in the area of mocking HTTP services. The other mocking " -"libraries work in a similar fashion as Mockall, meaning that they make it " -"easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are other [mocking " +"libraries available on crates.io](https://crates.io/keywords/mock), in particular in the area " +"of mocking HTTP services. The other mocking libraries work in a similar fashion as Mockall, " +"meaning that they make it easy to get a mock implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " -"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " -"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " -"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " -"را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking دیگری در " +"crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در زمینه سرویس‌های mocking " +"HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی " +"یا mock یک ویژگی خاص را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." +"Note that mocking is somewhat _controversial_: mocks allow you to completely isolate a test " +"from its dependencies. The immediate result is faster and more stable test execution. On the " +"other hand, the mocks can be configured wrongly and return output different from what the real " +"dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " -"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " -"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " -"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " -"برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان را می‌دهند که " +"آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای سریع‌تر و پایدارتر تست است. از " +"طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی " +"انجام می دادند را برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As an example, many " +"databases allow you to configure an in-memory backend. This means that you get the correct " +"behavior in your tests, plus they are fast and will automatically clean up after themselves." msgstr "" -"در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " -"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " -"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " -"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " -"مخصوص به خود پاک می شوند." +"در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، بسیاری از " +"پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی کنید. این به این معنی است " +"که شما در تست های خود رفتار صحیح را دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار " +"پس از اجرای عملیات مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" -"Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." +"Similarly, many web frameworks allow you to start an in-process server which binds to a random " +"port on `localhost`. Always prefer this over mocking away the framework since it helps you " +"test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " -"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " -"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " -"را در محیط واقعی آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process دیگر " +"راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را به mock کردن " +"framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example in a local " +"environment. Use `cargo add mockall` to quickly add Mockall to an existing Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " -"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " -"پروژه Cargo موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local اجرا کنید. " +"از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up expectations which depend " +"on the arguments passed. Here we use this to mock a cat which becomes hungry 3 hours after the " +"last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " -"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " -"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " -"گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که به استدلال های " +"ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat استفاده می‌کنیم که 3 ساعت پس " +"از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be called to `n` --- " +"the mock will automatically panic when dropped if this isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " -"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " -"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند به`n` فراخوانی " +"شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف کنید به‌طور خودکار دچار " +"panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) " -"or `stdout` (on-host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) or `stdout` (on-" +"host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " -"(روی host) استفاده کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی host) استفاده " +"کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -13441,15 +12402,13 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -13459,11 +12418,8 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This " -"means that you can:" -msgstr "" -"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " -"شما می‌توانید:" +"Rust has excellent support for interoperability with other languages. This means that you can:" +msgstr "‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -13475,12 +12431,11 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a " -"_foreign function interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a _foreign function " +"interface_, also known as FFI." msgstr "" -"وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " -"خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " -"می‌کنید." +"وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع خارج( _foreign " +"function interface_) که به نام FFI نیز شناخته می‌شود، استفاده می‌کنید." #: src/android/interoperability/with-c.md msgid "Interoperability with C" @@ -13488,12 +12443,11 @@ msgstr "قابلیت همکاری با C" #: src/android/interoperability/with-c.md msgid "" -"Rust has full support for linking object files with a C calling convention. " -"Similarly, you can export Rust functions and call them from C." +"Rust has full support for linking object files with a C calling convention. Similarly, you can " +"export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " -"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " -"کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به طور مشابه، می " +"توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -13509,19 +12463,12 @@ msgid "\"{x}, {abs_x}\"" msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md -msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" -"exercise.md)." -msgstr "" -"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " -"دیدیم." +msgid "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise.md)." +msgstr "ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." #: src/android/interoperability/with-c.md -msgid "" -"This assumes full knowledge of the target platform. Not recommended for " -"production." -msgstr "" -"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgid "This assumes full knowledge of the target platform. Not recommended for production." +msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -13533,11 +12480,11 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool can auto-" +"generate bindings from a C header file." msgstr "" -"ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." +"ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) می‌تواند اتصالات را " +"از یک فایل هدر C به طور خودکار ایجاد کند." #: src/android/interoperability/with-c/bindgen.md msgid "First create a small C library:" @@ -13588,12 +12535,8 @@ msgid "\"libbirthday.c\"" msgstr "\"libbirthday.c\"" #: src/android/interoperability/with-c/bindgen.md -msgid "" -"Create a wrapper header file for the library (not strictly needed in this " -"example):" -msgstr "" -"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " -"نیست):" +msgid "Create a wrapper header file for the library (not strictly needed in this example):" +msgstr "یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -13643,40 +12586,34 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " -"اتصالات (bindings) اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات (bindings) " +"اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -13772,35 +12709,30 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " -"\"some_name\"]` to specify whatever name you want." +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the " +"name of the function. You can also use `#[export_name = \"some_name\"]` to specify whatever " +"name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " -"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " -"برای تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط نام تابع خواهد " +"بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe " -"interoperability between Rust and C++." -msgstr "" -"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " -"می‌کند." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability between Rust " +"and C++." +msgstr "این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -13808,14 +12740,13 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed " -"from each language to the other. You provide this description using extern " -"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed from each language " +"to the other. You provide this description using extern blocks in a Rust module annotated with " +"the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " -"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " -"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " -"شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض دید قرار " +"می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust ارائه می‌کنید که با " +"attribute ماکروها `#[cxx::bridge]` شرح داده شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -13825,13 +12756,11 @@ msgstr "\"org::blobstore\"" msgid "// Shared structs with fields visible to both languages.\n" msgstr "// Shared structs with fields visible to both languages.\n" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/generated-cpp.md +#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/generated-cpp.md msgid "// Rust types and signatures exposed to C++.\n" msgstr "// Rust types and signatures exposed to C++.\n" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/rust-bridge.md #: src/android/interoperability/cpp/generated-cpp.md #: src/android/interoperability/cpp/rust-result.md #: src/chromium/interoperability-with-cpp/example-bindings.md @@ -13840,20 +12769,17 @@ msgstr "// Rust types and signatures exposed to C++.\n" msgid "\"Rust\"" msgstr "\"Rust\"" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md msgid "// C++ types and signatures exposed to Rust.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md #: src/android/interoperability/cpp/cpp-exception.md #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"C++\"" msgstr "\"C++\"" -#: src/android/interoperability/cpp/bridge.md -#: src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md msgid "\"include/blobstore.h\"" msgstr "\"include/blobstore.h\"" @@ -13863,25 +12789,21 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching " -"Rust and C++ type/function definitions in order to expose those items to " -"both languages." +"From the declarations made in the bridge module, CXX will generate matching Rust and C++ type/" +"function definitions in order to expose those items to both languages." msgstr "" -"از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" -"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " -"دهد." +"از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/function در Rust و +" +"+C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/" -"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " -"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " -"(though this doesn't apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/cargo-expand) " +"to view the expanded proc macro. For most of the examples you would use `cargo expand ::ffi` " +"to expand just the `ffi` module (though this doesn't apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" -"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " -"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " -"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-expand) که " +"برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از `cargo expand ::ffi` " +"فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -13906,23 +12828,19 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in " -"the parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in the parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " -"والد قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" -"+ header file containing the corresponding C++ declarations. The generated " -"header has the same path as the Rust source file containing the bridge, " -"except with a .rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ header file " +"containing the corresponding C++ declarations. The generated header has the same path as the " +"Rust source file containing the bridge, except with a .rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" -"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " -"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." -"h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C حاوی اعلان‌های +" +"+C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که فایل منبع Rust حاوی پل دارای " +"آن است، به جز استفاده از پسوند فایل rs.h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -13947,21 +12865,19 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed " -"in are accurate. CXX performs static assertions that the signatures exactly " -"correspond with what is declared in C++." +"The programmer does not need to promise that the signatures they have typed in are accurate. " +"CXX performs static assertions that the signatures exactly correspond with what is declared in " +"C++." msgstr "" -"برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " -"ندارد. CXX اظهارات ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C " -"اعلام شده مطابقت دارند." +"برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است ندارد. CXX اظهارات " +"ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C اعلام شده مطابقت دارند." #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to " -"call from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to call from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " -"Rust امن هستند را اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust امن هستند را " +"اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -13973,14 +12889,13 @@ msgstr "فقط C-like (unit) enums پشتیبانی می‌شود." #: src/android/interoperability/cpp/shared-types.md msgid "" -"A limited number of traits are supported for `#[derive()]` on shared types. " -"Corresponding functionality is also generated for the C++ code, e.g. if you " -"derive `Hash` also generates an implementation of `std::hash` for the " -"corresponding C++ type." +"A limited number of traits are supported for `#[derive()]` on shared types. Corresponding " +"functionality is also generated for the C++ code, e.g. if you derive `Hash` also generates an " +"implementation of `std::hash` for the corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " -"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " -"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد مربوطه نیز " +"برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، پیاده‌سازی `std::hash` " +"برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -13993,15 +12908,13 @@ msgstr "Generated C++:" #: src/android/interoperability/cpp/shared-enums.md #, fuzzy msgid "" -"On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum " -"class to hold a value different from all of the listed variants, and our " -"Rust representation needs to have the same behavior." +"On the Rust side, the code generated for shared enums is actually a struct wrapping a numeric " +"value. This is because it is not UB in C++ for an enum class to hold a value different from " +"all of the listed variants, and our Rust representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " -"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " -"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " -"رفتار مشابهی داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی را بسته‌بندی " +"می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از همه انواع فهرست شده " +"داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -14012,28 +12925,21 @@ msgid "\"Success!\"" msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md -msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ " -"side." -msgstr "" -"توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." +msgid "Rust functions that return `Result` are translated to exceptions on the C++ side." +msgstr "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" -"The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come " -"from the error type's `Display` impl." +"The exception thrown will always be of type `rust::Error`, which primarily exposes a way to " +"get the error message string. The error message will come from the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " -"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " -"خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول راهی برای " +"دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to " -"immediately terminate." -msgstr "" -"باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." +"A panic unwinding from Rust to C++ will always cause the process to immediately terminate." +msgstr "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." #: src/android/interoperability/cpp/cpp-exception.md msgid "\"example/include/example.h\"" @@ -14046,24 +12952,21 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception " -"on the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception on the C++ side " +"and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " -"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " -"برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت ++C را می‌گیرند " +"و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not " -"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" -"terminate`. The behavior is equivalent to the same exception being thrown " -"through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not declared by the CXX " +"bridge to return `Result`, the program calls C++'s `std::terminate`. The behavior is " +"equivalent to the same exception being thrown through a `noexcept` C++ function." msgstr "" -"اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " -"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " -"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " -"C++ function فعال می‌شود." +"اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت \"نتیجه\" اعلان " +"نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی می‌کند. این رفتار معادل همان " +"exception است که از طریق یک `noexcept` C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -14123,42 +13026,39 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments " -"and returns of extern functions." +"These types can be used in the fields of shared structs and the arguments and returns of " +"extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " -"functionها استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are " -"a few reasons for this:" +"Note that Rust's `String` does not map directly to `std::string`. There are a few reasons for " +"this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " -"چند دلیل برای این وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند دلیل برای این " +"وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "" -"`std::string` does not uphold the UTF-8 invariant that `String` requires." -msgstr "" -"‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." +msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgstr "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed " -"directly between languages." +"The two types have different layouts in memory and so can't be passed directly between " +"languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " -"مستقیماً بین زبان‌ها منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً بین زبان‌ها " +"منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move " -"semantics, so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move semantics, so a `std::" +"string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " -"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، بنابراین " +"`std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14168,11 +13068,10 @@ msgstr "ساخت در اندروید" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Create a `cc_library_static` to build the C++ library, including the CXX " -"generated header and source file." +"Create a `cc_library_static` to build the C++ library, including the CXX generated header and " +"source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " -"شده CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -14199,43 +13098,39 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the dependencies " +"for the CXX-generated C++ bindings. We'll show how these are setup on the next slide." msgstr "" -"به این نکته اشاره کنید که `libcxx_test_bridge_header` و " -"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" -"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"به این نکته اشاره کنید که `libcxx_test_bridge_header` و `libcxx_test_bridge_code` وابستگی‌هایی " +"برای پیوندهای ++C تولید شده توسط CXX ​​هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in order to pull in " +"common CXX definitions." msgstr "" -"توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" -"header` وابسته باشید." +"توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-header` وابسته " +"باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs](https://source.android." +"com/docs/setup/build/rust/building-rust-modules/android-rust-patterns#rust-cpp-interop-using-" +"cxx). You may want to share that link with the class so that students know where they can find " +"these instructions again in the future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " -"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" -"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " -"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " -"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید [the Android " +"docs](https://source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" +"patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید " +"تا دانش‌آموزان بدانند که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the " -"CXX source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the CXX source file. " +"These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " -"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. سپس از اینها " +"به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -14278,28 +13173,23 @@ msgstr "\"lib.rs.cc\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " -"bridge module. It is included in Android and available as a Soong tool." +"The `cxxbridge` tool is a standalone tool that generates the C++ side of the bridge module. It " +"is included in Android and available as a Soong tool." msgstr "" -"ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در " -"Android گنجانده شده و به عنوان ابزار Soong در دسترس است." +"ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در Android گنجانده شده " +"و به عنوان ابزار Soong در دسترس است." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"By convention, if your Rust source file is `lib.rs` your header file will be " -"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " -"convention isn't enforced, though." +"By convention, if your Rust source file is `lib.rs` your header file will be named `lib.rs.h` " +"and your source file will be named `lib.rs.cc`. This naming convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." -"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " -"اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و فایل منبع شما " +"`lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md -msgid "" -"Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." -msgstr "" -"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " -"دارد." +msgid "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." +msgstr "یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -14315,14 +13205,13 @@ msgstr "قابلیت همکاری با جاوا" #: src/android/interoperability/java.md msgid "" -"Java can load shared objects via [Java Native Interface (JNI)](https://en." -"wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" -"jni/) allows you to create a compatible library." +"Java can load shared objects via [Java Native Interface (JNI)](https://en.wikipedia.org/wiki/" +"Java_Native_Interface). The [`jni` crate](https://docs.rs/jni/) allows you to create a " +"compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " -"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " -"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " -"کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface (JNI)](https://" +"en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` crate](https://docs.rs/jni/) " +"به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -14392,11 +13281,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with and try to " +"integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " -"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و سعی می‌کنیم " +"مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -14408,11 +13297,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone in the class " +"having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " -"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی است که یک قطعه " +"کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -14420,52 +13309,47 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party " -"glue code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party glue code to connect " +"between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " -"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص برای اتصال " +"بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've " -"got a corner of the code where you're displaying a UTF8 string to the user, " -"feel free to follow this recipe in your part of the codebase instead of the " -"exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've got a corner of the " +"code where you're displaying a UTF8 string to the user, feel free to follow this recipe in " +"your part of the codebase instead of the exact part we talk about." msgstr "" -"امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " -"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " -"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " -"پایگاه کد دنبال کنید." +"امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر گوشه‌ای از کد را " +"دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت دقیقی که در مورد آن صحبت " +"می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build " -"flags is OK, so long as your code is relatively recent (commit position " -"1223636 onwards, corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build flags is OK, so long " +"as your code is relatively recent (commit position 1223636 onwards, corresponding to November " +"2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " -"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " -"commit 1223636 به بعد، مربوط به نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از build flag ها " +"بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit 1223636 به بعد، مربوط به " +"نوامبر 2023):" #: src/chromium/setup.md #, fuzzy msgid "" -"(A component, debug build is recommended for quickest iteration time. This " -"is the default!)" +"(A component, debug build is recommended for quickest iteration time. This is the default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " -"یک حالت پیش‌فرض است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک حالت پیش‌فرض " +"است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" -"the-code/) if you aren't already at that point. Be warned: setting up to " -"build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-code/) if you " +"aren't already at that point. Be warned: setting up to build Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." -"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " -"برای build Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium.org/developers/" +"how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -14477,25 +13361,21 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" -"This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. " -"If you don't have time to complete a certain part, don't worry: you can " -"catch up in the next slot." +"This part of the course has a series of exercises which build on each other. We'll be doing " +"them spread throughout the course instead of just at the end. If you don't have time to " +"complete a certain part, don't worry: you can catch up in the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " -"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " -"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " -"به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها را به جای " +"اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای تکمیل قسمت خاصی وقت " +"ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io]" -"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " -"set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io](https://crates.io/). " +"Chromium is built using `gn` and `ninja` and a curated set of dependencies." msgstr "" -"جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " -"استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " -"ساخته شده است." +"جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) استفاده می‌کند. " +"Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها ساخته شده است." #: src/chromium/cargo.md msgid "When writing code in Rust, your choices are:" @@ -14503,41 +13383,39 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." -"gni` (e.g. `rust_static_library` that we'll meet later). This uses " -"Chromium's audited toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e.g. " +"`rust_static_library` that we'll meet later). This uses Chromium's audited toolchain and " +"crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " -"crateهای بررسی‌شده Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای بررسی‌شده " +"Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " -"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates](https://" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " -"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" -"heads/main/docs/rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium محدود کنید]" +"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " -"downloaded from the internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded from the " +"internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " -"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای دانلود شده از " +"اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " -"code can be built into the Chromium browser. At the same time, Cargo is an " -"important part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code can be built " +"into the Chromium browser. At the same time, Cargo is an important part of the Rust ecosystem " +"and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " -"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " -"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان کد Rust را در " +"مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم Rust است و شما باید آن را در " +"جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -14549,127 +13427,112 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the " -"risk profile of these scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk profile of these " +"scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " -"ریسک‌های این سناریوها را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های این سناریوها " +"را ارزیابی کند." #: src/chromium/cargo.md msgid "" -"Discuss which tools, libraries, and groups of people need to be trusted when " -"using `gn` and `ninja`, offline `cargo`, etc." +"Discuss which tools, libraries, and groups of people need to be trusted when using `gn` and " +"`ninja`, offline `cargo`, etc." msgstr "" -"در هنگام استفاده از `gn` و `ninja`و `cargo` آفلاین و غیره در مورد ابزارها، " -"کتابخانه‌ها و گروه‌هایی از افراد بحث کنید." +"در هنگام استفاده از `gn` و `ninja`و `cargo` آفلاین و غیره در مورد ابزارها، کتابخانه‌ها و " +"گروه‌هایی از افراد بحث کنید." #: src/chromium/cargo.md msgid "" -"Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them " -"to discuss in small groups of 3-4 people." +"Ask students to avoid peeking at the speaker notes before completing the exercise. Assuming " +"folks taking the course are physically together, ask them to discuss in small groups of 3-4 " +"people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " -"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " -"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران خودداری کنند. با " +"فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، از آنها بخواهید در گروه های " +"کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where " -"Cargo may offer an advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where Cargo may offer an " +"advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " -"را ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, " -"one has access to the rich ecosystem of crates.io libraries. There is a " -"crate for almost anything and they are usually quite pleasant to use. " -"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" -"from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, one has access to " +"the rich ecosystem of crates.io libraries. There is a crate for almost anything and they are " +"usually quite pleasant to use. (`clap` for command-line parsing, `serde` for serializing/" +"deserializing to/from various formats, `itertools` for working with iterators, etc.)." msgstr "" -"این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " -"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " -"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " -"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " -"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." +"این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به اکوسیستم غنی " +"کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک crate وجود دارد و معمولاً " +"استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط فرمان، `serde` برای سریال‌سازی/" +"جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo." -"toml` and start writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` and start " +"writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " -"اضافه کنید و شروع به نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه کنید و شروع به " +"نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" -"It may be worth comparing how CPAN helped make `perl` a popular choice. Or " -"comparing with `python` + `pip`." +"It may be worth comparing how CPAN helped make `perl` a popular choice. Or comparing with " +"`python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " -"مقایسه با `python` + `pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با `python` + " +"`pip`." #: src/chromium/cargo.md #, fuzzy msgid "" -"Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate " -"that needs to work on nightly, current stable, and older stable) but also by " -"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a " +"Development experience is made really nice not only by core Rust tools (e.g. using `rustup` to " +"switch to a different `rustc` version when testing a crate that needs to work on nightly, " +"current stable, and older stable) but also by an ecosystem of third-party tools (e.g. Mozilla " +"provides `cargo vet` for streamlining and sharing security audits; `criterion` crate gives a " "streamlined way to run benchmarks)." msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " -"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " -"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " -"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " -"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " -"راهی ساده برای اجرای benchmark‌ها می‌دهد)." +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای تغییر به " +"نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی پایداری‌های شبانه، فعلی و " +"قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً " +"موزیلا `cargo vet` را برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` " +"crate راهی ساده برای اجرای benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "" -"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." -msgstr "" -"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " -"می‌کند." +msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgstr "‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." -msgstr "" -"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " -"باشد." +msgstr "ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." #: src/chromium/cargo.md -msgid "" -"Broad, generic examples of projects where `cargo` may be the right choice:" +msgid "Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " -"for writing command line tools. The breadth and ergonomics of libraries is " -"comparable to Python, while being more robust (thanks to the rich " -"typesystem) and running faster (as a compiled, rather than interpreted " -"language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for writing " +"command line tools. The breadth and ergonomics of libraries is comparable to Python, while " +"being more robust (thanks to the rich typesystem) and running faster (as a compiled, rather " +"than interpreted language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " -"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " -"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " -"زبان کامپایل شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان محبوب می‌شود. " +"گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که قوی‌تر (به لطف تایپ سیستم " +"غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل شده و نه مفسری)." #: src/chromium/cargo.md msgid "" -"Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be " -"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " -"should probably use Cargo." +"Participating in the Rust ecosystem requires using standard Rust tools like Cargo. Libraries " +"that want to get external contributions, and want to be used outside of Chromium (e.g. in " +"Bazel or Android/Soong build environments) should probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " -"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " -"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " -"باید از Cargo استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. کتابخانه‌هایی " +"که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium استفاده شوند (مثلاً در " +"محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -14677,11 +13540,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which " -"resulted in PRs with performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which resulted in PRs with " +"performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " -"با بهبود در عملکرد می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با بهبود در عملکرد " +"می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -14689,58 +13552,52 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` " -"for command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` for command-line " +"parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " -"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به `clap` و برای " +"فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " -"when building and bootstrapping Rust standard library when building Rust " -"toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when building and " +"bootstrapping Rust standard library when building Rust toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " -"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " -"toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در هنگام ساخت و " +"راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." #: src/chromium/cargo.md msgid "" -"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " -"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " -"`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" +"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on third-party " +"libraries downloaded from the internet, but `run_gnrt.py` asks `cargo` that only `--locked` " +"content is allowed via `Cargo.lock`.)" msgstr "" -"‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " -"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." -"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " -"است.)" +"‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به کتابخانه‌های شخص " +"ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` از `cargo` می‌پرسد که فقط " +"محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" #: src/chromium/cargo.md -msgid "" -"Students may identify the following items as being implicitly or explicitly " -"trusted:" -msgstr "" -"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgid "Students may identify the following items as being implicitly or explicitly trusted:" +msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" -"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the " -"Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " -"compiler team), binary Rust compiler downloaded for bootstrapping" +"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the Clang compiler, " +"the `rustc` sources (fetched from GitHub, reviewed by Rust compiler team), binary Rust " +"compiler downloaded for bootstrapping" msgstr "" -"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " -"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، منابع `rustc` " +"(برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر Rust باینری که برای راه اندازی " +"بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" -"`rustup` (it may be worth pointing out that `rustup` is developed under the " -"umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" +"`rustup` (it may be worth pointing out that `rustup` is developed under the umbrella of the " +"https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" -"rust-lang/ - همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-lang/ - " +"همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -14748,23 +13605,20 @@ msgstr "`cargo`, `rustfmt`, ب." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for " -"distributing the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for distributing the prebuilt " +"toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " -"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain از پیش‌ساخته " +"شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md -msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by " -"security@chromium.org)" +msgid "Rust libraries vendored into `//third_party/rust` (audited by security@chromium.org)" msgstr "" -"کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " -"security@chromium.org)" +"کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط security@chromium.org)" #: src/chromium/cargo.md msgid "Other Rust libraries (some niche, some quite popular and commonly used)" @@ -14776,94 +13630,71 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as approved by Chromium's " +"[Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " -"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" -"ATL_OWNERS) تأیید شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech Leads]" +"(https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"Chromium's policy on third party libraries is outlined [here](https://chromium.googlesource." +"com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust is allowed for third party " +"libraries under various circumstances, including if they're the best option for performance or " +"for security." msgstr "" -"رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " -"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " -"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." +"رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium.googlesource.com/" +"chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده است. Rust برای کتابخانه‌های " +"شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا " +"موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"Very few Rust libraries directly expose a C/C++ API, so that means that nearly all such " +"libraries will require a small amount of first-party glue code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " -"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " -"glue code اول شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) قرار می‌دهند، " +"به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" -": \"C++\" : : \"wrapper\" " -"crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" +": \"C++\" : : \"wrapper\" crate :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" -": \"C++\" : : \"wrapper\" " -"crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" +": \"C++\" : : \"wrapper\" crate :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should normally be kept in " +"`third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" -"rust///wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust//" +"/wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -14875,15 +13706,13 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." -msgstr "" -"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " -"کنید." +msgstr "نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " -"مسیر مناسب ادامه یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر مناسب ادامه " +"یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -14891,23 +13720,20 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and " -"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " -"is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` for efficiency " +"--- its static rules allow maximum parallelism. Rust is no exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " -"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " -"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت کارایی بیشتر " +"ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر می‌سازد. Rust نیز از این قاعده " +"مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "" -"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "" -"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -14931,47 +13757,43 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to " -"depend upon third party code." +"You can also add `deps` on other Rust targets. Later we'll use this to depend upon third party " +"code." msgstr "" -"همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " -"وابستگی به کد شخص ثالث استفاده خواهیم کرد." +"همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای وابستگی به کد شخص " +"ثالث استفاده خواهیم کرد." #: src/chromium/build-rules.md msgid "" -"You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root " -"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " -"list of all source files which `ninja` needs in order to determine when " -"rebuilds are necessary." +"You must specify _both_ the crate root, _and_ a full list of sources. The `crate_root` is the " +"file given to the Rust compiler representing the root file of the compilation unit --- " +"typically `lib.rs`. `sources` is a complete list of all source files which `ninja` needs in " +"order to determine when rebuilds are necessary." msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " -"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " -"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " -"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " -"دارد." +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی است که به " +"کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- معمولاً به‌نام `lib.rs` " +"است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی است که `ninja` برای تعیین زمان لازم " +"برای بازسازی به آن‌ها نیاز دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire " -"crate is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate is a " +"compilation unit. A `static_library` is the smallest unit.)" msgstr "" -"(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " -"جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" +"(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد جمع‌آوری است. " +"`static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using " -"[gn's built-in support for Rust static libraries](https://gn.googlesource." -"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " -"this template provides support for CXX interop, Rust features, and unit " -"tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using [gn's built-in " +"support for Rust static libraries](https://gn.googlesource.com/gn/+/main/docs/reference." +"md#func_static_library). The answer is that this template provides support for CXX interop, " +"Rust features, and unit tests, some of which we'll use later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " -"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" -"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " -"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " -"از برخی از آنها استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای کتابخانه‌های " +"استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library) به " +"یک الگوی gn نیاز داریم. پاسخ این است که این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد " +"پشتیبانی می‌کند که بعداً از برخی از آنها استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -14979,15 +13801,13 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " -"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " -"the gn target. (Later in the course we'll see circumstances where this is " -"necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't compile. If you " +"need unsafe Rust code, add `allow_unsafe = true` to the gn target. (Later in the course we'll " +"see circumstances where this is necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " -"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " -"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " -"است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل نمی‌شود. اگر به " +"کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn اضافه کنید. (بعداً در دوره ما " +"شرایطی را خواهیم دید که در آن لازم است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -15053,29 +13873,22 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than " -"for C++. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than for C++. Visual " +"Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " -"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " -"استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد ویژوال " +"استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy -msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " -"Rust support" +msgid "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " -"قبلی پشتیبانی از Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی پشتیبانی از " +"Rust" #: src/chromium/build-rules/vscode.md -msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output " -"directory)" -msgstr "" -"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " -"شما)" +msgid "`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" +msgstr "‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -15083,329 +13896,282 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-" -"analyzer might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-analyzer might be " +"beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " -"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های code annotation " +"و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a " -"piece of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a piece of Chromium-" +"related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " -"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به Chromium که " +"بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "" -"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" -"Place the cursor over the `QrCode::new` call (around line 26) in " -"\\`qr_code_generator_ffi_glue.rs" +"Place the cursor over the `QrCode::new` call (around line 26) in \\`qr_code_generator_ffi_glue." +"rs" msgstr "" -"مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در " -"\\`qr_code_generator_ffi_glue.rs قرار دهید" +"مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در \\`qr_code_generator_ffi_glue.rs قرار " +"دهید" #: src/chromium/build-rules/vscode.md -msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " -"K)." -msgstr "" -"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" -"CoC = K)." +msgid "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." +msgstr "نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " -"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This will take you " +"to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " -"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." -"rs` می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " +"(این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " -"164; the outline is in the file explorer pane in vscode; typical vim/CoC " -"bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; the outline " +"is in the file explorer pane in vscode; typical vim/CoC bindings = space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " -"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " -"bindings = space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط 164؛ طرح کلی در " +"پنجره file explorer در vscode است؛ typical vim/CoC bindings = space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the " -"`QrCode::with_bits` method)" +"Demo **type annotations** (there are quite a few nice examples in the `QrCode::with_bits` " +"method)" msgstr "" -"نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" -"with_bits` وجود دارد)" +"نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will " -"need to be rerun after editing `BUILD.gn` files (which we will do a few " -"times throughout the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will need to be rerun " +"after editing `BUILD.gn` files (which we will do a few times throughout the exercises in this " +"session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " -"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " -"اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های `BUILD.gn` " +"(که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md -msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " -"containing:" -msgstr "" -"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " -"که حاوی:" +msgid "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" +msgstr "در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " -"target." +"**Important**: note that `no_mangle` here is considered a type of unsafety by the Rust " +"compiler, so you'll need to allow unsafe code in your `gn` target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " -"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " -"`gn` target خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی (type of " +"unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" -"Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " -"see how this can be automated by bindings generation tools):" +"Add this new Rust target as a dependency of `//ui/base:base`. Declare this function at the top " +"of `ui/base/resource/resource_bundle.cc` (later, we'll see how this can be automated by " +"bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " -"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " -"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را در بالای `ui/" +"base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که چگونه می‌توان این کار را با " +"ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " -"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " -"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " -"times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we suggest the " +"top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run Chromium, and ensure that " +"\"Hello from Rust!\" is printed lots of times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " -"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " -"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " -"بارها چاپ می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما قسمت بالای " +"`ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. Chromium را Build و اجرا کنید " +"و مطمئن شوید که \"Hello from Rust!\" بارها چاپ می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " -"in subsequent exercises. If you've succeeded, you will be able to use right-" -"click \"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in subsequent " +"exercises. If you've succeeded, you will be able to use right-click \"Go to definition\" on " +"`println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " -"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " -"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار کند. این کار " +"در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک راست روی\"Go to " +"definition\" در`println!` استفاده کنید." -#: src/exercises/chromium/build-rules.md -#: src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/build-rules.md src/exercises/chromium/interoperability-with-cpp.md msgid "Where to find help" msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://" -"source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." -"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" -"l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" +"no_mangle-attribute)" msgstr "" -"اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." -"html#the-no_mangle-attribute)" +"اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" +"no_mangle-attribute)" #: src/exercises/chromium/build-rules.md -msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." -"extern.html)" -msgstr "" -"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." -"html)" +msgid "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" +msgstr "اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" -"languages/rust)" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" msgstr "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" -"languages/rust)" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-" -"denominator interop language, C. Both C++ and Rust can natively declare and " -"call C ABI functions. Later in the course, we'll connect C++ directly to " -"Rust." +"This example is unusual because it boils down to the lowest-common-denominator interop " +"language, C. Both C++ and Rust can natively declare and call C ABI functions. Later in the " +"course, we'll connect C++ directly to Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " -"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. بعداً در دوره، +" +"+C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to generate two " +"functions with the same name, and Rust can no longer guarantee that the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " -"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " -"کند که تابع مورد نظر فراخوانی شده است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به Rust اجازه دهد " +"دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که تابع مورد نظر فراخوانی شده " +"است." #: src/exercises/chromium/build-rules.md msgid "" -"If you need a pure Rust executable, you can also do that using the " -"`rust_executable` gn template." +"If you need a pure Rust executable, you can also do that using the `rust_executable` gn " +"template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " -"از الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " +"الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same " -"source file as the code being tested. This was covered [earlier](../testing." -"md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same source file as the " +"code being tested. This was covered [earlier](../testing.md) in the course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " -"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " -"پوشش داده شده بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد مورد آزمایش " +"قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده بود و به این صورت است:" #: src/chromium/testing.md msgid "" -"In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable " -"and helps to avoid rebuilding `.rs` files a second time (in the `test` " -"configuration)." +"In Chromium we place unit tests in a separate source file and we continue to follow this " +"practice for Rust --- this makes tests consistently discoverable and helps to avoid rebuilding " +"`.rs` files a second time (in the `test` configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " -"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " -"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " -"`test`) جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این روش را برای " +"Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف باشند و کمک می‌کند از بازسازی " +"فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) جلوگیری شود." #: src/chromium/testing.md -msgid "" -"This results in the following options for testing Rust code in Chromium:" +msgid "This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md -msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" -"rust`." -msgstr "" -"تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." +msgid "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." +msgstr "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " -"when Rust code is just a thin FFI layer and the existing unit tests provide " -"sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when Rust code is " +"just a thin FFI layer and the existing unit tests provide sufficient coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " -"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " -"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. زمانی که کد " +"Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای ویژگی‌هایی که ارائه " +"می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its " -"public API (using `pub mod for_testing { ... }` if needed). This is the " -"subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its public API (using " +"`pub mod for_testing { ... }` if needed). This is the subject of the next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " -"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " -"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی آن استفاده " +"می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده می‌کنند. این موضوع در چند " +"اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" -"Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after " -"adding or updating third-party crates.)" +"Mention that native Rust tests of third-party crates should eventually be exercised by " +"Chromium bots. (Such testing is needed rarely --- only after adding or updating third-party " +"crates.)" msgstr "" -"ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " -"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " -"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" +"ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط روبات‌های Chromium " +"انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از افزودن یا به‌روز‌رسانی crateهای شخص " +"ثالث.)" #: src/chromium/testing.md -msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " -"used:" +msgid "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " -"مقابل Rust `gtest` استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل Rust `gtest` " +"استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a " -"thin FFI glue) and therefore uses the existing C++ unit tests for testing " -"both the C++ and the Rust implementation (parameterizing the tests so they " -"enable or disable Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a thin FFI glue) and " +"therefore uses the existing C++ unit tests for testing both the C++ and the Rust " +"implementation (parameterizing the tests so they enable or disable Rust using a " +"`ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " -"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " -"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " -"`ScopedFeatureList` آن را فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و بنابراین از " +"unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند (تست‌ها را پارامتر می‌کند تا " +"Rust را با استفاده از یک `ScopedFeatureList` آن را فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe " -"implementation of pixel transformations that are provided by `libpng` but " -"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " -"functionality may benefit from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe implementation of pixel " +"transformations that are provided by `libpng` but missing in the `png` crate - e.g. RGBA => " +"BGRA, or gamma correction. Such functionality may benefit from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " -"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " -"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " -"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " -"بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی داشته باشد که " +"توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به عنوان مثال. RGBA => BGRA یا " +"تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust " +"نوشته شده است بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/" +"rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" -"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/" +"rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md -msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " -"attribute)" +msgid "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" msgstr "" -"از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " -"`#[gtest(...)]` attribute)" +"از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از `#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " -"panicking and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking and not " +"terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " -"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی assertion " +"ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -15413,11 +14179,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing " -"test binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing test binary that " +"already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " -"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که از قبل حاوی " +"تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -15439,11 +14205,11 @@ msgstr "" #: src/chromium/testing/build-gn.md msgid "" -"Authoring Rust tests in a separate `static_library` also works, but requires " -"manually declaring the dependency on the support libraries:" +"Authoring Rust tests in a separate `static_library` also works, but requires manually " +"declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " -"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام دستی وابستگی " +"به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -15485,19 +14251,17 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " -"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " -"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " -"computed based on the full target path and name. Fortunately we can avoid " -"working with such an unwieldy name by using the `chromium::import!` macro " -"from the automatically-imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import and use " +"`my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an explicit `crate_name` for " +"`my_rust_lib` so its crate name is computed based on the full target path and name. " +"Fortunately we can avoid working with such an unwieldy name by using the `chromium::import!` " +"macro from the automatically-imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " -"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " -"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " -"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " -"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " -"درنتیجه از کار با چنین نامی پرهیز کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " +"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح برای " +"`my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل هدف محاسبه می‌شود. " +"خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` از `chromium` crate که به‌طور " +"خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -15509,30 +14273,28 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" -"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" -"third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." +"More information can be found in [the doc comment](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude." +"rs%20pub.use.*%5Cbimport%5Cb;%20-f:third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::" +"import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" -"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" -"third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" -"import`." +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/chromium/src/" +"+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use." +"*%5Cbimport%5Cb;%20-f:third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه " +"`chromium::import`." #: src/chromium/testing/chromium-import-macro.md msgid "" -"`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the " -"crate name has to be globally unique. crates.io guarantees uniqueness of its " -"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " -"covered in a later section) use short crate names." +"`rust_static_library` supports specifying an explicit name via `crate_name` property, but " +"doing this is discouraged. And it is discouraged because the crate name has to be globally " +"unique. crates.io guarantees uniqueness of its crate names so `cargo_crate` GN targets " +"(generated by the `gnrt` tool covered in a later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " -"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " -"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " -"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " -"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، اما انجام " +"این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح سراسری منحصر‌به‌فرد باشد. " +"crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین می‌کند، بنابراین اهداف`cargo_crate` GN " +"(تولید شده توسط ابزار `gnrt` که در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده " +"می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -15548,13 +14310,11 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding " -"two integers received as arguments, computing the nth Fibonacci number, " -"summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding two integers " +"received as arguments, computing the nth Fibonacci number, summing integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " -"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " -"اعداد صحیح در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن دو عدد صحیح " +"دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -15566,122 +14326,101 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "" -"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new " -"tools being developed all the time. At the moment, Chromium uses a tool " -"called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new tools being " +"developed all the time. At the moment, Chromium uses a tool called CXX." msgstr "" -"جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " -"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " -"CXX استفاده می‌کند." +"جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای جدیدی که همیشه در " +"حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition " -"language (which looks a lot like Rust) and then CXX tools generate " -"declarations for functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition language (which looks a " +"lot like Rust) and then CXX tools generate declarations for functions and types in both Rust " +"and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " -"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " -"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار شبیه Rust به " +"نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع و تایپ‌ها در Rust و ++C " +"ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md -msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " -"using this." -msgstr "" -"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " -"ببینید." +msgid "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using this." +msgstr "برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just " -"the same as you previously did. Point out that automating the process has " -"the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just the same as you " +"previously did. Point out that automating the process has the following benefits:" msgstr "" -"از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " -"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " -"فرآیند دارای مزایای زیر است:" +"از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را انجام می‌دهد که " +"قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " -"definitions, but with out-of-sync manual bindings you'd get Undefined " -"Behavior)" +"The tool guarantees that the C++ and Rust sides match (e.g. you get compile errors if the " +"`#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, but with out-of-sync manual " +"bindings you'd get Undefined Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " -"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " -"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " -"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::bridge]` با " +"تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای کامپایل مواجه می‌شوید اما با " +"اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " -"methods; manual bindings would require authoring such top-level, free " -"functions manually)" +"The tool automates generation of FFI thunks (small, C-ABI-compatible, free functions) for non-" +"C features (e.g. enabling FFI calls into Rust or C++ methods; manual bindings would require " +"authoring such top-level, free functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " -"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " -"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " -"بالا و رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای ویژگی های غیر " +"C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور خودکار انجام می دهد؛ اتصال های " +"دستی نیاز به نوشتن چنین عملکردهای سطح بالا و رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " -"کنند - به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't " -"guarantee any particular ABI or memory layout. With manual bindings `std::" -"span` / `&[T]` have to be manually destructured and rebuilt out of a " -"pointer and length - this is error-prone given that each language represents " -"empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee any particular " +"ABI or memory layout. With manual bindings `std::span` / `&[T]` have to be manually " +"destructured and rebuilt out of a pointer and length - this is error-prone given that each " +"language represents empty slices slightly differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " -"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " -"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " -"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " -"خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی را تضمین " +"نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت دستی تخریب شود و از یک " +"pointer و length به صورت مجدد ساخته شود - با توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت " +"نشان می‌دهد، درنتیجه مستعد خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " -"are natively supported. With manual bindings, one would have to pass C-ABI-" -"compatible raw pointers, which would increase lifetime and memory-safety " -"risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are natively " +"supported. With manual bindings, one would have to pass C-ABI-compatible raw pointers, which " +"would increase lifetime and memory-safety risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " -"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " -"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " -"طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` به صورت native " +"پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-ABI-compatible raw pointers را " +"پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" -"`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can " -"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" -"terminate a string)." +"`rust::String` and `CxxString` types understand and maintain differences in string " +"representation across the languages (e.g. `rust::String::lossy` can build a Rust string from " +"non-UTF8 input and `rust::String::c_str` can NUL-terminate a string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " -"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " -"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " -"string را با NUL خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها درک و حفظ " +"می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را از ورودی غیر UTF8 و " +"`rust::String::c_str` بسازد و می‌تواند یک string را با NUL خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " -"modules inside `.rs` source code." +"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` modules inside `." +"rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." -"rs` اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -15697,14 +14436,13 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " -"procedural macro does complex things to it. The generated code is quite a " -"bit more sophisticated - though this does still result in a `mod` called " -"`ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural macro does " +"complex things to it. The generated code is quite a bit more sophisticated - though this does " +"still result in a `mod` called `ffi` in your code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" -"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " -"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` کارهای پیچیده‌ای " +"برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این کار همچنان منجر به یک `mod` " +"به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -15724,74 +14462,61 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by " -"Rust, but this is misleading. This header is never interpreted by Rust, but " -"simply `#include`d in the generated C++ code for the benefit of C++ " -"compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, but this is " +"misleading. This header is never interpreted by Rust, but simply `#include`d in the generated " +"C++ code for the benefit of C++ compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " -"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " -"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه کننده است. این " +"هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد ++C تولید‌شده برای کامپایلرهای +" +"+C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://" -"cxx.rs/bindings.html)." +"By far the most useful page when using CXX is the [type reference](https://cxx.rs/bindings." +"html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" -"(https://cxx.rs/bindings.html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx.rs/bindings." +"html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of " -"it." +msgid "Your Rust-C++ interface is sufficiently simple that you can declare all of it." msgstr "" -"اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " -"declare کنید." +"اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example " -"`std::unique_ptr`, `std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example `std::unique_ptr`, " +"`std::string`, `&[u8]` etc." msgstr "" -"شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " -"مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." +"شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای مثال`std::" +"unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` " -"type." -msgstr "" -"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " -"Rust." +msgid "It has many limitations --- for example lack of support for Rust's `Option` type." +msgstr "این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well " -"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " -"considering a use-case for Rust in Chromium, a good starting point is to " -"draft the CXX bindings for the language boundary to see if it appears simple " -"enough." +"These limitations constrain us to using Rust in Chromium only for well isolated \"leaf nodes\" " +"rather than for arbitrary Rust-C++ interop. When considering a use-case for Rust in Chromium, " +"a good starting point is to draft the CXX bindings for the language boundary to see if it " +"appears simple enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " -"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " -"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " -"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " -"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" به خوبی ایزوله " +"شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن یک مورد استفاده برای Rust " +"در Chromium، یک نقطه شروع خوب این است که پیش نویس پیوندهای CXX برای مرز زبان (language " +"boundary) را پیش‌نویس کنید تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"You should also discuss some of the other sticky points with CXX, for " -"example:" +msgid "You should also discuss some of the other sticky points with CXX, for example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"Its error handling is based around C++ exceptions (given on the next slide)" +msgid "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -15800,12 +14525,11 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " -"on C++ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C++ " +"exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" -"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " -"جایگزین‌های آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ exception متکی " +"است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -15814,12 +14538,11 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " -"be passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be passed across " +"the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " -"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " -"باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این مستلزم آن است " +"که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -15827,22 +14550,20 @@ msgstr "یک type اولیه (مانند `u32` یا `usize`)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " -"default value to use in a failure case (_unlike_ `Box`)." +"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable default value to " +"use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " -"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " -"`Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای یک مقدار " +"پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed " -"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " -"cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed when `T` is a Rust " +"type, which cannot be passed across the FFI boundary, and cannot be stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " -"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " -"کند و نمی تواند در `UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است زمانی مورد " +"نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و نمی تواند در " +"`UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -15850,19 +14571,15 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` " -"representing failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` representing failure)" msgstr "" -"به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " -"نشان‌دهنده یک شکست است)" +"به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` نشان‌دهنده یک شکست " +"است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been " -"needed in practice." -msgstr "" -"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " -"است." +"Preserving error details is in theory possible, but so far hasn't been needed in practice." +msgstr "حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -15870,16 +14587,15 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." -"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " -"used to communicate success vs failure, and where the successful result can " -"be passed across the FFI boundary:" +"The QR code generator is [an example](https://source.chromium.org/chromium/chromium/src/+/main:" +"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to communicate success " +"vs failure, and where the successful result can be passed across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" -"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " -"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:components/" +"qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;drc=7bf1b75b9101ca2013) است که در آن " +"بولی برای ارتباط موفقیت در مق‌بل شکست و جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد " +"استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -15887,37 +14603,33 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. " -"This is not the size of the vector, but the size of the QR code (and " -"admittedly it is a bit redundant - this is the square root of the size of " -"the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. This is not the size " +"of the vector, but the size of the QR code (and admittedly it is a bit redundant - this is the " +"square root of the size of the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " -"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " -"جذر اندازه بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه بردار نیست " +"بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` " -"before calling into the Rust function. Creation of a Rust reference that " -"points to uninitialized memory results in Undefined Behavior (unlike in C++, " -"when only the act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` before calling into " +"the Rust function. Creation of a Rust reference that points to uninitialized memory results in " +"Undefined Behavior (unlike in C++, when only the act of dereferencing such memory results in " +"UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " -"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " -"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " -"حافظه‌ای منجر به UB می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` اشاره کنیم. " +"ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار نامشخص می‌شود (برخلاف ++C، " +"زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable " -"references to C++ data: the answer is that C++ data can’t be moved around " -"like Rust data, because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable references to C++ data: " +"the answer is that C++ data can’t be moved around like Rust data, because it may contain self-" +"referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " -"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " -"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " -"خودارجاعی (self-referential pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل تغییر به " +"داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند داده‌های Rust جابه‌جا " +"کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -15925,11 +14637,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the " -"successful result cannot be passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the successful result cannot be " +"passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " -"FFI عبور کند و چه کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI عبور کند و چه " +"کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -15953,31 +14665,27 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " -"types cannot cross the FFI boundary without indirection of a `Box`. We " -"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " -"to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types cannot cross the " +"FFI boundary without indirection of a `Box`. We can't have an `out_parameter: &mut " +"PngReader`, because CXX doesn't allow C++ to store Rust objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " -"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " -"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " -"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این نوع نمیتوانند " +"بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم `out_parameter: &mut " +"PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary " -"generics nor templates, we can still pass them across the FFI boundary by " -"manually specializing / monomorphizing them into a non-generic type. In the " -"example `ResultOfPngReader` is a non-generic type that forwards into " -"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " -"`as_mut`)." -msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " -"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " -"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " -"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " -"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " -"ارسال می‌شود." +"This example illustrates that even though CXX doesn't support arbitrary generics nor " +"templates, we can still pass them across the FFI boundary by manually specializing / " +"monomorphizing them into a non-generic type. In the example `ResultOfPngReader` is a non-" +"generic type that forwards into appropriate methods of `Result` (e.g. into `is_err`, " +"`unwrap`, and/or `as_mut`)." +msgstr "" +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی نمی‌کند، ما " +"همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی تخصصی/تک‌شکلی " +"( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در مثال `ResultOfPngReader` یک " +"نوع non-generic است که به متدهای مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/" +"یا «as_mut» ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -15985,13 +14693,11 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" -"node where we want to use Rust. You'd typically have one for each " -"`rust_static_library`. Just add" +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node where we want to " +"use Rust. You'd typically have one for each `rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " -"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " -"یکی دارید. پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust استفاده کنیم " +"را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -16008,9 +14714,7 @@ msgstr "" "```" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md -msgid "" -"to your existing `rust_static_library` target alongside `crate_root` and " -"`sources`." +msgid "to your existing `rust_static_library` target alongside `crate_root` and `sources`." msgstr "به هدف `rust_static_library` موجود در کنار `crate_root` و `sources`." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md @@ -16023,49 +14727,43 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium " -"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" -"l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium C++ types to CXX " +"Rust types --- for example [`SpanToRustSlice`](https://source.chromium.org/chromium/chromium/" +"src/+/main:base/containers/span_rust.h;l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " -"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." -"h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به انواع CXX Rust " +"پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source.chromium.org/chromium/" +"chromium/src /+/main:base/containers/span_rust.h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" -msgstr "" -"دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" +msgstr "دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " -"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " -"to memory, and compromise the safety of Rust's own data layouts. Presence of " -"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " -"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " -"binary can cause unexpected behavior from Rust's perspective." -msgstr "" -"پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " -"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " -"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " -"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " -"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" -"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " -"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. Calling back " +"and forth to C/C++ from Rust may do arbitrary things to memory, and compromise the safety of " +"Rust's own data layouts. Presence of _too many_ `unsafe` keywords in C/C++ interop can harm " +"the signal-to-noise ratio of such a keyword, and is [controversial](https://steveklabnik.com/" +"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust binary can cause " +"unexpected behavior from Rust's perspective." +msgstr "" +"پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. فراخوانی مجدد و " +"برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام دهد و ایمنی طرح‌بندی داده‌های " +"خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به " +"نسبت سیگنال به نویز چنین کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/" +"writing/the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث " +"رفتار غیرمنتظره از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " -"`unsafe` and `extern \"C\"` functions just like we did manually in the " -"previous section." +"The narrow answer lies in the diagram at the top of [this page](../interoperability-with-cpp." +"md) --- behind the scenes, CXX generates Rust `unsafe` and `extern \"C\"` functions just like " +"we did manually in the previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " -"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " -"در بخش قبل به صورت دستی انجام دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است --- در پشت " +"صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل به صورت دستی انجام " +"دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -16077,21 +14775,21 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which " -"specifies a single function, to be called from C++, called " -"`hello_from_rust`, taking no parameters and returning no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a single " +"function, to be called from C++, called `hello_from_rust`, taking no parameters and returning " +"no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " -"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " -"بدون اینکه پارامتر و هیچ مقداری برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را مشخص می‌کند که " +"باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه پارامتر و هیچ مقداری " +"برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " -"`#[no_mangle]`. This is now just a standard Rust function." +"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and `#[no_mangle]`. " +"This is now just a standard Rust function." msgstr "" -"تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` " -"تغییر دهید. حالا این فقط یک تابع استاندارد Rust است." +"تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` تغییر دهید. حالا " +"این فقط یک تابع استاندارد Rust است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Modify your `gn` target to build these bindings." @@ -16099,11 +14797,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. " -"Instead, include the generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, include the " +"generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " -"عوض، فایل هِدِر تولید شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، فایل هِدِر تولید " +"شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -16115,11 +14813,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how " -"flexible Rust in Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how flexible Rust in " +"Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " -"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید که Rust در " +"Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -16131,29 +14829,27 @@ msgstr "از Rust دوباره به ++C فراخوانی کنید. درنهای #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An additional header file which you can `include!` from your `cxx::bridge`. " -"You'll need to declare your C++ function in that new header file." +"An additional header file which you can `include!` from your `cxx::bridge`. You'll need to " +"declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " -"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما باید تابع ++C " +"خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the " -"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" -"extern-c++.html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the `unsafe` keyword in " +"your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++.html#functions-and-member-" +"functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " -"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" -"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` را در `#[cxx::" +"bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx.rs/extern-c++.html#functions-" +"and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md -msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +msgid "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" -"cxx.h\"` را وارد کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"` را وارد " +"کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -16165,35 +14861,32 @@ msgstr "ارسال یک reference از یک C++ object به Rust ." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Intentionally get the Rust function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." +"Intentionally get the Rust function signatures mismatched from the `#[cxx::bridge]`, and get " +"used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " -"و به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به خطاهایی که می " +"بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Intentionally get the C++ function signatures mismatched from the `#[cxx::" -"bridge]`, and get used to the errors you see." +"Intentionally get the C++ function signatures mismatched from the `#[cxx::bridge]`, and get " +"used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " -"به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به خطاهایی که می " +"بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " -"own some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " -"بتواند دارای یک C++ object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند دارای یک C++ " +"object باشد." #: src/exercises/chromium/interoperability-with-cpp.md -msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " -"need a `Box`)." +msgid "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a `Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " -"(نکته: شما به یک `Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: شما به یک " +"`Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -16209,13 +14902,12 @@ msgstr "قسمت سوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Now you understand the strengths and limitations of CXX interop, think of a " -"couple of use-cases for Rust in Chromium where the interface would be " -"sufficiently simple. Sketch how you might define that interface." +"Now you understand the strengths and limitations of CXX interop, think of a couple of use-" +"cases for Rust in Chromium where the interface would be sufficiently simple. Sketch how you " +"might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " -"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " -"تعریف این رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای Rust در " +"Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -16223,11 +14915,11 @@ msgstr "یک [`cxx` binding reference](https://cxx.rs/bindings.html)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"The [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/" +"main:build/rust/rust_static_library.gni;l=16)" msgstr "" -"یک [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"یک [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/" +"main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" @@ -16235,35 +14927,31 @@ msgstr "برخی از سؤالاتی که ممکن است با آن مواجه #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X " -"and Y are both function types. This is because your C++ function doesn't " -"quite match the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X and Y are both " +"function types. This is because your C++ function doesn't quite match the declaration in your " +"`cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " -"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " -"`cxx::bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر دو نوع تابع " +"هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. " -"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" -"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " -"CXX's design makes it quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. Doesn't that risk UB? " +"For CXX's _opaque_ types, no, because they are zero-sized. For CXX trivial types yes, it's " +"_possible_ to cause UB, although CXX's design makes it quite difficult to craft such an " +"example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " -"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " -"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " -"نمونه‌ای را بسیار دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB را ندارد؟ " +"برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع بی‌اهمیت CXX بله، ممکن است " +"باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://crates.io). It's " +"_very easy_ for Rust crates to depend upon one another. So they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." -"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " -"آنها این کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) یافت می‌شوند. " +"وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -16314,20 +15002,18 @@ msgid "For a Chromium engineer, this has pros and cons:" msgstr "برای یک مهندس Chromium، این مزایا و معایب دارد:" #: src/chromium/adding-third-party-crates.md -msgid "" -"All crates use a common build system so we can automate their inclusion into " -"Chromium..." +msgid "All crates use a common build system so we can automate their inclusion into Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " -"آن‌ها در Chromium را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها در Chromium " +"را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely " -"have to bring in multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely have to bring in " +"multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " -"بود چندین کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود چندین " +"کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -16351,15 +15037,13 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. These are managed " +"through a single [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/+/main:" +"third_party/rust/chromium_crates_io/Cargo.toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " -"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" -"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " -"می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. اینها از طریق " +"یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16381,41 +15065,35 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." +"As with any other `Cargo.toml`, you can specify [more details about the dependencies](https://" +"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) --- most commonly, you'll want " +"to specify the `features` that you wish to enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" -"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " -"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " -"کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://doc.rust-lang." +"org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- معمولاً شما می‌خواهید " +"«ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"When adding a crate to Chromium, you'll often need to provide some extra " -"information in an additional file, `gnrt_config.toml`, which we'll meet next." +"When adding a crate to Chromium, you'll often need to provide some extra information in an " +"additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" -"هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، " -"`gnrt_config.toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." +"هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، `gnrt_config." +"toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml). This contains Chromium-specific extensions to crate handling." +"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/" +"src/+/main:third_party/rust/chromium_crates_io/gnrt_config.toml). This contains Chromium-" +"specific extensions to crate handling." msgstr "" -"در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " -"crate است." +"در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/" +"src/+/main:third_party/rust/chromium_crates_io/gnrt_config.toml) قرار دارد. این شامل " +"برنامه‌های extension مخصوص Chromium برای مدیریت crate است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md -msgid "" -"If you add a new crate, you should specify at least the `group`. This is one " -"of:" -msgstr "" -"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +msgid "If you add a new crate, you should specify at least the `group`. This is one of:" +msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -16424,27 +15102,23 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this " -"file to specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this file to specify where " +"its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " -"یافتن فایل (های) مجوز آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن فایل (های) مجوز " +"آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file " -"to resolve problems." +"Later, we'll see some other things you will need to configure in this file to resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " -"مشاهده خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md -msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD." -"gn` rules." +msgid "A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " -"`BUILD.gn` را ایجاد کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD.gn` را ایجاد " +"کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -16452,14 +15126,12 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running " -"this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." +"Although the `gnrt` tool is part of the Chromium source code, by running this command you will " +"be downloading and running its dependencies from `crates.io`. See [the earlier section](../" +"cargo.md) discussing this security decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " -"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." -"md) را در مورد این تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن را از " +"`crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -16475,46 +15147,37 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete " -"set of crates required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete set of crates " +"required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " -"جعبه‌های مورد نیاز Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های مورد نیاز " +"Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Chromium maintains patches for some crates, kept in `//third_party/rust/" -"chromium_crates_io/patches`. These will be reapplied automatically, but if " -"patching fails you may need to take manual action." +"Chromium maintains patches for some crates, kept in `//third_party/rust/chromium_crates_io/" +"patches`. These will be reapplied automatically, but if patching fails you may need to take " +"manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" -"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " -"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" +"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال می‌شوند، اما اگر " +"وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" -msgstr "" -"هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" +msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgstr "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Now run `git status`. You should find:" msgstr "اکنون `git status` را اجرا کنید. شما باید این موارد را پیدا کنید:" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/" -"vendor`" -msgstr "" -"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +msgid "At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" +msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"At least one new `BUILD.gn` in `third_party/rust//v`" -msgstr "" -"حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" +msgid "At least one new `BUILD.gn` in `third_party/rust//v`" +msgstr "حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "An appropriate `README.chromium`" @@ -16522,46 +15185,36 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." -msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " -"مراجعه کنید." +"The \"major semver version\" is a [Rust \"semver\" version number](https://doc.rust-lang.org/" +"cargo/reference/semver.html)." +msgstr "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Take a close look, especially at the things generated in `third_party/rust`." -msgstr "" -"نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." +msgid "Take a close look, especially at the things generated in `third_party/rust`." +msgstr "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium " -"it's to allow multiple incompatible versions of a crate, which is " -"discouraged but sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium it's to allow " +"multiple incompatible versions of a crate, which is discouraged but sometimes necessary in the " +"Cargo ecosystem." msgstr "" -"کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " -"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " -"منع می‌شود ولی گاهی اوقات ضروری است." +"کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه ناسازگار از crateها " +"را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" -"If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the " -"design of `gn` and `ninja` which aim for static, deterministic, build rules " -"to maximize parallelism and repeatability of builds." +"If your build fails, it may be because of a `build.rs`: programs which do arbitrary things at " +"build time. This is fundamentally at odds with the design of `gn` and `ninja` which aim for " +"static, deterministic, build rules to maximize parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " -"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " -"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " -"رساندن موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که کارهای دلخواه " +"را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی `gn` و `ninja` است که هدفشان " +"قواعد build ایستا، قطعی برای به حداکثر رساندن موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "" -"Some `build.rs` actions are automatically supported; others require action:" -msgstr "" -"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " -"اقدام دارند:" +msgid "Some `build.rs` actions are automatically supported; others require action:" +msgstr "برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -16617,33 +15270,31 @@ msgstr "سایر اقدامات دلخواه" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" -"Fortunately, most crates don't contain a build script, and fortunately, most " -"build scripts only do the top two actions." +"Fortunately, most crates don't contain a build script, and fortunately, most build scripts " +"only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " -"scriptها تنها دو عمل اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها تنها دو عمل " +"اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If `ninja` complains about missing files, check the `build.rs` to see if it " -"writes source code files." +"If `ninja` complains about missing files, check the `build.rs` to see if it writes source code " +"files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " -"ببینید که آیا کدهای منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که آیا کدهای " +"منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " -"add `build-script-outputs` to the crate. If this is a transitive dependency, " -"that is, one on which Chromium code should not directly depend, also add " -"`allow-first-party-usage=false`. There are several examples already in that " -"file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add `build-script-" +"outputs` to the crate. If this is a transitive dependency, that is, one on which Chromium code " +"should not directly depend, also add `allow-first-party-usage=false`. There are several " +"examples already in that file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " -"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " -"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " -"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " -"فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر دهید تا `build-" +"script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، یعنی وابستگی که کد Chromium " +"نباید مستقیماً به آن وابسته باشد، پس `allow-first-party-usage=false` را نیز اضافه کنید. چندین " +"نمونه از قبل در آن فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -16661,28 +15312,25 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input " -"to subsequent build steps." +"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate `BUILD.gn` files " +"to inform ninja that this particular output file is input to subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " -"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " -"فایل خروجی خاص ورودی مراحل build بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا فایل‌های " +"`BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی خاص ورودی مراحل build " +"بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " -"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" -"crates.io/crates/bindgen) within their build scripts. These actions can't be " -"supported in a Chromium context --- our gn, ninja and LLVM build system is " -"very specific in expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " -"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " -"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " -"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " -"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " -"است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/C++ " +"libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/crates/bindgen) within " +"their build scripts. These actions can't be supported in a Chromium context --- our gn, ninja " +"and LLVM build system is very specific in expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build و link " +"کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از [`bindgen`](https://" +"crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در " +"زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build " +"actionsها بسیار خاص است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -16699,27 +15347,25 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" -"` - see for example the [patches against the `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - and will be applied automatically by " -"`gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - see for " +"example the [patches against the `cxx` crate](https://source.chromium.org/chromium/chromium/" +"src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - and will be applied " +"automatically by `gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" -"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " -"خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` نگهداری شوند - " +"برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium.org/chromium/chromium/src/+/" +"main:third_party/rust/chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند " +"به‌طور خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending " -"on a crate is simple. Find your `rust_static_library` target, and add a " -"`dep` on the `:lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending on a crate is " +"simple. Find your `rust_static_library` target, and add a `dep` on the `:lib` target within " +"your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " -"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " -"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه به نوع crate " +"می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا کنید و یک `dep` روی هدف `:" +"lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -16729,15 +15375,13 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" @@ -16765,44 +15409,39 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Third_party-review), but of course also subject to security review. As " -"you may be bringing in not just a single crate but also transitive " -"dependencies, there may be a lot of code to review. On the other hand, safe " +"Adding new libraries is subject to Chromium's standard [policies](https://chromium." +"googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review), but of " +"course also subject to security review. As you may be bringing in not just a single crate but " +"also transitive dependencies, there may be a lot of code to review. On the other hand, safe " "Rust code can have limited negative side effects. How should you review it?" msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" -"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " -"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " -"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " -"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " -"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما البته موضوع بررسی " +"امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد " +"کنید، ممکن است کدهای زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند " +"عوارض جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet]" -"(https://mozilla.github.io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet](https://mozilla.github." +"io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" -"mozilla.github.io/cargo-vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla.github.io/cargo-" +"vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "" -"Meanwhile, for each new crate addition, we are checking for the following:" +msgid "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? " -"If the build system for each crate contains a `build.rs` or procedural " -"macros, work out what they're for. Are they compatible with the way Chromium " -"is normally built?" +"Understand why each crate is used. What's the relationship between crates? If the build system " +"for each crate contains a `build.rs` or procedural macros, work out what they're for. Are they " +"compatible with the way Chromium is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " -"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " -"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " -"ساخته و built می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر جعبه حاوی " +"`build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که آن‌ها برای چه چیزی هستند. " +"آیا آنها با روشی که Chromium به طور معمول ساخته و built می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -16811,25 +15450,21 @@ msgstr "بررسی کنید که هر crate به نظر برسد که به خو #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " -"vulnerabilities (first you'll need to `cargo install cargo-audit`, which " -"ironically involves downloading lots of dependencies from the internet[2](../" -"cargo.md))" +"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known vulnerabilities " +"(first you'll need to `cargo install cargo-audit`, which ironically involves downloading lots " +"of dependencies from the internet[2](../cargo.md))" msgstr "" -"از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " -"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" -"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." -"md))" +"از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی cargo برای بررسی " +"آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` که از قضا شامل دانلود " +"وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." -"md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium.googlesource." +"com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages)" msgstr "" -"مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" -"in-safe-languages) خوب است" +"مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium.googlesource.com/" +"chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -16837,21 +15472,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place " -"that might have been maliciously inserted. (You can't realistically aim for " -"100% perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place that might have been " +"maliciously inserted. (You can't realistically aim for 100% perfection here: there's often " +"just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " -"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " -"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد شده باشد را " +"بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ درصدی باشید: اغلب کدهای " +"زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium." -"org` to work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium.org` to work out the " +"right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " -"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار کنید تا راه " +"درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -16866,12 +15501,8 @@ msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "کد Crate را در `//third_party/rust/chromium_crates_io`." #: src/chromium/adding-third-party-crates/checking-in.md -msgid "" -"Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" -"`" -msgstr "" -"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" -"`" +msgid "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//`" +msgstr "متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -16879,72 +15510,69 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config." -"toml` changes, into the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into " +"the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " -"مخزن Chromium قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن Chromium " +"قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` " -"files may result in some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` files may result in " +"some files being skipped." msgstr "" -"**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." -"gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." +"**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `.gitignore` ممکن است " +"منجر به حذف برخی از فایل‌ها شود." #: src/chromium/adding-third-party-crates/checking-in.md #, fuzzy msgid "" -"As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git " -"branches, and many projects still use non-inclusive terminology there. So " -"you may need to run:" +"As you do so, you might find presubmit checks fail because of non-inclusive language. This is " +"because Rust crate data tends to include names of git branches, and many projects still use " +"non-inclusive terminology there. So you may need to run:" msgstr "" -"در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " -"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " -"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " -"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" +"در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان غیرمطرح با شکست " +"مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام شاخه‌های git می‌شوند و بسیاری از " +"پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد " +"را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to " -"keep it up to date with any security fixes](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " -"hoped that we will soon automate this for Rust crates, but for now, it's " -"still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to keep it up to date " +"with any security fixes](https://chromium.googlesource.com/chromium/src/+/main/docs/" +"adding_to_third_party.md#add-owners). It is hoped that we will soon automate this for Rust " +"crates, but for now, it's still your responsibility just as it is for any other third party " +"dependency." msgstr "" -"شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " -"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" -"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " -"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " -"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." +"شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه اصلاحات امنیتی " +"به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/main/docs/" +"adding_to_third_party.md#add-owners). امید است که ما به زودی این را برای crateهای Rust خودکار " +"کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این " +"مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" -"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/" -"features.html#the-default-feature). Assume that the crate will be used in " -"shipping Chromium, but won't be used to handle untrustworthy input." +"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the crate's [default " +"features](https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature). Assume " +"that the crate will be used in shipping Chromium, but won't be used to handle untrustworthy " +"input." msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " -"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." -"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " -"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " -"نمی‌شود." +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های پیش‌فرض]" +"(https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature). فرض کنید از " +"crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های " +"غیرقابل اعتماد استفاده نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " -"ahead and do that now if you like. Or, you could create a new " -"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead and do that " +"now if you like. Or, you could create a new [`rust_executable` target](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" -"(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " -"می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" -"(https://source.chromium.org /chromium/chromium/src/+/main:build/rust/" -"rust_executable.gni) جدید ایجاد کنید که از `uwuify` استفاده می‌کند)." +"(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل می‌توانید این کار " +"را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable'](https://source.chromium.org /" +"chromium/chromium/src/+/main:build/rust/rust_executable.gni) جدید ایجاد کنید که از `uwuify` " +"استفاده می‌کند)." #: src/exercises/chromium/third-party.md msgid "Students will need to download lots of transitive dependencies." @@ -16988,18 +15616,15 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to " -"turn off the default features." +"If students are downloading even more than that, they probably forgot to turn off the default " +"features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " -"ویژگی‌های پیش‌فرض را خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های پیش‌فرض را " +"خاموش کنند." #: src/exercises/chromium/third-party.md -msgid "" -"Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" -msgstr "" -"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " -"crate!" +msgid "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" +msgstr "با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -17007,11 +15632,11 @@ msgstr " برای جمع‌آوری آن --- تمرین کنید" #: src/exercises/chromium/bringing-it-together.md msgid "" -"In this exercise, you're going to add a whole new Chromium feature, bringing " -"together everything you already learned." +"In this exercise, you're going to add a whole new Chromium feature, bringing together " +"everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " -"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی را که قبلاً یاد " +"گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -17019,46 +15644,38 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. " -"It's important that we get Chromium for Pixies delivered to them as soon as " -"possible." +"A community of pixies has been discovered living in a remote rainforest. It's important that " +"we get Chromium for Pixies delivered to them as soon as possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " -"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم است که " +"Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md -msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie " -"language." -msgstr "" -"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " -"شوند." +msgid "The requirement is to translate all Chromium's UI strings into Pixie language." +msgstr "لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie " -"language is very close to English, and it turns out there's a Rust crate " -"which does the translation." +"There's not time to wait for proper translations, but fortunately pixie language is very close " +"to English, and it turns out there's a Rust crate which does the translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " -"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " -"که ترجمه را انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie بسیار نزدیک به " +"انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"In fact, you already [imported that crate in the previous exercise](https://" -"crates.io/crates/uwuify)." +"In fact, you already [imported that crate in the previous exercise](https://crates.io/crates/" +"uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" -"crates/uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and " -"diligence. Don't ship this!)" +"(Obviously, real translations of Chrome require incredible care and diligence. Don't ship " +"this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " -"این مورد را ارسال نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این مورد را ارسال " +"نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -17066,85 +15683,77 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always " -"do this irrespective of the setting of `mangle_localized_strings_`." +"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all strings before " +"display. In this special build of Chromium, it should always do this irrespective of the " +"setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " -"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " -"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را قبل از نمایش " +"یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات `mangle_localized_strings_` " +"همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, " -"you should have created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, you should have " +"created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " -"را برای pixies ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را برای pixies " +"ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " -"and will probably decide that it's better to do the conversion on the C++ " -"side using `base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and will probably " +"decide that it's better to do the conversion on the C++ side using `base::UTF16ToUTF8` and " +"back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " -"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " -"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و احتمالاً " +"تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::UTF16ToUTF8` انجام " +"دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If students decide to do the conversion on the Rust side, they'll need to " -"consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which " -"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" -"slice.html)." +"If students decide to do the conversion on the Rust side, they'll need to consider [`String::" +"from_utf16`](https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf16), " +"consider error handling, and consider which [CXX supported types can transfer a lot of u16s]" +"(https://cxx.rs/binding/slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. " -"taking and returning strings by value, or taking a mutable reference to a " -"string. If a mutable reference is used, CXX will likely tell the student " -"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " -"need to explain what `Pin` does, and then explain why CXX needs it for " -"mutable references to C++ data: the answer is that C++ data can't be moved " -"around like Rust data, because it may contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " -"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " -"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " -"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " -"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " -"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " -"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " -"نشانگرهای خودارجاعی (self-referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. taking and returning " +"strings by value, or taking a mutable reference to a string. If a mutable reference is used, " +"CXX will likely tell the student that they need to use [`Pin`](https://doc.rust-lang.org/std/" +"pin/). You may need to explain what `Pin` does, and then explain why CXX needs it for mutable " +"references to C++ data: the answer is that C++ data can't be moved around like Rust data, " +"because it may contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. گرفتن و " +"برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک string. اگر از یک مرجع " +"قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که باید از [`Pin`](https://doc.rust-" +"lang.org/std/pin/) استفاده کند. ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید " +"که چرا CXX به آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های " +"C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" +"referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " -"need to depend on a `rust_static_library` target. The student probably " -"already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need to depend on " +"a `rust_static_library` target. The student probably already did this." msgstr "" -"هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " -"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " -"داده است." +"هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف `rust_static_library` " +"وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده است." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The `rust_static_library` target will need to depend on `//third_party/rust/" -"uwuify/v0_2:lib`." -msgstr "" -"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " -"وابسته باشد." +"The `rust_static_library` target will need to depend on `//third_party/rust/uwuify/v0_2:lib`." +msgstr "هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs]" -"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" -"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review.googlesource." +"com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -17152,16 +15761,15 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people " -"who are familiar with the basics of Rust (perhaps from completing the " -"Comprehensive Rust course), and ideally also have some experience with bare-" -"metal programming in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people who are familiar " +"with the basics of Rust (perhaps from completing the Comprehensive Rust course), and ideally " +"also have some experience with bare-metal programming in some other language such as C." msgstr "" #: src/bare-metal.md msgid "" -"Today we will talk about 'bare-metal' Rust: running Rust code without an OS " -"underneath us. This will be divided into several parts:" +"Today we will talk about 'bare-metal' Rust: running Rust code without an OS underneath us. " +"This will be divided into several parts:" msgstr "" #: src/bare-metal.md @@ -17182,21 +15790,18 @@ msgstr "" #: src/bare-metal.md msgid "" -"For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " -"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " -"an on-board SWD debugger." +"For the microcontroller part of the course we will use the [BBC micro:bit](https://microbit." +"org/) v2 as an example. It's a [development board](https://tech.microbit.org/hardware/) based " +"on the Nordic nRF52833 microcontroller with some LEDs and buttons, an I2C-connected " +"accelerometer and compass, and an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "" -"To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" #: src/bare-metal.md -msgid "" -"And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md @@ -17321,21 +15926,21 @@ msgstr "" #: src/bare-metal/minimal.md msgid "" -"Depending on the target, you may need to compile with `panic = \"abort\"` to " -"avoid an error about `eh_personality`." +"Depending on the target, you may need to compile with `panic = \"abort\"` to avoid an error " +"about `eh_personality`." msgstr "" #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to " -"define your own entry point. This will typically involve a linker script and " -"some assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to define your own entry " +"point. This will typically involve a linker script and some assembly code to set things up " +"ready for Rust code to run." msgstr "" #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc." -"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-lang.org/stable/" +"std/alloc/trait.GlobalAlloc.html)." msgstr "" #: src/bare-metal/alloc.md @@ -17357,28 +15962,26 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy system allocator. " +"Other crates are available, or you can write your own or hook into your existing allocator." msgstr "" #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " -"in this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in this case it " +"can allocate regions of up to 2\\*\\*32 bytes." msgstr "" #: src/bare-metal/alloc.md msgid "" -"If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in " -"the top-level binary crate." +"If any crate in your dependency tree depends on `alloc` then you must have exactly one global " +"allocator defined in your binary. Usually this is done in the top-level binary crate." msgstr "" #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " -"crate is linked in so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in " +"so we get its panic handler." msgstr "" #: src/bare-metal/alloc.md @@ -17387,20 +15990,18 @@ msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for " -"Cortex M microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex M " +"microcontrollers." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "" -"Next we'll look at how to access peripherals, with increasing levels of " -"abstraction." +msgid "Next we'll look at how to access peripherals, with increasing levels of abstraction." msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" -"> !`, because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, because " +"returning to the reset handler doesn't make sense." msgstr "" #: src/bare-metal/microcontrollers.md @@ -17409,8 +16010,8 @@ msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try " -"turning on an LED on our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning on an LED on " +"our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -17425,8 +16026,7 @@ msgstr "" msgid "// PIN_CNF fields\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" @@ -17437,22 +16037,18 @@ msgid "" " // aliases exist.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " -"to the first row." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md -#: src/bare-metal/microcontrollers/hals.md -#: src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/hals.md src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" msgstr "" @@ -17462,28 +16058,27 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" -"pack/doc/CMSIS/SVD/html/index.html) files." +"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust wrappers for memory-" +"mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) " +"files." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by " -"silicon vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by silicon vendors which " +"describe the memory map of the device." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"They are organised by peripheral, register, field and value, with names, " -"descriptions, addresses and so on." +"They are organised by peripheral, register, field and value, with names, descriptions, " +"addresses and so on." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects " -"which patch the mistakes, add missing details, and publish the generated " -"crates." +"SVD files are often buggy and incomplete, so there are various projects which patch the " +"mistakes, add missing details, and publish the generated crates." msgstr "" #: src/bare-metal/microcontrollers/pacs.md @@ -17492,8 +16087,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " -"pac -- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac -- -d --no-" +"show-raw-insn` to see the resulting binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -17502,10 +16097,9 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around " -"various peripherals. These generally implement traits from [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal)." +"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-implementation-crates) " +"for many microcontrollers provide wrappers around various peripherals. These generally " +"implement traits from [`embedded-hal`](https://crates.io/crates/embedded-hal)." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -17513,14 +16107,13 @@ msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "" #: src/bare-metal/microcontrollers/hals.md -msgid "" -"`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." +msgid "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various " -"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, GD32, nRF, " +"NXP, MSP430, AVR and PIC microcontrollers." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -17529,20 +16122,19 @@ msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"Board support crates provide a further level of wrapping for a specific " -"board for convenience." +"Board support crates provide a further level of wrapping for a specific board for convenience." msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, " -"and a bit of initialisation." +"In this case the board support crate is just providing more useful names, and a bit of " +"initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"The crate may also include drivers for some on-board devices outside of the " -"microcontroller itself." +"The crate may also include drivers for some on-board devices outside of the microcontroller " +"itself." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -17563,29 +16155,27 @@ msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can " -"exist. Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. Once a pin is " +"moved out of the port struct nobody else can take it." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you " -"can’t keep use the old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you can’t keep use the " +"old instance afterwards." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, " -"the configuration state of a GPIO pin. This encodes the state machine into " -"the type system, and ensures that you don't try to use a pin in a certain " -"way without properly configuring it first. Illegal state transitions are " -"caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, the configuration " +"state of a GPIO pin. This encodes the state machine into the type system, and ensures that you " +"don't try to use a pin in a certain way without properly configuring it first. Illegal state " +"transitions are caught at compile time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but " -"not vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but not vice-versa." msgstr "" #: src/bare-metal/microcontrollers/type-state.md @@ -17594,8 +16184,8 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " -"number of traits covering common microcontroller peripherals:" +"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a number of traits " +"covering common microcontroller peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -17616,54 +16206,50 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " -"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" -"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" -"crates.io/crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out into " +"[`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`](https://crates.io/" +"crates/embedded-can) and [`rand_core`](https://crates.io/crates/rand_core) respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-embedded-" +"rust#driver-crates) in terms of these traits, e.g. an accelerometer driver might need an I2C " +"or SPI device instance." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring " -"them, as initialisation and configuration is usually highly platform-" -"specific." +"The traits cover using the peripherals but not initialising or configuring them, as " +"initialisation and configuration is usually highly platform-specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other " -"platforms such as Linux on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other platforms such as Linux " +"on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " -"async versions of the traits." +"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides async versions of " +"the traits." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " -"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" -"crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another approach to non-" +"blocking I/O, based on the [`nb`](https://crates.io/crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " -"like OpenOCD but better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like OpenOCD but " +"better integrated." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md -msgid "" -"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -17676,42 +16262,36 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " -"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." -"toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real Time Transfers) " +"output and connect GDB. It's configured by an `Embed.toml` file in your project directory." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " -"an Arm standard protocol over USB for an in-circuit debugger to access the " -"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " -"on-board debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm standard " +"protocol over USB for an in-circuit debugger to access the CoreSight Debug Access Port of " +"various Arm Cortex processors. It's what the on-board debugger on the BBC micro:bit uses." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " -"is a range from SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a range from " +"SEGGER." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " -"Serial Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md -msgid "" -"probe-rs is a library which you can integrate into your own tools if you " -"want to." +msgid "probe-rs is a library which you can integrate into your own tools if you want to." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" -"adapter-protocol/) lets VSCode and other IDEs debug code running on any " -"supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) " +"lets VSCode and other IDEs debug code running on any supported microcontroller." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -17720,8 +16300,8 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " -"host and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host and the " +"target through a number of ringbuffers." msgstr "" #: src/bare-metal/microcontrollers/debugging.md @@ -17744,8 +16324,7 @@ msgstr "" msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md -#: src/bare-metal/aps/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md src/bare-metal/aps/other-projects.md msgid "Other projects" msgstr "" @@ -17758,8 +16337,7 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +msgid "Shared resource management, message passing, task scheduling, timer queue" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17775,9 +16353,7 @@ msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Security-focused RTOS with preemptive scheduling and Memory Protection Unit " -"support" +msgid "Security-focused RTOS with preemptive scheduling and Memory Protection Unit support" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17786,8 +16362,7 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17796,8 +16371,8 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." -"github.io/book/overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github.io/book/" +"overview/using-the-standard-library.html)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17810,8 +16385,8 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " -"scheduling rather than a proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling rather than a " +"proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17819,35 +16394,26 @@ msgid "Cortex-M only." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"FreeRTOS is mostly written in C, but there are Rust bindings for writing " -"applications." +msgid "FreeRTOS is mostly written in C, but there are Rust bindings for writing applications." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port." +msgid "We will read the direction from an I2C compass, and log the readings to a serial port." msgstr "" #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"morning.md) provided." -msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " -"نگاه کنید." +"After looking at the exercises, you can look at the [solutions](solutions-morning.md) provided." +msgstr "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port. If you have time, try displaying it on the LEDs somehow too, or " -"use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a serial port. If you " +"have time, try displaying it on the LEDs somehow too, or use the buttons somehow." msgstr "" #: src/exercises/bare-metal/compass.md @@ -17856,46 +16422,42 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" -"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" -"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." -"org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) and " +"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) crates, as well as the [micro:" +"bit hardware](https://tech.microbit.org/hardware/)." msgstr "" #: src/exercises/bare-metal/compass.md -msgid "" -"The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." +msgid "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" #: src/exercises/bare-metal/compass.md -msgid "" -"TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" -"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" -"microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` trait. The " +"[`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/hal/struct.Twim.html) " +"struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct.Board.html) " +"struct with fields for the various pins and peripherals." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " -"this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/pdf/" +"nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this exercise." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the " +"`compass` directory for the following files." msgstr "" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md @@ -17919,8 +16481,7 @@ msgid "See the serial output on Linux with:" msgstr "" #: src/exercises/bare-metal/compass.md -msgid "" -"Or on Mac OS something like (the device name may be slightly different):" +msgid "Or on Mac OS something like (the device name may be slightly different):" msgstr "" #: src/exercises/bare-metal/compass.md @@ -17969,8 +16530,7 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" msgstr "" @@ -17980,29 +16540,26 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now let's try " +"writing something for Cortex-A. For simplicity we'll just work with QEMU's aarch64 ['virt']" +"(https://qemu-project.gitlab.io/qemu/system/arm/virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" -"Broadly speaking, microcontrollers don't have an MMU or multiple levels of " -"privilege (exception levels on Arm CPUs, rings on x86), while application " -"processors do." +"Broadly speaking, microcontrollers don't have an MMU or multiple levels of privilege " +"(exception levels on Arm CPUs, rings on x86), while application processors do." msgstr "" #: src/bare-metal/aps.md msgid "" -"QEMU supports emulating various different machines or board models for each " -"architecture. The 'virt' board doesn't correspond to any particular real " -"hardware, but is designed purely for virtual machines." +"QEMU supports emulating various different machines or board models for each architecture. The " +"'virt' board doesn't correspond to any particular real hardware, but is designed purely for " +"virtual machines." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "" -"Before we can start running Rust code, we need to do some initialisation." +msgid "Before we can start running Rust code, we need to do some initialisation." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -18012,8 +16569,7 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18032,8 +16588,7 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18043,8 +16598,7 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18083,69 +16637,60 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, " -"zeroing the BSS, and setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, zeroing the BSS, and " +"setting up the stack pointer." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the " -"object file which containing statically allocated variables which are " -"initialised to zero. They are omitted from the image, to avoid wasting space " -"on zeroes. The compiler assumes that the loader will take care of zeroing " -"them." +"The BSS (block starting symbol, for historical reasons) is the part of the object file which " +"containing statically allocated variables which are initialised to zero. They are omitted from " +"the image, to avoid wasting space on zeroes. The compiler assumes that the loader will take " +"care of zeroing them." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and " -"the image is loaded, but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and the image is loaded, " +"but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If " -"we don't:" +msgid "We need to enable the MMU and cache before reading or writing any memory. If we don't:" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-" -"unknown-none` target which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses, so it should be fine in this case, but this " -"is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-none` target " +"which sets `+strict-align` to prevent the compiler generating unaligned accesses, so it should " +"be fine in this case, but this is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost when the cache " -"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " -"not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The problem is that the " +"VM is accessing memory directly with the cache disabled, while the host has cacheable aliases " +"to the same memory. Even if the host doesn't explicitly access the memory, speculative " +"accesses can lead to cache fills, and then changes from one or the other will get lost when " +"the cache is cleaned or the VM enables the cache. (Cache is keyed by physical address, not VA " +"or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " -"identity maps the first 1 GiB of address space for devices, the next 1 GiB " -"for DRAM, and another 1 GiB higher up for more devices. This matches the " -"memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity maps the " +"first 1 GiB of address space for devices, the next 1 GiB for DRAM, and another 1 GiB higher up " +"for more devices. This matches the memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "" -"We also set up the exception vector (`vbar_el1`), which we'll see more about " -"later." +msgid "We also set up the exception vector (`vbar_el1`), which we'll see more about later." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 " -"(EL1). If you need to run at a different exception level you'll need to " -"modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 (EL1). If you need " +"to run at a different exception level you'll need to modify `entry.S` accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -18154,13 +16699,12 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with " -"Rust code. For example, to make an HVC (hypervisor call) to tell the " -"firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with Rust code. For " +"example, to make an HVC (hypervisor call) to tell the firmware to power off the system:" msgstr "" -"گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " -"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " -"که به firmware بگویید سیستم را خاموش کند:" +"گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی استفاده کنیم. به " +"عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به firmware بگویید سیستم را " +"خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -18209,67 +16753,57 @@ msgstr "\"w7\"" #: src/bare-metal/aps/inline-assembly.md msgid "" -"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" -"smccc) crate which has wrappers for all these functions.)" +"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/smccc) crate " +"which has wrappers for all these functions.)" msgstr "" -"(اگر واقعاُ می‌خواهید این کار را انجام دهید، از crate مربوطه [`smccc`](https://" -"crates.io/crates/smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این " -"عملکردها است.)" +"(اگر واقعاُ می‌خواهید این کار را انجام دهید، از crate مربوطه [`smccc`](https://crates.io/crates/" +"smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این عملکردها است.)" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of " -"functions to manage system and CPU power states, among other things. It is " -"implemented by EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of functions to manage " +"system and CPU power states, among other things. It is implemented by EL3 firmware and " +"hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " -"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " -"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای مدیریت وضعیت‌های " +"power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط میان‌افزار EL3 و hypervisor در " +"بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the " -"inline assembly code, and ignore its contents afterwards. We need to use " -"`inout` rather than `in` because the call could potentially clobber the " -"contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the inline assembly " +"code, and ignore its contents afterwards. We need to use `inout` rather than `in` because the " +"call could potentially clobber the contents of the registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " -"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " -"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " -"محتویات رجیسترها را مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی به 0 " +"مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به جای `in` استفاده " +"کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is called from " +"our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " -"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه ورودی (entry " +"point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " -"used by the bootloader to pass things like a pointer to the device tree. " -"According to the standard aarch64 calling convention (which is what `extern " -"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " -"arguments passed to a function, so `entry.S` doesn't need to do anything " +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used by the " +"bootloader to pass things like a pointer to the device tree. According to the standard aarch64 " +"calling convention (which is what `extern \"C\"` specifies to use), registers `x0`–`x7` are " +"used for the first 8 arguments passed to a function, so `entry.S` doesn't need to do anything " "special except make sure it doesn't change these registers." msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " -"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " -"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " -"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " -"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " -"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " -"نمی‌دهد." +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader برای ارسال " +"چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد فراخوانی استاندارد aarch64 (که " +"همان چیزی است که `extern \"C\"` برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان " +"اول ارسال شده به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست " +"کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md -msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" -"examples`." -msgstr "" -"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +msgid "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." +msgstr "مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -18284,49 +16818,39 @@ msgid "Never hold a reference." msgstr "هرگز reference‌ای را نگه ندارید." #: src/bare-metal/aps/mmio.md -msgid "" -"`addr_of!` lets you get fields of structs without creating an intermediate " -"reference." +msgid "`addr_of!` lets you get fields of structs without creating an intermediate reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " -"ساختارها را دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent " -"the compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent the compiler or " +"hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " -"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " -"حذف آنها جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته باشد، " +"بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the " -"compiler may assume that the value read is the same as the value just " -"written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the compiler may assume that " +"the value read is the same as the value just written, and not bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " -"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " -"است و در واقع خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر ممکن است فرض " +"کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but " -"this is unsound. Whenever a reference exist, the compiler may choose to " -"dereference it." +"Some existing crates for volatile access to hardware do hold references, but this is unsound. " +"Whenever a reference exist, the compiler may choose to dereference it." msgstr "" -"برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " -"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " -"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." +"برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای referenceهایی " +"هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته باشد، کامپایلر ممکن است " +"انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md -msgid "" -"Use the `addr_of!` macro to get struct field pointers from a pointer to the " -"struct." +msgid "Use the `addr_of!` macro to get struct field pointers from a pointer to the struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " -"ساختار استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -18334,11 +16858,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" -"documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/ddi0183/g) UART, " +"so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" -"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/g) به‌عنوان " +"UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -18353,10 +16877,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -18364,10 +16886,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -18401,51 +16921,44 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is " -"because as long as the caller of `Uart::new` guarantees that its safety " -"requirements are met (i.e. that there is only ever one instance of the " -"driver for a given UART, and nothing else aliasing its address space), then " -"it is always safe to call `write_byte` later because we can assume the " -"necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is because as long as " +"the caller of `Uart::new` guarantees that its safety requirements are met (i.e. that there is " +"only ever one instance of the driver for a given UART, and nothing else aliasing its address " +"space), then it is always safe to call `write_byte` later because we can assume the necessary " +"preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " -"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " -"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " -"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " -"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " -"را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن هستند. این " +"به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که الزامات ایمنی آن برآورده " +"شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار " +"فضای آدرس آن را ندارد)، پس همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم " +"پیش‌شرط‌های لازم را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but " -"`write_byte` unsafe), but that would be much less convenient to use as every " -"place that calls `write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but `write_byte` unsafe), but " +"that would be much less convenient to use as every place that calls `write_byte` would need to " +"reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " -"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " -"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " -"استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما `write_byte` " +"را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر مکانی که `write_byte` را صدا " +"می‌زند باید در مورد ایمنی یا safety استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving " -"the burden of proof for soundness from a large number of places to a smaller " -"number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving the burden of proof " +"for soundness from a large number of places to a smaller number of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " -"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت عملکردی از " +"تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md -msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more " -"traits too." -msgstr "" -"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +msgid "We derived the `Debug` trait. It would be useful to implement a few more traits too." +msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -18457,20 +16970,14 @@ msgstr "" "// accessed from any context.\n" #: src/bare-metal/aps/uart/traits.md -msgid "" -"Implementing `Write` lets us use the `write!` and `writeln!` macros with our " -"`Uart` type." +msgid "Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type." msgstr "" -"پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ " -"`Uart` خود استفاده کنیم." +"پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ `Uart` خود " +"استفاده کنیم." #: src/bare-metal/aps/uart/traits.md -msgid "" -"Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" -"examples`." -msgstr "" -"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +msgid "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/examples`." +msgstr "مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -18479,17 +16986,15 @@ msgstr "یک درایور UART بهتر" #: src/bare-metal/aps/better-uart.md #, fuzzy msgid "" -"The PL011 actually has [a bunch more registers](https://developer.arm.com/" -"documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to " -"read. Plus, some of them are bit fields which would be nice to access in a " -"structured way." +"The PL011 actually has [a bunch more registers](https://developer.arm.com/documentation/" +"ddi0183/g/programmers-model/summary-of-registers), and adding offsets to construct pointers to " +"access them is error-prone and hard to read. Plus, some of them are bit fields which would be " +"nice to access in a structured way." msgstr "" -"‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" -"documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " -"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " -"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " -"به آنها به روشی ساختاریافته خوب است." +"‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/documentation/ddi0183/g/" +"programmers-model/summary-of-registers) و اضافه کردن offset برای ساختن اشاره‌گرها برای دسترسی " +"به آنها مستعدخطا است و حتی فرآبند خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit " +"هستند که دسترسی به آنها به روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -18653,11 +17158,9 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " -"working with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working with bitflags." msgstr "" -"این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " -"bitflags مفید است." +"این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با bitflags مفید است." #: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy @@ -18711,36 +17214,31 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a bunch of " +"method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " -"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی متد برای " +"دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "" -"We can use a struct to represent the memory layout of the UART's registers." -msgstr "" -"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " -"کنیم." +msgid "We can use a struct to represent the memory layout of the UART's registers." +msgstr "ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" -"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) tells the compiler to lay the struct fields out in order, " -"following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to " -"(among other things) reorder fields however it sees fit." -msgstr "" -"‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " -"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " -"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " -"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " +"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) " +"tells the compiler to lay the struct fields out in order, following the same rules as C. This " +"is necessary for our struct to have a predictable layout, as default Rust representation " +"allows the compiler to (among other things) reorder fields however it sees fit." +msgstr "" +"‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) به " +"کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این پیروی از قوانین مشابه با زبان C " +"است. این کار را برای ساختار ما برای داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض " +"Rust به کامپایلر اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " "کند." #: src/bare-metal/aps/better-uart/driver.md @@ -18787,11 +17285,11 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " -"fields without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields without " +"creating an intermediate reference, which would be unsound." msgstr "" -"به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " -"جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." +"به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای جداگانه بدون ایجاد " +"یک reference میانی توجه کنید، که ممکن است نادرست باشد." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md msgid "Using it" @@ -18799,11 +17297,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, " -"and echo incoming bytes." +"Let's write a small program using our driver to write to the serial console, and echo incoming " +"bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " -"بنویسیم و بایت‌های ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم و بایت‌های " +"ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -18829,8 +17327,7 @@ msgstr "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgid "b'\\r'" msgstr "b'\\r'" -#: src/bare-metal/aps/better-uart/using.md -#: src/concurrency/async-pitfalls/cancellation.md +#: src/bare-metal/aps/better-uart/using.md src/concurrency/async-pitfalls/cancellation.md msgid "b'\\n'" msgstr "b'\\n'" @@ -18844,30 +17341,23 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` function is called " +"from our entry point code in `entry.S`. See the speaker notes there for details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " -"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " -"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از کد نقطه ورودی " +"ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md -msgid "" -"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." -msgstr "" -"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +msgid "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +msgstr "مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`]" -"(https://crates.io/crates/log) crate. We can do this by implementing the " -"`Log` trait." +"It would be nice to be able to use the logging macros from the [`log`](https://crates.io/" +"crates/log) crate. We can do this by implementing the `Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" -"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " -"دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/log) استفاده " +"کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -18879,87 +17369,72 @@ msgid "/// Initialises UART logger.\n" msgstr "/// Initialises UART logger.\n" #: src/bare-metal/aps/logging.md -msgid "" -"The unwrap in `log` is safe because we initialise `LOGGER` before calling " -"`set_logger`." +msgid "The unwrap in `log` is safe because we initialise `LOGGER` before calling `set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " -"مقداردهی اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." msgstr "قبل از استفاده از لاگر باید مقداردهی اولیه کنیم." -#: src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/solutions-afternoon.md msgid "\"{info}\"" msgstr "\"{info}\"" #: src/bare-metal/aps/logging/using.md msgid "Note that our panic handler can now log details of panics." -msgstr "" -"توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." +msgstr "توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." #: src/bare-metal/aps/logging/using.md -msgid "" -"Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" -"examples`." -msgstr "" -"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +msgid "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/examples`." +msgstr "مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/exceptions.md msgid "" -"AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " -"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " -"We implement this in assembly to save volatile registers to the stack before " -"calling into Rust code:" +"AArch64 defines an exception vector table with 16 entries, for 4 types of exceptions " +"(synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, current EL with SPx, lower " +"EL using AArch64, lower EL using AArch32). We implement this in assembly to save volatile " +"registers to the stack before calling into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " -"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " -"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " -"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " -"فراخوانی Rust در stack ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، IRQ، FIQ، " +"SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL using AArch64, lower EL " +"using AArch32) تعریف می‌کند. ما این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار " +"(volatile) را قبل از فراخوانی Rust در stack ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "" -"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current " -"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current EL exceptions, or " +"between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " -"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 برای استثناهای " +"پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't " -"expect any of them to actually happen." +"For this example we just log the exception and power down, as we don't expect any of them to " +"actually happen." msgstr "" -"برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " -"نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." +"برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار نداریم هیچ یک از " +"آنها واقعاً اتفاق بیفتد." #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or " -"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." -"md) will control what we can share between them, just like with threads. For " -"example, if we want to share some value between exception handlers and the " -"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " -"it in something like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or less like different " +"threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will control what we can share " +"between them, just like with threads. For example, if we want to share some value between " +"exception handlers and the rest of the program, and it's `Send` but not `Sync`, then we'll " +"need to wrap it in something like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " -"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." -"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " -"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " -"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " -"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " -"قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای مختلف فکر " +"کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که می‌توانیم بین آنها به " +"اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین " +"handlerهای exception و بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " +"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -18980,27 +17455,24 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception handling, " +"page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " -"exception و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" -"Some dodginess around cache maintenance and initialisation in Rust, not " -"necessarily a good example to copy for production code." +"Some dodginess around cache maintenance and initialisation in Rust, not necessarily a good " +"example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " -"برای کپی کردن برای کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای کپی کردن برای " +"کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -19012,120 +17484,102 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. This will " +"read and write memory (e.g. the stack). However:" msgstr "" -"آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " -"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " -"بااین‌حال:" +"آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا می‌کند. این کار " +"memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-unknown-" +"none` which sets `+strict-align` to prevent the compiler generating unaligned accesses so it " +"should be alright, but this is not necessarily the case in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " -"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " -"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " -"صحیح باشد، اما لزوماً اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-unknown-none` " +"ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر " +"جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." +"If it were running in a VM, this can lead to cache coherency issues. The problem is that the " +"VM is accessing memory directly with the cache disabled, while the host has cacheable aliases " +"to the same memory. Even if the host doesn't explicitly access the memory, speculative " +"accesses can lead to cache fills, and then changes from one or the other will get lost. Again " +"this is alright in this particular case (running directly on the hardware with no hypervisor), " +"but isn't a good pattern in general." msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " -"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " -"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " -"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " -"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " -"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " -"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. مشکل این است " +"که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا می‌کند، درحالی‌که host دارای " +"alias قابل کَش برای همان حافظه است. حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، " +"دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " +"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما " +"به‌طورکلی الگوی خوبی نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" msgstr "جعبه‌های (crates) کاربردی" #: src/bare-metal/useful-crates.md -msgid "" -"We'll go over a few crates which solve some common problems in bare-metal " -"programming." -msgstr "" -"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " -"را حل می‌کند." +msgid "We'll go over a few crates which solve some common problems in bare-metal programming." +msgstr "ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " -"traits and macros for safely converting between byte sequences and other " -"types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits and macros " +"for safely converting between byte sequences and other types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " -"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی را برای تبدیل " +"ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " -"but can be useful for working with structures shared with hardware e.g. by " -"DMA, or sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but can be useful " +"for working with structures shared with hardware e.g. by DMA, or sent over some external " +"interface." msgstr "" -"این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " -"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " -"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." +"این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده نمی‌کند)، اما می‌تواند " +"برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط DMA، یا از طریق برخی از رابط‌های خارجی " +"ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is " -"valid, and so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is valid, and so can " +"safely be converted from an untrusted sequence of bytes." msgstr "" -"‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " -"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " -"تبدیل کرد." +"‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است پیاده‌سازی کرد و " +"بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not " -"all byte patterns are valid." +"Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use " +"all possible u32 values as discriminants, so not all byte patterns are valid." msgstr "" -"تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " -"`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " -"بنابراین همه الگوهای بایت معتبر نیستند." +"تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا `RequestType` از همه " +"مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، بنابراین همه الگوهای بایت معتبر نیستند." #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "" -"`zerocopy::byteorder` has types for byte-order aware numeric primitives." -msgstr "" -"‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." +msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgstr "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"zerocopy-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-example/`. (It " +"won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" -"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا کنید. (به دلیل " +"وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " -"you create page tables according to the AArch64 Virtual Memory System " -"Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you create page " +"tables according to the AArch64 Virtual Memory System Architecture." msgstr "" -"این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " -"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " -"کنید." +"این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما امکان می‌دهد page " +"tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -19144,50 +17598,41 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." -msgstr "" -"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " -"ساده باشد." +"For now it only supports EL1, but support for other exception levels should be straightforward " +"to add." +msgstr "در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android.com/android/" +"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" -"android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/) استفاده می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/platform/" +"superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware or under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " -"یا تحت QEMU اجرا شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت QEMU اجرا " +"شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " -"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " -"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" -"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " -"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." -"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " -"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " -"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " -"اختصاص دهیم:" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a third-party " +"crate implementing a basic buddy system allocator. It can be used both for [`LockedHeap`]" +"(https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"implementing [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so " +"you can use the standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating " +"other address space. For example, we might want to allocate MMIO space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک third-party " +"crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن را هم برای ['LockedHeap']" +"(https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) " +"استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " +"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را " +"برای PCI BARها اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -19195,102 +17640,85 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"allocator-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-example/`. (It " +"won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " -"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا کنید. (به " +"دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without " -"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " -"this: a vector backed by an array or slice, which could be statically " -"allocated or on the stack, which keeps track of how many elements are used " -"and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without heap allocation. " +"[`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector backed by an array or " +"slice, which could be statically allocated or on the stack, which keeps track of how many " +"elements are used and panics if you try to use more than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " -"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " -"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " -"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " -"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " -"کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما بدون heap " +"allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را فراهم می‌کند: یک برداری که " +"توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که " +"تعداد عناصر استفاده شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را " +"استفاده کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md -msgid "" -"`tinyvec` requires that the element type implement `Default` for " -"initialisation." -msgstr "" -"‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." +msgid "`tinyvec` requires that the element type implement `Default` for initialisation." +msgstr "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." #: src/bare-metal/useful-crates/tinyvec.md -msgid "" -"The Rust Playground includes `tinyvec`, so this example will run fine inline." +msgid "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " -"داخلی اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " -"are not available in `core` or `alloc`. How can we manage synchronisation or " -"interior mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are not available " +"in `core` or `alloc`. How can we manage synchronisation or interior mutability, such as for " +"sharing state between different CPUs?" msgstr "" -"‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " -"`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " -"اشتراک‌گذاری وضعیت بین CPU‌های مختلف را مدیریت کنیم؟" +"‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا `alloc` موجود " +"نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند اشتراک‌گذاری وضعیت بین CPU‌های " +"مختلف را مدیریت کنیم؟" #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " -"equivalents of many of these primitives." +"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based equivalents of many " +"of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " -"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، بسیاری از این " +"موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." -msgstr "" -"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " -"کنید." +msgstr "اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." #: src/bare-metal/useful-crates/spin.md msgid "" -"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " -"`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." +"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, `Barrier` and " +"`Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " -"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و `Once` از " +"`std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " -"useful types for late initialisation with a slightly different approach to " -"`spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful types for " +"late initialisation with a slightly different approach to `spin::once::Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " -"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" -"once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های مفیدی برای " +"مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "" -"The Rust Playground includes `spin`, so this example will run fine inline." -msgstr "" -"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " -"اجرا می‌شود." +msgid "The Rust Playground includes `spin`, so this example will run fine inline." +msgstr "‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a " -"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " -"with a linker script to produce the binary itself, and then a `raw_binary` " -"to convert the ELF to a raw binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` Soong rule to " +"build your Rust code, then a `cc_binary` with a linker script to produce the binary itself, " +"and then a `raw_binary` to convert the ELF to a raw binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " -"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " -"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " -"ELF به یک raw binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong برای ساخت کد " +"Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script برای تولید binary استفاده " +"کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -19299,32 +17727,27 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md #, fuzzy msgid "" -"For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" -"libs/libvmbase/) library provides a linker script and useful defaults for " -"the build rules, along with an entry point, UART console logging and more." +"For VMs running under crosvm on aarch64, the [vmbase](https://android.googlesource.com/" +"platform/packages/modules/Virtualization/+/refs/heads/main/libs/libvmbase/) library provides a " +"linker script and useful defaults for the build rules, along with an entry point, UART console " +"logging and more." msgstr "" -"برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" -"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" -"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " -"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " -"موارد دیگر." +"برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase](https://android." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/master/vmbase/) یک " +"اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، " +"UART console logging و موارد دیگر." #: src/bare-metal/android/vmbase.md -msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` " -"entry point." -msgstr "" -"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " -"فراخوانی شود." +msgid "The `main!` macro marks your main function, to be called from the `vmbase` entry point." +msgstr "این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی شود." #: src/bare-metal/android/vmbase.md msgid "" -"The `vmbase` entry point handles console initialisation, and issues a " -"PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." +"The `vmbase` entry point handles console initialisation, and issues a PSCI_SYSTEM_OFF to " +"shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " -"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main function، یک " +"PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -19332,58 +17755,52 @@ msgstr "ما یک درایور برای دستگاه PL031 real-time clock خو #: src/exercises/bare-metal/afternoon.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"afternoon.md) provided." +"After looking at the exercises, you can look at the [solutions](solutions-afternoon.md) " +"provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " -"شده نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " -"you should write a driver for it." +"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/documentation/ddi0224/c) " +"real-time clock at 0x9010000. For this exercise, you should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." -"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " -"برای آن بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/documentation/" +"ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the " -"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the [`chrono`](https://" +"crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " -"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " -"کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`](https://" +"crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given " -"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" -"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given time, e.g. 3 " +"seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-lang.org/core/hint/fn." +"spin_loop.html) inside the loop.)" msgstr "" -"از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " -"بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" -"(https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر بمانید، به عنوان " +"مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`](https://doc.rust-lang.org/core/" +"hint/fn.spin_loop.html) inside the loop.)" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by " -"the RTC match. You can use the driver provided in the [`arm-gic`](https://" -"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by the RTC match. You " +"can use the driver provided in the [`arm-gic`](https://docs.rs/arm-gic/) crate to configure " +"the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " -"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" -"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " -"کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را مدیریت کنید. " +"می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/arm-gic/) برای پیکربندی Arm " +"Generic Interrupt Controller استفاده کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -19391,27 +17808,24 @@ msgstr "از وقفه RTC استفاده کنید که به عنوان `IntId::s #: src/exercises/bare-metal/rtc.md msgid "" -"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" -"wfi()`, which will cause the core to sleep until it receives an interrupt." +"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::wfi()`, which will " +"cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" -"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " -"به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به حالت Sleep " +"درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `rtc` " +"directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " -"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های زیر را در " +"دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " -"the exercise):" -msgstr "" -"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the exercise):" +msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -19589,10 +18003,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -19600,10 +18012,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19632,12 +18042,10 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19658,14 +18066,12 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19687,58 +18093,49 @@ msgid "Welcome to Concurrency in Rust" msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md -msgid "" -"Rust has full support for concurrency using OS threads with mutexes and " -"channels." +msgid "Rust has full support for concurrency using OS threads with mutexes and channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " -"از mutex ها و channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از mutex ها و " +"channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" -"The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since " -"you can rely on the compiler to ensure correctness at runtime." +"The Rust type system plays an important role in making many concurrency bugs compile time " +"bugs. This is often referred to as _fearless concurrency_ since you can rely on the compiler " +"to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " -"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " -"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " -"زمان اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان کامپایل ایفا " +"می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless concurrency_) شناخته می‌شود زیرا " +"می‌توانید به کامپایلر برای اطمینان از صحت در زمان اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 20 " -"minutes. It contains:" +"Including 10 minute breaks, this session should take about 3 hours and 20 minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " -"بکشد. شامل موارد زیر است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. شامل موارد زیر " +"است:" #: src/concurrency/welcome.md -msgid "" -"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " -"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: thread‌ها، " +"سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md -msgid "" -"The type system gives us safety for concurrency without any special features." -msgstr "" -"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgid "The type system gives us safety for concurrency without any special features." +msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e." -"g., a called function that might mutate an argument or save references to it " -"to read later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e.g., a called " +"function that might mutate an argument or save references to it to read later) save us from " +"multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " -"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " -"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " -"می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند یک تابع " +"فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای خواندن بعد ذخیره کند) " +"ما را از مشکلات multi-threading نجات می‌دهند. " -#: src/concurrency/threads.md src/concurrency/shared-state.md -#: src/concurrency/async.md +#: src/concurrency/threads.md src/concurrency/shared-state.md src/concurrency/async.md msgid "This segment should take about 30 minutes. It contains:" msgstr "این بخش باید حدود ۳۰ دقیقه طول بکشد و شامل موارد زیر است:" @@ -19756,8 +18153,7 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the " -"end of `main`." +"Spawning new threads does not automatically delay program termination at the end of `main`." msgstr "" #: src/concurrency/threads/plain.md @@ -19766,41 +18162,30 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." -msgstr "" -"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " -"کرد." +msgstr "‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." -msgstr "" -"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " -"آن‌ها است." +msgstr "‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها است." #: src/concurrency/threads/plain.md msgid "Run the example." msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md -msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in " -"lockstep." +msgid "5ms timing is loose enough that main and spawned threads stay mostly in lockstep." msgstr "" -"زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " -"عمدتاً همگام می‌مانند." +"زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها عمدتاً همگام " +"می‌مانند." #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" -msgstr "" -"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " -"پایان می‌رسد!" +msgstr "توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان می‌رسد!" #: src/concurrency/threads/plain.md -msgid "" -"This is because main ends the program and spawned threads do not make it " -"persist." +msgid "This is because main ends the program and spawned threads do not make it persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " -"تداوم آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -19812,27 +18197,27 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. " +"Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. " +"به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) method that blocks." +"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) method that blocks." msgstr "" -"`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) متد آن بلاک‌ها." +"`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) متد آن بلاک‌ها." #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the thread to " +"finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " -"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا منتظر بمانید تا " +"thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -19844,26 +18229,21 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method." +"join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method." +"join) returns `thread::Result`" #: src/concurrency/threads/plain.md -msgid "" -"Use the `Result` return value from `handle.join()` to get access to the " -"returned value." -msgstr "" -"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +msgid "Use the `Result` return value from `handle.join()` to get access to the returned value." +msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -19871,21 +18251,19 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "" -"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://" -"doc.rust-lang.org/std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://doc.rust-lang.org/" +"std/any/index.html)." msgstr "" -"دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" -"(https://doc.rust-lang.org/std/any/index.html)." +"دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`](https://doc.rust-" +"lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "" -"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -19898,8 +18276,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " -"مشتق شده را برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق شده را " +"برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -19907,17 +18285,15 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just " -"return and leave them running." +"Main kills child threads when it returns, but another function would just return and leave " +"them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " -"return می‌شود و آنها را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return می‌شود و آنها " +"را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" -msgstr "" -"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " -"نقض می‌کند!" +msgstr "این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -19929,28 +18305,27 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" -"fn.scope.html) for this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope.html) for " +"this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" -"std/thread/fn.scope.html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope." +"html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all " -"the threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all the threads are " +"guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " -"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین می‌شود، " +"بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one " -"thread, or immutably by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably " +"by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " -"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " -"بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با یک thread یا " +"غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -19958,8 +18333,8 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts are connected " +"via the channel, but you only see the end-points." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -19968,15 +18343,14 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` " +"(so you can make multiple producers) but `Receiver` does not." msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the " -"counterpart `Sender` or `Receiver` is dropped and the channel is closed." +"`send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` " +"or `Receiver` is dropped and the channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md @@ -20000,27 +18374,25 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +msgid "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the " -"channel for the new message. The thread can be blocked indefinitely if there " -"is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the channel for the new " +"message. The thread can be blocked indefinitely if there is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) if the channel is " +"closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". Every send will " +"block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -20032,49 +18404,42 @@ msgid "Sync" msgstr "همگام سازی" #: src/concurrency/send-sync/marker-traits.md -msgid "" -"How does Rust know to forbid shared access across threads? The answer is in " -"two traits:" +msgid "How does Rust know to forbid shared access across threads? The answer is in two traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " -"دو trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " -"is `Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is `Send` if it is " +"safe to move a `T` across a thread boundary." msgstr "" -"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " -"جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." +"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که جابجایی `T` در " +"امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " -"is `Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is `Sync` if it is " +"safe to move a `&T` across a thread boundary." msgstr "" -"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " -"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " -"`Sync` است." +"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که جابجایی یک `&T` در " +"سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " -"The compiler will automatically derive them for your types as long as they " -"only contain `Send` and `Sync` types. You can also implement them manually " -"when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The compiler will " +"automatically derive them for your types as long as they only contain `Send` and `Sync` types. " +"You can also implement them manually when you know it is valid." msgstr "" -"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " -"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " -"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " -"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). کامپایلر به‌طور " +"خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای انواع `Send` و `Sync` باشند. " +"شما همچنین می توانید آنها را به صورت دستی پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن " +"معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-" -"safety properties." +"One can think of these traits as markers that the type has certain thread-safety properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" -"safety خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -20082,39 +18447,34 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " -"if it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if it is safe to " +"move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" -"doc.rust-lang.org/std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc.rust-lang.org/" +"std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will " -"run in that thread. So the question is when you can allocate a value in one " -"thread and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will run in that " +"thread. So the question is when you can allocate a value in one thread and deallocate it in " +"another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " -"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " -"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " -"thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " +"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی می‌توانید یک " +"مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from " -"a single thread." -msgstr "" -"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " -"باشد." +"As an example, a connection to the SQLite library must only be accessed from a single thread." +msgstr "به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " -"if it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if it is safe to " +"access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." -"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " -"همزمان امن باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) است، " +"اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -20126,27 +18486,23 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is " -"thread-safe for shared use, it is also thread-safe to pass references of it " -"across threads." +"This statement is essentially a shorthand way of saying that if a type is thread-safe for " +"shared use, it is also thread-safe to pass references of it across threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " -"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " -"امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده مشترک امن باشد، " +"انتقال ارجاعات (pass references) آن به threadها نیز امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across " -"multiple threads without the risk of data races or other synchronization " -"issues, so it is safe to move it to another thread. A reference to the type " -"is also safe to move to another thread, because the data it references can " -"be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across multiple threads " +"without the risk of data races or other synchronization issues, so it is safe to move it to " +"another thread. A reference to the type is also safe to move to another thread, because the " +"data it references can be accessed from any thread safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " -"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " -"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " -"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " -"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را در چند thread " +"بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک گذاشت، بنابراین انتقال آن به " +"thread‌ای دیگر امن است. ارجاع به تایپ نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی " +"که به آن ارجاع می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -20174,8 +18530,7 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "" -"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -20183,16 +18538,12 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "" -"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md -msgid "" -"The generic types are typically `Send + Sync` when the type parameters are " -"`Send + Sync`." +msgid "The generic types are typically `Send + Sync` when the type parameters are `Send + Sync`." msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " -"هستند.`Send + Sync`." +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند.`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -20200,11 +18551,11 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. " -"Typically because of interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. Typically because of " +"interior mutability:" msgstr "" -"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " -"معمول به دلیل تغییرپذیری داخلی(interior mutability):" +"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور معمول به دلیل " +"تغییرپذیری داخلی(interior mutability):" #: src/concurrency/send-sync/examples.md msgid "`mpsc::Receiver`" @@ -20225,21 +18576,19 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple " -"threads, but they cannot be moved to another thread:" -msgstr "" -"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " -"منتقل کرد:" +"These types are safe to access (via shared references) from multiple threads, but they cannot " +"be moved to another thread:" +msgstr "این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them. However, an already-locked mutex can have its " -"guarded variable read by any thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on the thread which " +"created them. However, an already-locked mutex can have its guarded variable read by any " +"thread with which the guard is shared." msgstr "" -"‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " -"threadای که آنها را ایجاد کرده است، توزیع شوند." +"‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در threadای که آنها " +"را ایجاد کرده است، توزیع شوند." #: src/concurrency/send-sync/examples.md msgid "`!Send + !Sync`" @@ -20247,25 +18596,21 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" -msgstr "" -"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " -"منتقل کرد:" +msgstr "این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل کرد:" #: src/concurrency/send-sync/examples.md msgid "" -"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" -"atomic reference count." +"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-atomic reference " +"count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " -"مراجع غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" -"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " -"considerations." +"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " -"است ملاحظات همزمانی خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است ملاحظات همزمانی " +"خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -20277,11 +18622,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-only access " +"via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " -"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا دسترسی read-only " +"مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -20293,36 +18638,31 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " -"that uses atomic operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that uses atomic " +"operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " -"عملیات atomic استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات atomic " +"استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " -"and `Sync` if and only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and `Sync` if and " +"only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " -"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " -"آنها را پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. `Send` و " +"`Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but " -"after that the use of the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but after that the use of " +"the `T` is free." msgstr "" -"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن " -"استفاده از `T` آزاد است." +"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن استفاده از `T` آزاد است." #: src/concurrency/shared-state/arc.md -msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect " -"them." +msgid "Beware of reference cycles, `Arc` does not use a garbage collector to detect them." msgstr "" -"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " -"استفاده نمی‌کند." +"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها استفاده نمی‌کند." #: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." @@ -20330,15 +18670,13 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " -"mutual exclusion _and_ allows mutable access to `T` behind a read-only " -"interface (another form of [interior mutability](../../borrowing/interior-" -"mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual exclusion " +"_and_ allows mutable access to `T` behind a read-only interface (another form of [interior " +"mutability](../../borrowing/interior-mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " -"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " -"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" -"borrowing/interior-mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که حذف متقابل " +"_و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only interface (شکل دیگری از " +"[تغییرپذیری (mutable) داخلی](../../borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -20346,45 +18684,33 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " -"implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" +"struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " -"کامل آن داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" +"struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن داریم." #: src/concurrency/shared-state/mutex.md -msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the " -"protected data." +msgid "`Mutex` in Rust looks like a collection with just one element --- the protected data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " -"(protected) به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md -msgid "" -"It is not possible to forget to acquire the mutex before accessing the " -"protected data." -msgstr "" -"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " -"فراموش کرد." +msgid "It is not possible to forget to acquire the mutex before accessing the protected data." +msgstr "نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The " -"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that " +"the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " -"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین می‌کند که`&mut " +"T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md -msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +msgid "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements `Send`." msgstr "" -"‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " -"استفاده‌ می‌کنند." +"‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` استفاده‌ می‌کنند." #: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." @@ -20396,17 +18722,15 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." -msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" -"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " -"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " -"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " -"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal that " +"the data it protected might be in an inconsistent state. Calling `lock()` on a poisoned mutex " +"fails with a [`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). You " +"can call `into_inner()` on the error to recover the data regardless." +msgstr "" +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» می‌شود تا نشان " +"دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. فراخوانی `lock()` در یک " +"mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang.org/std/sync/struct.PoisonError.html) " +"انجام نمی‌شود. می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " "فراخوانی کنید." #: src/concurrency/shared-state/example.md @@ -20426,31 +18750,26 @@ msgid "Notable parts:" msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md -msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " -"orthogonal." +msgid "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " -"between threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " -"قابل تغییر (mutable) بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل تغییر (mutable) " +"بین threadها است." #: src/concurrency/shared-state/example.md msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " -"thread. Note `move` was added to the lambda signature." +"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` " +"was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " -"منتقل کرد. نکته `move` به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل کرد. نکته `move` " +"به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md -msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as " -"possible." +msgid "Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -20459,33 +18778,29 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " -"philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " -"down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " -"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " -"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " -"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " -"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " -"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " -"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " -"پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has their own place at the " +"table. There is a fork between each plate. The dish served is a kind of spaghetti which has to " +"be eaten with two forks. Each philosopher can only alternately think and eat. Moreover, a " +"philosopher can only eat their spaghetti when they have both a left and right fork. Thus two " +"forks will only be available when their two nearest neighbors are thinking, not eating. After " +"an individual philosopher finishes eating, they will put down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز دارد. بین هر " +"بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که باید با دو چنگال خورده شود. " +"هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند " +"اسپاگتی خود را زمانی بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " +"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس " +"از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) " -"for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. " +"Copy the code below to a file called `src/main.rs`, fill out the blanks, and test that `cargo " +"run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " -"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " -"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی نیاز دارید. کد " +"زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر کنید و آزمایش کنید که `cargo " +"run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -20599,49 +18914,41 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It " -"should start at a webpage and check that links on the page are valid. It " -"should recursively check other pages on the same domain and keep doing this " -"until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It should start at a " +"webpage and check that links on the page are valid. It should recursively check other pages on " +"the same domain and keep doing this until all pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " -"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " -"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " -"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. باید از یک " +"صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. باید به‌صورت بازگشتی صفحات " +"دیگر را در همان دامنه بررسی کند و این کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`]" -"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " -"we will use [`thiserror`](https://docs.rs/thiserror/)." +"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/reqwest/). You will " +"also need a way to find links, we can use [`scraper`](https://docs.rs/scraper/). Finally, " +"we'll need some way of handling errors, we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " -"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " -"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " -"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" -"thiserror/) استفاده خواهیم کرد." +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز دارید. شما " +"همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از [`reqwest`](https://docs.rs/" +"reqwest/) استفاده کنیم. در نهایت، ما به روشی برای رسیدگی به خطاها نیاز داریم پس درنتیجه از " +"[`thiserror`](https://docs.rs/thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" -msgstr "" -"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " -"اعلام کنید:" +msgstr "یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"If `cargo add` fails with `error: no such subcommand`, then please edit the " -"`Cargo.toml` file by hand. Add the dependencies listed below." +"If `cargo add` fails with `error: no such subcommand`, then please edit the `Cargo.toml` file " +"by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." -"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` را دستی " +"ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "" -"The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "" -"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -20653,8 +18960,7 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -20667,53 +18973,45 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://" -"www.google.org/`." +"You can now download the start page. Try with a small site such as `https://www.google.org/`." msgstr "" -"اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." -"google.org/` امتحان کنید." +"اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www.google.org/` " +"امتحان کنید." #: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "فایل `src/main.rs` شما باید چیزی شبیه به این باشد:" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "\"request error: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"bad http response: {0}\"" msgstr "\"bad http response: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "\"بررسی {:#}\"" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "\"href\"" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" -#: src/concurrency/sync-exercises/link-checker.md -#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "\"https://www.google.org\"" @@ -20731,22 +19029,19 @@ msgstr "این کد را در `src/main.rs` اجرا کنید" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Use threads to check the links in parallel: send the URLs to be checked to a " -"channel and let a few threads check the URLs in parallel." +"Use threads to check the links in parallel: send the URLs to be checked to a channel and let a " +"few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " -"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " -"بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند به یک channel " +"ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google." -"org` domain. Put an upper limit of 100 pages or so so that you don't end up " -"being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google.org` domain. Put an " +"upper limit of 100 pages or so so that you don't end up being blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." -"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " -"نهایت توسط سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google.org» استخراج " +"کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -20773,10 +19068,8 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "" -"/// Determine whether links within the given page should be extracted.\n" -msgstr "" -"/// Determine whether links within the given page should be extracted.\n" +msgid "/// Determine whether links within the given page should be extracted.\n" +msgstr "/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -20802,57 +19095,46 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed " -"concurrently by executing each task until it would block, then switching to " -"another task that is ready to make progress. The model allows running a " -"larger number of tasks on a limited number of threads. This is because the " -"per-task overhead is typically very low and operating systems provide " -"primitives for efficiently identifying I/O that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " -"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " -"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " -"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " -"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " +"\"Async\" is a concurrency model where multiple tasks are executed concurrently by executing " +"each task until it would block, then switching to another task that is ready to make progress. " +"The model allows running a larger number of tasks on a limited number of threads. This is " +"because the per-task overhead is typically very low and operating systems provide primitives " +"for efficiently identifying I/O that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر کار تا زمانی که " +"مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است سوئیچ می‌شود. این مدل اجازه " +"می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار " +"هر task معمولاً بسیار کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " "ادامه هستند فراهم می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work " -"that may be completed in the future. Futures are \"polled\" until they " -"signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work that may be " +"completed in the future. Futures are \"polled\" until they signal that they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " -"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " -"ندهند، «polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن است در آینده " +"تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، «polled» می‌شوند." #: src/concurrency/welcome-async.md -msgid "" -"Futures are polled by an async runtime, and several different runtimes are " -"available." -msgstr "" -"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " -"دسترس هستند." +msgid "Futures are polled by an async runtime, and several different runtimes are available." +msgstr "‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس هستند." #: src/concurrency/welcome-async.md msgid "" -"Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", " -"similar to a runtime in Rust." +"Python has a similar model in its `asyncio`. However, its `Future` type is callback-based, and " +"not polled. Async Python programs require a \"loop\", similar to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " -"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " -"runtime در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر callback است و " +"poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language " -"runtime implements the event loop, so many of the details of Promise " -"resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language runtime implements " +"the event loop, so many of the details of Promise resolution are hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " -"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " -"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. runtime زبان " +"حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از جزئیات واضح در Promise پنهان " +"می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -20860,12 +19142,9 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy -msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential " -"code:" +msgid "At a high level, async Rust code looks very much like \"normal\" sequential code:" msgstr "" -"در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " -"sequential code):" +"در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" sequential code):" #: src/concurrency/async/async-await.md #, fuzzy @@ -20874,11 +19153,11 @@ msgstr "\"Count is: {i}!\"" #: src/concurrency/async/async-await.md msgid "" -"Note that this is a simplified example to show the syntax. There is no long " -"running operation or any real concurrency in it!" +"Note that this is a simplified example to show the syntax. There is no long running operation " +"or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " -"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی مدت یا هیچ " +"هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -20886,141 +19165,128 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." -msgstr "" -"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " -"کنید." +msgstr "برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return " -"type with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return type with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " -"یک future جایگزین می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک future جایگزین " +"می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the " -"compiler on how to use the returned future." +"You cannot make `main` async, without additional instructions to the compiler on how to use " +"the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " -"future بازگشتی، `main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future بازگشتی، " +"`main` را async کنید." #: src/concurrency/async/async-await.md msgid "" -"You need an executor to run async code. `block_on` blocks the current thread " -"until the provided future has run to completion." +"You need an executor to run async code. `block_on` blocks the current thread until the " +"provided future has run to completion." msgstr "" -"برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که " -"thread رشته فعلی را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." +"برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که thread رشته فعلی " +"را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. " -"Unlike `block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. Unlike `block_on`, `." +"await` doesn't block the current thread." msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` can only be used inside an `async` function (or block; these are " -"introduced later)." +"`.await` can only be used inside an `async` function (or block; these are introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " -"مورد در آینده معرفی می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در آینده معرفی " +"می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " -"trait, implemented by objects that represent an operation that may not be " -"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, implemented by " +"objects that represent an operation that may not be complete yet. A future can be polled, and " +"`poll` returns a [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " -"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " -"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، اجرا شده " +"توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده باشد. می‌توان یک future " +"را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll.html) را " +"برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but " -"uncommon) to implement `Future` for your own types. For example, the " -"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " -"joining to it." +"An async function returns an `impl Future`. It's also possible (but uncommon) to implement " +"`Future` for your own types. For example, the `JoinHandle` returned from `tokio::spawn` " +"implements `Future` to allow joining to it." msgstr "" -"یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " -"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " -"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " -"امکان پیوستن (joining) به آن را فراهم کند." +"یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) پیاده‌سازی `Future` " +"برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` برگردانده شده از `tokio::spawn` " +"`Future` را پیاده‌سازی می‌کند تا امکان پیوستن (joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function " -"to pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function to pause until " +"that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " -"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا زمانی که " +"Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the " -"links to show the implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the links to show the " +"implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " -"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای نمایش " +"پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async code, rather than " +"building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " -"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر نوشتن کدهای " +"async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md -msgid "" -"`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +msgid "`Context` allows a Future to schedule itself to be polled again when an event occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " -"poll مجدد برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll مجدد " +"برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into " -"that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into that future remain " +"valid. This is required to allow references to remain valid after an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " -"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " -"ماندن پس از `.await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future معتبر باقی " +"می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `.await` لازم است." #: src/concurrency/async/runtimes.md msgid "" -"A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust " -"does not have a \"built-in\" runtime, but several options are available:" +"A _runtime_ provides support for performing operations asynchronously (a _reactor_) and is " +"responsible for executing futures (an _executor_). Rust does not have a \"built-in\" runtime, " +"but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " -"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " -"اما چندین گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و مسئول اجرای " +"futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" -"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" -"github.com/hyperium/tonic) for gRPC." +"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of functionality like " +"[Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github.com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " -"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " -"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به خوبی توسعه " +"یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://github) .com/hyperium/" +"tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a basic runtime " +"in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " -"شامل یک runtime اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل یک runtime " +"اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -21028,35 +19294,33 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" -"Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" -"async/src/lib.rs) already has one." +"Several larger applications have their own runtimes. For example, [Fuchsia](https://fuchsia." +"googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/src/lib.rs) already has one." msgstr "" -"چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " -"[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" -"fuchsia-async/src/lib.rs) اکنون یکی runtime دارد." +"چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، [Fuchsia](https://" +"fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/src/lib.rs) اکنون یکی " +"runtime دارد." #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust " -"playground. The playground also does not permit any I/O, so most interesting " -"async things can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust playground. The " +"playground also does not permit any I/O, so most interesting async things can't run in the " +"playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " -"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " -"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان Rust پشتیبانی " +"می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین بیشتر چیزهای async جالب " +"نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" -"Futures are \"inert\" in that they do not do anything (not even start an I/O " -"operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never " -"used." +"Futures are \"inert\" in that they do not do anything (not even start an I/O operation) unless " +"there is an executor polling them. This differs from JS Promises, for example, which will run " +"to completion even if they are never used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " -"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " -"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " -"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/O را شروع " +"نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling کند. به عنوان مثال، " +"این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا " +"خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21065,8 +19329,7 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "" -"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -21095,8 +19358,7 @@ msgstr "تابع `spawn` یک \"task\" جدید و همزمان ایجاد می #: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." -msgstr "" -"توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." +msgstr "توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." #: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" @@ -21104,12 +19366,11 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" -"Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " -"until it finishes." +"Why does `count_to` not (usually) get to 10? This is an example of async cancellation. `tokio::" +"spawn` returns a handle which can be awaited to wait until it finishes." msgstr "" -"چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " -"`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." +"چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. `tokio::spawn` یک " +"handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." #: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." @@ -21125,17 +19386,15 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make " -"progress. That future may have one or more nested futures that its `poll` " -"method polls, corresponding loosely to a call stack. Concurrency within a " -"task is possible by polling multiple child futures, such as racing a timer " -"and an I/O operation." +"A task has a single top-level future which the executor polls to make progress. That future " +"may have one or more nested futures that its `poll` method polls, corresponding loosely to a " +"call stack. Concurrency within a task is possible by polling multiple child futures, such as " +"racing a timer and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " -"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " -"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " -"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " -"یک تایمر و یک عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را poll می‌کند. آن " +"future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` آن را `poll` می‌کند، که به طور " +"ناپایداری با یک stack فراخوانی شده مطابقت دارد. همزمانی در یک task با poll از چندین child " +"future، مانند رقابت یک تایمر و یک عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -21167,53 +19426,42 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"Thanks for dialing in, {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "" -"Copy this example into your prepared `src/main.rs` and run it from there." -msgstr "" -"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " -"کنید." +msgid "Copy this example into your prepared `src/main.rs` and run it from there." +msgstr "این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix." -"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" -"telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/man-page/" +"linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" -"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/nc/) یا " +"[telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with " -"a few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with a few connected " +"clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " -"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه taskهایی " +"وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a " -"closure, but does not take any arguments. Its return value is a Future, " -"similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a closure, but does not " +"take any arguments. Its return value is a Future, similar to an `async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " -"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ استدلالی " +"ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md -msgid "" -"Refactor the async block into a function, and improve the error handling " -"using `?`." -msgstr "" -"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " -"بخشید." +msgid "Refactor the async block into a function, and improve the error handling using `?`." +msgstr "بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "" -"Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "" -"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md #, fuzzy @@ -21242,16 +19490,15 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "" -"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](../channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the [morning class](../" +"channels.md)." msgstr "" -"به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" -"channels.md) دیده می‌شود." +"به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../channels.md) دیده " +"می‌شود." #: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" @@ -21259,32 +19506,30 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" -"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient " -"for complex applications with both IO and heavy CPU processing tasks." +"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that implement both `sync` " +"and `async` `send` and `recv`. This can be convenient for complex applications with both IO " +"and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " -"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " -"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی است که `sync` " +"و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای برنامه‌های پیچیده با taskهای " +"پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to " -"combine them with other `future`s to combine them and create complex control " -"flow." +"What makes working with `async` channels preferable is the ability to combine them with other " +"`future`s to combine them and create complex control flow." msgstr "" -"چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " -"`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." +"چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر `future` برای ترکیب " +"آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns " -"a collection of their results. This is similar to `Promise.all` in " -"JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns a collection of " +"their results. This is similar to `Promise.all` in JavaScript or `asyncio.gather` in Python." msgstr "" -"عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " -"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " -"در JavaScript یا `asyncio.gather` در پایتون است." +"عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و مجموعه‌ای " +"(collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در JavaScript یا `asyncio." +"gather` در پایتون است." #: src/concurrency/async-control-flow/join.md #, fuzzy @@ -21307,62 +19552,55 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but " -"you must know how many futures you will have at compile time. This is " -"currently in the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but you must know how " +"many futures you will have at compile time. This is currently in the `futures` crate, soon to " +"be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " -"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " -"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " -"می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، اما باید " +"بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در جعبه (crate از نوع " +"`futures` است که به زودی در `std::future` تثبیت می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would " -"cause your program to stall." +"The risk of `join` is that one of the futures may never resolve, this would cause your program " +"to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " -"باعث می‌شود برنامه شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث می‌شود برنامه " +"شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all " -"requests to an http service as well as a database query. Try adding a " -"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " -"timeout (that requires `select!`, explained in the next chapter), but " -"demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all requests to an http " +"service as well as a database query. Try adding a `tokio::time::sleep` to the future, using " +"`futures::join!`. This is not a timeout (that requires `select!`, explained in the next " +"chapter), but demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " -"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " -"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " -"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " -"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن (`join!`) همه " +"درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید `tokio::time::sleep` را با " +"استفاده از `futures::join!` به future اضافه کنید. این یک timeout نیست (که به `select!`نیاز " +"دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and " -"responds to that future's result. In JavaScript, this is similar to `Promise." -"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." -"FIRST_COMPLETED)`." +"A select operation waits until any of a set of futures is ready, and responds to that future's " +"result. In JavaScript, this is similar to `Promise.race`. In Python, it compares to `asyncio." +"wait(task_set, return_when=asyncio.FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " -"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " -"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." -"FIRST_COMPLETED)` قابل مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به نتیجه آن future " +"پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و در پایتون با `asyncio." +"wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, " -"each of the form `pattern = future => statement`. When a `future` is ready, " -"its return value is destructured by the `pattern`. The `statement` is then " -"run with the resulting variables. The `statement` result becomes the result " -"of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, each of the form " +"`pattern = future => statement`. When a `future` is ready, its return value is destructured by " +"the `pattern`. The `statement` is then run with the resulting variables. The `statement` " +"result becomes the result of the `select!` macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " -"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " -"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " -"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " -"`select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که هر کدام به " +"شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` آماده است، مقدار بازگشتی " +"آن توسط `pattern` تخریب می‌شود. سپس `statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه " +"`statement` نتیجه‌ي ماکرو `select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -21384,29 +19622,26 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, " -"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " -"does the `send` also fail in this situation?" +"The `listener` async block here is a common form: wait for some async event, or for a timeout. " +"Change the `sleep` to sleep longer to see it fail. Why does the `send` also fail in this " +"situation?" msgstr "" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a " -"task reacts to events in a loop. That has some pitfalls, which will be " -"discussed in the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a task reacts to " +"events in a loop. That has some pitfalls, which will be discussed in the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" -"Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes " -"with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter." +"Async / await provides convenient and efficient abstraction for concurrent asynchronous " +"programming. However, the async/await model in Rust also comes with its share of pitfalls and " +"footguns. We illustrate some of them in this chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " -"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " -"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " -"می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous فراهم می‌کند. " +"با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و pitfallها و footgunها همراه است. " +"برخی از آنها را در این فصل توضیح می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -21418,15 +19653,13 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that " -"CPU blocking tasks will block the executor and prevent other tasks from " -"being executed. An easy workaround is to use async equivalent methods where " -"possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that CPU blocking " +"tasks will block the executor and prevent other tasks from being executed. An easy workaround " +"is to use async equivalent methods where possible." msgstr "" -"اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " -"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " -"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " -"است که در صورت امکان از متدهای معادل async استفاده کنید." +"اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان (concurrent) اجرا شوند. " +"این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن executor و جلوگیری از اجرای سایر " +"تسک‌ها می‌شود. یک راه حل آسان این است که در صورت امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -21439,94 +19672,80 @@ msgid "\"current_thread\"" msgstr "\"current_thread\"" #: src/concurrency/async-pitfalls/blocking-executor.md -msgid "" -"Run the code and see that the sleeps happen consecutively rather than " -"concurrently." +msgid "Run the code and see that the sleeps happen consecutively rather than concurrently." msgstr "" -"کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت " -"همزمان (concurrent)." +"کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت همزمان " +"(concurrent)." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This " -"makes the effect more obvious, but the bug is still present in the multi-" -"threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the effect more " +"obvious, but the bug is still present in the multi-threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " -"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " -"دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را آشکارتر " +"می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." #: src/concurrency/async-pitfalls/blocking-executor.md -msgid "" -"Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." -msgstr "" -"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " -"باشید." +msgid "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." +msgstr "‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " -"thread and transforms its handle into a future without blocking the executor." +"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual thread and " +"transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " -"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و handle آن را " +"بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"You should not think of tasks as OS threads. They do not map 1 to 1 and most " -"executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, " -"where that library might depend on thread-local storage or map to specific " -"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " -"situations." +"You should not think of tasks as OS threads. They do not map 1 to 1 and most executors will " +"allow many tasks to run on a single OS thread. This is particularly problematic when " +"interacting with other libraries via FFI, where that library might depend on thread-local " +"storage or map to specific OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in " +"such situations." msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " -"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " -"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " -"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " -"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " -"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ به ۱ پشتیبانی " +"نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک thread سیستم عامل اجرا شوند. " +"این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه " +"ممکن است به ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی " +"داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause " -"another task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause another task to block, " +"and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." -"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " -"thread در حال اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` ممکن است باعث " +"مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The type returned is " +"the result of a compiler transformation which turns local variables into data stored inside " +"the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " -"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " -"ذخیره شده در future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. نوع برگشتی " +"نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because of that, the " +"future should never be moved to a different memory location, as it would invalidate those " +"pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " -"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " -"این pointerها را باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به همین دلیل، " +"future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"To prevent moving the future type in memory, it can only be polled through a " -"pinned pointer. `Pin` is a wrapper around a reference that disallows all " -"operations that would move the instance it points to into a different memory " -"location." +"To prevent moving the future type in memory, it can only be polled through a pinned pointer. " +"`Pin` is a wrapper around a reference that disallows all operations that would move the " +"instance it points to into a different memory location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " -"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " -"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " -"متفاوت منتقل کند را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می توان آن را " +"بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی را که می‌تواند نمونه‌ای را " +"که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -21579,154 +19798,136 @@ msgstr "\"Welcome to chat! Type a message\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically " -"call `select!` in a loop." +"You may recognize this as an example of the actor pattern. Actors typically call `select!` in " +"a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " -"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. بازیگران " +"معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md -msgid "" -"This serves as a summation of a few of the previous lessons, so take your " -"time with it." -msgstr "" -"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " -"آن کنید." +msgid "This serves as a summation of a few of the previous lessons, so take your time with it." +msgstr "این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " -"the `select!`. This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the `select!`. " +"This will never execute. Why?" msgstr "" -"به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " -"`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" +"به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به `select!` اضافه " +"کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "" -"Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" -"This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::" -"pin`:" +"This still doesn't work. Follow the compiler errors, adding `&mut` to the `timeout_fut` in the " +"`select!` to work around the move, then using `Box::pin`:" msgstr "" -"این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " -"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" -"pin` استفاده کنید:" +"این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به `timeout_fut` در " +"`select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" -"This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires:" +"This compiles, but once the timeout expires it is `Poll::Ready` on every iteration (a fused " +"future would help with this). Update to reset `timeout_fut` every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " -"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " -"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::Ready` است " +"(future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی `timeout_fut` هر بار که منقضی " +"می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" -"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, " -"but that is difficult to use for a future that is reassigned." +"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently stabilized, with " +"older code often using `tokio::pin!`) is also an option, but that is difficult to use for a " +"future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " -"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " -"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " -"دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت شده است، با " +"کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه است، اما استفاده از آن " +"برای futureای که دوباره تخصیص داده می‌شود دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that " -"will send to a `oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that will send to a " +"`oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " -"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد کنید که هر " +"100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, " -"the Rust borrow checker would prevent self-referential data from being " -"moved, as the references cannot outlive the data they point to. However, the " -"code transformation for async blocks and functions is not verified by the " -"borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, the Rust borrow " +"checker would prevent self-referential data from being moved, as the references cannot outlive " +"the data they point to. However, the code transformation for async blocks and functions is not " +"verified by the borrow checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " -"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " -"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " -"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " -"borrow checker تأیید نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده می شوند. به " +"طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری می‌کند، زیرا منابع " +"نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای " +"بلوک‌ها و توابع async توسط borrow checker تأیید نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its " -"place using a pinned pointer. However, it can still be moved through an " -"unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its place using a pinned " +"pointer. However, it can still be moved through an unpinned pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " -"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " -"از طریق یک pointer بدون پین جابجا کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از یک pointer پین " +"شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق یک pointer بدون پین جابجا " +"کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " -"`&mut Self` to refer to the instance. That's why it can only be called on a " -"pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut Self` to refer " +"to the instance. That's why it can only be called on a pinned pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " -"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " -"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به نمونه " +"(instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک اشاره‌‌گر پین شده فراخوانی " +"کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 " -"release. This required support for using return-position `impl Trait` (RPIT) " -"in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 release. This required " +"support for using return-position `impl Trait` (RPIT) in traits, as the desugaring for `async " +"fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " -"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " -"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " -"Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی برای استفاده " +"از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا شیرین‌زدایی (desugaring) برای " +"`async fn` شامل `-> impl Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +"However, even with the native support today there are some pitfalls around `async fn` and RPIT " +"in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " -"RPIT در ویژگی‌ها وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT در ویژگی‌ها " +"وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns of borrowing " +"cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " -"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین برخی از الگوهای " +"قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +"Traits whose methods use return-position `impl trait` or `async` are not `dyn` compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " -"می‌کنند با `dyn` سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند با `dyn` " +"سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) provides a workaround through a macro, with some " -"caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/latest/" +"async_trait/) provides a workaround through a macro, with some caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " -"چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/latest/" +"async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -21740,46 +19941,42 @@ msgstr "\"slept for {}ms\"" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"`async_trait` is easy to use, but note that it's using heap allocations to " -"achieve this. This heap allocation has performance overhead." +"`async_trait` is easy to use, but note that it's using heap allocations to achieve this. This " +"heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " -"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " -"عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف از heap " +"allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"The challenges in language support for `async trait` are deep Rust and probably not worth " +"describing in-depth. Niko Matsakis did a good job of explaining them in [this post](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) if you are " +"interested in digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " -"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" -"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " -"هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش توصیف عمیق در " +"اینجا را ندارند. Niko Matsakis در [این پست](https://smallcultfollowing.com/babysteps/" +"blog/2019/10/26/async-fn-in-traits-are-hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما " +"به این موضوع علاقه‌مند هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of time and adding it to " +"the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " -"را به Vec اضافه کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به Vec اضافه " +"کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to " -"ensure the system works correctly even when futures are cancelled. For " -"example, it shouldn't deadlock or lose data." +"Dropping a future implies it can never be polled again. This is called _cancellation_ and it " +"can occur at any `await` point. Care is needed to ensure the system works correctly even when " +"futures are cancelled. For example, it shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " -"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " -"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " -"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این حالت " +"_cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از عملکرد صحیح سیستم " +"حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به " +"بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -21798,35 +19995,27 @@ msgstr "\"tick!\"" #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"The compiler doesn't help with cancellation-safety. You need to read API " -"documentation and consider what state your `async fn` holds." +"The compiler doesn't help with cancellation-safety. You need to read API documentation and " +"consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " -"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و در نظر بگیرید " +"که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md -msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " -"error-handling)." +msgid "Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " -"به خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "اسن مثال بخش‌هایی از string را از دست می‌دهد." #: src/concurrency/async-pitfalls/cancellation.md -msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " -"dropped." -msgstr "" -"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +msgid "Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." +msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md -msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the " -"struct:" +msgid "`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -21836,33 +20025,29 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a " -"tick has been 'delivered'." +"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) " +"is cancellation-safe because it keeps track of whether a tick has been 'delivered'." msgstr "" -"‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " -"tick تحویل داده شده است." +"‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) " +"برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) is cancellation-safe because it either " -"returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method." +"read) is cancellation-safe because it either returns or doesn't read data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " -"برمی‌گرداند یا نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method." +"read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " -"cancellation-safe. See its documentation for details and alternatives." +"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt." +"html#method.read_line) is similar to the example and _isn't_ cancellation-safe. See its " +"documentation for details and alternatives." msgstr "" -"‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" -"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." +"‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt." +"html#method.read_line) مشابه مثال است و شبیه cancellation-safe نیست. برای جزئیات و موارد " +"جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -21872,21 +20057,20 @@ msgstr "فلسفه Dining --- Async" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " -"description of the problem." +"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a description of the " +"problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" -"philosophers.md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers.md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-" -"locally.md) for this exercise. Copy the code below to a file called `src/" -"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-locally.md) for this " +"exercise. Copy the code below to a file called `src/main.rs`, fill out the blanks, and test " +"that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." -"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " -"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) نیاز دارید. " +"کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر کنید و تست کنید که `cargo " +"run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -21902,11 +20086,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. " -"You can use the following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. You can use the " +"following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " -"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. می‌توانید از " +"`Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -21917,8 +20101,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-" +"thread\"] }\n" "```" msgstr "" "```toml\n" @@ -21928,17 +20112,17 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-" +"thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module " -"from the `tokio` crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module from the `tokio` " +"crate." msgstr "" -"همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " -"crate استفاده کنید." +"همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` crate استفاده " +"کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" @@ -21946,28 +20130,25 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast " -"chat application. We have a chat server that the clients connect to and " -"publish their messages. The client reads user messages from the standard " -"input, and sends them to the server. The chat server broadcasts each message " -"that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast chat application. " +"We have a chat server that the clients connect to and publish their messages. The client reads " +"user messages from the standard input, and sends them to the server. The chat server " +"broadcasts each message that it receives to all the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " -"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " -"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " -"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " -"دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast chat استفاده " +"کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت " +"پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را " +"که دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/) for the communication between the client " -"and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn." +"channel.html) on the server, and [`tokio_websockets`](https://docs.rs/tokio-websockets/) for " +"the communication between the client and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" -"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn." +"channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/tokio-websockets/) برای " +"ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -21990,8 +20171,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", \"server\", " +"\"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22004,8 +20185,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", \"server\", " +"\"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22014,50 +20195,46 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" -"You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " -"to familiarize yourself with the API." +"You are going to need the following functions from `tokio` and [`tokio_websockets`](https://" +"docs.rs/tokio-websockets/). Spend a few minutes to familiarize yourself with the API." msgstr "" -"شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" -"websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." +"شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-websockets/) نیاز " +"دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " -"asynchronously reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt." +"html#method.next) implemented by `WebSocketStream`: for asynchronously reading messages from a " +"Websocket Stream." msgstr "" -"‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " -"ناهمزمان پیام‌ها از یک جریان وب سوکت." +"‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt." +"html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " -"asynchronously sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt." +"html#method.send) implemented by `WebSocketStream`: for asynchronously sending messages on a " +"Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " -"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt." +"html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال ناهمزمان پیام‌ها در یک " +"Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): for asynchronously reading user messages from the " -"standard input." +"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method." +"next_line): for asynchronously reading user messages from the standard input." msgstr "" -"‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " -"استاندارد." +"‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method." +"next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender." +"html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender." +"html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -22065,34 +20242,29 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main." -"rs` file. In this project, we need two binaries. One for the client, and one " -"for the server. You could potentially make them two separate Cargo projects, " -"but we are going to put them in a single Cargo project with two binaries. " -"For this to work, the client and the server code should go under `src/bin` " -"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" +"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` file. In this " +"project, we need two binaries. One for the client, and one for the server. You could " +"potentially make them two separate Cargo projects, but we are going to put them in a single " +"Cargo project with two binaries. For this to work, the client and the server code should go " +"under `src/bin` (see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" "targets.html#binaries))." msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " -"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " -"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " -"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " -"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " -"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." -"html#binaries) مراجعه کنید )." +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/main.rs` داشته " +"باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و دیگری برای سرور. شما به طور " +"بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo " +"واحد با دو باینری قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " +"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) " +"مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/" -"bin/client.rs`, respectively. Your task is to complete these files as " -"described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/bin/client.rs`, " +"respectively. Your task is to complete these files as described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " -"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " -"شده است تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی کنید. وظیفه " +"شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است تکمیل کنید." -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "_src/bin/server.rs_:" @@ -22101,36 +20273,30 @@ msgstr "_src/bin/server.rs_:" msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "// TODO: For a hint, see the description of the task below.\n" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "\"127.0.0.1:2000\"" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"listening on port 2000\"" msgstr "\"listening on port 2000\"" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"New connection from {addr:?}\"" msgstr "\"New connection from {addr:?}\"" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "// Wrap the raw TCP stream into a websocket.\n" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "_src/bin/client.rs_:" -#: src/concurrency/async-exercises/chat-app.md -#: src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"ws://127.0.0.1:2000\"" msgstr "\"ws://127.0.0.1:2000\"" @@ -22153,14 +20319,13 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a " -"continuous loop. One task receives messages from the client and broadcasts " -"them. The other sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous loop. One " +"task receives messages from the client and broadcasts them. The other sends messages received " +"by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " -"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " -"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " -"می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده کنید. یک task " +"پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده " +"توسط سرور را برای کاربر ارسال می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -22168,22 +20333,21 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and " -"sending them to the server, and (2) receiving messages from the server, and " -"displaying them for the user." +"Hint: As before, use `tokio::select!` in a continuous loop for concurrently performing two " +"tasks: (1) reading user messages from standard input and sending them to the server, and (2) " +"receiving messages from the server, and displaying them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " -"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " -"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task استفاده کنید: " +"(۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و (۲) دریافت پیام از سرور و " +"نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Optional: Once you are done, change the code to broadcast messages to all " -"clients, but the sender of the message." +"Optional: Once you are done, change the code to broadcast messages to all clients, but the " +"sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " -"جز فرستنده پیام، منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز فرستنده پیام، " +"منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -22251,33 +20415,28 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " -"برده باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده باشید و برای‌ شما " +"مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not " -"perfect, so if you spotted any mistakes or have ideas for improvements, " -"please get in [contact with us on GitHub](https://github.com/google/" -"comprehensive-rust/discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not perfect, so if you " +"spotted any mistakes or have ideas for improvements, please get in [contact with us on GitHub]" +"(https://github.com/google/comprehensive-rust/discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " -"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " -"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " -"شوید. ما دوست داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی را مشاهده " +"کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید](https://github.com/" +"google/comprehensive-rust/discussions) وارد شوید. ما دوست داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many " -"Rust terms. For translations, this also serves to connect the term back to " -"the English original." +"The following is a glossary which aims to give a short definition of many Rust terms. For " +"translations, this also serves to connect the term back to the English original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " -"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " -"انگلیسی است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان Rust است. " +"برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -22299,19 +20458,18 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the " -"relationship between types." +"A type associated with a specific trait. Useful for defining the relationship between types." msgstr "" #: src/glossary.md msgid "" "Bare-metal Rust: \n" -"Low-level Rust development, often deployed to a system without an operating " -"system. See [Bare-metal Rust](bare-metal.md)." +"Low-level Rust development, often deployed to a system without an operating system. See [Bare-" +"metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " -"[Bare-metal Rust](bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-metal Rust]" +"(bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -22350,8 +20508,7 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable " -"program." +"The process of converting source code into executable code or a usable program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -22370,8 +20527,7 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " -"می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." #: src/glossary.md msgid "" @@ -22393,8 +20549,7 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "" -"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -22407,8 +20562,7 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in " -"a program." +"The order in which the individual statements or instructions are executed in a program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -22424,12 +20578,12 @@ msgstr "" #: src/glossary.md msgid "" "enumeration: \n" -"A data type that holds one of several named constants, possibly with an " -"associated tuple or struct." +"A data type that holds one of several named constants, possibly with an associated tuple or " +"struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " -"ساختار مرتبط، نگه می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار مرتبط، نگه " +"می‌دارد." #: src/glossary.md msgid "" @@ -22442,8 +20596,7 @@ msgstr "" #: src/glossary.md msgid "" "error handling: \n" -"The process of managing and responding to errors that occur during program " -"execution." +"The process of managing and responding to errors that occur during program execution." msgstr "" "error handling: \n" "فرآیند مدیریت و پاسخگویی به خطاهایی که در حین اجرای برنامه رخ می‌دهد." @@ -22467,22 +20620,20 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are " -"no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are no longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " -"نمی‌شوند را آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling " -"code reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling code reuse with " +"different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " -"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده مجدد از کد با " +"انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -22495,8 +20646,8 @@ msgstr "" #: src/glossary.md msgid "" "integration test: \n" -"A type of test that verifies the interactions between different parts or " -"components of a system." +"A type of test that verifies the interactions between different parts or components of a " +"system." msgstr "" "integration test: \n" "نوعی تست که تعامل بین بخش‌ها یا اجزای مختلف یک سیستم را تأیید می‌کند." @@ -22504,12 +20655,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and " -"cannot be used as an identifier." +"A reserved word in a programming language that has a specific meaning and cannot be used as an " +"identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " -"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به عنوان شناسه یا " +"سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -22517,20 +20668,19 @@ msgid "" "A collection of precompiled routines or code that can be used by programs." msgstr "" "library: \n" -"مجموعه‌ای از routine‌ها یا کدهای از پیش کامپایل شده که می تواند توسط برنامه‌ها " -"استفاده شود." +"مجموعه‌ای از routine‌ها یا کدهای از پیش کامپایل شده که می تواند توسط برنامه‌ها استفاده شود." #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when " -"normal functions are not enough. A typical example is `format!`, which takes " -"a variable number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when normal functions are " +"not enough. A typical example is `format!`, which takes a variable number of arguments, which " +"isn't supported by Rust functions." msgstr "" "macro: \n" -"ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " -"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " -"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." +"ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده می‌شوند که توابع " +"عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از آرگومان‌ها را می‌گیرد که توسط " +"توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -22544,22 +20694,21 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the " -"value of an expression." +"A control flow construct in Rust that allows for pattern matching on the value of an " +"expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " -"فراهم می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer " -"needed, leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer needed, leading to a " +"gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " -"منجر به افزایش تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر به افزایش " +"تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -22572,12 +20721,11 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, " -"to organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, to organize code " +"in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " -"Rust است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust است." #: src/glossary.md msgid "" @@ -22590,8 +20738,7 @@ msgstr "" #: src/glossary.md msgid "" "mutable: \n" -"A property in Rust that allows variables to be modified after they have been " -"declared." +"A property in Rust that allows variables to be modified after they have been declared." msgstr "" "mutable: \n" "یک ویژگی در Rust که به متغیرها اجازه می‌دهد پس از اعلان، اصلاح شوند." @@ -22599,18 +20746,16 @@ msgstr "" #: src/glossary.md msgid "" "ownership: \n" -"The concept in Rust that defines which part of the code is responsible for " -"managing the memory associated with a value." +"The concept in Rust that defines which part of the code is responsible for managing the memory " +"associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " -"مقدار است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of " -"the program." +"An unrecoverable error condition in Rust that results in the termination of the program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -22626,12 +20771,11 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against " -"an expression in Rust." +"A combination of values, literals, or structures that can be matched against an expression in " +"Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " -"مطابقت داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت داده شوند." #: src/glossary.md msgid "" @@ -22644,40 +20788,39 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task " -"or solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task or solve a " +"particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاصی اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک مشکل خاصی " +"اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاص اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک مشکل خاص اجرا " +"کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which " -"the method is called." +"The first parameter in a Rust method that represents the instance on which the method is " +"called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " -"می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object " -"is tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object is tracked, and " +"the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " -"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که شمارش به صفر " +"می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -22685,14 +20828,12 @@ msgid "" "A keyword in Rust used to indicate the value to be returned from a function." msgstr "" "return: \n" -"یک کلمه کلیدی در Rust برای نشان دادن مقداری که باید از یک تابع برگردانده شود " -"استفاده می‌شود." +"یک کلمه کلیدی در Rust برای نشان دادن مقداری که باید از یک تابع برگردانده شود استفاده می‌شود." #: src/glossary.md msgid "" "Rust: \n" -"A systems programming language that focuses on safety, performance, and " -"concurrency." +"A systems programming language that focuses on safety, performance, and concurrency." msgstr "" "Rust: \n" "یک زبان برنامه‌نویسی سیستمی که بر safety، کارایی و concurrency تمرکز دارد." @@ -22726,12 +20867,12 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, " -"preventing memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, preventing memory-related " +"errors." msgstr "" "safe: \n" -"به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " -"(borrowing) پایبند است و از خطاهای مربوط به حافظه جلوگیری می‌کند." +"به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن (borrowing) پایبند " +"است و از خطاهای مربوط به حافظه جلوگیری می‌کند." #: src/glossary.md msgid "" @@ -22752,38 +20893,33 @@ msgstr "" #: src/glossary.md msgid "" "static: \n" -"A keyword in Rust used to define static variables or items with a `'static` " -"lifetime." +"A keyword in Rust used to define static variables or items with a `'static` lifetime." msgstr "" "static: \n" -"یک کلمه کلیدی در Rust برای تعریف متغیرهای ثابت یا موارد با طول عمر `'static` " -"استفاده می‌شود." +"یک کلمه کلیدی در Rust برای تعریف متغیرهای ثابت یا موارد با طول عمر `'static` استفاده می‌شود." #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for " -"more." +"A data type storing textual data. See [Strings](references/strings.html) for more." msgstr "" "string: \n" -"نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" -"(references/strings.html) مراجعه کنید." +"نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings](references/strings." +"html) مراجعه کنید." #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different " -"types under a single name." +"A composite data type in Rust that groups together variables of different types under a single " +"name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " -"می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other " -"functions." +"A Rust module containing functions that test the correctness of other functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -22799,8 +20935,7 @@ msgstr "" #: src/glossary.md msgid "" "thread safety: \n" -"The property of a program that ensures correct behavior in a multithreaded " -"environment." +"The property of a program that ensures correct behavior in a multithreaded environment." msgstr "" "thread safety: \n" "ویژگی برنامه‌ای که رفتار صحیح را در یک محیط multithread تضمین می‌کند." @@ -22808,49 +20943,46 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to " -"achieve polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to achieve polymorphism " +"in Rust." msgstr "" "trait: \n" -"مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " -"polymorphism در Rust ارائه می‌دهد." +"مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به polymorphism در Rust " +"ارائه می‌دهد." #: src/glossary.md #, fuzzy msgid "" "trait bound: \n" -"An abstraction where you can require types to implement some traits of your " -"interest." +"An abstraction where you can require types to implement some traits of your interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " -"علاقه‌تان به typeها نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان به typeها " +"نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple " -"fields have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple fields have no names, " +"and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " -"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام هستند و با شماره " +"ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values " -"of a particular kind in Rust." +"A classification that specifies which operations can be performed on values of a particular " +"kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " -"در Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or " -"expression." +"The ability of the Rust compiler to deduce the type of a variable or expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -22858,12 +20990,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading " -"to unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading to unpredictable " +"program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " -"غیرقابل پیش‌بینی برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل پیش‌بینی " +"برنامه می‌شوند." #: src/glossary.md msgid "" @@ -22871,18 +21003,17 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " -"یکی در یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در یک زمان خاص." #: src/glossary.md msgid "" "unit test: \n" -"Rust comes with built-in support for running small unit tests and larger " -"integration tests. See [Unit Tests](testing/unit-tests.html)." +"Rust comes with built-in support for running small unit tests and larger integration tests. " +"See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " -"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر ارائه می‌شود. " +"[Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -22890,18 +21021,17 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " -"شده است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe Rust](unsafe-" +"rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " -"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. [Unsafe Rust] " +"(unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -22916,11 +21046,8 @@ msgid "Other Rust Resources" msgstr "سایر منابع برای Rust" #: src/other-resources.md -msgid "" -"The Rust community has created a wealth of high-quality and free resources " -"online." -msgstr "" -"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +msgid "The Rust community has created a wealth of high-quality and free resources online." +msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -22928,47 +21055,41 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" -msgstr "" -"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " -"می‌دهند:" +msgstr "پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " -"canonical free book about Rust. Covers the language in detail and includes a " -"few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical free book " +"about Rust. Covers the language in detail and includes a few projects for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " -"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " -"پروژه برای ساخت نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف در مورد Rust " +"که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " -"Rust syntax via a series of examples which showcase different constructs. " -"Sometimes includes small exercises where you are asked to expand on the code " -"in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust syntax via a " +"series of examples which showcase different constructs. Sometimes includes small exercises " +"where you are asked to expand on the code in the examples." msgstr "" -"‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " -"syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " -"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " -"در مثال‌ها گسترش دهید." +"‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust syntax را به کمک " +"یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش می‌گذارد. گاهی اوقات شامل تمرین‌های " +"کوچکی می‌شود که از شما خواسته می‌شود کد را در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " -"of the standard library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of the standard " +"library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " -"کتابخانه استاندارد برای Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه استاندارد برای " +"Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " -"book which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book which describes " +"the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " -"گرامر و مدل حافظه Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر و مدل حافظه " +"Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -22976,33 +21097,27 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" -"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages " -"(FFI)." +"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, including working " +"with raw pointers and interfacing with other languages (FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " -"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " -"(FFI) را تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش می‌دهد، از " +"جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را تشریح می‌کند." #: src/other-resources.md msgid "" -"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the " -"Rust Book was written." +"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): covers the new " +"asynchronous programming model which was introduced after the Rust Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " -"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " -"پس از نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل برنامه‌نویسی " +"ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"an introduction to using Rust on embedded devices without an operating " -"system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an introduction to " +"using Rust on embedded devices without an operating system." msgstr "" -"‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " -"شامل می‌شود." +"‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): مقدمه‌ای بر استفاده " +"از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -23014,115 +21129,103 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " -"from the perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from the " +"perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " -"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را از دیدگاه " +"برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): covers Rust from the perspective of developers who " -"write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): covers " +"Rust from the perspective of developers who write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " -"زبان C می‌نویسند پوشش می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): که " +"Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): " -"covers the syntax of Rust using side-by-side comparisons with other " -"languages such as C, C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers the syntax of " +"Rust using side-by-side comparisons with other languages such as C, C++, Java, JavaScript, and " +"Python." msgstr "" -"‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " -"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " -"C++، Java، JavaScript و Python پوشش می‌دهد." +"‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که syntax مورد " +"استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، Java، JavaScript و " +"Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " -"you learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " -"کمک به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک به یادگیری " +"Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): a series of small presentations covering both basic " -"and advanced part of the Rust language. Other topics such as WebAssembly, " -"and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): a " +"series of small presentations covering both basic and advanced part of the Rust language. " +"Other topics such as WebAssembly, and async/await are also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " -"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " -"پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): " +"مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را پوشش می‌دهد. موضوعات دیگری " +"مانند WebAssembly و async/wait نیز پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" -"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" -"testing/): a self-paced workshop that goes beyond Rust's built-in testing " -"framework. It covers `googletest`, snapshot testing, mocking as well as how " -"to write your own custom test harness." +"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-testing/): a self-" +"paced workshop that goes beyond Rust's built-in testing framework. It covers `googletest`, " +"snapshot testing, mocking as well as how to write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" -"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " -"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " -"تست‌های سفارشی خود را پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-testing-" +"workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این `googletest`، تست " +"snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs." -"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " -"new developers. The first is a set of 35 videos and the second is a set of " -"11 modules which covers Rust syntax and basic constructs." +"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) " +"and [Take your first steps with Rust](https://docs.microsoft.com/en-us/learn/paths/rust-first-" +"steps/): two Rust guides aimed at new developers. The first is a set of 35 videos and the " +"second is a set of 11 modules which covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" -"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" -"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " -"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " -"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) " +"و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. com/en-us/learn/paths/rust-" +"first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و " +"دومی مجموعه‌ای از ۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." -"github.io/too-many-lists/): in-depth exploration of Rust's memory management " -"rules, through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github.io/too-many-" +"lists/): in-depth exploration of Rust's memory management rules, through implementing a few " +"different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." -"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " -"نوع مختلف list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/too-many-" +"lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " -"for even more Rust books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for even more Rust " +"books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " -"کتاب‌های بیشتر در مورد Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های بیشتر در مورد " +"Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust " -"documentation. See the page on [other resources](other-resources.md) for a " -"full list of useful resources." +"The material here builds on top of the many great sources of Rust documentation. See the page " +"on [other resources](other-resources.md) for a full list of useful resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " -"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست کامل منابع " +"مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache " -"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" -"rust/blob/main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 license, " +"please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/main/LICENSE) for " +"details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " -"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" -"LICENSE) مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر به ['LICENSE']" +"(https://github.com/google/comprehensive-rust/blob/main/LICENSE) مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -23130,14 +21233,13 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by " -"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " -"`third_party/rust-by-example/` directory for details, including the license " -"terms." +"Some examples and exercises have been copied and adapted from [Rust by Example](https://doc." +"rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-example/` directory for " +"details, including the license terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" -"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " -"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-example/) کپی " +"و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-by-" +"example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -23145,13 +21247,12 @@ msgstr "‏ Rust در تمرین‌ها" #: src/credits.md msgid "" -"Some exercises have been copied and adapted from [Rust on Exercism](https://" -"exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " -"directory for details, including the license terms." +"Some exercises have been copied and adapted from [Rust on Exercism](https://exercism.org/" +"tracks/rust). Please see the `third_party/rust-on-exercism/` directory for details, including " +"the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " -"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " -"`third_party/rust-on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس شده‌اند. لطفاً " +"برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -23159,13 +21260,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section " -"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " -"directory for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section uses an image from " +"[CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory for details, including the " +"license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " -"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " -"license، دایرکتوری `third_party/cxx/` را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از [CXX](https://" +"cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، دایرکتوری `third_party/cxx/` " +"را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -23174,31 +21275,25 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` " -#~ "keyword makes them capture by value." +#~ "By default, closures will capture by reference if they can. The `move` keyword makes them " +#~ "capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " -#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " -#~ "value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. کلمه کلیدی " +#~ "`move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/build/bazel/" +#~ "introduction), [ChromeOS](https://chromium.googlesource.com/chromiumos/bazel/), and " +#~ "[Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" -#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." -#~ "com/docs/setup/build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/bazel/" +#~ "introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/bazel/) وجود دارد و " +#~ "انتقال [Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) به Bazel." -#~ msgid "" -#~ "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "" -#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "" -#~ "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -23222,46 +21317,38 @@ msgstr "" #~ msgstr "\"Winner is {winner:?}\"" #~ msgid "" -#~ "In this example, we have a race between a cat and a dog. " -#~ "`first_animal_to_finish_race` listens to both channels and will pick " -#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " -#~ "cat that take 500ms." +#~ "In this example, we have a race between a cat and a dog. `first_animal_to_finish_race` " +#~ "listens to both channels and will pick whichever arrives first. Since the dog takes 50ms, " +#~ "it wins against the cat that take 500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " -#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." -#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " -#~ "می‌کشد تا پیروز شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر دو channelها " +#~ "گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، " +#~ "در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are " -#~ "supposed to receive only one `send`." +#~ "You can use `oneshot` channels in this example as the channels are supposed to receive only " +#~ "one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " -#~ "کانال‌ها فقط یک `send` را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها فقط یک `send` " +#~ "را دریافت کنند." -#~ msgid "" -#~ "Try adding a deadline to the race, demonstrating selecting different " -#~ "sorts of futures." -#~ msgstr "" -#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " -#~ "نشان دهید." +#~ msgid "Try adding a deadline to the race, demonstrating selecting different sorts of futures." +#~ msgstr "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their " -#~ "futures. It is easiest to use when every execution of `select!` creates " -#~ "new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their futures. It is easiest to " +#~ "use when every execution of `select!` creates new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " -#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " -#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future آنها را لغو " +#~ "می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد می‌کند، راحت‌ترین استفاده از " +#~ "آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but " -#~ "this can lead to issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but this can lead to " +#~ "issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " -#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " -#~ "(pinning slide) شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما این کار " +#~ "می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -23297,8 +21384,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات " +#~ "بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -23311,12 +21398,8 @@ msgstr "" #~ msgid "Blocks are delimited by curly braces." #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." -#~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/" -#~ "* ... */`." -#~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " -#~ "مشخص می‌شوند." +#~ msgid "Line comments are started with `//`, block comments are delimited by `/* ... */`." +#~ msgstr "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -23324,28 +21407,25 @@ msgstr "" #~ msgid "Variable assignment is done with `=`, comparison is done with `==`." #~ msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." -#~ msgid "" -#~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "" -#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgid "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; " -#~ "3]" +#~ "[20, 30, 40], [0; 3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), " -#~ "(T1, T2), …" +#~ "(), (T,), (T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" -#~ "(), ('x',), " -#~ "('x', 1.2), …" +#~ "(), ('x',), ('x', 1.2), …" #~ msgid "Array assignment and access:" #~ msgstr "انتساب و دسترسی به آرایه:" @@ -23361,31 +21441,26 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " -#~ "type, and the only valid value of that type --- that is to say both the " -#~ "type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, and the only " +#~ "valid value of that type --- that is to say both the type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " -#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " -#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " -#~ "که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. این هم یک نوع " +#~ "است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد " +#~ "استفاده می‌شود، همانطور که در اسلاید بعدی خواهیم دید. " #, fuzzy #~ msgid "" -#~ "You can think of it as `void` that can be familiar to you from other " -#~ "programming languages." +#~ "You can think of it as `void` that can be familiar to you from other programming languages." #~ msgstr "" -#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " -#~ "برنامه‌نویسی برایتان آشنا باشد." +#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های برنامه‌نویسی " +#~ "برایتان آشنا باشد." #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" -#~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " -#~ "کنید." +#~ msgstr "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -23394,31 +21469,24 @@ msgstr "" #~ msgid "Add more values to the array." #~ msgstr "مقادیر بیشتری را به آرایه اضافه کنید." -#~ msgid "" -#~ "Point out that how `..` will expand to account for different number of " -#~ "elements." -#~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " -#~ "یافت." +#~ msgid "Point out that how `..` will expand to account for different number of elements." +#~ msgstr "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." -#~ msgid "" -#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" -#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " -#~ "`[a@..,b]` را نشان دهید." +#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و `[a@..,b]` را نشان دهید." #~ msgid "Hard-code both functions to operate on 3 × 3 matrices." #~ msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-" -#~ "scoped values that cannot be moved or reallocated during the execution of " -#~ "the program." +#~ "Static and constant variables are two different ways to create globally-scoped values that " +#~ "cannot be moved or reallocated during the execution of the program." #~ msgstr "" -#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " -#~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " -#~ "دوباره تعریف شوند." +#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال (قابل دسترس در کل " +#~ "برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا دوباره تعریف شوند." #~ msgid "Properties table:" #~ msgstr "جدول خاصیت‌ها:" @@ -23450,16 +21518,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات " +#~ "بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل " -#~ "تغییر به یک برش از رشته‌ است." +#~ "&str یک مرجع غیرقابل تغییر به یک برش از " +#~ "رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -23687,13 +21755,10 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "" -#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." -#~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the " -#~ "standard library." +#~ msgid "Day 2: Memory management, ownership, compound data types, and the standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -23726,30 +21791,24 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " -#~ "and `continue`." -#~ msgstr "" -#~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " -#~ "`continue`. " +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and `continue`." +#~ msgstr "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و `continue`. " #~ msgid "" -#~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a " -#~ "major feature and we should show students this right away." +#~ "The idea for the first day is to show _just enough_ of Rust to be able to 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 یک ویژگی مهم است و باید آن را بلافاصله به " -#~ "دانشجویان نشان دهیم." +#~ "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا بتوانیم در مورد " +#~ "بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه مدیریت حافظه توسط Rust یک ویژگی مهم " +#~ "است و باید آن را بلافاصله به دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over " -#~ "the schedule. We suggest splitting the day into two parts (following the " -#~ "slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over the schedule. We " +#~ "suggest splitting the day into two parts (following the slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس می دهیدما " +#~ "پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -23758,11 +21817,11 @@ msgstr "" #~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" #~ msgid "" -#~ "You can of course adjust this as necessary. Please make sure to include " -#~ "breaks, we recommend a break every hour!" +#~ "You can of course adjust this as necessary. Please make sure to include breaks, we " +#~ "recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را نیز درنظر " +#~ "بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -23801,56 +21860,50 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop will always end, " +#~ "but this is not yet proved. Edit the code and play with different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این است که حلقه " +#~ "همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و با ورودی‌های مختلف بازی " +#~ "کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to trigger type " +#~ "inference. Try with `i8` instead and trigger a runtime integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا استنتاج نوع " +#~ "را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها با قالب رشته " +#~ "(`format string`) ، خطای کامپایل می دهد." #~ 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." +#~ "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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد است، باید از " +#~ "‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "fmt` which has the rules of the formatting mini-language. It's important " -#~ "that the students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه `std::fmt` را که " +#~ "قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان با جستجو در کتابخانه " +#~ "استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::" -#~ "fmt documentation" +#~ "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` را توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات محلی ‍`std::fmt` را " +#~ "توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -23862,15 +21915,12 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" -#~ msgid "" -#~ "Despite just 29 lines of code, this C example contains serious bugs in at " -#~ "least 11:" +#~ msgid "Despite just 29 lines of code, this C example contains serious bugs in at least 11:" #~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " #~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" @@ -23888,9 +21938,7 @@ msgstr "" #~ msgid "Forgotten `break` in a `switch` statement (line 32)" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" -#~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" +#~ msgid "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -23907,46 +21955,42 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning " -#~ "level, even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش فرض کامپایل می " +#~ "شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security " -#~ "vulnerabilities in the past. Some examples:" +#~ "Absolutely not, these kind of bugs have lead to serious security vulnerabilities in the " +#~ "past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند نمونه:" #~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-" -#~ "backdoor-attempt-of-2003)" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor 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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of 2003](https://" +#~ "freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003)" #~ msgid "" -#~ "Forgotten braces in multi-line `if`: [The Apple goto fail vulnerability]" -#~ "(https://dwheeler.com/essays/apple-goto-fail.html)" +#~ "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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability](https://dwheeler.com/" +#~ "essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-" -#~ "the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke sudo](https://" +#~ "nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-break-that-broke-sudo) " +#~ "" #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -23968,127 +22012,111 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " -#~ "you can't accidentally forget a `break`." +#~ "`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 را " -#~ "فراموش کنید." +#~ "دستور`match` (به عنوان معادل Rust برای `switch`) فرو نمی‌پاشد (منظور fall-through پذیر بودن " +#~ "ان است) ، بنابراین نمی‌توانید به طور تصادفی یک break را فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding `Box` leaves the " +#~ "scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` مورد نظر اسکوپ " +#~ "مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get یک برش " +#~ "(`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped and 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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و در نتیجه برای " +#~ "موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی تابعی که با `#[must_use]` علامت گذاری شده است را فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "" -#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" +#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get " -#~ "runtime-initialized and runtime-sized static variables" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." +#~ "html#method.leak) برای نشت دادن یک اشاره‌گر استفاده کنید.یک مورد استفاده از این کار " +#~ "می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.html) to make the compiler \"forget\" about a value (meaning the " -#~ "destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget." +#~ "html) استفاده کنید تا کامپایلر «مقدار» را فراموش کند (به این معنا که تابع مخرب " +#~ "(`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-" -#~ "lang.org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory leak and Rust does " +#~ "not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر می‌گیرند و " +#~ "Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood as \"Pretty much " +#~ "no _accidental_ memory leaks\"." #~ msgstr "" -#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " -#~ "_تصادفی_» درنظر گرفته شود." +#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» درنظر گرفته " +#~ "شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "panics in debug mode (`cargo build`) and wrap-around in release mode " +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang.org/rustc/" +#~ "codegen-options/index.html#overflow-checks) compile-time flag. If enabled, the program will " +#~ "panic (a controlled crash of the program), otherwise you get wrap-around semantics. By " +#~ "default, you get 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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be disabled " +#~ "directly with the `unsafe` keyword. However, `unsafe` allows you to call functions such as " +#~ "`slice::get_unchecked` which does not do bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور مستقیم با " +#~ "کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان می‌دهد توابعی مانند " +#~ "`slice::get_unchecked` را صدا بزنید که بررسی محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." +#~ msgstr "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -24097,97 +22125,88 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, writing a loop using `for` should result in roughly the same low " -#~ "level instructions as using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for higher-level " +#~ "programming constructs with memory or CPU. For example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که شما مجبور نیستید " +#~ "برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU «هزینه»‌ای پرداخت کنید. به عنوان " +#~ "مثال، نوشتن یک حلقه با استفاده از for باید تقریباً به همان دستورالعمل‌های سطح پایین به عنوان " +#~ "استفاده از ساختار `iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also 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` را بیان کند." #~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to " -#~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ "Remind people to read the errors --- many developers have gotten used to ignore lengthy " +#~ "compiler output. The Rust compiler is significantly more talkative than other compilers. It " +#~ "will often provide you with _actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به نادیده گرفتن خروجی " +#~ "طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها " +#~ "است. اغلب بازخوردهای _عملیاتی_ را در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد " +#~ "شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, Python, and Go. Rust " +#~ "does not come with several things you might consider standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک است. زبان Rust " +#~ "با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/rand/) " +#~ "را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" -#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" -#~ "(https://docs.rs/rustls/) را ببینید." +#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`](https://docs.rs/" +#~ "rustls/) را ببینید." #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "Rust community is still working on finding the best solution --- and " -#~ "perhaps there isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library cannot go away, so " +#~ "it has to be very stable. For the examples above, the 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 هنوز در تلاش است تا بهترین راه حل را پیدا " +#~ "کند --- و شاید برای برخی از این موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "makes it trivial to download and compile third-party crates. A " -#~ "consequence of this is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this 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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این امر دانلود و " +#~ "کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی از پیامدهای این امر این است که " +#~ "کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help " +#~ "with this by letting you compare health metrics for crates to find a good and trusted one." #~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates به شما کمک می‌کنند تا یک مورد خوب و قابل " +#~ "اعتماد را پیدا کنید." #~ msgid "" -#~ "[rust-analyzer](https://rust-analyzer.github.io/) is a well supported LSP " -#~ "implementation used in major IDEs and text editors." +#~ "[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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است که در IDE‌ها و " +#~ "ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -24197,131 +22216,111 @@ msgstr "" #~ msgid "Like C++, Rust has references:" #~ msgstr "مانند C++، راست دارای مراجع است:" -#~ msgid "" -#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " -#~ "pointers." +#~ msgid "We must dereference `ref_x` when assigning to it, similar to C and C++ pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." +#~ "References that are declared as `mut` can be bound to different values over their lifetime." #~ msgstr "" -#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " -#~ "مختلفی ارجاع داده شوند." +#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر مختلفی ارجاع داده " +#~ "شوند." #~ msgid "A reference is said to \"borrow\" the value it refers to." #~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." -#~ msgid "" -#~ "Rust is tracking the lifetimes of all references to ensure they live long " -#~ "enough." +#~ msgid "Rust is tracking the lifetimes of all references to ensure they live long enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " -#~ msgid "" -#~ "You can borrow `&str` slices from `String` via `&` and optionally range " -#~ "selection." +#~ msgid "You can borrow `&str` slices from `String` via `&` and optionally range selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و انتخاب محدوده به " +#~ "صورت اختیاری، قرض بگیرید." #~ msgid "" -#~ "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/" -#~ "Fizz_buzz) interview question:" +#~ "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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " +#~ "We refer in `main` to a function written below. Neither forward declarations nor headers " +#~ "are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره می‌کنیم. نیازی " +#~ "به اعلان از قبل تابع `main` یا در بخش هدر نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains " -#~ "`=n`, which causes it to include the upper bound." +#~ "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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است که باعث می‌شود " +#~ "محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." +#~ msgid "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." +#~ "This course does not include rustdoc on slides, just to save space, but in real code they " +#~ "should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما در کدهای " +#~ "دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." +#~ "Inner doc comments are discussed later (in the page on modules) and need not be addressed " +#~ "here." #~ msgstr "" -#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " -#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." +#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار می‌گیرد و نیازی به " +#~ "پرداختن به آنها در اینجا نیست." #~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." +#~ "Rustdoc comments can contain code snippets that we can run and test using `cargo test`. We " +#~ "will discuss these tests in the [Testing section](../testing/doc-tests.html)." #~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست نویسی](../testing/doc-tests." +#~ "html) در مورد این تست‌ها بحث خواهیم کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a " -#~ "method is an instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای از نوعی است که با " +#~ "آن مرتبط است:" -#~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." +#~ msgid "We will look much more at methods in today's exercise and in tomorrow's class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را از `main` " +#~ "فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual constructor, `Rectangle { width, height }`, could be called " -#~ "directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/" -#~ "constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static methods are commonly " +#~ "used to initialize structs (but don't have to). The actual 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) را ببینید." #~ msgid "" -#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " -#~ "static methods can take arbitrary parameters." +#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such static methods " +#~ "can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، با ارگمان‌های " +#~ "یک سازنده `Rectangle::square(width: u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -24345,13 +22344,12 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." +#~ "When using generics, the standard library's `Into` can provide a kind of limited " +#~ "polymorphism on argument types. We will see more details in a later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد می‌تواند نوعی " +#~ "چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات بیشتر را در بخش‌های بعدی " +#~ "خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -24369,99 +22367,87 @@ msgstr "" #~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" #~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." +#~ "Use a local Rust installation, if possible. This way you can get auto-completion in your " +#~ "editor. See the page about [Using Cargo](../../cargo.md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل خودکار در " +#~ "ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه مربوط به [استفاده از " +#~ "کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets lose their state if " +#~ "you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج شوید، به " +#~ "حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." #~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types " -#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)). You can see this in a program like this:" +#~ "Rust will not automatically apply _implicit conversions_ between types ([unlike C++]" +#~ "(https://en.cppreference.com/w/cpp/language/implicit_conversion)). You can see this in a " +#~ "program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" -#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C+" +#~ "+`](https://en.cppreference.com/w/cpp/language/implicit_conversion)).به عنوان مثال " +#~ "میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` trait has a single `into()` method. Implementing these traits " -#~ "is how a type expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/std/convert/" +#~ "trait.From.html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " +#~ "traits to let us convert between them. The `From` trait has a single `from()` method and " +#~ "similarly, the `Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "همه انواع عدد صحیح راست، تریت‌های (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` همه انواع یک متد مشترک به اسم `into()` را " +#~ "دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which means that we can " +#~ "convert a variable `x` of type `i8` to an `i16` by calling `i16::from(x)`. Or, simpler, " +#~ "with `x.into()`, because `From for i16` implementation automatically create an " +#~ "implementation of `Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From``From for i16` دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع `i8` را با فراخوانی " +#~ "`i16::from(x)` به یک `i16` تبدیل کنیم. یا به " +#~ "شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " -#~ "implementation automatically." +#~ "The same applies for your own `From` implementations for your own types, so it is " +#~ "sufficient to only implement `From` to get a respective `Into` implementation automatically." #~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " -#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع خودتان نیز صدق " +#~ "می‌کند، بنابراین کافیست فقط `From` را پیاده‌سازی کنید تا به طور خودکار " +#~ "پیاده‌سازی `Into` مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای انجام تبدیل " +#~ "استفاده شود." #~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " -#~ "`i128`) to see which types you can convert to which other types. Try " -#~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/" -#~ "trait.From.html) to see if `From` is implemented for the pairs you " -#~ "check." +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, `i128`) to see " +#~ "which types you can convert to which other types. Try converting small types to big types " +#~ "and the other way around. Check the [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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) تغییر دهید تا ببینید " +#~ "کدام انواع را می‌توانید به کدام انواع دیگر تبدیل کنید. سعی کنید انواع کوچک را به انواع بزرگ " +#~ "تبدیل کنید و برعکس. [مستندات کتابخانه استاندارد](https://doc.rust-lang.org/std/convert/" +#~ "trait.From.html) را بررسی کنید تا ببینید آیا `From` برای تبدیل " +#~ "انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -24469,426 +22455,363 @@ msgstr "" #~ msgid "We saw that an array can be declared like this:" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " -#~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" +#~ msgid "You can print such an array by asking for its debug representation with `{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ " +#~ "کنید:" -#~ msgid "" -#~ "Rust lets you iterate over things like arrays and ranges using the `for` " -#~ "keyword:" +#~ msgid "Rust lets you iterate over things like arrays and ranges using the `for` keyword:" #~ msgstr "" -#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " -#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" +#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی چیزهایی مانند " +#~ "آرایه‌ها و رنج‌ها پیمایش کنید:" #~ msgid "Bonus Question" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your argument and " +#~ "return types? Something like `&[&[i32]]` for a two-dimensional slice-of-slices. Why or why " +#~ "not?" #~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` " +#~ "برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://" +#~ "docs.rs/ndarray/) سر بزنید." #~ msgid "" -#~ "The solution and the answer to the bonus section are available in the " -#~ "[Solution](solutions-morning.md#arrays-and-for-loops) section." +#~ "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) موجود است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-and-for-loops) موجود " +#~ "است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." #~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change " -#~ "[introduced in the 2021 Edition](https://doc.rust-lang.org/edition-guide/" -#~ "rust-2021/IntoIterator-for-arrays.html)." +#~ "The loop would have been one that consumes the array. This is a change [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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال ۲۰۲۱ معرفی شده است.]" +#~ "(https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, " -#~ "then `[i32; 3]` is also a copy type." +#~ "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]` نیز یک نوع کپی است." +#~ "یک کپی آرایه ضمنی رخ می‌داد. از آنجایی که `i32` یک نوع کپی است، پس `[i32; 3]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally evaluate one of " +#~ "two blocks, but the blocks can have a value which then becomes the value of the `if` " +#~ "expression. Other control flow expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود که یکی از ۲ " +#~ "بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این بلاک های `if` میتوانند یک " +#~ "مقدار را برگرداند و در اصطلاح یک مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این " +#~ "کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" -#~ msgstr "" -#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " -#~ "برگشتی است: " +#~ "The same rule is used for functions: the value of the function body is the return value:" +#~ msgstr "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار برگشتی است: " -#~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " -#~ msgstr "" -#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " -#~ "هستند. " +#~ msgid "The point of this slide is to show that blocks have a type and value in Rust. " +#~ msgstr "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely related to the [`while let` loop](while-let-expressions.md). It " -#~ "will automatically call `into_iter()` on the expression and then iterate " -#~ "over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely 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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور نزدیکی به حلقه [حلقه " +#~ "`while let` ](while-let-expressions.md) مرتبط است. حلقه `for` به طور خودکار `into_iter()` را روی عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." +#~ msgstr "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که ویژگی `Iterator` را " +#~ "پیاده‌سازی می‌کند." -#~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " +#~ msgid "`step_by` is a method that returns another `Iterator` that skips every other element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه عناصر را " +#~ "برمی‌گرداند." #~ 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()`." +#~ "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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را قابل تغییر کنید " +#~ "(با اضافه کردن `mut`) و حلقه `for` را به `for x in v.iter_mut()` " +#~ "تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" #~ msgid "" -#~ "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/" -#~ "expressions/loop-expr.html#infinite-loops) which creates an endless loop." +#~ "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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/expressions/loop-expr." +#~ "html#infinite-loops) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" +#~ msgstr "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن " +#~ "را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the types less and less " +#~ "as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و کمتر آن را " +#~ "نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic container without the " +#~ "code ever explicitly specifying the contained type, using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در یک کانتینر " +#~ "عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک جایگزین برای اعلام نوع " +#~ "داده: " #~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-" -#~ "HashSet%3CT,+S%3E) implements." +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) " +#~ "relies on [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html), " +#~ "which [`HashSet`](https://doc.rust-lang.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) آن را پیاده‌سازی می‌کند." +#~ "[`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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse memory locations when " +#~ "shadowing an immutable variable in a scope, even if the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که قبلا برای یک " +#~ "متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل تغییر داریم استفاده کند. " +#~ "حتی اگر چه نوع داده تغییر نکند." #~ msgid "" -#~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " -#~ "`Tails`. You might note the namespace when using variants." +#~ "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`ها، به این اینگونه نام‌ها توجه کنید." +#~ "در این صفحه نوع`Enum`به اسم `CoinFlip` که دارای `Heads` و `Tails` می‌باشد. هنگام استفاده از " +#~ "`Enum`ها، به این اینگونه نام‌ها توجه کنید." #~ msgid "In both, associated functions are defined within an `impl` block." #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده باشند. سپس می‌توانید از " +#~ "دستور `match` برای استخراج داده‌ها از هر فیلد استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There " -#~ "is no fall-through like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There is no fall-through " +#~ "like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از بالا به پایین " +#~ "نمی‌باشد." #~ msgid "" -#~ "The match expression has a value. The value is the last expression in the " -#~ "match arm which was executed." +#~ "The match expression has a value. The value is the last expression in the match arm which " +#~ "was executed." #~ msgstr "" -#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " -#~ "`match` ای است که اجرا شده است." +#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی `match` ای است که " +#~ "اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته باشد، سپس کد پس از " +#~ "`=>` را اجرا می‌کنیم. بعد از اینکه توی match اولین طبیق الگو انجام شد " +#~ "جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را بررسی می کند." -#~ msgid "" -#~ "It is possible to retrieve the discriminant by calling `std::mem::" -#~ "discriminant()`" +#~ msgid "It is possible to retrieve the discriminant by calling `std::mem::discriminant()`" #~ msgstr "" -#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " -#~ "تشخیصی پنهان را دریافت کرد." +#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد تشخیصی پنهان را " +#~ "دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs where comparing field " +#~ "values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت `PartialEq` بر " +#~ "برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top " +#~ "level `struct Click { ... }`. The inlined version cannot implement traits, for example." #~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::" +#~ "Click(Click)` با `struct Click { ... }` در سطح بالا نیست.برای " +#~ "مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را پیاده‌سازی کند." -#~ msgid "" -#~ "Rust enums are packed tightly, taking constraints due to alignment into " -#~ "account:" +#~ msgid "Rust enums are packed tightly, taking constraints due to alignment into account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های ناشی از هم " +#~ "ترازی:" -#~ msgid "" -#~ "Internally Rust is using a field (discriminant) to keep track of the enum " -#~ "variant." +#~ msgid "Internally Rust is using a field (discriminant) to keep track of the enum variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای `enum` استفاده " +#~ "می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی حافظه 1 بایت، فضای " +#~ "مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): اندازه توی حافظه 1 " +#~ "بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" +#~ "dbg_size!(&i32): اندازه توی حافظه ۸ بایت، ، " +#~ "فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" #~ msgid "" -#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " -#~ "optimization, see below)." +#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer optimization, see " +#~ "below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): اندازه توی حافظه ۸ " +#~ "بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" -#~ msgid "" -#~ "Niche optimization: Rust will merge unused bit patterns for the enum " -#~ "discriminant." +#~ msgid "Niche optimization: Rust will merge unused bit patterns for the enum discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." +#~ "More complex example if you want to discuss what happens when we chain more than 256 " +#~ "`Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد `Option` را به " +#~ "صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring assignment, or if it fails, execute a block which is " -#~ "required to abort normal control flow (with `panic`/`return`/`break`/" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/" +#~ "let_else.html) construct allows to do a destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) اجازه می‌دهد تا یک انتساب به صورت destructuring انجام " +#~ "شود، یا اگر شکست خورد، یک بلوک را اجرا کند که برای خاتمه دادن به جریان کنترل عادی (با panic/" +#~ "return/break/continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-expr.html) برای " +#~ "مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از این نظر، مانند یک سری عبارات `if " +#~ "let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "" -#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." +#~ msgstr "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." +#~ ".as_deref() را حذف کنید و خطا را توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان `String` تطبیق الگو " +#~ "کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our " -#~ "case, this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "as_deref() یک `Option` را به `Option<&T::Target>` تبدیل می‌کند. در مورد ما، این `Option` را به `Option<&str>` تبدیل می‌کند." -#~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." +#~ msgid "We can now use pattern matching to match against the `&str` inside `Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل `Option` " +#~ "استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`." +#~ "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`، به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف `q`، به نمایش نحوه " +#~ "کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable " -#~ "patterns, as the term can show up in error messages." +#~ "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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار (irrefutable patterns) " +#~ "باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" -#~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." -#~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." +#~ msgid "Destructuring of slices of unknown length also works with patterns of fixed length." +#~ msgstr "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می کند." #~ 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:" +#~ "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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت بولین دلخواه است که " +#~ "در صورت مطابقت الگو اجرا می شود." -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "You can use the variables defined in the pattern in your if expression." +#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -24903,42 +22826,34 @@ msgstr "" #~ msgstr "تمرینی درباره تطبیق الگو" #~ 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." +#~ "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`ها پیاده‌سازی " -#~ "کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح حل کنید. " +#~ "سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based memory management, " +#~ "and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت حافظه مبتنی بر " +#~ "اسکوپ و جمع آوری زباله. " -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." -#~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` and `Arc`." +#~ msgstr "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -24950,90 +22865,72 @@ msgstr "" #~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." #~ msgid "" -#~ "If not done with care, this can lead to crashes, bugs, security " -#~ "vulnerabilities, and memory leaks." +#~ "If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory " +#~ "leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی و نشتی حافظه " +#~ "شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" +#~ msgstr "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and `free`: the pointer is " +#~ "lost and we cannot deallocate the memory. Worse, freeing the pointer twice, or accessing a " +#~ "freed pointer can lead to exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه نشت می‌کند: " +#~ "اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، آزاد کردن مجدد اشاره گر " +#~ "یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل " +#~ "سوءاستفاده شود." -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." +#~ msgid "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object is destroyed. The " +#~ "compiler guarantees that this happens, even if an exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را آزاد کنید. " +#~ "کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and gives you smart " +#~ "pointers." #~ msgstr "" -#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " -#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." +#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده می‌شود و به شما " +#~ "اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory allocated on " +#~ "the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به حافظه‌ای که روی " +#~ "انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." +#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "Special move constructors are used when passing ownership to a function:" +#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" -#~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" +#~ "An alternative to manual and scope-based memory management is automatic memory management:" +#~ msgstr "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." -#~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." +#~ msgid "A garbage collector finds unused memory and deallocates it for the programmer." #~ msgstr "" -#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " -#~ "تخصیص‌زدایی (آزاد) می‌کند." +#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس تخصیص‌زدایی (آزاد) " +#~ "می‌کند." #~ msgid "Java Example" #~ msgstr "مثالی در Java" @@ -25051,43 +22948,39 @@ msgstr "" #~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." #~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." +#~ msgstr "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even have no cost at " +#~ "runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، برخی مانند C " +#~ "هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." #~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually " -#~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "ownership and memory allocation via various means, and prevent the " -#~ "potential errors in C." +#~ "If asked how at this point, you can mention that in Rust this is usually handled by RAII " +#~ "wrapper types such as [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), or [Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html). These " +#~ "encapsulate 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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید به این موضوع که " +#~ "زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی [Drop](https://doc." +#~ "rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -25098,18 +22991,16 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way to generate code in Rust at compile time. In this case the default " -#~ "implementations of `Copy` and `Clone` traits are generated." +#~ "If students ask about `derive`, it is sufficient to say that this is a way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای تولید کد در`Rust` " +#~ "در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From ed35ccefa257aed03f5e1e68643fa3efd8e20f7b Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 13 Sep 2024 00:22:13 +0330 Subject: [PATCH 75/92] fa: resolve error - fmt --- po/fa.po | 15475 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 8792 insertions(+), 6683 deletions(-) diff --git a/po/fa.po b/po/fa.po index ce2fcfae5e3..a6e535d08d6 100644 --- a/po/fa.po +++ b/po/fa.po @@ -52,14 +52,15 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md -#: src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -75,8 +76,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -100,19 +101,21 @@ msgstr "تعیین تایپ ضمنی" msgid "Exercise: Fibonacci" msgstr "تمرین: دنباله فیبوناچی" -#: src/SUMMARY.md src/types-and-values/solution.md src/control-flow-basics/solution.md -#: src/tuples-and-arrays/solution.md src/references/solution.md -#: src/user-defined-types/solution.md src/pattern-matching/solution.md -#: src/methods-and-traits/solution.md src/generics/solution.md src/std-types/solution.md -#: src/std-traits/solution.md src/memory-management/solution.md src/smart-pointers/solution.md -#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md -#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md +#: src/SUMMARY.md src/types-and-values/solution.md +#: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md +#: src/references/solution.md src/user-defined-types/solution.md +#: src/pattern-matching/solution.md src/methods-and-traits/solution.md +#: src/generics/solution.md src/std-types/solution.md +#: src/std-traits/solution.md src/memory-management/solution.md +#: src/smart-pointers/solution.md src/borrowing/solution.md +#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md +#: src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -140,7 +143,8 @@ msgstr "`break` و `continue`" msgid "Labels" msgstr "برچسب‌ها" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/blocks-and-scopes.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md msgid "Blocks and Scopes" msgstr "بلوک‌ها و محدوده‌ها" @@ -148,7 +152,8 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -156,7 +161,8 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -164,8 +170,8 @@ msgstr "تمرین: دنباله Collatz" msgid "Day 1: Afternoon" msgstr "روز ۱: بعد از ظهر" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md -#: src/tuples-and-arrays.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "تاپل ها و آرایه ها" @@ -181,7 +187,8 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -189,8 +196,8 @@ msgstr "الگو‌ها و ضدِ ساختارها" msgid "Exercise: Nested Arrays" msgstr "تمرین: آرایه‌های تو در تو" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md -#: src/references.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "مراجع" @@ -214,16 +221,18 @@ msgstr "رشته‌ها" msgid "Exercise: Geometry" msgstr "تمرین: هندسه" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md -#: src/user-defined-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/user-defined-types.md msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -252,8 +261,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -270,7 +279,8 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -278,8 +288,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -315,8 +325,8 @@ msgstr "تمرین: توابع Generic" msgid "Day 2: Afternoon" msgstr "روز دوم: عصر" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md -#: src/generics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" msgstr "Generics" @@ -348,8 +358,8 @@ msgstr "`dyn Trait`" msgid "Exercise: Generic `min`" msgstr "تمرین: Generic `min`" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md -#: src/std-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" msgstr "کتابخانه‌ استاندارد تایپ‌ها" @@ -386,8 +396,8 @@ msgstr "`HashMap`" msgid "Exercise: Counter" msgstr "تمرین: شمارنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md -#: src/std-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" msgstr "کتابخانه استاندارد Traits" @@ -428,8 +438,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -465,12 +475,13 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" -#: src/SUMMARY.md src/smart-pointers/box.md src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/smart-pointers/box.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Box`" msgstr "`. If you are reading somewhere else, please check there for updates." +"The latest version of the course can be found at . If you are reading somewhere else, please check there " +"for updates." msgstr "" -"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر " -"از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز بررسی کنید." +"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " +"نیز بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language in the top right " -"corner of the page or check the [Translations](running-the-course/translations.md) page for a " -"list of all available translations." +"The course is available in other languages. Select your preferred language " +"in the top right corner of the page or check the [Translations](running-the-" +"course/translations.md) page for a list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای صفحه انتخاب " -"کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای فهرستی از تمام ترجمه‌های " -"موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " +"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " +"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1361,9 +1392,11 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know anything about Rust and " -"hope to:" -msgstr "هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی دانید :" +"The goal of the course is to teach you Rust. We assume you don't know " +"anything about Rust and hope to:" +msgstr "" +"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " +"نمی دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1372,7 +1405,8 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " +"در Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1383,44 +1417,51 @@ msgid "We call the first four course days Rust Fundamentals." msgstr "ما چهار روز اول دوره را اصول Rust می نامیم." #: src/index.md -msgid "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgid "" +"Building on this, you're invited to dive into one or more specialized topics:" +msgstr "" +"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" -"[Android](android.md): a half-day course on using Rust for Android platform development " -"(AOSP). This includes interoperability with C, C++, and Java." +"[Android](android.md): a half-day course on using Rust for Android platform " +"development (AOSP). This includes interoperability with C, C++, and Java." msgstr "" -"[Android](android.md): یک دوره نیم روزه استفاده از Rust برای توسعه پلت فرم اندروید (AOSP). " -"این شامل قابلیت همکاری با C، C ++و Java است." +"[Android](android.md): یک دوره نیم روزه استفاده از Rust برای توسعه پلت فرم " +"اندروید (AOSP). این شامل قابلیت همکاری با C، C ++و Java است." #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium based browsers. This " -"includes interoperability with C++ and how to include third-party crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium " +"based browsers. This includes interoperability with C++ and how to include " +"third-party crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای مبتنی بر " -"Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه های(crates) شخص ثالث در کروم " -"است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " +"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " +"جعبه های(crates) شخص ثالث در کروم است." #: src/index.md msgid "" -"[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal (embedded) " -"development. Both microcontrollers and application processors are covered." +"[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal " +"(embedded) development. Both microcontrollers and application processors are " +"covered." msgstr "" -"[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای توسعهbare-metal " -"(تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده شده اند." +"[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " +"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " +"داده شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. We cover both " -"classical concurrency (preemptively scheduling using threads and mutexes) and async/await " -"concurrency (cooperative multitasking using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " +"Rust. We cover both classical concurrency (preemptively scheduling using " +"threads and mutexes) and async/await concurrency (cooperative multitasking " +"using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. ما هر دو " -"مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و mutexها ) و async/" -"await concurrency (multitasking مشارکتی) با استفاده از futures را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " +"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " +"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " +"استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1428,21 +1469,21 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few days. Some non-goals " -"of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few " +"days. Some non-goals of this course are:" msgstr "" -"زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم.چندتا از اهداف " -"خارج از این دوره عبارتند از:" +"زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." +"چندتا از اهداف خارج از این دوره عبارتند از:" #: src/index.md msgid "" -"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book](https://doc.rust-" -"lang.org/book/ch19-06-macros.html) and [Rust by Example](https://doc.rust-lang.org/rust-by-" -"example/macros.html) instead." +"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" +"(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://doc.rust-lang." -"org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-lang.org/rust-by-example/" -"macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" +"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1450,32 +1491,32 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a statically-typed language " -"and we will sometimes make comparisons with C and C++ to better explain or contrast the Rust " -"approach." +"The course assumes that you already know how to program. Rust is a " +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا رویکرد‌های Rust " -"را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " +"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" -"If you know how to program in a dynamically-typed language such as Python or JavaScript, then " -"you will be able to follow along just fine too." +"If you know how to program in a dynamically-typed language such as Python or " +"JavaScript, then you will be able to follow along just fine too." msgstr "" -"اگر می‌دانید چگونه به زبانی با دینامیک تایپ مانند پایتون یا جاوا اسکریپت برنامه‌نویسی کنید " -"می‌توانید به خوبی این روش را دنبال کنید." +"اگر می‌دانید چگونه به زبانی با دینامیک تایپ مانند پایتون یا جاوا اسکریپت " +"برنامه‌نویسی کنید می‌توانید به خوبی این روش را دنبال کنید." #: src/index.md msgid "" -"This is an example of a _speaker note_. We will use these to add additional information to the " -"slides. This could be key points which the instructor should cover as well as answers to " -"typical questions which come up in class." +"This is an example of a _speaker note_. We will use these to add additional " +"information to the slides. This could be key points which the instructor " +"should cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات بیشتری را " -"ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و همچنین پاسخ به سوالات رایجی " -"که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " +"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " +"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1483,21 +1524,24 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the course internally at " -"Google." -msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the " +"course internally at Google." +msgstr "" +"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in the middle. " -"This leaves 3 hours for the morning class and 3 hours for the afternoon class. Both sessions " -"contain multiple breaks and time for students to work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " +"in the middle. This leaves 3 hours for the morning class and 3 hours for the " +"afternoon class. Both sessions contain multiple breaks and time for students " +"to work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت ناهار در میانه " -"روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته " -"باشید که این فقط یک توصیه است: شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد " -"کنید. نکته منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر " -"خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " +"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " +"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " +"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " +"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " +"ظهر خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1505,91 +1549,103 @@ msgstr "قبل از اجرای دوره، شما می خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker notes to help " -"highlight the key points (please help us by contributing more speaker notes!). When " -"presenting, you should make sure to open the speaker notes in a popup (click the link with a " -"little arrow next to \"Speaker Notes\"). This way you have a clean screen to present to the " -"class." +"Make yourself familiar with the course material. We've included speaker " +"notes to help highlight the key points (please help us by contributing more " +"speaker notes!). When presenting, you should make sure to open the speaker " +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات کلیدی " -"گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). هنگام ارائه، باید " -"مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در " -"کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید " -"داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " +"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " +"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " +"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " +"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." #: src/running-the-course.md msgid "" -"Decide on the dates. Since the course takes four days, we recommend that you schedule the days " -"over two weeks. Course participants have said that they find it helpful to have a gap in the " -"course since it helps them process all the information we give them." +"Decide on the dates. Since the course takes four days, we recommend that you " +"schedule the days over two weeks. Course participants have said that they " +"find it helpful to have a gap in the course since it helps them process all " +"the information we give them." msgstr "" -"در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول می‌کشد، توصیه " -"می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره گفته‌اند که داشتن فاصله‌ای در " -"دوره مفید است، زیرا به آنها کمک می‌کند تا تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " +"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " +"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " +"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a class size of 15-25 " -"people. That's small enough that people are comfortable asking questions --- it's also small " -"enough that one instructor will have time to answer the questions. Make sure the room has " -"_desks_ for yourself and for the students: you will all need to be able to sit and work with " -"your laptops. In particular, you will be doing a lot of live-coding as an instructor, so a " -"lectern won't be very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر را پیشنهاد " -"می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین مدرس وقت کافی برای پاسخ‌ " -"دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما " -"همگی نیاز دارید که بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی " -"live-coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a " +"class size of 15-25 people. That's small enough that people are comfortable " +"asking questions --- it's also small enough that one instructor will have " +"time to answer the questions. Make sure the room has _desks_ for yourself " +"and for the students: you will all need to be able to sit and work with your " +"laptops. In particular, you will be doing a lot of live-coding as an " +"instructor, so a lectern won't be very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " +"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " +"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " +"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " +"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" +"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " +"نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things up. We recommend " -"presenting directly using `mdbook serve` running on your laptop (see the [installation " -"instructions](https://github.com/google/comprehensive-rust#building)). This ensures optimal " -"performance with no lag as you change pages. Using your laptop will also allow you to fix " -"typos as you or the course participants spot them." +"On the day of your course, show up to the room a little early to set things " +"up. We recommend presenting directly using `mdbook serve` running on your " +"laptop (see the [installation instructions](https://github.com/google/" +"comprehensive-rust#building)). This ensures optimal performance with no lag " +"as you change pages. Using your laptop will also allow you to fix typos as " +"you or the course participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه می کنیم " -"مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای نصب](https://github." -"com/google/comprehensive-rust#building) را ببنیید). با این کار عملکرد بدون تاخیر در هنگام " -"تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در " -"صورت مشاهده شما یا شرکت کنندگان در دوره اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " +"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " +"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " +"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " +"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " +"شما یا شرکت کنندگان در دوره اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We typically spend 30-45 " -"minutes on exercises in the morning and in the afternoon (including time to review the " -"solutions). Make sure to ask people if they're stuck or if there is anything you can help " -"with. When you see that several people have the same problem, call it out to the class and " -"offer a solution, e.g., by showing people where to find the relevant information in the " -"standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ الی ۴۵ دقیقه را " -"برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) صرف می‌کنیم. حتما از افراد " -"بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که می‌توانید به آنها کمک کنید. وقتی که می‌بینید " -"چندین نفر مشکل یکسانی دارند, خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن " -"جایی که می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." +"Let people solve the exercises by themselves or in small groups. We " +"typically spend 30-45 minutes on exercises in the morning and in the " +"afternoon (including time to review the solutions). Make sure to ask people " +"if they're stuck or if there is anything you can help with. When you see " +"that several people have the same problem, call it out to the class and " +"offer a solution, e.g., by showing people where to find the relevant " +"information in the standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " +"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " +"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " +"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " +"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " +"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " +"کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun for you as it has " -"been for us!" +"That is all, good luck running the course! We hope it will be as much fun " +"for you as it has been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه که برای ما " -"لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " +"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" -"Please [provide feedback](https://github.com/google/comprehensive-rust/discussions/86) " -"afterwards so that we can keep improving the course. We would love to hear what worked well " -"for you and what can be made better. Your students are also very welcome to [send us feedback]" -"(https://github.com/google/comprehensive-rust/discussions/100)!" +"Please [provide feedback](https://github.com/google/comprehensive-rust/" +"discussions/86) afterwards so that we can keep improving the course. We " +"would love to hear what worked well for you and what can be made better. " +"Your students are also very welcome to [send us feedback](https://github.com/" +"google/comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/discussions/86) " -"تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم بشنویم چه چیزی برای شما خوب بوده و " -"چه چیزی می تواند بهتر شود. همینطور شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال " -"کنید](https://github.com/google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" +"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " +"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " +"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" +"github.com/google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1597,11 +1653,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days are fast paced " -"and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " +"days are fast paced and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز با سرعت " -"بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " +"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1611,46 +1667,54 @@ msgstr "مباحث دوره:" msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" msgstr "روز ۱ صبح (۲ ساعت و ۵ دقیقه با احتساب استراحت)" -#: src/running-the-course/course-structure.md src/welcome-day-1.md src/welcome-day-1-afternoon.md -#: src/welcome-day-2.md src/welcome-day-2-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4.md src/welcome-day-4-afternoon.md -#: src/concurrency/welcome.md src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4.md +#: src/welcome-day-4-afternoon.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Segment" msgstr "بخش" -#: src/running-the-course/course-structure.md src/welcome-day-1.md src/hello-world.md -#: src/types-and-values.md src/control-flow-basics.md src/welcome-day-1-afternoon.md -#: src/tuples-and-arrays.md src/references.md src/user-defined-types.md src/welcome-day-2.md -#: src/pattern-matching.md src/methods-and-traits.md src/welcome-day-2-afternoon.md -#: src/generics.md src/std-types.md src/std-traits.md src/welcome-day-3.md -#: src/memory-management.md src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md -#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md +#: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md +#: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md #: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/welcome.md src/concurrency/threads.md src/concurrency/channels.md -#: src/concurrency/send-sync.md src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md msgid "Duration" msgstr "مدت زمان" -#: src/running-the-course/course-structure.md src/welcome-day-1.md src/types-and-values.md -#: src/control-flow-basics.md src/tuples-and-arrays.md src/user-defined-types.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md -#: src/lifetimes.md src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/shared-state.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1.md src/types-and-values.md -#: src/control-flow-basics.md src/tuples-and-arrays.md src/references.md -#: src/user-defined-types.md src/methods-and-traits.md src/modules.md src/concurrency/welcome.md -#: src/concurrency/threads.md src/concurrency/shared-state.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/user-defined-types.md src/methods-and-traits.md +#: src/modules.md src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/shared-state.md msgid "15 minutes" msgstr "۱۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1.md src/welcome-day-4.md +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-4.md msgid "40 minutes" msgstr "۴۰ دقیقه" @@ -1662,13 +1726,14 @@ msgstr "روز ۱ بعد از ظهر (۲ ساعت و ۳۵ دقیقه،شامل msgid "35 minutes" msgstr "۳۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/concurrency/welcome-async.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-3.md src/welcome-day-3-afternoon.md +#: src/concurrency/welcome-async.md msgid "55 minutes" msgstr "۵۵ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md src/welcome-day-2.md -#: src/welcome-day-3-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-2.md src/welcome-day-3-afternoon.md msgid "50 minutes" msgstr "۵۰ دقیقه" @@ -1676,15 +1741,17 @@ msgstr "۵۰ دقیقه" msgid "Day 2 Morning (2 hours and 10 minutes, including breaks)" msgstr "روز ۲ صبح (۲ ساعت و ۱۰ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md src/hello-world.md src/types-and-values.md -#: src/control-flow-basics.md src/tuples-and-arrays.md src/welcome-day-2.md -#: src/methods-and-traits.md src/std-types.md src/welcome-day-3.md src/borrowing.md -#: src/welcome-day-4.md src/modules.md src/testing.md src/error-handling.md +#: src/running-the-course/course-structure.md src/hello-world.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/welcome-day-2.md src/methods-and-traits.md src/std-types.md +#: src/welcome-day-3.md src/borrowing.md src/welcome-day-4.md src/modules.md +#: src/testing.md src/error-handling.md msgid "3 minutes" msgstr "۳ دقیقه" -#: src/running-the-course/course-structure.md src/welcome-day-2.md src/welcome-day-2-afternoon.md -#: src/welcome-day-3.md src/welcome-day-4-afternoon.md +#: src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +#: src/welcome-day-4-afternoon.md msgid "1 hour" msgstr "۱ ساعت" @@ -1692,7 +1759,8 @@ msgstr "۱ ساعت" msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" msgstr "روز ۲ بعد از ظهر (۴ ساعت و ۵ دقیقه، شامل وقت استراحت)" -#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md src/welcome-day-4.md +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/welcome-day-4.md msgid "45 minutes" msgstr "۴۵ دقیقه" @@ -1727,8 +1795,11 @@ msgstr "عمیق تر شدن" #: src/running-the-course/course-structure.md msgid "" -"In addition to the 4-day class on Rust Fundamentals, we cover some more specialized topics:" -msgstr "علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" +"In addition to the 4-day class on Rust Fundamentals, we cover some more " +"specialized topics:" +msgstr "" +"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " +"دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1736,34 +1807,38 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust for Android " -"platform development. This includes interoperability with C, C++, and Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using " +"Rust for Android platform development. This includes interoperability with " +"C, C++, and Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده از Rust برای " -"توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا " -"می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " +"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " +"با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/downloading). " -"Make a checkout of the [course repository](https://github.com/google/comprehensive-rust) on " -"the same machine and move the `src/android/` directory into the root of your AOSP checkout. " -"This will ensure that the Android build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/" +"download/downloading). Make a checkout of the [course repository](https://" +"github.com/google/comprehensive-rust) on the same machine and move the `src/" +"android/` directory into the root of your AOSP checkout. This will ensure " +"that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/download/" -"downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/google/comprehensive-" -"rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن ASOP قرار دهید. با این کار طمینان " -"حاصل می‌کنید که سیستم build اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" +"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" +"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" +"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " +"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build all Android " -"examples using `src/android/build_all.sh`. Read the script to see the commands it runs and " -"make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build " +"all Android examples using `src/android/build_all.sh`. Read the script to " +"see the commands it runs and make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه نمونه‌های " -"Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. اسکریپت را بخوانید تا " -"دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " +"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " +"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " +"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1771,23 +1846,25 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using Rust as part of " -"the Chromium browser. It includes using Rust in Chromium's `gn` build system, bringing in " -"third-party libraries (\"crates\") and C++ interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " +"using Rust as part of the Chromium browser. It includes using Rust in " +"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " +"and C++ interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به عنوان بخشی از " -"مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` Chromium، آوردن کتابخانه‌های " -"شخص ثالث (\"crates\") و قابلیت همکاری ++C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " +"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " +"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" +"+C است." #: src/running-the-course/course-structure.md msgid "" -"You will need to be able to build Chromium --- a debug, component build is [recommended](../" -"chromium/setup.md) for speed but any build will work. Ensure that you can run the Chromium " -"browser that you've built." +"You will need to be able to build Chromium --- a debug, component build is " +"[recommended](../chromium/setup.md) for speed but any build will work. " +"Ensure that you can run the Chromium browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت [توصیه می شود] " -"(../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که می‌توانید مرورگر Chromium را " -"که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " +"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " +"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1795,22 +1872,25 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using Rust for bare-" -"metal (embedded) development. Both microcontrollers and application processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " +"using Rust for bare-metal (embedded) development. Both microcontrollers and " +"application processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک روزه با تمرکز " -"بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل (embedded) است. این دوره هم " -"میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " +"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " +"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " +"کارایی خاص را پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit](https://microbit.org/) " -"v2 development board ahead of time. Everybody will need to install a number of packages as " -"described on the [welcome page](../bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit]" +"(https://microbit.org/) v2 development board ahead of time. Everybody will " +"need to install a number of packages as described on the [welcome page](../" +"bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 را خریداری " -"کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-metal.md) توضیح داده شده " -"نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " +"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" +"(../bare-metal.md) توضیح داده شده نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1819,35 +1899,39 @@ msgstr "همزمانی در Rust" #: src/running-the-course/course-structure.md #, fuzzy msgid "" -"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day class on " -"classical as well as `async`/`await` concurrency." +"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " +"class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل همزمانی " -"کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " +"شامل همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready to go. You can " -"then copy/paste the examples into `src/main.rs` to experiment with them:" +"You will need a fresh crate set up and the dependencies downloaded and ready " +"to go. You can then copy/paste the examples into `src/main.rs` to experiment " +"with them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. سپس می‌توانید " -"نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " +"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " +"آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" -#: src/running-the-course/course-structure.md src/pattern-matching.md src/std-traits.md -#: src/smart-pointers.md src/lifetimes.md src/iterators.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/running-the-course/course-structure.md src/pattern-matching.md +#: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async-exercises.md msgid "30 minutes" msgstr "۳۰ دقیقه" -#: src/running-the-course/course-structure.md src/methods-and-traits.md src/std-types.md -#: src/memory-management.md src/borrowing.md src/concurrency/welcome.md -#: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md -#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +#: src/running-the-course/course-structure.md src/methods-and-traits.md +#: src/std-types.md src/memory-management.md src/borrowing.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md msgid "20 minutes" msgstr "۲۰ دقیقه" @@ -1865,10 +1949,11 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the questions drive the " -"exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the " +"questions drive the exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " +"Rust را هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1895,85 +1980,101 @@ msgid "s: Activate the search bar." msgstr "s: نوار جستجو را فعال می کند." #: src/running-the-course/translations.md -msgid "The course has been translated into other languages by a set of wonderful volunteers:" -msgstr "این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" +msgid "" +"The course has been translated into other languages by a set of wonderful " +"volunteers:" +msgstr "" +"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " +"است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by [@rastringer]" -"(https://github.com/rastringer), [@hugojacob](https://github.com/hugojacob), [@joaovicmendes]" -"(https://github.com/joaovicmendes), and [@henrif75](https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " +"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " +"[@henrif75](https://github.com/henrif75)." msgstr "" -"[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط [@rastringer]" -"(https://github.com/rastringer), [@hugojacob](https://github.com/hugojacob), [@joaovicmendes]" -"(https://github.com/joaovicmendes) و [@henrif75](https://github.com/henrif75)." +"[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " +"[@henrif75](https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by [@suetfei]" -"(https://github.com/suetfei), [@wnghl](https://github.com/wnghl), [@anlunx](https://github.com/" -"anlunx), [@kongy](https://github.com/kongy), [@noahdragon](https://github.com/noahdragon), " -"[@superwhd](https://github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " +"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" +"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" +"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" +"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" -"[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط [@suetfei](https://" -"github.com/suetfei), [@wnghl](https://github.com/wnghl), [@anlunx](https://github.com/anlunx), " -"[@kongy](https://github.com/kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd]" -"(https://github.com/superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://" -"github.com/nodmp)." +"[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " +"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " +"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " +"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" +"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." +"com/nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by [@hueich]" -"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://" -"github.com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen), and [@johnathan79717]" -"(https://github.com/johnathan79717)." +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " +"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen), and [@johnathan79717](https://github.com/" +"johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich](https://" -"github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://github." -"com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen) و [@johnathan79717](https://" -"github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN](https://github." -"com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), [@HidenoriKobayashi](https://" -"github.com/HidenoriKobayashi) and [@kantasv](https://github.com/kantasv)." +"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " +"and [@kantasv](https://github.com/kantasv)." msgstr "" -"[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN](https://github.com/" -"CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." +"[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" +"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" +"momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://github.com/" -"keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan](https://github.com/" -"jooyunghan), and [@namhyung](https://github.com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " +"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." +"com/namhyung)." msgstr "" -"[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace](https://github.com/" -"keispace), [@jiyongp](https://github.com/jiyongp) و [@jooyunghan](https://github.com/" -"jooyunghan)." +"[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " +"[@jooyunghan](https://github.com/jooyunghan)." #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://github.com/" -"deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" +"(https://github.com/deavid)." msgstr "" -"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid](https://github.com/" -"deavid)." +"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" +"(https://github.com/deavid)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp](https://github." -"com/git-user-cpp), [@yaremam](https://github.com/yaremam) and [@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" +"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) and [@reta](https://github.com/reta)." msgstr "" -"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS](https://github.com/" -"KookaS) و [@vcaen](https://github.com/vcaen)." +"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" +"(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "Use the language picker in the top-right corner to switch between languages." -msgstr "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." +msgid "" +"Use the language picker in the top-right corner to switch between languages." +msgstr "" +"از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." #: src/running-the-course/translations.md msgid "Incomplete Translations" @@ -1981,96 +2082,103 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most recently updated " -"translations:" +"There is a large number of in-progress translations. We link to the most " +"recently updated translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " +"پیوند می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://github.com/" -"younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" +"(https://github.com/younies)" msgstr "" -"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid](https://github.com/" -"deavid)." +"[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" +"(https://github.com/deavid)." #: src/running-the-course/translations.md msgid "" -"[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol](https://github." -"com/raselmandol)." +"[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" +"(https://github.com/raselmandol)." msgstr "" -"[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol](https://github." -"com/raselmandol)." +"[بنگالی](https://google.github.io/comprehensive-rust/bn/) توسط [@raselmandol]" +"(https://github.com/raselmandol)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://github.com/" -"alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp](https://github.com/" -"hamidrezakp), [@javad-jafari](https://github.com/javad-jafari) and [@moaminsharifi](https://" -"github.com/moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" +"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " +"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" +"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" +"moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich](https://" -"github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), [@mingyc](https://github." -"com/mingyc), [@kuanhungchen](https://github.com/kuanhungchen) و [@johnathan79717](https://" -"github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://github.com/" -"KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont](https://github.com/" -"AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" +"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" -"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS](https://github.com/" -"KookaS) و [@vcaen](https://github.com/vcaen)." +"[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" +"(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://github.com/" -"Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" +"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://github.com/" -"Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" +"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder](https://" -"github.com/henrythebuilder) and [@detro](https://github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by " +"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" +"github.com/detro)." msgstr "" -"[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://github.com/" -"Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" +"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available either [as of their " -"last update](https://google.github.io/comprehensive-rust/translation-report.html) or [synced " -"to the latest version of the course](https://google.github.io/comprehensive-rust/synced-" -"translation-report.html)." +"The full list of translations with their current status is also available " +"either [as of their last update](https://google.github.io/comprehensive-rust/" +"translation-report.html) or [synced to the latest version of the course]" +"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" #: src/running-the-course/translations.md msgid "" -"If you want to help with this effort, please see [our instructions](https://github.com/google/" -"comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get going. Translations are " -"coordinated on the [issue tracker](https://github.com/google/comprehensive-rust/issues/282)." +"If you want to help with this effort, please see [our instructions](https://" +"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " +"get going. Translations are coordinated on the [issue tracker](https://" +"github.com/google/comprehensive-rust/issues/282)." msgstr "" -"اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/google/" -"comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار ببینید. ترجمه ها در " -"[issue tracker](https://github.com/google/comprehensive-rust/issues/282) هماهنگ و کنترل می " -"شوند." +"اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" +"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " +"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" +"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-lang.org/" -"cargo/), the standard tool used in the Rust ecosystem to build and run Rust applications. Here " -"we want to give a brief overview of what Cargo is and how it fits into the wider ecosystem and " -"how it fits into this training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc." +"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " +"and run Rust applications. Here we want to give a brief overview of what " +"Cargo is and how it fits into the wider ecosystem and how it fits into this " +"training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-lang.org/" -"cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه های Rust استفاده می " -"شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در مورد کارگو و نحوه انطباق آن با " -"اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." +"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " +"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " +"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " +"را در این آموزش ارائه دهیم." #: src/cargo.md msgid "Installation" @@ -2082,159 +2190,179 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will pass them to `rustc` when building your " -"project. Cargo also comes with a built-in test runner which is used to execute unit tests." +"`rustc`: the Rust compiler which turns `.rs` files into binaries and other " +"intermediate formats." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها را که معمولاً " -"در میزبانی می شوند دانلود کند و هنگام ساخت پروژه آنها را به `rustc` منتقل " -"می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." +"`rustc`: کامپایلر Rust که فایل‌های `.rs` را به باینری و سایر فرمت‌های میانی " +"تبدیل می‌کند." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to install and update " -"`rustc` and `cargo` when new versions of Rust are released. In addition, `rustup` can also " -"download documentation for the standard library. You can have multiple versions of Rust " -"installed at once and `rustup` will let you switch between them as needed." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to " +"download dependencies, usually hosted on , and it will " +"pass them to `rustc` when building your project. Cargo also comes with a " +"built-in test runner which is used to execute unit tests." msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز رسانی " -"\"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. علاوه بر این، " -"\"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود کند. شما می توانید چندین " -"نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها " -"تغییر دهید." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " +"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " +"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " +"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." -#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md src/references/exclusive.md -#: src/memory-management/move.md src/error-handling/try.md src/android/setup.md +#: src/cargo/rust-ecosystem.md +msgid "" +"`rustup`: the Rust toolchain installer and updater. This tool is used to " +"install and update `rustc` and `cargo` when new versions of Rust are " +"released. In addition, `rustup` can also download documentation for the " +"standard library. You can have multiple versions of Rust installed at once " +"and `rustup` will let you switch between them as needed." +msgstr "" +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " +"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " +"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " +"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " +"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." + +#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md +#: src/references/exclusive.md src/memory-management/move.md +#: src/error-handling/try.md src/android/setup.md #: src/concurrency/async/async-await.md msgid "Key points:" msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six weeks. New releases " -"maintain backwards compatibility with old releases --- plus they enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six " +"weeks. New releases maintain backwards compatibility with old releases --- " +"plus they enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر می شود. " -"نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " +"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " +"علاوه قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "" +"There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" every six " -"weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes " +"\"stable\" every six weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته \"stable\" می " -"شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " +"هفته \"stable\" می شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc.rust-lang.org/" -"cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc." +"rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" -"همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/reference/" -"registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." +"همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" +"reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current edition is " -"Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " +"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه فعلی Rust " -"2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " +"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md -msgid "The editions are allowed to make backwards incompatible changes to the language." +msgid "" +"The editions are allowed to make backwards incompatible changes to the " +"language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for your crate via the " -"`Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for " +"your crate via the `Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد نظر برای crate " -"خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " +"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" -"To avoid splitting the ecosystem, Rust compilers can mix code written for different editions." +"To avoid splitting the ecosystem, Rust compilers can mix code written for " +"different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای نسخه های " -"مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " +"برای نسخه های مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" -"Mention that it is quite rare to ever use the compiler directly not through `cargo` (most " -"users never do)." +"Mention that it is quite rare to ever use the compiler directly not through " +"`cargo` (most users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` بسیار " -"غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " +"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" -"It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool. " -"It is capable of many advanced features including but not limited to:" +"It might be worth alluding that Cargo itself is an extremely powerful and " +"comprehensive tool. It is capable of many advanced features including but " +"not limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است که قادر به " -"بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " +"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2242,31 +2370,42 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "" +"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" msgstr "وابستگی های Dev و وابستگی‌های Runtime Management/Caching" #: src/cargo/rust-ecosystem.md -msgid "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" -msgstr "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +msgid "" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" +msgstr "" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" #: src/cargo/rust-ecosystem.md -msgid "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" -msgstr "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +msgid "" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" +msgstr "" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo clippy](https://github." -"com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo " +"clippy](https://github.com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/rust-clippy)) " -"قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" +"lang/rust-clippy)) قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "" +"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "" +"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2274,23 +2413,23 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" -"For this training, we will mostly explore the Rust language through examples which can be " -"executed through your browser. This makes the setup much easier and ensures a consistent " -"experience for everyone." +"For this training, we will mostly explore the Rust language through examples " +"which can be executed through your browser. This makes the setup much easier " +"and ensures a consistent experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر شما اجرا کرد، " -"بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه ای ثابت را برای همه تضمین می " -"کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " +"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " +"کند و تجربه ای ثابت را برای همه تضمین می کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do the exercises. On " -"the last day, we will do a larger exercise which shows you how to work with dependencies and " -"for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do " +"the exercises. On the last day, we will do a larger exercise which shows you " +"how to work with dependencies and for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. در روز آخر، " -"تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با وابستگی ها کار کنید و برای " -"این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " +"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " +"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2302,34 +2441,36 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy -msgid "You can use Ctrl + Enter to execute the code when focus is in the text box." +msgid "" +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md msgid "" -"Most code samples are editable like shown above. A few code samples are not editable for " -"various reasons:" +"Most code samples are editable like shown above. A few code samples are not " +"editable for various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به دلایل مختلف " -"قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " +"کد به دلایل مختلف قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open it in the " -"real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " +"open it in the real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و آن را در " -"Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " +"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from the page! This is " -"the reason that the students should solve the exercises using a local Rust installation or via " -"the Playground." +"The embedded playgrounds lose their state the moment you navigate away from " +"the page! This is the reason that the students should solve the exercises " +"using a local Rust installation or via the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را از دست می " -"دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از local Rust installation یا " -"از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " +"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " +"استفاده از local Rust installation یا از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2337,48 +2478,60 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will need to first " -"install Rust. Do this by following the [instructions in the Rust Book](https://doc.rust-lang." -"org/book/ch01-01-installation.html). This should give you a working `rustc` and `cargo`. At " -"the time of writing, the latest stable Rust release has these version numbers:" +"If you want to experiment with the code on your own system, then you will " +"need to first install Rust. Do this by following the [instructions in the " +"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " +"should give you a working `rustc` and `cargo`. At the time of writing, the " +"latest stable Rust release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این کار را با " -"دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/book/ch01-01-installation." -"html) انجام دهید. این باید به شما یک `rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه " -"پایدار Rust دارای این version numberها است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " +"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" +"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " +"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " +"این version numberها است:" #: src/cargo/running-locally.md -msgid "You can use any later version too since Rust maintains backwards compatibility." +msgid "" +"You can use any later version too since Rust maintains backwards " +"compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های قبلی را حفظ " -"می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " +"های قبلی را حفظ می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of the examples in this " -"training:" +"With this in place, follow these steps to build a Rust binary from one of " +"the examples in this training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " +"باینری Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "" +"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md -msgid "Use `cargo new exercise` to create a new `exercise/` directory for your code:" -msgstr "از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده کنید:" +msgid "" +"Use `cargo new exercise` to create a new `exercise/` directory for your code:" +msgstr "" +"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " +"استفاده کنید:" #: src/cargo/running-locally.md -msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" -msgstr "به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" +msgid "" +"Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgstr "" +"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " +"کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For example, using the " -"example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For " +"example, using the example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از مثال در صفحه " -"قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " +"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2386,47 +2539,55 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo build` to compile it " -"without running it. You will find the output in `target/debug/` for a normal debug build. Use " -"`cargo build --release` to produce an optimized release build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo " +"build` to compile it without running it. You will find the output in `target/" +"debug/` for a normal debug build. Use `cargo build --release` to produce an " +"optimized release build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo build` برای " -"کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای ساخت اشکال زدایی معمولی " -"خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/release/` از `cargo build --release` " -"استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " +"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" +"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " +"شده در `target/release/` از `cargo build --release` استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you run `cargo` " -"commands, it will automatically download and compile missing dependencies for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you " +"run `cargo` commands, it will automatically download and compile missing " +"dependencies for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که دستورات " -"`cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما دانلود و کامپایل " -"می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " +"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " +"نیاز را برای شما دانلود و کامپایل می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local editor. It will make " -"their life easier since they will have a normal development environment." +"Try to encourage the class participants to install Cargo and use a local " +"editor. It will make their life easier since they will have a normal " +"development environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر محلی استفاده " -"کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " +"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " +"محیط توسعه عادی خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md -msgid "This is the first day of Rust Fundamentals. We will cover a lot of ground today:" -msgstr "این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" +msgid "" +"This is the first day of Rust Fundamentals. We will cover a lot of ground " +"today:" +msgstr "" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " +"داد:" #: src/welcome-day-1.md msgid "" -"Basic Rust syntax: variables, scalar and compound types, enums, structs, references, " -"functions, and methods." +"Basic Rust syntax: variables, scalar and compound types, enums, structs, " +"references, functions, and methods." msgstr "" -" سینتکس‌های مقدماتی: متغیرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, مراجع, توابع, و " -"متدها." +" سینتکس‌های مقدماتی: متغیرها, تایپ‌های عددی و تایپ‌های مرکب, enums, structs, " +"مراجع, توابع, و متدها." #: src/welcome-day-1.md msgid "Types and type inference." @@ -2444,113 +2605,136 @@ msgstr "تایپ های تعریف شده توسط کاربر: ساختارها msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." -#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md -#: src/concurrency/welcome.md src/concurrency/welcome-async.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. It contains:" -msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 5 " +"minutes. It contains:" +msgstr "" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "They should ask questions when they get them, don't save them to the end." -msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "" +"They should ask questions when they get them, don't save them to the end." +msgstr "" +"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md -msgid "The class is meant to be interactive and discussions are very much encouraged!" +msgid "" +"The class is meant to be interactive and discussions are very much " +"encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., keep the discussions " -"related to how Rust does things vs some other language. It can be hard to find the right " -"balance, but err on the side of allowing discussions since they engage people much more than " -"one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., " +"keep the discussions related to how Rust does things vs some other language. " +"It can be hard to find the right balance, but err on the side of allowing " +"discussions since they engage people much more than one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های مرتبط با نحوه " -"انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا کردن تعادل مناسب می تواند " -"سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد " -"را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " +"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " +"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " +"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." #: src/welcome-day-1.md -msgid "The questions will likely mean that we talk about things ahead of the slides." -msgstr "احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." +msgid "" +"The questions will likely mean that we talk about things ahead of the slides." +msgstr "" +"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " +"کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. Remember that the slides " -"are just a support and you are free to skip them as you like." +"This is perfectly okay! Repetition is an important part of learning. " +"Remember that the slides are just a support and you are free to skip them as " +"you like." msgstr "" -"این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که اسلایدها فقط یک " -"پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف نظر کنید." +"این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " +"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " +"صرف نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that should have immediate " -"parallels in other languages. The more advanced parts of Rust come on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that " +"should have immediate parallels in other languages. The more advanced parts " +"of Rust come on the subsequent days." msgstr "" -"ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر مشابهت های فوری " -"داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." +"ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " +"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " +"شوند." #: src/welcome-day-1.md msgid "" -"If you're teaching this in a classroom, this is a good place to go over the schedule. Note " -"that there is an exercise at the end of each segment, followed by a break. Plan to cover the " -"exercise solution after the break. The times listed here are a suggestion in order to keep the " -"course on schedule. Feel free to be flexible and adjust as necessary!" +"If you're teaching this in a classroom, this is a good place to go over the " +"schedule. Note that there is an exercise at the end of each segment, " +"followed by a break. Plan to cover the exercise solution after the break. " +"The times listed here are a suggestion in order to keep the course on " +"schedule. Feel free to be flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه داشته باشید " -"که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن محلول تمرین بعد از " -"استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با " -"خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " +"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " +"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " +"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " +"باشید و در صورت لزوم تنظیم کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شامل:" -#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md -#: src/references.md src/user-defined-types.md src/pattern-matching.md src/methods-and-traits.md -#: src/generics.md src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md -#: src/testing.md src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md -#: src/concurrency/channels.md src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md +#: src/tuples-and-arrays.md src/references.md src/user-defined-types.md +#: src/pattern-matching.md src/methods-and-traits.md src/generics.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md #: src/concurrency/sync-exercises.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" -#: src/hello-world.md src/references.md src/user-defined-types.md src/pattern-matching.md -#: src/methods-and-traits.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/borrowing.md src/lifetimes.md -#: src/modules.md src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md -#: src/concurrency/shared-state.md src/concurrency/async.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md +#: src/hello-world.md src/references.md src/user-defined-types.md +#: src/pattern-matching.md src/methods-and-traits.md src/generics.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015](https://blog.rust-lang." -"org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://blog.rust-lang." -"org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" -msgstr "زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." +msgstr "" +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2558,11 +2742,11 @@ msgstr "`rustc` از `LLVM` به عنوان بک‌اند خود استفاده #: src/hello-world/what-is-rust.md msgid "" -"Rust supports many [platforms and architectures](https://doc.rust-lang.org/nightly/rustc/" -"platform-support.html):" +"Rust supports many [platforms and architectures](https://doc.rust-lang.org/" +"nightly/rustc/platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/platform-" -"support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" +"rustc/platform-support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2609,7 +2793,8 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "Can be scaled down to very constrained devices such as microcontrollers." +msgid "" +"Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2625,8 +2810,12 @@ msgid "Some unique selling points of Rust:" msgstr "برخی از نقاط قوت منحصر به فرد زبان Rust:" #: src/hello-world/benefits.md -msgid "_Compile time memory safety_ - whole classes of memory bugs are prevented at compile time" -msgstr "_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" +msgid "" +"_Compile time memory safety_ - whole classes of memory bugs are prevented at " +"compile time" +msgstr "" +"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " +"می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2657,9 +2846,12 @@ msgid "No iterator invalidation." msgstr "تکرارکننده‌ها (`iterators`) هیچگاه نامعتبر نمی‌شوند.." #: src/hello-world/benefits.md -msgid "_No undefined runtime behavior_ - what a Rust statement does is never left unspecified" +msgid "" +"_No undefined runtime behavior_ - what a Rust statement does is never left " +"unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " +"نامشخص باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2670,8 +2862,11 @@ msgid "Integer overflow is defined (panic or wrap-around)." msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wrap-around`)." #: src/hello-world/benefits.md -msgid "_Modern language features_ - as expressive and ergonomic as higher-level languages" -msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +msgid "" +"_Modern language features_ - as expressive and ergonomic as higher-level " +"languages" +msgstr "" +"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2706,92 +2901,111 @@ msgid "Excellent Language Server Protocol support." msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md -msgid "Do not spend much time here. All of these points will be covered in more depth later." -msgstr "وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." +msgid "" +"Do not spend much time here. All of these points will be covered in more " +"depth later." +msgstr "" +"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " +"خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. Depending on the answer " -"you can highlight different features of Rust:" +"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 " -"را برجسته کنید::" +"حتما از کلاس بپرسید که با چه زبان‌هایی تجربه دارند. بسته به پاسخ، می توانید " +"ویژگی‌های مختلف Rust را برجسته کنید::" #: src/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via the borrow " -"checker. You get performance like in C and C++, but you don't have the memory unsafety issues. " -"In addition, you get a modern language with constructs like pattern matching and built-in " -"dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " +"via the borrow checker. You get performance like in C and C++, but you don't " +"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++ را دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر " -"این، شما یک زبان مدرن با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"تجربه با C یا C++ : زبان Rust با استفاده از بررسی کننده " +"قرض‌گیری (اشاره به مبحث قرض گرفتن یا `borrow`) ، یک سری کامل از _خطاهای زمان " +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " +"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " +"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory safety as in those " -"languages, plus a similar high-level language feeling. In 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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory " +"safety as in those languages, plus a similar high-level language feeling. In " +"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++ (بدون جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین " -"(در صورت نیاز) دریافت می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن " +"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " +"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " +"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " +"می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run short Rust " -"programs, and is the basis for the examples and exercises in this course. Try running the " -"\"hello-world\" program it starts with. It comes with a few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " +"run short Rust programs, and is the basis for the examples and exercises in " +"this course. Try running the \"hello-world\" program it starts with. It " +"comes with a few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های Rust کوتاه " -"ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه \"Hello-world\" را که با " -"آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " +"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " +"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " +"مفید است:" #: src/hello-world/playground.md -msgid "Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" way." +msgid "" +"Under \"Tools\", use the `rustfmt` option to format your code in the " +"\"standard\" way." msgstr "" -"در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش \"استاندارد\" استفاده " -"کنید." +"در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " +"\"استاندارد\" استفاده کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, less " -"optimization) and Release (fewer runtime checks, lots of optimization). These are accessible " -"under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime " +"checks, less optimization) and Release (fewer runtime checks, lots of " +"optimization). These are accessible under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، بهینه سازی " -"کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در قسمت «اشکال‌زدایی» در " -"بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " +"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " +"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." #: src/hello-world/playground.md -msgid "If you're interested, use \"ASM\" under \"...\" to see the generated assembly code." +msgid "" +"If you're interested, use \"ASM\" under \"...\" to see the generated " +"assembly code." msgstr "" -"اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده استفاده کنید." +"اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " +"استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground and experiment a " -"little. Encourage them to keep the tab open and try things out during the rest of the course. " -"This is particularly helpful for advanced students who want to know more about Rust's " -"optimizations or generated assembly." +"As students head into the break, encourage them to open up the playground " +"and experiment a little. Encourage them to keep the tab open and try things " +"out during the rest of the course. This is particularly helpful for advanced " +"students who want to know more about Rust's optimizations or generated " +"assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground را باز کنند و " -"کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در بقیه دوره چیزهایی را امتحان " -"کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید " -"شده بیشتر بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " +"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " +"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " +"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " +"بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" msgstr "این بخش باید حدود ۴۰ دقیقه طول بکشد. آن شامل:" #: src/types-and-values/hello-world.md -msgid "Let us jump into the simplest possible Rust program, a classic Hello World program:" -msgstr "بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" +msgid "" +"Let us jump into the simplest possible Rust program, a classic Hello World " +"program:" +msgstr "" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " +"بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -2807,7 +3021,9 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." -msgstr "بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." +msgstr "" +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " +"می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -2816,27 +3032,32 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک " +"نمونه از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." -msgstr "رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." +msgstr "" +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " +"باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will see a ton of it " -"over the next four days so we start small with something familiar." +"This slide tries to make the students comfortable with Rust code. They will " +"see a ton of it over the next four days so we start small with something " +"familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده خیلی از این " -"کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " +"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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." +"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) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه " +"کاملاً ضروری باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -2844,40 +3065,46 @@ msgstr "زبان Rust, یک زبان مدرن با پشتیبانی کامل ا #: src/types-and-values/hello-world.md msgid "" -"Rust uses macros for situations where you want to have a variable number of arguments (no " -"function [overloading](../control-flow-basics/functions.md))." +"Rust uses macros for situations where you want to have a variable number of " +"arguments (no function [overloading](../control-flow-basics/functions.md))." msgstr "" -"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از آرگومان‌ها داشته " -"باشید (بدون [اورلودینگ](../control-flow-basics/functions.md) تابع)." +"Rust از ماکروها برای موقعیت‌هایی استفاده می‌کند که می‌خواهید تعداد متغیری از " +"آرگومان‌ها داشته باشید (بدون [اورلودینگ](../control-flow-basics/functions.md) " +"تابع)." #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers from the scope they " -"are used in. Rust macros are actually only [partially hygienic](https://veykril.github.io/" -"tlborm/decl-macros/minutiae/hygiene.html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers " +"from the scope they are used in. Rust macros are actually only [partially " +"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." +"html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را از اسکوپ‌ای " -"که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا حدی هاجنیک](https://" -"veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " +"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented programming features]" -"(https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented " +"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " +"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) است." +"زبان Rust, یک زبان چند پارادایمی است. به عنوان مثال، دارای ویژگی‌های قدرتمند " +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " +"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم " +"فانکشنال](https://doc.rust-lang.org/book/ch13-00-functional-features.html) " +"است." #: src/types-and-values/variables.md -msgid "Rust provides type safety via static typing. Variable bindings are made with `let`:" +msgid "" +"Rust provides type safety via static typing. Variable bindings are made with " +"`let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض تعریف متغییر " -"ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " +"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -2894,23 +3121,29 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by default. Add the `mut` " -"keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by " +"default. Add the `mut` keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را حذف کنید. " -"برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " +"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile time, but type " -"inference (covered later) allows the programmer to omit it in many cases." +"The `i32` here is the type of the variable. This must be known at compile " +"time, but type inference (covered later) allows the programmer to omit it in " +"many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج نوع (که بعداً " -"پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " +"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " +"بسیاری از موارد آن را حذف کند." #: src/types-and-values/values.md -msgid "Here are some basic built-in types, and the syntax for literal values of each type." -msgstr "در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." +msgid "" +"Here are some basic built-in types, and the syntax for literal values of " +"each type." +msgstr "" +"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " +"است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -2931,8 +3164,8 @@ msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" #: src/types-and-values/values.md msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "" -"-10, 0, 1_000, 123_i64" +"-10, 0, 1_000, 123_i64" #: src/types-and-values/values.md msgid "Unsigned integers" @@ -2945,8 +3178,8 @@ msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" #: src/types-and-values/values.md msgid "`0`, `123`, `10_u16`" msgstr "" -"0, 123, 10_u16" +"0, 123, 10_u16" #: src/types-and-values/values.md msgid "Floating point numbers" @@ -2959,8 +3192,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, 2_f32" +"3.14, -10.0e20, 2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3012,13 +3245,14 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" -"All underscores in numbers can be left out, they are for legibility only. So `1_000` can be " -"written as `1000` (or `10_00`), and `123_i64` can be written as `123i64`." +"All underscores in numbers can be left out, they are for legibility only. So " +"`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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3026,12 +3260,13 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the meaning should be " -"clear: it takes three integers, and returns an integer. Functions will be covered in more " -"detail later." +"This is the first time we've seen a function other than `main`, but the " +"meaning should be clear: it takes three integers, and returns an integer. " +"Functions will be covered in more detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: سه عدد صحیح " -"می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " +"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " +"بیشتر پوشش داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3040,31 +3275,34 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #: src/types-and-values/arithmetic.md #, fuzzy msgid "" -"What about integer overflow? In C and C++ overflow of _signed_ integers is actually undefined, " -"and might do unknown things at runtime. In Rust, it's defined." +"What about integer overflow? In C and C++ overflow of _signed_ integers is " +"actually undefined, and might do unknown things at runtime. In Rust, it's " +"defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف نشده است و " -"ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " +"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " +"مختلف انجام دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in a debug " -"build and wraps in a release build. There are other options, such as overflowing, saturating, " -"and carrying. These are accessed with method syntax, e.g., `(a * b).saturating_add(b * c)." -"saturating_add(c * a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics " +"(checked) in a debug build and wraps in a release build. There are other " +"options, such as overflowing, saturating, and carrying. These are accessed " +"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " +"a)`." msgstr "" -"«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت اشکال‌زدایی وحشت " -"می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری مانند سرریز، اشباع و حمل وجود " -"دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان مثال، `(a * b).saturating_add(b * c)." -"saturating_add(c *a)`." +"«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " +"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " +"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " +"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is why the example " -"requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is " +"why the example requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به یک تابع " -"جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " +"مثال به یک تابع جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3072,32 +3310,35 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on constraints given by " -"variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on " +"constraints given by variable declarations and usages." msgstr "" -"این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های متغیر، انواع را " -"استنتاج می‌کند. " +"این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " +"متغیر، انواع را استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not of some sort of " -"dynamic \"any type\" that can hold any data. The machine code generated by such declaration is " -"identical to the explicit declaration of a type. The compiler does the job for us and helps us " -"write more concise code." +"It is very important to emphasize that variables declared like this are not " +"of some sort of dynamic \"any type\" that can hold any data. The machine " +"code generated by such declaration is identical to the explicit declaration " +"of a type. The compiler does the job for us and helps us write more concise " +"code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده پویای `any`» " -"نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** استفاده می‌کنیم در واقع مشابه " -"زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط " -"با استفاده از تعیین تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " +"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " +"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " +"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " +"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to `i32`. This sometimes " -"appears as `{integer}` in error messages. Similarly, floating-point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to " +"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " +"floating-point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» قرار می " -"گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به طور مشابه، تایپ ممیز " -"شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " +"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " +"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3105,18 +3346,20 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is calculated " -"recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی به عنوان " -"مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " +"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will this function " -"panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " +"will this function panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " +"panic می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3154,11 +3397,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-" -"expressions) exactly like `if` statements in other languages:" +"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) " -"رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3174,11 +3417,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each block becomes the " -"value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " +"هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3194,26 +3437,30 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its branch blocks must " -"have the same type. Show what happens if you add `;` after `\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its " +"branch blocks must have the same type. Show what happens if you add `;` " +"after `\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و `else`) باید از " -"نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` در مثال دوم `;` اضافه کنید، چه " -"اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " +"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " +"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. For example, when " -"it is used in a `let` statement, the statement must be terminated with a `;` as well. Remove " -"the `;` before `println!` to see the compiler error." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از عبارت بعدی " -"جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " +"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " +"کامپایلر را ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "" +"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3221,12 +3468,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-" -"loops) works much like in other languages, executing the loop body as long as the condition is " -"true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) works much like in other languages, executing the " +"loop body as long as the condition is true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-" -"loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3234,11 +3481,11 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over ranges of " -"values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " +"over ranges of values or the items in a collection:" msgstr "" -"حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از مقادیر یا موارد " -"موجود در یک مجموعه تکرار می‌شود:" +"حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " +"مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" #: src/control-flow-basics/loops/for.md msgid "\"elem: {elem}\"" @@ -3246,28 +3493,30 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle iterating over " -"different kinds of ranges/collections. Iterators will be discussed in more detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle " +"iterating over different kinds of ranges/collections. Iterators will be " +"discussed in more detail later." msgstr "" -"حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع مختلف محدوده/" -"مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار خواهند گرفت." +"حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " +"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " +"قرار خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for an inclusive " -"range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک محدوده فراگیر " -"نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " +"یک محدوده فراگیر نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" -"The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just loops forever, " -"until a `break`." +"The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " +"loops forever, until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که یک «break» " -"ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " +"زمانی که یک «break» ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3275,26 +3524,29 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#continue-expressions)." +"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) استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc." +"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " +"استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang.org/reference/" -"expressions/loop-expr.html#break-expressions). With `loop`, this can take an optional " -"expression that becomes the value of the `loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " +"`loop`, this can take an optional expression that becomes the value of the " +"`loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/reference/" -"expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md -#: src/borrowing/interior-mutability.md src/modules/exercise.md src/modules/solution.md -#: src/android/build-rules/library.md src/android/interoperability/cpp/rust-bridge.md +#: src/borrowing/interior-mutability.md src/modules/exercise.md +#: src/modules/solution.md src/android/build-rules/library.md +#: src/android/interoperability/cpp/rust-bridge.md #: src/concurrency/async-pitfalls/cancellation.md msgid "\"{}\"" msgstr "\"{}\"" @@ -3302,20 +3554,22 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-trivial value. This is " -"because it's guaranteed to only return at a `break` statement (unlike `while` and `for` loops, " -"which can also return when the condition fails)." +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را برمی‌گرداند. این " -"به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " +"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " +"(برخلاف حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is used to break out of " -"nested loops:" +"Both `continue` and `break` can optionally take a label argument which is " +"used to break out of nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب (label) " -"بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " +"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3327,38 +3581,43 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each block has a " -"value and a type, which are those of the last expression of the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " +"Each block has a value and a type, which are those of the last expression of " +"the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. هر بلوک دارای " -"یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " +"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md -msgid "If the last expression ends with `;`, then the resulting value and type is `()`." +msgid "" +"If the last expression ends with `;`, then the resulting value and type is " +"`()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال " -"کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر " +"می‌کند. به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید " +"واژه `return` تغییرات را اعمال کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محاصره‌کننده آن است." #: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "You can shadow variables, both those from outer scopes and variables from the same scope:" +msgid "" +"You can shadow variables, both those from outer scopes and variables from " +"the same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم متغیرهایی که " -"از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " +"هم متغیرهایی که از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3383,21 +3642,22 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block in the last " -"example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block " +"in the last example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در خارج از بلوک، " -"نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " +"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both variables' memory locations " -"exist at the same time. Both are available under the same name, depending where you use it in " -"the code." +"Shadowing is different from mutation, because after shadowing both " +"variables' memory locations exist at the same time. Both are available under " +"the same name, depending where you use it in the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور همزمان وجود " -"دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " +"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " +"کد استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3405,93 +3665,107 @@ msgstr "یک متغیر سایه‌دار می تواند انواع داده‌ #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Shadowing looks obscure at first, but is convenient for holding on to values after `.unwrap()`." +"Shadowing looks obscure at first, but is convenient for holding on to values " +"after `.unwrap()`." msgstr "" -"سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `." -"unwrap()` مناسب است." +"سایه زدن در ابتدا مبهم به نظر می رسد، اما برای نگه داشتن مقادیر پس از `.unwrap()` مناسب است." #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some programming languages), " -"then a return type." +"Declaration parameters are followed by a type (the reverse of some " +"programming languages), then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی از زبان‌های " -"برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " +"برخی از زبان‌های برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return value. Simply omit " -"the `;` at the end of the expression. The `return` keyword can be used for early return, but " -"the \"bare value\" form is idiomatic at the end of a function (refactor `gcd` to use a " -"`return`)." +"The last expression in a function body (or any block) becomes the return " +"value. Simply omit the `;` at the end of the expression. The `return` " +"keyword can be used for early return, but the \"bare value\" form is " +"idiomatic at the end of a function (refactor `gcd` to use a `return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته می‌شود. به همین " -"سادگی `;` را میتوان در انتهای عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " +"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " +"عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy msgid "" -"Some functions have no return value, and return the 'unit type', `()`. The compiler will infer " -"this if the return type is omitted." +"Some functions have no return value, and return the 'unit type', `()`. The " +"compiler will infer this if the return type is omitted." msgstr "" -"برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` را برمی‌گردانند. " -"اگر `-> ()` از بخش نوع برگشتی حذف شود، کامپایلر این را استنتاج خواهد کرد " -"که هیچ نوع برگشتی وجود ندارد." +"برخی از توابع هیچ مقدار برگشتی ندارند و «نوع یکه» `()` " +"را برمی‌گردانند. اگر `-> ()` از بخش نوع برگشتی حذف شود، " +"کامپایلر این را استنتاج خواهد کرد که هیچ نوع برگشتی وجود ندارد." #: src/control-flow-basics/functions.md -msgid "Overloading is not supported -- each function has a single implementation." -msgstr "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." +msgid "" +"Overloading is not supported -- each function has a single implementation." +msgstr "" +"بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not supported. Macros can be " -"used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not " +"supported. Macros can be used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. ماکروها را " -"می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " +"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, which will be " -"covered later." +"Always takes a single set of parameter types. These types can be generic, " +"which will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a variable number of " -"arguments. They are distinguished by a `!` at the end. The Rust standard library includes an " -"assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a " +"variable number of arguments. They are distinguished by a `!` at the end. " +"The Rust standard library includes an assortment of useful macros." msgstr "" -"ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از آرگومان‌ها را " -"بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد Rust شامل مجموعه ای از " -"ماکروهای مفید است." +"ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " +"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " +"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" -"`println!(format, ..)` prints a line to standard output, applying formatting described in " -"[`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." +"`println!(format, ..)` prints a line to standard output, applying formatting " +"described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح داده شده در " -"[`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " +"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " +"را اعمال می کند. ." #: src/control-flow-basics/macros.md -msgid "`format!(format, ..)` works just like `println!` but returns the result as a string." +msgid "" +"`format!(format, ..)` works just like `println!` but returns the result as a " +"string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک رشته برمی " -"گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " +"یک رشته برمی گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن را برمی گرداند." #: src/control-flow-basics/macros.md -msgid "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." -msgstr "`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می کند." +msgid "" +"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " +"panic." +msgstr "" +"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " +"panic می کند." #: src/control-flow-basics/macros.md -msgid "`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." +msgid "" +"`unreachable!()` marks a bit of code as unreachable. If executed, it will " +"panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " +"اعدام شود وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3499,40 +3773,49 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and how to use them. " -"Why they are defined as macros, and what they expand to, is not especially critical." +"The takeaway from this section is that these common conveniences exist, and " +"how to use them. Why they are defined as macros, and what they expand to, is " +"not especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. اینکه چرا آنها " -"به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " +"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " +"یابند، بسیار مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe use of derive " -"macros." +"The course does not cover defining macros, but a later section will describe " +"use of derive macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده توضیح داده " -"خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " +"مشتق شده توضیح داده خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy msgid "" -"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is defined as " -"follows, for an arbitrary n1 greater than zero:" +"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " +"defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر تعریف می‌شود، " -"برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " +"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "If _ni_ is 1, then the sequence terminates at _ni_." -msgstr "اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." +msgstr "" +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " +"می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "" +"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." -msgstr "اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgstr "" +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " +"+ ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3571,8 +3854,11 @@ msgid "the sequence terminates." msgstr "دنباله به پایان می‌رسد." #: src/control-flow-basics/exercise.md -msgid "Write a function to calculate the length of the collatz sequence for a given initial `n`." -msgstr "یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." +msgid "" +"Write a function to calculate the length of the collatz sequence for a given " +"initial `n`." +msgstr "" +"یک تابع بنویسید تا طول دنباله Collatz برای یک n اولیه داده شده را محاسبه کند." #: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" @@ -3582,15 +3868,18 @@ msgstr "/// Determine the length of the collatz sequence beginning at `n`.\n" msgid "\"Length: {}\"" msgstr "\"Length: {}\"" -#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md src/welcome-day-3-afternoon.md -#: src/welcome-day-4-afternoon.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md msgid "Welcome Back" msgstr "خوش آمد" #: src/welcome-day-1-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 35 minutes. It contains:" -msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 35 " +"minutes. It contains:" +msgstr "" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " +"آن شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3598,24 +3887,27 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements of the same " -"type `T`. Note that the length of the array is _part of its type_, which means that `[u8; 3]` " -"and `[u8; 4]` are considered two different types. Slices, which have a size determined at " -"runtime, are covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) " +"elements of the same type `T`. Note that the length of the array is _part of " +"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " +"different types. Slices, which have a size determined at runtime, are " +"covered later." msgstr "" -"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت " -"زمان کامپایل) عنصر از نوع یکسان `T` است. توجه داشته باشید که طول آرایه " -"بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر گرفته می‌شوند." +"یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " +"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " +"نظر گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" -"Try accessing an out-of-bounds array element. Array accesses are checked at runtime. Rust can " -"usually optimize these checks away, and they can be avoided using unsafe Rust." +"Try accessing an out-of-bounds array element. Array accesses are checked at " +"runtime. Rust can usually optimize these checks away, and they can be " +"avoided using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در زمان اجرا " -"بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با استفاده از Rust ناایمن از " -"آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " +"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " +"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3623,23 +3915,26 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" -"The `println!` macro asks for the debug implementation with the `?` format parameter: `{}` " -"gives the default output, `{:?}` gives the debug output. Types such as integers and strings " -"implement the default output, but arrays only implement the debug output. This means that we " -"must use debug output here." +"The `println!` macro asks for the debug implementation with the `?` format " +"parameter: `{}` gives the default output, `{:?}` gives the debug output. " +"Types such as integers and strings implement the default output, but arrays " +"only implement the debug output. This means that we must use debug output " +"here." msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده " -"سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، `{:?}` " -"خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، " -"اما آرایه‌ها فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی " -"دیباگ استفاده کنیم." +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " +"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " +"خروجی دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" -"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be easier to read." +"Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " +"easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت «چاپ زیبا» " -"را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک " +"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3651,46 +3946,52 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, e.g. `t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " +"`t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of a return " -"value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies " +"absence of a return value, akin to `void` in other languages." msgstr "" -"تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار بازگشتی است، مشابه " -"`void` در زبان‌های دیگر." +"تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " +"بازگشتی است، مشابه `void` در زبان‌های دیگر." #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه تاپل ها) پشتیبانی می کند." #: src/tuples-and-arrays/iteration.md -msgid "This functionality uses the `IntoIterator` trait, but we haven't covered that yet." -msgstr "این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." +msgid "" +"This functionality uses the `IntoIterator` trait, but we haven't covered " +"that yet." +msgstr "" +"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " +"پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` macros. These " -"are always checked, while debug-only variants like `debug_assert!` compile to nothing in " -"release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" +"` macros. These are always checked, while debug-only variants like " +"`debug_assert!` compile to nothing in release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` وجود دارد. " -"این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند `debug_assert!` در نسخه‌های " -"ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" +"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " +"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" -"When working with tuples and other structured values it's common to want to extract the inner " -"values into local variables. This can be done manually by directly accessing the inner values:" +"When working with tuples and other structured values it's common to want to " +"extract the inner values into local variables. This can be done manually by " +"directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی را در " -"متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به مقادیر داخلی انجام " -"داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " +"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " +"دسترسی مستقیم به مقادیر داخلی انجام داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -3698,45 +3999,47 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger value into its " -"constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger " +"value into its constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در بخش های تشکیل " -"دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " +"در بخش های تشکیل دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" -"The patterns used here are \"irrefutable\", meaning that the compiler can statically verify " -"that the value on the right of `=` has the same structure as the pattern." +"The patterns used here are \"irrefutable\", meaning that the compiler can " +"statically verify that the value on the right of `=` has the same structure " +"as the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می تواند به طور " -"ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " +"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " +"دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, hence why we can also " -"use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, " +"hence why we can also use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو می‌توانیم از " -"«let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " +"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" -"Rust also supports using patterns in conditionals, allowing for equality comparison and " -"destructuring to happen at the same time. This form of pattern matching will be discussed in " -"more detail later." +"Rust also supports using patterns in conditionals, allowing for equality " +"comparison and destructuring to happen at the same time. This form of " +"pattern matching will be discussed in more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و تخریب ساختار " -"را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات بیشتری مورد بحث قرار خواهد " -"گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " +"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " +"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't match the value " -"being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't " +"match the value being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده مطابقت ندارد " -"نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " +"مطابقت‌شده مطابقت ندارد نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -3748,21 +4051,22 @@ msgstr "نوع این متغیر چیست؟" #: src/tuples-and-arrays/exercise.md msgid "" -"Use an array such as the above to write a function `transpose` which will transpose a matrix " -"(turn rows into columns):" +"Use an array such as the above to write a function `transpose` which will " +"transpose a matrix (turn rows into columns):" msgstr "" -"از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` استفاده کنید که یک " -"ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" +"از آرایه‌ای مشابه مثال بالا برای نوشتن تابع `transpose` " +"استفاده کنید که یک ماتریس را جابجا می‌کند (ردیف‌ها را به ستون‌ها تبدیل می‌کند):" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the function. This function " -"only operates on 3x3 matrices." +"Copy the code below to and implement the " +"function. This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و توابع را پیاده‌سازی " -"کنید:" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" -#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md src/unsafe-rust/exercise.md +#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md +#: src/unsafe-rust/exercise.md msgid "// TODO: remove this when you're done with your implementation.\n" msgstr "// TODO: این را زمانی که پیاده‌سازی‌تان تمام شد حذف کنید.\n" @@ -3782,27 +4086,31 @@ msgstr "\"matrix: {:#?}\"" msgid "\"transposed: {:#?}\"" msgstr "\"transposed: {:#?}\"" -#: src/references.md src/smart-pointers.md src/borrowing.md src/concurrency/async-pitfalls.md +#: src/references.md src/smart-pointers.md src/borrowing.md +#: src/concurrency/async-pitfalls.md msgid "This segment should take about 55 minutes. It contains:" msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن شامل:" #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership of the value, and " -"is also called \"borrowing\". Shared references are read-only, and the referenced data cannot " -"change." +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن «قرض» نیز می " -"گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " +"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " +"نمی توانند تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made with the `&` " -"operator. The `*` operator \"dereferences\" a reference, yielding its value." +"A shared reference to a type `T` has type `&T`. A reference value is made " +"with the `&` operator. The `*` operator \"dereferences\" a reference, " +"yielding its value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته می شود. عملگر " -"`*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " +"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " +"دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -3810,101 +4118,116 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) #: src/references/shared.md msgid "" -"A reference is said to \"borrow\" the value it refers to, and this is a good model for " -"students not familiar with pointers: code can use the reference to access the value, but is " -"still \"owned\" by the original variable. The course will get into more detail on ownership in " -"day 3." +"A reference is said to \"borrow\" the value it refers to, and this is a good " +"model for students not familiar with pointers: code can use the reference to " +"access the value, but is still \"owned\" by the original variable. The " +"course will get into more detail on ownership in day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و این مدل خوبی " -"برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع برای دسترسی به مقدار " -"استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در روز 3 به جزئیات بیشتری در مورد " -"مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " +"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " +"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " +"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can be much smaller " -"than the thing they point to. Students familiar with C or C++ will recognize references as " -"pointers. Later parts of the course will cover how Rust prevents the memory-safety bugs that " -"come from using raw pointers." +"References are implemented as pointers, and a key advantage is that they can " +"be much smaller than the thing they point to. Students familiar with C or C+" +"+ will recognize references as pointers. Later parts of the course will " +"cover how Rust prevents the memory-safety bugs that come from using raw " +"pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند بسیار کوچکتر " -"از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ آشنا هستند، مراجع را به " -"عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات " -"ایمنی حافظه ناشی از استفاده از نشانگرهای خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " +"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " +"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " +"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " +"استفاده از نشانگرهای خام جلوگیری می‌کند." #: src/references/shared.md -msgid "Rust does not automatically create references for you - the `&` is always required." -msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgid "" +"Rust does not automatically create references for you - the `&` is always " +"required." +msgstr "" +"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking methods (try `r." -"is_ascii()`). There is no need for an `->` operator like in C++." +"Rust will auto-dereference in some cases, in particular when invoking " +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها (`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " +"متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note that this re-" -"binds `r`, so that it refers to something else. This is different from C++, where assignment " -"to a reference changes the referenced value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " +"Note that this re-binds `r`, so that it refers to something else. This is " +"different from C++, where assignment to a reference changes the referenced " +"value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه داشته باشید " -"که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می کند. این با C++ متفاوت است، " -"جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " +"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " +"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " +"تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if that value was " -"mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if " +"that value was mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن مقدار قابل " -"تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " +"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long enough. Dangling " -"references cannot occur in safe Rust. `x_axis` would return a reference to `point`, but " -"`point` will be deallocated when the function returns, so this will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long " +"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " +"a reference to `point`, but `point` will be deallocated when the function " +"returns, so this will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه کافی عمر می " -"کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک ارجاع به `point` برمی‌گرداند، " -"اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " +"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " +"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " +"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." -msgstr "هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." +msgstr "" +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " +"خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the value they refer " -"to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the " +"value they refer to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند مقداری را که به " -"آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " +"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the value. No other " -"references (shared or exclusive) can exist at the same time, and the referenced value cannot " -"be accessed while the exclusive reference exists. Try making an `&point.0` or changing " -"`point.0` while `x_coord` is alive." +"\"Exclusive\" means that only this reference can be used to access the " +"value. No other references (shared or exclusive) can exist at the same time, " +"and the referenced value cannot be accessed while the exclusive reference " +"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " +"alive." msgstr "" -"\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار استفاده کرد. هیچ " -"مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود داشته باشد، و تا زمانی که مرجع " -"انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، " -"`&point.0` بسازید یا `point.0` را تغییر دهید." +"\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " +"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " +"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " +"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " +"`point.0` را تغییر دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: &mut i32`. " -"The first one represents a shared reference which can be bound to different values, while the " -"second represents an exclusive reference to a mutable value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let " +"x_coord: &mut i32`. The first one represents a shared reference which can be " +"bound to different values, while the second represents an exclusive " +"reference to a mutable value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. مورد اول یک " -"مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در حالی که دومی نشان دهنده یک " -"مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " +"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " +"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -3917,65 +4240,76 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید " -"چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending indexes in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending " +"indexes in brackets." msgstr "" -"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در براکت‌ها، برش " -"(slice) ایجاد می‌کنیم." +"ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " +"براکت‌ها، برش (slice) ایجاد می‌کنیم." #: src/references/slices.md msgid "" -"If the slice starts at index 0, Rust’s range syntax allows us to drop the starting index, " -"meaning that `&a[0..a.len()]` and `&a[..a.len()]` are identical." +"If the slice starts at index 0, Rust’s range syntax allows us to drop the " +"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/references/slices.md -msgid "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are identical." +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/references/slices.md -msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." -msgstr "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` استفاده کنیم." +msgid "" +"To easily create a slice of the full array, we can therefore use `&a[..]`." +msgstr "" +"یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " +"استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) no longer " -"mentions the array length. This allows us to perform computation on slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " +"(`&[i32]`) no longer mentions the array length. This allows us to perform " +"computation on slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. این به ما امکان می‌دهد " -"محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " +"`s` (`&[i32]`) دیگر طول آرایه را " +"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " +"انجام دهیم." #: src/references/slices.md 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." +"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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but the answer is " -"that for memory safety reasons you cannot do it through `a` at this point in the execution, " -"but you can read the data from both `a` and `s` safely. It works before you created the slice, " -"and again after the `println`, when the slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but " +"the answer is that for memory safety reasons you cannot do it through `a` at " +"this point in the execution, but you can read the data from both `a` and `s` " +"safely. It works before you created the slice, and again after the " +"`println`, when the slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، اما پاسخ‌اش " -"این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این " -"مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر دو `a` و `s` به طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش " -"بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " +"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " +"داده‌ها را از هر دو `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -3987,7 +4321,8 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4012,94 +4347,107 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" -"`&str` introduces a string slice, which is an immutable reference to UTF-8 encoded string data " -"stored in a block of memory. String literals (`\"Hello\"`), are stored in the program’s binary." +"`&str` introduces a string slice, which is an immutable reference to UTF-8 " +"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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a " +"`Vec`, it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " +"بایت‌هاست. مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string literal; `String::" -"new()` creates a new empty string, to which string data can be added using the `push()` and " -"`push_str()` methods." +"As with many other types `String::from()` creates a string from a string " +"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()` به آن اضافه شوند." +"مانند بسیاری از انواع دیگر، `String::from()` یک رشته از " +"یک لیترال رشته ایجاد می‌کند. `String::new()` که رشته " +"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md msgid "" -"The `format!()` macro is a convenient way to generate an owned string from dynamic values. It " -"accepts the same format specification as `println!()`." +"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!()` یک راه راحت برای ایجاد یک رشته Owned از مقادیر پویا " -"است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned " +"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"()` است." #: src/references/strings.md msgid "" -"You can borrow `&str` slices from `String` via `&` and optionally range selection. If you " -"select a byte range that is not aligned to character boundaries, the expression will panic. " -"The `chars` iterator iterates over characters and is preferred over trying to get character " -"boundaries right." +"You can borrow `&str` slices from `String` via `&` and optionally range " +"selection. If you select a byte range that is not aligned to character " +"boundaries, the expression will panic. The `chars` iterator iterates over " +"characters and is preferred over trying to get character boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. اگر محدوده " -"بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. تکرار کننده `chars` روی " -"کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " +"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " +"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " +"درست کردن مرزهای کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one that always " -"points to a valid string in memory. Rust `String` is a rough equivalent of `std::string` from " -"C++ (main difference: it can only contain UTF-8 encoded bytes and will never use a small-" -"string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " +"one that always points to a valid string in memory. Rust `String` is a rough " +"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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n\" == \"\\\\n\"`. " -"You can embed double-quotes by using an equal amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`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\"`.شما می‌توانید با استفاده از تعداد " -"برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " +"== \"\\\\n\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " +"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, representing a point as " -"`[f64;3]`. It is up to you to determine the function signatures." +"We will create a few utility functions for 3-dimensional geometry, " +"representing a point as `[f64;3]`. It is up to you to determine the function " +"signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان `[f64;3]` نشان " -"می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " +"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the square\n" +"// Calculate the magnitude of a vector by summing the squares of its " +"coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the " +"square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v.sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " +"`v.sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4130,7 +4478,9 @@ msgid "/// Calculate the magnitude of the given vector.\n" msgstr "/// اندازه‌ی بردار داده شده را محاسبه کنید.\n" #: src/references/solution.md -msgid "/// Change the magnitude of the vector to 1.0 without changing its direction.\n" +msgid "" +"/// Change the magnitude of the vector to 1.0 without changing its " +"direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4145,7 +4495,8 @@ msgstr "‏مانند C و C++، زبان Rust از ساختارهای سفار msgid "\"{} is {} years old\"" msgstr "‏\"{} {} ساله است\"" -#: src/user-defined-types/named-structs.md src/android/interoperability/with-c/bindgen.md +#: src/user-defined-types/named-structs.md +#: src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" msgstr "\"پیتر\"" @@ -4175,38 +4526,47 @@ msgid "Unlike in C++, there is no inheritance between structs." msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری وجود ندارد." #: src/user-defined-types/named-structs.md -msgid "This may be a good time to let people know there are different types of structs." -msgstr "این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." +msgid "" +"This may be a good time to let people know there are different types of " +"structs." +msgstr "" +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " +"دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait on some type " -"but don’t have any data that you want to store in the value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " +"trait on some type but don’t have any data that you want to store in the " +"value itself." msgstr "" -"ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که می‌خواهید یک صفت " -"(trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که بخواهید در خود مقدار ذخیره کنید." +"ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " +"که بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md -msgid "The next slide will introduce Tuple structs, used when the field names are not important." +msgid "" +"The next slide will introduce Tuple structs, used when the field names are " +"not important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده می‌شوند که نام " -"فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " +"استفاده می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" -"If you already have variables with the right names, then you can create the struct using a " -"shorthand." +"If you already have variables with the right names, then you can create the " +"struct using a shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک روش میانبر " -"ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " +"یک روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the old struct without " -"having to explicitly type it all out. It must always be the last element." +"The syntax `..avery` allows us to copy the majority of the fields from the " +"old struct without having to explicitly type it all out. It must always be " +"the last element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم بدون اینکه همه " -"آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " +"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" @@ -4224,15 +4584,17 @@ msgstr "" msgid "\"Ask a rocket scientist at NASA\"" msgstr "\"از یک دانشمند حوزه موشک در ناسا بپرس\"" -#: src/user-defined-types/tuple-structs.md src/android/interoperability/cpp/cpp-bridge.md -#: src/bare-metal/microcontrollers/type-state.md src/concurrency/async-pitfalls/cancellation.md +#: src/user-defined-types/tuple-structs.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/bare-metal/microcontrollers/type-state.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in a primitive type, " -"for example:" +"Newtypes are a great way to encode additional information about the value in " +"a primitive type, for example:" msgstr "" #: src/user-defined-types/tuple-structs.md @@ -4241,20 +4603,20 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have to validate it " -"again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have " +"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single field in the " -"newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " +"single field in the newtype." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for instance using " -"booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " +"for instance using booleans as integers." msgstr "" #: src/user-defined-types/tuple-structs.md @@ -4263,13 +4625,17 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The example is a subtle reference to the [Mars Climate Orbiter](https://en.wikipedia.org/wiki/" -"Mars_Climate_Orbiter) failure." +"The example is a subtle reference to the [Mars Climate Orbiter](https://en." +"wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" #: src/user-defined-types/enums.md -msgid "The `enum` keyword allows the creation of a type which has a few different variants:" -msgstr "کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" +msgid "" +"The `enum` keyword allows the creation of a type which has a few different " +"variants:" +msgstr "" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " +"است:" #: src/user-defined-types/enums.md msgid "// Simple variant\n" @@ -4290,19 +4656,20 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک نوع جمع آوری " -"کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " +"تحت یک نوع جمع آوری کنید." #: src/user-defined-types/enums.md msgid "" -"`Direction` is a type with variants. There are two values of `Direction`: `Direction::Left` " -"and `Direction::Right`." +"`Direction` is a type with variants. There are two values of `Direction`: " +"`Direction::Left` and `Direction::Right`." msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, Rust will store a " -"discriminant so that it knows at runtime which variant is in a `PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, " +"Rust will store a discriminant so that it knows at runtime which variant is " +"in a `PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4311,19 +4678,21 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one with different " -"types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " +"مختلف فیلد (variant payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate structs but then they " -"wouldn’t be the same type as they would if they were all defined in an enum." +"You could even implement the different variants of an enum with separate " +"structs but then they wouldn’t be the same type as they would if they were " +"all defined in an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، اما در آن " -"صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " +"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " +"نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." @@ -4335,50 +4704,61 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use invalid bit patterns " -"to encode the discriminant (the \"niche optimization\"). For example, `Option<&u8>` stores " -"either a pointer to an integer or `NULL` for the `None` variant." +"If the allowed variant values do not cover all bit patterns, it will use " +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md -msgid "You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "" +"You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " +"را کنترل کنید:" #: src/user-defined-types/enums.md -msgid "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." -msgstr "بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا می‌شود." +msgid "" +"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " +"bytes." +msgstr "" +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " +"بایت جا می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md -#: src/memory-management/copy-types.md src/smart-pointers/box.md src/borrowing/shared.md -#: src/error-handling/result.md +#: src/memory-management/copy-types.md src/smart-pointers/box.md +#: src/borrowing/shared.md src/error-handling/result.md msgid "More to Explore" msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md -msgid "Rust has several optimizations it can employ to make enums take up less space." +msgid "" +"Rust has several optimizations it can employ to make enums take up less " +"space." msgstr "" -"زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده توسط`Enum`ها استفاده " -"کند." +"زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " +"توسط`Enum`ها استفاده کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" -"#representation), Rust guarantees that `size_of::()` equals `size_of::>()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" +"option/#representation), Rust guarantees that `size_of::()` equals " +"`size_of::>()`." msgstr "" -"بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::" -"()` برابر با `size_of::>()` است." +"بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" +">()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look like in practice. " -"It's important to note that the compiler provides no guarantees regarding this representation, " -"therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look " +"like in practice. It's important to note that the compiler provides no " +"guarantees regarding this representation, therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر برسد. مهم " -"است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، بنابراین این کاملاً " -"ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " +"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " +"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4387,41 +4767,44 @@ msgstr "" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined wherever they are used:" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده می شوند، درج " -"می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-static.html) " -"these are inlined upon use." +"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)، این موارد " -"هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html)، این موارد هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate `const` values. " -"`const` functions can however be called at runtime." +"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` را می توان در زمان اجرا فراخوانی کرد (بر خلاف " -"تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای " +"تولید مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در " +"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but it is helpful and " -"safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا " +"ارزیابی می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده " +"`static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4429,9 +4812,11 @@ msgstr "" #: src/user-defined-types/static.md msgid "" -"Static variables will live during the whole execution of the program, and therefore will not " -"move:" -msgstr "متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" +"Static variables will live during the whole execution of the program, and " +"therefore will not move:" +msgstr "" +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " +"نمی‌شوند:" #: src/user-defined-types/static.md #, fuzzy @@ -4445,54 +4830,60 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-static.html), " -"these are not inlined upon use and have an actual associated memory location. This is useful " -"for unsafe and embedded code, and the variable lives through the entirety of the program " -"execution. When a globally-scoped value does not have a reason to need object identity, " +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html), these are not inlined upon use and have an actual " +"associated memory location. This is useful for unsafe and embedded code, and " +"the variable lives through the entirety of the program execution. When a " +"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` ترجیح داده می‌شود." +"همانطور که در [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-" +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان " +"حافظه واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل " +"اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " +"استفاده از `const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C+" -"+` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " +"`C++` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as required by types with " -"interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as " +"required by types with interior mutability such as `Mutex`." msgstr "" -"`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با تغییرپذیری داخلی " -"مانند `Mutex` را نیاز دارد." +"`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " +"تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be `Sync`. Interior " -"mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex." -"html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be " +"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html), atomic or similar." 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) نگاه خواهیم کرد." +"از آنجایی که متغیرهای `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/user-defined-types/static.md #, fuzzy msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" -"داده‌های `thread_local` را با ماکروی `std::thread_local` می‌توان ایجاد کرد." +"داده‌های `thread_local` را با ماکروی `std::thread_local` " +"می‌توان ایجاد کرد." #: src/user-defined-types/aliases.md -msgid "A type alias creates a name for another type. The two types can be used interchangeably." +msgid "" +"A type alias creates a name for another type. The two types can be used " +"interchangeably." msgstr "" #: src/user-defined-types/aliases.md @@ -4505,19 +4896,22 @@ msgstr "" #: src/user-defined-types/exercise.md msgid "" -"We will create a data structure to represent an event in an elevator control system. It is up " -"to you to define the types and functions to construct various events. Use `#[derive(Debug)]` " -"to allow the types to be formatted with `{:?}`." +"We will create a data structure to represent an event in an elevator control " +"system. It is up to you to define the types and functions to construct " +"various events. Use `#[derive(Debug)]` to allow the types to be formatted " +"with `{:?}`." msgstr "" #: src/user-defined-types/exercise.md msgid "" -"This exercise only requires creating and populating data structures so that `main` runs " -"without errors. The next part of the course will cover getting data out of these structures." +"This exercise only requires creating and populating data structures so that " +"`main` runs without errors. The next part of the course will cover getting " +"data out of these structures." msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// An event in the elevator system that the controller must react to.\n" +msgid "" +"/// An event in the elevator system that the controller must react to.\n" msgstr "" #: src/user-defined-types/exercise.md @@ -4541,7 +4935,9 @@ msgid "/// The car doors have closed.\n" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md -msgid "/// A directional button was pressed in an elevator lobby on the given floor.\n" +msgid "" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md @@ -4610,8 +5006,12 @@ msgid "Welcome to Day 2" msgstr "به روز ۲ خوش آمدید" #: src/welcome-day-2.md -msgid "Now that we have seen a fair amount of Rust, today will focus on Rust's type system:" -msgstr "اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز خواهیم کرد:" +msgid "" +"Now that we have seen a fair amount of Rust, today will focus on Rust's type " +"system:" +msgstr "" +"اکنون که مقدار زیادی از Rust را دیده ایم، امروز بر روی سیستم تایپ Rust تمرکز " +"خواهیم کرد:" #: src/welcome-day-2.md msgid "Pattern matching: extracting data from structures." @@ -4630,25 +5030,31 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "Standard library types and traits: a tour of Rust's rich standard library." -msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "" +"Standard library types and traits: a tour of Rust's rich standard library." +msgstr "" +"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 10 minutes. It contains:" -msgstr "با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 10 " +"minutes. It contains:" +msgstr "" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " +"این شامل:" -#: src/pattern-matching.md src/std-types.md src/memory-management.md src/error-handling.md +#: src/pattern-matching.md src/std-types.md src/memory-management.md +#: src/error-handling.md msgid "This segment should take about 1 hour. It contains:" msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شامل:" #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت دهید. مقایسه‌ها از " -"بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." +"کلمه کلیدی `match` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " +"دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." #: src/pattern-matching/match.md msgid "The patterns can be simple values, similarly to `switch` in C and C++:" @@ -4666,8 +5072,9 @@ msgstr "" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md -#: src/std-traits/solution.md src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" msgstr "" @@ -4687,11 +5094,13 @@ msgstr "" msgid "\"Moving around\"" msgstr "\"حرکت در اطراف\"" -#: src/pattern-matching/match.md src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'0'" msgstr "" -#: src/pattern-matching/match.md src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'9'" msgstr "" @@ -4709,40 +5118,44 @@ msgstr "" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The expressions _must_ be " -"exhaustive, meaning that it covers every possibility, so `_` is often used as the final catch-" -"all case." +"The `_` pattern is a wildcard pattern which matches any value. The " +"expressions _must_ be exhaustive, meaning that it covers every possibility, " +"so `_` is often used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید جامع باشند، به " -"این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان آخرین حالت برای پوشش تمامی " -"موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " +"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " +"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match باید از یک تایپ " -"باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته باشد. در مثال بالا، تایپ " -"بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " +"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " +"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that can be used " -"within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that " +"can be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش مطابقت " -"استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " +"بخش مطابقت استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد که شرط برقرار " -"باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " +"باشد که شرط برقرار باشد." #: src/pattern-matching/match.md -msgid "You might point out how some specific characters are being used when in a pattern" -msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +msgid "" +"You might point out how some specific characters are being used when in a " +"pattern" +msgstr "" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -4754,7 +5167,8 @@ msgstr "`..` برای تعیین همه محدوده یا تا جایی که م #: src/pattern-matching/match.md msgid "`1..=5` represents an inclusive range" -msgstr "1..=5 نمایانگر یک محدوده خاص است" +msgstr "" +"1..=5 نمایانگر یک محدوده خاص است" #: src/pattern-matching/match.md msgid "`_` is a wild card" @@ -4762,25 +5176,29 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when we wish to " -"concisely express more complex ideas than patterns alone would allow." +"Match guards as a separate syntax feature are important and necessary when " +"we wish to concisely express more complex ideas than patterns alone would " +"allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و ضروری هستند که " -"بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. An `if` expression " -"inside of the branch block (after `=>`) happens after the 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." +"They are not the same as separate `if` expression inside of the match arm. " +"An `if` expression inside of the branch block (after `=>`) happens after the " +"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` اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " +"عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md -msgid "The condition defined in the guard applies to every expression in a pattern with an `|`." +msgid "" +"The condition defined in the guard applies to every expression in a pattern " +"with an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -4813,13 +5231,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to 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." +"The distinction between a capture and a constant expression can be hard to " +"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` تغییر دهید و " -"خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -4827,11 +5245,13 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is how you inspect " -"the structure of your types. Let us start with a simple `enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is " +"how you inspect the structure of your types. Let us start with a simple " +"`enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده شوند. این روش " -"به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " +"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " +"بیایید با یک نوع ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -4847,61 +5267,72 @@ msgstr "" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first arm, `half` is " -"bound to the value inside the `Ok` variant. In the second arm, `msg` is bound to the error " -"message." +"Here we have used the arms to _destructure_ the `Result` value. In the first " +"arm, `half` is bound to the value inside the `Ok` variant. In the second " +"arm, `msg` is bound to the error message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` به مقداری که " -"درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " +"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " +"`msg` به پیام خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md -msgid "The `if`/`else` expression is returning an enum that is later unpacked with a `match`." -msgstr "عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از هم باز می‌شود." +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 msgid "" -"You can try adding a third variant to the enum definition and displaying the errors when " -"running the code. Point out the places where your code is now inexhaustive and how the " -"compiler tries to give you hints." +"You can try adding a third variant to the enum definition and displaying the " +"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` اضافه کنید و نمایش خطاها هنگام اجرای " -"کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش کامپایلر برای ارائه نکاتی " -"به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش " +"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " +"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md -msgid "The values in the enum variants can only be accessed after being pattern matched." +msgid "" +"The values in the enum variants can only be accessed after being pattern " +"matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage the Rust compiler " -"provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage " +"the Rust compiler provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر Rust فراهم " -"می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " +"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " +"شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it in a loop. That " -"won't compile because `msg` is consumed when matched. To fix it, match `&result` instead of " -"`result`. That will make `msg` a reference so it won't be consumed. This [\"match ergonomics\"]" -"(https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you " -"want to support older Rust, replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با استفاده از " -"`match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف می‌شود. برای رفع این " -"مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع " -"باشد و مصرف نشود. این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" -"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از " -"نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it " +"in a loop. That won't compile because `msg` is consumed when matched. To fix " +"it, match `&result` instead of `result`. That will make `msg` a reference so " +"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." +"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " +"support older Rust, replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " +"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " +"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " +"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " +"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" +"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " +"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " +"msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. They are used for " -"pattern matching:" +"Rust has a few control flow constructs which differ from other languages. " +"They are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها برای مطابقت " -"الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " +"ساختارها برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -4917,12 +5348,13 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-let-" -"expressions) lets you execute different code depending on whether a value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" +"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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت دارد، کدهای " -"مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " +"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md msgid "\"slept for {:?}\"" @@ -4930,13 +5362,15 @@ msgstr "" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, use [`let else`]" -"(https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html). The \"else\" case must " -"diverge (`return`, `break`, or panic - anything but falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, " +"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" +"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"- anything but falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc.rust-lang.org/" -"rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، حالت \"else\" باید منحرف " -"شود (مانند `return`، `break`، یا `panic` - به غیر از اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" +"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " +"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " +"- به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -4955,31 +5389,32 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md -#: src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md +#: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/reference/expressions/" -"loop-expr.html#predicate-pattern-loops) variant which repeatedly tests a value against a " -"pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" +"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) وجود دارد که مقادیر مقابل الگو به طور مکرر (تکرار شونده‌ای) " -"بررسی می‌کند:" +"مانند `if let`، یک دستور [`while let`](https://doc.rust-lang.org/reference/" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر " +"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method." -"pop) returns `Some(c)` until the string is empty, after which it will return `None`. The " -"`while let` lets us keep iterating through all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) returns `Some(c)` until the string is empty, after " +"which it will return `None`. The `while let` lets us keep iterating through " +"all items." msgstr "" -"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method." -"pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و پس از آن `None` را باز " -"می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد که به طور مداوم از میان همه موارد " -"عبور کنیم." +"در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " +"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " +"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -4987,21 +5422,25 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make it more concise " -"than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make " +"it more concise than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی نمیکند. اگر " -"می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " +"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " +"کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." -msgstr "یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` است:" +msgstr "" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " +"`Option` است:" #: src/pattern-matching/let-control-flow.md -msgid "Unlike `match`, `if let` does not support guard clauses for pattern matching." +msgid "" +"Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو استفاده " -"نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " +"الگو استفاده نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5009,12 +5448,14 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports flattening this nested " -"code. Rewrite the awkward version for students, so they can see the transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports " +"flattening this nested code. Rewrite the awkward version for students, so " +"they can see the transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده شده است. " -"ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی پیچیده را برای " -"دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " +"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " +"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " +"مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5026,20 +5467,22 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value matches the pattern." +"Point out that the `while let` loop will keep going as long as the value " +"matches the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته باشد (شرط برقرار " -"باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " +"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if statement that breaks " -"when there is no value to unwrap for `name.pop()`. The `while let` provides syntactic sugar " -"for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if " +"statement that breaks when there is no value to unwrap for `name.pop()`. The " +"`while let` provides syntactic sugar for the above scenario." msgstr "" -"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` بازنویسی کنید که در " -"صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، شکسته می‌شود. `while let` یک " -"Syntactic sugar برای این سناریو ارائه می‌دهد." +"شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." +"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " +"می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5047,44 +5490,49 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later in the course. An " -"expression can be \"boxed\" with `Box::new` as seen in the tests. To evaluate a boxed " -"expression, use the deref operator (`*`) to \"unbox\" it: `eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later " +"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " +"tests. To evaluate a boxed expression, use the deref operator (`*`) to " +"\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی قرار خواهد " -"گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور که در تست‌ها مشاهده " -"می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) برای \"باز کردن باکس\" استفاده " -"کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " +"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " +"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" -"Some expressions cannot be evaluated and will return an error. The standard [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) type is an enum that " -"represents either a successful value (`Ok(Value)`) or an error (`Err(String)`). We will cover " -"this type in detail later." +"Some expressions cannot be evaluated and will return an error. The standard " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) type is an enum that represents either a successful value " +"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " +"later." msgstr "" -"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) یک enum است که یا نمایانگر یک " -"مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا (`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در " -"آینده پوشش خواهیم داد." +"برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing `eval`. The final " -"product should pass the tests. It may be helpful to use `todo!()` and get the tests to pass " -"one-by-one. You can also skip a test temporarily with `#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing " +"`eval`. The final product should pass the tests. It may be helpful to use " +"`todo!()` and get the tests to pass one-by-one. You can also skip a test " +"temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. محصول نهایی " -"باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها به صورت تک به تک مفید " -"باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از `[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " +"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " +"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " +"را با استفاده از `[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" -"If you finish early, try writing a test that results in division by zero or integer overflow. " -"How could you handle this with `Result` instead of a panic?" +"If you finish early, try writing a test that results in division by zero or " +"integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز عدد صحیح شود. " -"چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " +"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " +"panic مدیریت کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation to perform on two subexpressions.\n" @@ -5112,10 +5560,11 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with an `impl` block:" +"Rust allows you to associate functions with your new types. You do this with " +"an `impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار را با استفاده " -"از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " +"کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md msgid "// No receiver, a static method\n" @@ -5156,38 +5605,39 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts on. There are " -"several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts " +"on. There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. چندین گیرنده " -"رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " +"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" -"`&self`: borrows the object from the caller using a shared and immutable reference. The object " -"can be used again afterwards." +"`&self`: borrows the object from the caller using a shared and immutable " +"reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض می‌گیرد. شیء " -"می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " +"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"`&mut self`: borrows the object from the caller using a unique and mutable reference. The " -"object can be used again afterwards." +"`&mut self`: borrows the object from the caller using a unique and mutable " +"reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر قرض می‌گیرد. " -"شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " +"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " +"به پایان برسد." #: src/methods-and-traits/methods.md msgid "" -"`self`: takes ownership of the object and moves it away from the caller. The method becomes " -"the owner of the object. The object will be dropped (deallocated) when the method returns, " -"unless its ownership is explicitly transmitted. Complete ownership does not automatically mean " -"mutability." +"`self`: takes ownership of the object and moves it away from the caller. The " +"method becomes the owner of the object. The object will be dropped " +"(deallocated) when the method returns, unless its ownership is explicitly " +"transmitted. Complete ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک شیء می‌شود. " -"شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور صریح منتقل شود. مالکیت " -"کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " +"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " +"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5195,11 +5645,11 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to create constructors " -"which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to " +"create constructors which are called `new` by convention." msgstr "" -"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد سازنده‌ها استفاده " -"می‌شود که به‌طور معمول `new` نامیده می‌شوند." +"بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " +"سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." #: src/methods-and-traits/methods.md msgid "It can be helpful to introduce methods by comparing them to functions." @@ -5207,73 +5657,76 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the first parameter " -"represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the " +"first parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر اول نمونه را " -"به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " +"پارامتر اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver syntax and to help " -"keep them more organized. By using methods we can keep all the implementation code in one " -"predictable place." +"Developers may choose to use methods to take advantage of method receiver " +"syntax and to help keep them more organized. By using methods we can keep " +"all the implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد بهره‌برداری کنند " -"و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم تمامی کدهای پیاده‌سازی را در یک " -"مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " +"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " +"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." -msgstr "استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." +msgstr "" +"استفاده از کلمه کلیدی `self`، که به‌عنوان گیرنده متد عمل می‌کند، را مشخص کنید." #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how the struct name " -"could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how " +"the struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که چگونه نام " -"struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " +"دهید که چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and can be used " -"elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and " +"can be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار دارد و می‌تواند " -"در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " +"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to refer to individual " -"fields." +"Note how `self` is used like other structs and dot notation can be used to " +"refer to individual fields." msgstr "" -"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation می‌تواند برای ارجاع " -"به فیلدهای فردی به کار رود." +"توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " +"می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` by trying to run " -"`finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` " +"by trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش برای اجرای متد " -"`finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " +"تلاش برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://doc.rust-lang.org/" -"reference/special-types-and-traits.html) allowed to be receiver types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://" +"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " +"receiver types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc.rust-lang.org/" -"reference/special-types-and-traits.html) نیز وجود دارند که به‌عنوان تایپ‌های گیرنده مجاز هستند، " -"مانند ` Point {}`? Isn't that redundant?" -msgstr "_سوال:_ چرا `T` در عبارت `{} Point Point {}`? Isn't that " +"redundant?" +msgstr "" +"_سوال:_ چرا `T` در عبارت `{} Point`, but methods in this block will only be " -"available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this " +"block will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type " +"parameters. Here, `Foo::from(\"hello\")` would not compile because there is " +"no `From<&str>` implementation for `Foo`." msgstr "" -"پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، `Foo::" -"from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can " +"be arbitrary, like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه باشد، مانند " -"`() -> B` can return any type satisfying `B`, and the caller may need to choose one, " -"such as with `let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::>()`." +"Inference is hard in return position. A function returning `impl Foo` picks " +"the concrete type it returns, without writing it out in the source. A " +"function returning a generic type like `collect() -> B` can return any " +"type satisfying `B`, and the caller may need to choose one, such as with " +"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" +">()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ مشخصی را که " -"برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. تابعی که تایپ generic " -"مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و " -"ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo." -"collect()` یا با استفاده از ()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " +"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " +"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " +"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " +"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " +"یا با استفاده از ()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the error message " -"shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " +"the error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید پیام خطا چه " -"چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " +"ببینید پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also supports using them " -"for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین از استفاده از " -"آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " +"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " +"اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -5812,77 +6317,86 @@ msgstr "" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a specialized instance of the " -"function for each different type that the generic is instantiated with. This means that " -"calling a trait method from within a generic function still uses static dispatch, as the " -"compiler has full type information and can resolve which type's trait implementation to use." +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از تابع برای هر " -"تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست که فراخوانی یک متد trait از " -"درون یک تابع generic همچنان از فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ " -"را دارد و می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " +"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " +"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " +"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " +"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" -"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual method table]" -"(https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This means that there's a " -"single version of `fn dynamic` that is used regardless of what type of `Pet` is passed in." +"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " +"This means that there's a single version of `fn dynamic` that is used " +"regardless of what type of `Pet` is passed in." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable) استفاده می‌کند. این " -"بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد " -"می‌شود، استفاده می‌شود." +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " +"یک [virtual method table](https://en.wikipedia.org/wiki/" +"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " +"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " +"استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" -"When using `dyn Trait`, the trait object needs to be behind some kind of indirection. In this " -"case it's a reference, though smart pointer types like `Box` can also be used (this will be " -"demonstrated on day 3)." +"When using `dyn Trait`, the trait object needs to be behind some kind of " +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته باشد. در این " -"مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند " -"استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " +"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " +"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " +"سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two pointers: One " -"pointer points to the concrete object that implements `Pet`, and the other points to the " -"vtable for the trait implementation for that type. When calling the `talk` method on `&dyn " -"Pet` the compiler looks up the function pointer for `talk` in the vtable and then invokes the " -"function, passing the pointer to the `Dog` or `Cat` into that function. The compiler doesn't " -"need to know the concrete type of the `Pet` in order to do this." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، یعنی یک جفت " -"از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی می‌کند اشاره دارد و دیگری به " -"vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، " -"کامپایلر آدرس تابع `talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " -"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام " -"این کار ندارد." +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " +"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " +"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " +"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " +"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " +"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " +"`Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md msgid "" -"A `dyn Trait` is considered to be \"type-erased\", because we no longer have compile-time " -"knowledge of what the concrete type is." +"A `dyn Trait` is considered to be \"type-erased\", because we no longer have " +"compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا دیگر در زمان " -"کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " +"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" -"In this short exercise, you will implement a generic `min` function that determines the " -"minimum of two values, using the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." -"html) trait." +"In this short exercise, you will implement a generic `min` function that " +"determines the minimum of two values, using the [`Ord`](https://doc.rust-" +"lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از دو مقدار را " -"تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." -"html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " +"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." +"rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "" -#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "" @@ -5908,11 +6422,13 @@ msgstr "\"آرمادیلو\"" #: src/generics/exercise.md msgid "" -"Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait and " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum." +"Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." +"html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." +"Ordering.html) enum." msgstr "" -"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و [`Ordering`](https://" -"doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را به دانش‌آموزان نشان دهید." +"[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " +"enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -5936,44 +6452,53 @@ msgstr "HashMap" #: src/std-types.md msgid "" -"For each of the slides in this section, spend some time reviewing the documentation pages, " -"highlighting some of the more common methods." +"For each of the slides in this section, spend some time reviewing the " +"documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از متدهای رایج‌تر " -"را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " +"از متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common types used by Rust " -"libraries and programs. This way, two libraries can work together smoothly because they both " -"use the same `String` type." +"Rust comes with a standard library which helps establish a set of common " +"types used by Rust libraries and programs. This way, two libraries can work " +"together smoothly because they both use the same `String` type." msgstr "" -"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج استفاده‌شده توسط " -"کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه می‌توانند به‌راحتی با هم کار " -"کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." +"Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " +"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " +"استفاده می‌کنند." #: src/std-types/std.md -msgid "In fact, Rust contains several layers of the Standard Library: `core`, `alloc` and `std`." -msgstr "در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." +msgid "" +"In fact, Rust contains several layers of the Standard Library: `core`, " +"`alloc` and `std`." +msgstr "" +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " +"`std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on `libc`, allocator or " -"even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on " +"`libc`, allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی وجود یک " -"سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " +"حتی وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" -"`alloc` includes types which require a global heap allocator, such as `Vec`, `Box` and `Arc`." +"`alloc` includes types which require a global heap allocator, such as `Vec`, " +"`Box` and `Arc`." msgstr "" -"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند `Vec`، `Box` و " -"`Arc`." +"`alloc` شامل تایپ‌هایی است که به یک تخصیص‌دهنده حافظه سراسری نیاز دارند، مانند " +"`Vec`، `Box` و `Arc`." #: src/std-types/std.md -msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." -msgstr "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده می‌کنند." +msgid "" +"Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgstr "" +"برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " +"می‌کنند." #: src/std-types/docs.md msgid "Rust comes with extensive documentation. For example:" @@ -5981,25 +6506,29 @@ msgstr "Rust دارای مستندات گسترده‌ای است. به عنوا #: src/std-types/docs.md msgid "" -"All of the details about [loops](https://doc.rust-lang.org/stable/reference/expressions/loop-" -"expr.html)." +"All of the details about [loops](https://doc.rust-lang.org/stable/reference/" +"expressions/loop-expr.html)." msgstr "" -"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/expressions/loop-expr." -"html)." +"تمام جزئیات مربوط به [حلقه‌ها](https://doc.rust-lang.org/stable/reference/" +"expressions/loop-expr.html)." #: src/std-types/docs.md -msgid "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html)." -msgstr "تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html)." +msgid "" +"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." +msgstr "" +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." #: src/std-types/docs.md msgid "" -"Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/option/enum.Option." -"html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap." -"html)." +"Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" +"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" +"std/collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/option/enum." -"Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct." -"BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" +"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" +"stable/std/collections/struct.BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6007,48 +6536,57 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md msgid "" -"/// Determine whether the first argument is divisible by the second argument.\n" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" #: src/std-types/docs.md msgid "" -"The contents are treated as Markdown. All published Rust library crates are automatically " -"documented at [`docs.rs`](https://docs.rs) using the [rustdoc](https://doc.rust-lang.org/" -"rustdoc/what-is-rustdoc.html) tool. It is idiomatic to document all public items in an API " -"using this pattern." +"The contents are treated as Markdown. All published Rust library crates are " +"automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " +"idiomatic to document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust به‌طور خودکار در " -"[`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc](https://doc.rust-lang.org/rustdoc/" -"what-is-rustdoc.html) مستند می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این " -"الگو به‌طور رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " +"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " +"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " +"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " +"رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!` or `/*! .. */`, " -"called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!" +"` or `/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/* .. !*/` " -"استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " +"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md -msgid "//! This module contains functionality relating to divisibility of integers.\n" +msgid "" +"//! This module contains functionality relating to divisibility of " +"integers.\n" msgstr "" #: src/std-types/docs.md -msgid "Show students the generated docs for the `rand` crate at ." -msgstr "مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان نشان دهید." +msgid "" +"Show students the generated docs for the `rand` crate at ." +msgstr "" +"مستندات تولیدشده برای `rand` crate را در به " +"دانش‌آموزان نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of type `T` or nothing. " -"For example, [`String::find`](https://doc.rust-lang.org/stable/std/string/struct.String." -"html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of " +"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" +"stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in memory as `T`." -msgstr "بهینه‌سازی niche به این معناست که `` often has the same size in " +"memory as `T`." +msgstr "" +"بهینه‌سازی niche به این معناست که `` where `T` is used in the `Ok` " -"variant and `E` appears in the `Err` variant." +"`Result` is similar to `Option`, but indicates the success or failure of an " +"operation, each with a different enum variant. It is generic: `Result` " +"where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، هرکدام با یک نوع " -"متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/string/struct.String." -"html#deref-methods-str), which means that you can call all `str` methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/" +"string/struct.String.html#deref-methods-str), which means that you can call " +"all `str` methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/string/struct." -"String.html#deref-methods-str) است، که به این معناست که می‌توانید تمام متدهای `str` را بر روی " -"`String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" +"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " +"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when you know how much " -"data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when " +"you know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده کنید زمانی که " -"می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " +"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be different from its " -"length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be " +"different from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول آن به‌صورت " -"کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " +"طول آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" -"`String::chars` returns an iterator over the actual characters. Note that a `char` can be " -"different from what a human will consider a \"character\" due to [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes.html)." +"`String::chars` returns an iterator over the actual characters. Note that a " +"`char` can be different from what a human will consider a \"character\" due " +"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" +"unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه داشته باشید که " -"یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل " -"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/unicode_segmentation/struct." -"Graphemes.html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " +"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." +"html)." #: src/std-types/string.md -msgid "When people refer to strings they could either be talking about `&str` or `String`." -msgstr "زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." +msgid "" +"When people refer to strings they could either be talking about `&str` or " +"`String`." +msgstr "" +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " +"باشد." #: src/std-types/string.md msgid "" -"When a type implements `Deref`, the compiler will let you transparently call " -"methods from `T`." +"When a type implements `Deref`, the compiler will let you " +"transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it access to `str`'s " -"methods." +"`String` implements `Deref` which transparently gives it " +"access to `str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/struct.Vec." -"html#deref-methods-%5BT%5D), which means that you can call slice methods on a `Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/" +"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " +"methods on a `Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/struct.Vec." -"html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را بر روی یک `Vec` " -"فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" +"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " +"متدهای برش را بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data it contains is " -"stored on the heap. This means the amount of data doesn't need to be known at compile time. It " -"can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data " +"it contains is stored on the heap. This means the amount of data doesn't " +"need to be known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap ذخیره می‌شود. به " -"این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و می‌تواند در زمان اجرا رشد یا " -"کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " +"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " +"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md msgid "" -"Notice how `Vec` is a generic type too, but you don't have to specify `T` explicitly. As " -"always with Rust type inference, the `T` was established during the first `push` call." +"Notice how `Vec` is a generic type too, but you don't have to specify `T` " +"explicitly. As always with Rust type inference, the `T` was established " +"during the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://doc.rust-lang.org/" -"std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V," -"+RandomState%3E), which allows us to easily initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://doc.rust-lang." -"org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);+N%5D%3E-for-" -"HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه " -"مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" +"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " +"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md -msgid "Alternatively HashMap can be built from any `Iterator` which yields key-value tuples." +msgid "" +"Alternatively HashMap can be built from any `Iterator` which yields key-" +"value tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید می‌کند، ساخته " -"شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " +"تولید می‌کند، ساخته شود." #: src/std-types/hashmap.md msgid "" -"We are showing `HashMap`, and avoid using `&str` as key to make examples easier. " -"Using references in collections can, of course, be done, but it can lead into complications " -"with the borrow checker." +"We are showing `HashMap`, and avoid using `&str` as key to make " +"examples easier. Using references in collections can, of course, be done, " +"but it can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " +"used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" -"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این ویژگی برای " -"پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." +"`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " +"ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "" +"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, because it is " -"reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, " +"because it is reflexive:" msgstr "" -"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا بازتابی است:" +"`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " +"بازتابی است:" #: src/std-traits/comparisons.md -msgid "In practice, it's common to derive these traits, but uncommon to implement them." +msgid "" +"In practice, it's common to derive these traits, but uncommon to implement " +"them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها به‌طور دستی " -"پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " +"آن‌ها به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-lang.org/std/" -"ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc." +"rust-lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/std/ops/index." -"html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." +"org/std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -6645,57 +7237,66 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "You could implement `Add` for `&Point`. In which situations is that useful?" -msgstr "می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" +msgid "" +"You could implement `Add` for `&Point`. In which situations is that useful?" +msgstr "" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " +"مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the operator is " -"not `Copy`, you should consider overloading the operator for `&T` as well. This avoids " -"unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " +"the operator is not `Copy`, you should consider overloading the operator for " +"`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" -"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را بارگذاری می‌کنید، " -"`Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر بگیرید. این کار از ایجاد کپی‌های " -"غیرضروری در محل فراخوانی جلوگیری می‌کند." +"پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " +"بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " +"بگیرید. این کار از ایجاد کپی‌های غیرضروری در محل فراخوانی جلوگیری می‌کند." #: src/std-traits/operators.md -msgid "Why is `Output` an associated type? Could it be made a type parameter of the method?" +msgid "" +"Why is `Output` an associated type? Could it be made a type parameter of the " +"method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " +"متد تعریف کرد؟" #: src/std-traits/operators.md msgid "" -"Short answer: Function type parameters are controlled by the caller, but associated types " -"(like `Output`) are controlled by the implementer of a trait." +"Short answer: Function type parameters are controlled by the caller, but " +"associated types (like `Output`) are controlled by the implementer of a " +"trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های مرتبط (مانند " -"`Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " +"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for Point` would " -"add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, " +"i32)> for Point` would add a tuple to a `Point`." msgstr "" -"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl Add<(i32, i32)> " -"for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." +"شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " +"Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." #: src/std-traits/operators.md msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like the same " -"operator in C-family languages; instead, for integer types it negates each bit of the number, " -"which arithmetically is equivalent to subtracting it from -1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." msgstr "" #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]" -"(https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate type conversions. Unlike " -"`as`, these traits correspond to lossless, infallible conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) و " -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای تسهیل تبدیل تایپ " -"پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " +"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -6703,37 +7304,41 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically implemented " -"when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " +"automatically implemented when [`From`](https://doc.rust-lang.org/std/" +"convert/trait.From.html) is implemented:" msgstr "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار زمانی پیاده‌سازی " -"می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) پیاده‌سازی شده باشد:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" +"trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get `Into` implementation " -"too." +"That's why it is common to only implement `From`, as your type will get " +"`Into` implementation too." msgstr "" -"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار پیاده‌سازی `Into` " -"را نیز دریافت می‌کند." +"به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " +"پیاده‌سازی `Into` را نیز دریافت می‌کند." #: src/std-traits/from-and-into.md msgid "" -"When declaring a function argument input type like \"anything that can be converted into a " -"`String`\", the rule is opposite, you should use `Into`. Your function will accept types that " -"implement `From` and those that _only_ implement `Into`." +"When declaring a function argument input type like \"anything that can be " +"converted into a `String`\", the rule is opposite, you should use `Into`. " +"Your function will accept types that implement `From` and those that _only_ " +"implement `Into`." msgstr "" -"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل شود\"، قاعده " -"برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول می‌کند که پیاده‌سازی `From` " -"دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی کرده‌اند." +"هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " +"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " +"پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts with `as`. These " -"generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts " +"with `as`. These generally follow C semantics where those are defined." msgstr "" -"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی می‌کند. این تبدیل‌ها " -"معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." +"Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " +"می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." #: src/std-traits/casting.md msgid "\"as u16: {}\"" @@ -6749,38 +7354,42 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across platforms. This might " -"not match your intuition for changing sign or casting to a smaller type -- check the docs, and " -"comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across " +"platforms. This might not match your intuition for changing sign or casting " +"to a smaller type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. این ممکن است " -"با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته باشد -- مستندات را بررسی " -"کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " +"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " +"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and can be a " -"source of subtle bugs as future maintenance work changes the types that are used or the ranges " -"of values in types. Casts are best used only when the intent is to indicate unconditional " -"truncation (e.g. selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what was " -"in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use " +"incorrectly, and can be a source of subtle bugs as future maintenance work " +"changes the types that are used or the ranges of values in types. Casts are " +"best used only when the intent is to indicate unconditional truncation (e.g. " +"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " +"was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان است و می‌تواند " -"منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث تغییر تایپ‌های مورد استفاده " -"یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن " -"برش بدون قید و شرط باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه " -"در بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " +"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " +"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " +"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " +"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " +"بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over `as` to confirm " -"that the cast is in fact infallible. For fallible casts, `TryFrom` and `TryInto` are available " -"when you want to handle casts that fit differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " +"over `as` to confirm that the cast is in fact infallible. For fallible " +"casts, `TryFrom` and `TryInto` are available when you want to handle casts " +"that fit differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` بر `as` ارجح " -"است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با احتمال خطا، `TryFrom` و " -"`TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت " -"ندارند، مدیریت کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " +"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " +"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " +"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " +"کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -6788,23 +7397,29 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might be lost is " -"generally discouraged, or at least deserves an explanatory comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might " +"be lost is generally discouraged, or at least deserves an explanatory " +"comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است داده‌ها از دست " -"برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " +"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " +"دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." -msgstr "این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." +msgstr "" +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " +"است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`](https://doc." -"rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " +"abstract over `u8` sources:" msgstr "" -"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و [`BufRead`](https://" -"doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی منابع `u8` انتزاع کنید:" +"با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " +"بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -6820,11 +7435,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you abstract over " -"`u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " +"you abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما امکان می‌دهد " -"که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " +"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -6840,11 +7455,11 @@ msgstr "The `Default` Trait" #: src/std-traits/default.md msgid "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait produces a default " -"value for a type." +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " +"produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک مقدار پیش‌فرض " -"برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -6862,33 +7477,39 @@ msgstr "\"Y is set!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md +#: src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" #: src/std-traits/default.md -msgid "It can be implemented directly or it can be derived via `#[derive(Default)]`." +msgid "" +"It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" -"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق `[derive(Default)]#` به صورت " -"خودکار تولید شود." +"این ویژگی می‌تواند به طور مستقیم پیاده‌سازی شود یا می‌تواند از طریق " +"`[derive(Default)]#` به صورت خودکار تولید شود." #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to their default values." +"A derived implementation will produce a value where all fields are set to " +"their default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض خود تنظیم " -"شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " +"پیش‌فرض خود تنظیم شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." -msgstr "این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی کنند." +msgstr "" +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " +"پیاده‌سازی کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, `\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. " +"`0`, `\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل `0`، `\"\"` و " -"غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " +"(مثل `0`، `\"\"` و غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -6896,31 +7517,34 @@ msgstr "مقداردهی جزئی ساختارها با `Default` به خوبی #: src/std-traits/default.md msgid "" -"The Rust standard library is aware that types can implement `Default` and provides convenience " -"methods that use it." +"The Rust standard library is aware that types can implement `Default` and " +"provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی کنند و " -"روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " +"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/ch05-01-" -"defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" +"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" +"with-struct-update-syntax)." msgstr "" -"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/ch05-01-defining-" -"structs.html#creating-instances-from-other-instances-with-struct-update-syntax) شناخته می‌شود." +"سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" +"struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, they implement " -"special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc.rust-" -"lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://doc.rust-lang.org/std/ops/trait." -"FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها پیاده‌سازی‌های " -"ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html)، [`FnMut`](https://doc." -"rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait." -"FnOnce.html) هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " +"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" +"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." +"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " +"هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -6944,74 +7568,82 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be called needing " -"only a shared reference to the closure, which means the closure can be executed repeatedly and " -"even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " +"be called needing only a shared reference to the closure, which means the " +"closure can be executed repeatedly and even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر می‌دهد، یا " -"شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " +"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " +"چندین بار فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object is accessed " -"via exclusive reference, so it can be called repeatedly but not concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما می‌توانید آن را " -"چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " +"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing so consumes " -"the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " +"Doing so consumes the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار فراخوانی " -"کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " +"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. you can use " -"an `FnMut` wherever an `FnOnce` is called for, and you can use an `Fn` wherever an `FnMut` or " -"`FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` است. به عبارت " -"دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید و از `Fn` در جایی که " -"`FnMut` یا `FnOnce` نیاز است استفاده کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " +"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " +"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " +"کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if you can (i.e. you " -"call it once), or `FnMut` else, and last `Fn`. This allows the most flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده کنید اگر فقط یک " -"بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از `FnMut` در غیر این صورت، و در " -"نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " +"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " +"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " +"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" -"In contrast, when you have a closure, the most flexible you can have is `Fn` (which can be " -"passed to a consumer of any of the 3 closure traits), then `FnMut`, and lastly `FnOnce`." +"In contrast, when you have a closure, the most flexible you can have is `Fn` " +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید `Fn` است (که " -"می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " +"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " +"`FnOnce`." #: src/std-traits/closures.md #, fuzzy msgid "" -"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. `multiply_sum`), " -"depending on what the closure captures. Function pointers (references to `fn` items) implement " -"`Copy` and `Fn`." +"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " +"`multiply_sum`), depending on what the closure captures. Function pointers " +"(references to `fn` items) implement `Copy` and `Fn`." msgstr "" -"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال `multiply_sum`) را بر " -"اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." +"کامپایلر همچنین `Copy` (برای مثال برای `add_3`) و `Clone` (برای مثال " +"`multiply_sum`) را بر اساس آنچه که closure به دست می‌آورد، استنتاج می‌کند." #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the least demanding " -"form of access they can (by shared reference if possible, then exclusive reference, then by " -"move). The `move` keyword forces capture by value." +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." msgstr "" #: src/std-traits/closures.md src/smart-pointers/trait-objects.md @@ -7028,13 +7660,15 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://en.wikipedia.org/" -"wiki/ROT13). Copy this code to the playground, and implement the missing bits. Only rotate " -"ASCII alphabetic characters, to ensure the result is still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://" +"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " +"implement the missing bits. Only rotate ASCII alphabetic characters, to " +"ensure the result is still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/wiki/ROT13) را " -"پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و بخش‌های ناقص آن را پیاده‌سازی " -"کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." +"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " +"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " +"تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7050,10 +7684,11 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating by 13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating " +"by 13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ کاراکتر را " -"بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " +"۱۳ کاراکتر را بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7068,10 +7703,12 @@ msgid "Today, we will cover:" msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md -msgid "Memory management, lifetimes, and the borrow checker: how Rust ensures memory safety." +msgid "" +"Memory management, lifetimes, and the borrow checker: how Rust ensures " +"memory safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از ایمنی حافظه " -"اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " +"Rust از ایمنی حافظه اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7079,9 +7716,11 @@ msgstr "اشاره‌گر هوشمند: تایپ‌های اشاره‌گر در #: src/welcome-day-3.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 20 minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 20 " +"minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " +"بکشد. این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7097,7 +7736,9 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." -msgstr "Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." +msgstr "" +"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " +"می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7133,39 +7774,41 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized data, the " -"actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically " +"sized data, the actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، یعنی رشته واقعی، " -"را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " +"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول است و در صورت " -"تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " +"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " +"کند." #: src/memory-management/review.md msgid "" -"If students ask about it, you can mention that the underlying memory is heap allocated using " -"the [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) and custom " -"allocators can be implemented using the [Allocator API](https://doc.rust-lang.org/std/alloc/" -"index.html)" +"If students ask about it, you can mention that the underlying memory is heap " +"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" +"struct.System.html) and custom allocators can be implemented using the " +"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده از [System " -"Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر روی heap اختصاص داده شده " -"و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator API](https://doc.rust-lang.org/std/" -"alloc/index.html) پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " +"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." +"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " +"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " +"پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should point out that this " -"is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should " +"point out that this is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با این حال، باید " -"اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " +"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7178,11 +7821,13 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7202,34 +7847,46 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "Programmer must determine whether a pointer still points to valid memory." -msgstr "برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." +msgid "" +"Programmer must determine whether a pointer still points to valid memory." +msgstr "" +"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " +"یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." msgstr "مطالعات نشان می‌دهد که برنامه‌نویسان اشتباهاتی مرتکب می‌شوند." #: src/memory-management/approaches.md -msgid "Full safety via automatic memory management at runtime: Java, Python, Go, Haskell, ..." -msgstr "ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." +msgid "" +"Full safety via automatic memory management at runtime: Java, Python, Go, " +"Haskell, ..." +msgstr "" +"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " +"هسکل، ..." #: src/memory-management/approaches.md -msgid "A runtime system ensures that memory is not freed until it can no longer be referenced." +msgid "" +"A runtime system ensures that memory is not freed until it can no longer be " +"referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع داده شود، آزاد " -"نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " +"ارجاع داده شود، آزاد نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "" +"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" msgstr "Rust یک ترکیب جدید ارائه می‌دهد:" #: src/memory-management/approaches.md -msgid "Full control _and_ safety via compile time enforcement of correct memory management." +msgid "" +"Full control _and_ safety via compile time enforcement of correct memory " +"management." msgstr "کنترل کامل و ایمنی از طریق اجرای صحیح مدیریت حافظه در زمان کامپایل." #: src/memory-management/approaches.md @@ -7238,89 +7895,98 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put Rust in context." +"This slide is intended to help students coming from other languages to put " +"Rust in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را در زمینه مناسب " -"قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " +"را در زمینه مناسب قرار دهند." #: src/memory-management/approaches.md msgid "" -"C must manage heap manually with `malloc` and `free`. Common errors include forgetting to call " -"`free`, calling it multiple times for the same pointer, or dereferencing a pointer after the " -"memory it points to has been freed." +"C must manage heap manually with `malloc` and `free`. Common errors include " +"forgetting to call `free`, calling it multiple times for the same pointer, " +"or dereferencing a pointer after the memory it points to has been freed." msgstr "" -"C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. خطاهای رایج شامل " -"فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک اشاره‌گر، یا dereference کردن یک " -"اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره می‌کند." +"C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " +"خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " +"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " +"اشاره می‌کند." #: src/memory-management/approaches.md msgid "" -"C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take advantage of language " -"guarantees about calling destructors to ensure memory is freed when a function returns. It is " -"still quite easy to mis-use these tools and create similar bugs to C." +"C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " +"advantage of language guarantees about calling destructors to ensure memory " +"is freed when a function returns. It is still quite easy to mis-use these " +"tools and create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از تضمین‌های زبانی " -"درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن حافظه هنگام بازگشت از تابع " -"استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و " -"باگ‌هایی مشابه به C ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " +"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " +"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " +"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " +"ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that is no longer " -"reachable and discard it. This guarantees that any pointer can be dereferenced, eliminating " -"use-after-free and other classes of bugs. But, GC has a runtime cost and is difficult to tune " -"properly." +"Java, Go, and Python rely on the garbage collector to identify memory that " +"is no longer reachable and discard it. This guarantees that any pointer can " +"be dereferenced, eliminating use-after-free and other classes of bugs. But, " +"GC has a runtime cost and is difficult to tune properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای که دیگر در " -"دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر اشاره‌گری می‌تواند dereference " -"شود و از بروز خطاهای استفاده پس از آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. " -"اما، GC هزینه‌ای در زمان اجرا دارد و تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " +"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " +"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " +"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " +"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance of C, with alloc " -"and free operations precisely where they are required -- zero cost. It also provides tools " -"similar to C++'s smart pointers. When required, other options such as reference counting are " -"available, and there are even third-party crates available to support runtime garbage " -"collection (not covered in this class)." -msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد عملکرد C را با " -"عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه صفر -- به دست آورد. همچنین " -"ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند " -"شمارش ارجاع نیز در دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " +"Rust's ownership and borrowing model can, in many cases, get the performance " +"of C, with alloc and free operations precisely where they are required -- " +"zero cost. It also provides tools similar to C++'s smart pointers. When " +"required, other options such as reference counting are available, and there " +"are even third-party crates available to support runtime garbage collection " +"(not covered in this class)." +msgstr "" +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " +"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " +"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" +"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " +"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " "اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error to use a variable " -"outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error " +"to use a variable outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از متغیر خارج از " -"دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " +"از متغیر خارج از دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely one owner at all " -"times." -msgstr "می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." +"We say that the variable _owns_ the value. Every Rust value has precisely " +"one owner at all times." +msgstr "" +"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " +"دارد." #: src/memory-management/ownership.md msgid "" -"At the end of the scope, the variable is _dropped_ and the data is freed. A destructor can run " -"here to free up resources." +"At the end of the scope, the variable is _dropped_ and the data is freed. A " +"destructor can run here to free up resources." msgstr "" -"در پایان دامنه، متغیر **حذف** می‌شود و داده‌ها آزاد می‌شوند. یک ویرایشگر (destructor) می‌تواند در " -"اینجا اجرا شود تا منابع را آزاد کند." +"در پایان دامنه، متغیر **حذف** می‌شود و داده‌ها آزاد می‌شوند. یک ویرایشگر " +"(destructor) می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." #: src/memory-management/ownership.md msgid "" -"Students familiar with garbage-collection implementations will know that a garbage collector " -"starts with a set of \"roots\" to find all reachable memory. Rust's \"single owner\" principle " -"is a similar idea." +"Students familiar with garbage-collection implementations will know that a " +"garbage collector starts with a set of \"roots\" to find all reachable " +"memory. Rust's \"single owner\" principle is a similar idea." msgstr "" -"دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک جمع‌آوری‌کننده زباله " -"با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی شروع می‌کند. اصول \"مالکیت " -"تک‌گانه\" Rust ایده مشابهی است." +"دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " +"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " +"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -7340,7 +8006,9 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." -msgstr "زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." +msgstr "" +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " +"نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -7380,11 +8048,11 @@ msgstr "" #: src/memory-management/move.md msgid "" -"When you pass a value to a function, the value is assigned to the function parameter. This " -"transfers ownership:" +"When you pass a value to a function, the value is assigned to the function " +"parameter. This transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده می‌شود. به این " -"شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " +"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -7401,25 +8069,29 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` استفاده کنیم ( تا یک مقدار را جا به جا " -"کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ " +"است که در ان مقدار کپی میشود مگر که از `std::move` " +"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated to manipulate the " -"data itself is a matter of optimization, and such copies are aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated " +"to manipulate the data itself is a matter of optimization, and such copies " +"are aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود داده‌ها تولید " -"می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی (aggressively) بهینه‌سازی " -"می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " +"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " +"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." #: src/memory-management/move.md -msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." -msgstr "مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." +msgid "" +"Simple values (such as integers) can be marked `Copy` (see later slides)." +msgstr "" +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " +"ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -7431,40 +8103,45 @@ msgstr "در مثال `say_hello`:" #: src/memory-management/move.md msgid "" -"With the first call to `say_hello`, `main` gives up ownership of `name`. Afterwards, `name` " -"cannot be used anymore within `main`." +"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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " +"از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the `say_hello` function." -msgstr "حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." +"The heap memory allocated for `name` will be freed at the end of the " +"`say_hello` function." +msgstr "" +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " +"خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and if `say_hello` " -"accepts a reference as a parameter." +"`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` یک مرجع را به عنوان پارامتر باید " -"بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع " +"(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " +"را به عنوان پارامتر باید بپذیرد." #: src/memory-management/move.md -msgid "Alternatively, `main` can pass a clone of `name` in the first call (`name.clone()`)." +msgid "" +"Alternatively, `main` can pass a clone of `name` in the first call (`name." +"clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع ای که در نظر " -"داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " +"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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." +"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++ است که سهوا کپی ایجاد کنیم, زیر به صورت پیش‌فرض " -"از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که لازم هست به صورت صریح کلون " -"را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, " +"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " +"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -7483,16 +8160,17 @@ msgid "// Duplicate the data in s1.\n" msgstr "// Duplicate the data in s1.\n" #: src/memory-management/move.md -msgid "The heap data from `s1` is duplicated and `s2` gets its own independent copy." +msgid "" +"The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این کپی به صورت " -"مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " +"این کپی به صورت مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای حافظه خود را " -"آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " +"جداگانه‌ای حافظه خود را آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -7504,74 +8182,84 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, the string data " -"has to be cloned. Otherwise we would get a double-free when either string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, " +"the string data has to be cloned. Otherwise we would get a double-free when " +"either string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده است. زیرا `=` " -"داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، هر موقع از اسکوپ یکی از " -"آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " +"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " +"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " +"آزادسازی مجدد حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which is used to " -"indicate when a value may be moved from. If the example had been `s2 = std::move(s1)`, no heap " -"allocation would take place. After the 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++ " +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " +"which is used to indicate when a value may be moved from. If the example had " +"been `s2 = std::move(s1)`, no heap allocation would take place. After the " +"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/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is being copied " -"or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " +"which is being copied or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال دادن استفاده " -"شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " +"انتقال دادن استفاده شود." #: src/memory-management/clone.md -msgid "Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes this." -msgstr "گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام می‌دهد." +msgid "" +"Sometimes you _want_ to make a copy of a value. The `Clone` trait " +"accomplishes this." +msgstr "" +"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " +"انجام می‌دهد." #: src/memory-management/clone.md msgid "" -"The idea of `Clone` is to make it easy to spot where heap allocations are occurring. Look for " -"`.clone()` and a few others like `vec!` or `Box::new`." +"The idea of `Clone` is to make it easy to spot where heap allocations are " +"occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال `()clone.` و " -"چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " +"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, and return later to " -"try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, " +"and return later to try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن استفاده می‌شود و " -"سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " +"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e.g. clone an array, " -"all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان مثال یک آرایه " -"را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " +"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning logic if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." msgstr "" -"رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق کپی‌برداری سفارشی را " -"اجرا کند." +"رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " +"کپی‌برداری سفارشی را اجرا کند." #: src/memory-management/copy-types.md -msgid "While move semantics are the default, certain types are copied by default:" +msgid "" +"While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت پیش‌فرض کپی " -"می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " +"صورت پیش‌فرض کپی می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -7587,7 +8275,9 @@ msgstr "پس از انتساب، هر دو `p1` و `p2` داده‌های خود #: src/memory-management/copy-types.md msgid "We can also use `p1.clone()` to explicitly copy the data." -msgstr "همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها استفاده کنیم." +msgstr "" +"همچنین می‌توانیم از `p1.clone()` برای کپی صریح داده‌ها " +"استفاده کنیم." #: src/memory-management/copy-types.md msgid "Copying and cloning are not the same thing:" @@ -7595,27 +8285,31 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on arbitrary objects." +"Copying refers to bitwise copies of memory regions and does not work on " +"arbitrary objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف شده توسط شما " -"کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " +"تعریف شده توسط شما کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "" +"Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" -"کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." +"کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." #: src/memory-management/copy-types.md msgid "" -"Cloning is a more general operation and also allows for custom behavior by implementing the " -"`Clone` trait." +"Cloning is a more general operation and also allows for custom behavior by " +"implementing the `Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار سفارشی را فراهم " -"می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " +"رفتار سفارشی را فراهم می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "" +"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -7623,18 +8317,19 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` is not a `Copy` " -"type." +"Add a `String` field to `struct Point`. It will not compile because `String` " +"is not a `Copy` type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " +"یک نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" -"Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for " -"`p1`." +"Remove `Copy` from the `derive` attribute. The compiler error is now in the " +"`println!` for `p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای `p1` قرار " -"دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " +"برای `p1` قرار دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -7642,14 +8337,16 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is because rust " -"requires that mutable references be exclusive, so while it's valid to make a copy of a shared " -"reference, creating a copy of a mutable reference would violate Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات قابل تغییر " -"(`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز دارد که ارجاعات قابل " -"تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی " -"از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " +"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " +"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " +"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " +"قوانین قرض‌گیری Rust را نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -7657,11 +8354,12 @@ msgstr "ویژگی `Drop`" #: src/memory-management/drop.md msgid "" -"Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) can specify " -"code to run when they go out of scope:" +"Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." +"html) can specify code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را پیاده‌سازی " -"می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " +"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " +"شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -7698,7 +8396,8 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "" +"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -7706,34 +8405,38 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " -"implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" +"drop` implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی کرده باشد، " -"پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " +"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md -msgid "All its fields will then be dropped too, whether or not it implements `Drop`." +msgid "" +"All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " +"کرده باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The significance is that it " -"takes ownership of the value, so at the end of its scope it gets dropped. This makes it a " -"convenient way to explicitly drop values earlier than they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The " +"significance is that it takes ownership of the value, so at the end of its " +"scope it gets dropped. This makes it a convenient way to explicitly drop " +"values earlier than they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که مالکیت مقدار " -"را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن را به روشی مناسب برای حذف " -"صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " +"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " +"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " +"دامنه خارج می‌شوند، تبدیل می‌کند." #: src/memory-management/drop.md msgid "" -"This can be useful for objects that do some work on `drop`: releasing locks, closing files, " -"etc." +"This can be useful for objects that do some work on `drop`: releasing locks, " +"closing files, etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن قفل‌ها، بستن " -"فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " +"کردن قفل‌ها، بستن فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -7741,11 +8444,12 @@ msgstr "چرا `Drop::drop` `self` را نمی‌گیرد؟" #: src/memory-management/drop.md msgid "" -"Short-answer: If it did, `std::mem::drop` would be called at the end of the block, resulting " -"in another call to `Drop::drop`, and a stack overflow!" +"Short-answer: If it did, `std::mem::drop` would be called at the end of the " +"block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر به فراخوانی " -"مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " +"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " +"می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -7753,13 +8457,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its data. We will use " -"the \"builder pattern\" to support building a new value piece-by-piece, using convenience " -"functions." +"In this example, we will implement a complex data type that owns all of its " +"data. We will use the \"builder pattern\" to support building a new value " +"piece-by-piece, using convenience functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های خود است. ما از " -"\"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت قطعه‌قطعه، با استفاده از توابع " -"کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " +"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " +"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -7780,7 +8484,8 @@ msgid "\"1\"" msgstr "" #: src/memory-management/exercise.md src/memory-management/solution.md -msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "" +"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" #: src/memory-management/exercise.md @@ -7869,11 +8574,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer to data on " -"the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " +"pointer to data on the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به داده‌های روی " -"heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " +"به داده‌های روی heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -7881,20 +8586,22 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call methods from `T` " -"directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref.html#more-on-deref-" -"coercion)." +"`Box` implements `Deref`, which means that you can [call " +"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" +"trait.Deref.html#more-on-deref-coercion)." msgstr "" -"`| Element | 2 | o--+--->| Nil | // | // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----+ :\n" +": " +"list : : :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" "```" msgstr "" #: src/smart-pointers/box.md -msgid "`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not null." +msgid "" +"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " +"not null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه تهی (null) " -"نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " +"هیچ‌گاه تهی (null) نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -7936,47 +8651,51 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust compiler wants to " -"know an exact size." +"have a type whose size that can't be known at compile time, but the Rust " +"compiler wants to know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به دانستن اندازه " -"دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " +"به دانستن اندازه دقیق آن دارد." #: src/smart-pointers/box.md msgid "" -"want to transfer ownership of a large amount of data. To avoid copying large amounts of data " -"on the stack, instead store the data on the heap in a `Box` so only the pointer is moved." +"want to transfer ownership of a large amount of data. To avoid copying large " +"amounts of data on the stack, instead store the data on the heap in a `Box` " +"so only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم زیادی از داده‌ها " -"در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " +"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " +"کنید تا فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" -"If `Box` was not used and we attempted to embed a `List` directly into the `List`, the " -"compiler would not be able to compute a fixed size for the struct in memory (the `List` would " -"be of infinite size)." +"If `Box` was not used and we attempted to embed a `List` directly into the " +"`List`, the compiler would not be able to compute a fixed size for the " +"struct in memory (the `List` would be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` قرار دهیم، " -"کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت " -"پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " +"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " +"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and just points at the " -"next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and " +"just points at the next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به عنصر بعدی " -"`List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " +"به عنصر بعدی `List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get the message " -"\"recursive without indirection\", because for data recursion, we have to use indirection, a " -"`Box` or reference of some kind, instead of storing the value directly." +"Remove the `Box` in the List definition and show the compiler error. We get " +"the message \"recursive without indirection\", because for data recursion, " +"we have to use indirection, a `Box` or reference of some kind, instead of " +"storing the value directly." msgstr "" -"`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا \"recursive without " -"indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها باید از یک روش غیرمستقیم، مانند " -"`Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم مقدار استفاده کنیم." +"`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " +"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " +"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " +"مستقیم مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -7984,22 +8703,25 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This makes `Box` " -"one of the types that allow the compiler to optimize storage of some enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " +"This makes `Box` one of the types that allow the compiler to optimize " +"storage of some enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null باشد. این " -"ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه می‌دهد ذخیره‌سازی برخی از " -"`enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" +"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " +"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" -"For example, `Option>` has the same size, as just `Box`, because compiler uses NULL-" -"value to discriminate variants instead of using explicit tag ([\"Null Pointer Optimization\"]" -"(https://doc.rust-lang.org/std/option/#representation)):" +"For example, `Option>` has the same size, as just `Box`, because " +"compiler uses NULL-value to discriminate variants instead of using explicit " +"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده کرد، مثلاً `dyn " -"Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای هوشمند مانند `Box` نیز استفاده کنیم " -"تا یک شیء ویژگی مالک (owned trait object) ایجاد کنیم: `\" : : \"data: Cat\" +----+----+----+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----+ :\n" -": | len | 2 | : | : +-------+-------+ ^ :\n" -": | capacity | 2 | : | : ^ | :\n" -": +-----------+-------+ : | : | '-------. :\n" -": : | : | data:\"Dog\"| :\n" -": : | : | +-------+--|-------+ :\n" -"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 | :\n" -" `--+-->| o o | o o-|----->| age | 5 | :\n" -" : +-|---+-|---+ +-------+----------+ :\n" -" : | | :\n" -" `- - -| - - |- - - - - - - - - - - - - - - - -'\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" +": | len | 2 | : | : +-------+-------+ " +"^ :\n" +": | capacity | 2 | : | : ^ " +"| :\n" +": +-----------+-------+ : | : | " +"'-------. :\n" +": : | : | data:" +"\"Dog\"| :\n" +": : | : | +-------+--|-------" +"+ :\n" +"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " +"| :\n" +" `--+-->| o o | o o-|----->| age | 5 " +"| :\n" +" : +-|---+-|---+ +-------+----------" +"+ :\n" +" : | " +"| :\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" " | |\n" -" | | \"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - - -.\n" -" : | | vtable :\n" -" : | | +----------------------+ :\n" -" : | `----->| \"::talk\" | :\n" -" : | +----------------------+ :\n" -" : | vtable :\n" -" : | +----------------------+ :\n" -" : '----------->| \"::talk\" | :\n" -" : +----------------------+ :\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" +" : | | " +"vtable :\n" +" : | | +----------------------" +"+ :\n" +" : | `----->| \"::" +"talk\" | :\n" +" : | +----------------------" +"+ :\n" +" : | " +"vtable :\n" +" : | +----------------------" +"+ :\n" +" : '----------->| \"::" +"talk\" | :\n" +" : +----------------------" +"+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - - -'\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" #: src/smart-pointers/trait-objects.md msgid "" -"Types that implement a given trait may be of different sizes. This makes it impossible to have " -"things like `Vec` in the example above." +"Types that implement a given trait may be of different sizes. This makes it " +"impossible to have things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته باشند. این موضوع " -"باعث می‌شود که داشتن مواردی مانند ` and fill in the missing method:" -msgstr "کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" +msgid "" +"Copy the code below to and fill in the missing " +"method:" +msgstr "" +"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " +"کنید:" #: src/borrowing/exercise.md -msgid "\"Update a user's statistics based on measurements from a visit to the doctor\"" +msgid "" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "" -#: src/borrowing/exercise.md src/borrowing/solution.md src/android/build-rules/library.md +#: src/borrowing/exercise.md src/borrowing/solution.md +#: src/android/build-rules/library.md #: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -8555,40 +9351,41 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. This is " -"verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers " +"to. This is verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع توسط بررسی‌کننده " -"قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " +"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes can also be " -"explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and `'a` is a typical " -"default name. Read `&'a Point` as \"a borrowed `Point` which is valid for at least the " -"lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes " +"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " +"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " +"`Point` which is valid for at least the lifetime `a`\"." msgstr "" -"طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول عمرها می‌توانند " -"صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` شروع می‌شوند و `'a` نام پیش‌فرض " -"معمولی است. `&'a Point` را به عنوان \"یک `Point` قرضی که برای حداقل طول عمر `a` معتبر است\" " -"بخوانید." +"طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " +"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " +"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " +"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes are always inferred by the compiler: you cannot assign a lifetime yourself. Explicit " -"lifetime annotations create constraints where there is ambiguity; the compiler verifies that " -"there is a valid solution." +"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " +"yourself. Explicit lifetime annotations create constraints where there is " +"ambiguity; the compiler verifies that there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر را اختصاص " -"دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود ابهام است؛ کامپایلر " -"تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " +"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " +"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes become more complicated when considering passing values to and returning values from " -"functions." +"Lifetimes become more complicated when considering passing values to and " +"returning values from functions." msgstr "" -"طول عمرها وقتی که به عبور مقادیر به توابع و بازگشت مقادیر از توابع می‌پردازیم پیچیده‌تر می‌شوند." +"طول عمرها وقتی که به عبور مقادیر به توابع و بازگشت مقادیر از توابع می‌پردازیم " +"پیچیده‌تر می‌شوند." #: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" @@ -8600,14 +9397,16 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"In this example, the compiler does not know what lifetime to infer for `p3`. Looking inside " -"the function body shows that it can only safely assume that `p3`'s lifetime is the shorter of " -"`p1` and `p2`. But just like types, Rust requires explicit annotations of lifetimes on " -"function arguments and return values." +"In this example, the compiler does not know what lifetime to infer for `p3`. " +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به بدنه تابع " -"نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر از `p1` و `p2` است. اما " -"مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " +"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " +"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " +"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -8615,16 +9414,18 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " +"for at least `'a`." msgstr "" -"این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر می‌کنند، مقدار " -"بازگشتی برای مدت `'a` معتبر خواهد بود.\"" +"این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " +"می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "In common cases, lifetimes can be elided, as described on the next slide." +msgid "" +"In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی توضیح داده شده " -"است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " +"بعدی توضیح داده شده است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -8632,32 +9433,37 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, but Rust allows " -"lifetimes to be elided in most cases with [a few simple rules](https://doc.rust-lang.org/" -"nomicon/lifetime-elision.html). This is not inference -- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, " +"but Rust allows lifetimes to be elided in most cases with [a few simple " +"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " +"inference -- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما Rust اجازه " -"می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang.org/nomicon/lifetime-" -"elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه " -"است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " +"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." +"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " +"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." -msgstr "هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." +msgstr "" +"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " +"می‌شود." #: src/lifetimes/lifetime-elision.md -msgid "If there is only one argument lifetime, it is given to all un-annotated return values." +msgid "" +"If there is only one argument lifetime, it is given to all un-annotated " +"return values." msgstr "" -"اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، " -"اختصاص داده می‌شود." +"اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " +"حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, that lifetime is " -"given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, " +"that lifetime is given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام مقادیر " -"بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " +"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -8665,46 +9471,53 @@ msgstr "در این مثال، `cab_distance` به طور خودکار حذف م #: src/lifetimes/lifetime-elision.md msgid "" -"The `nearest` function provides another example of a function with multiple references in its " -"arguments that requires explicit annotation." +"The `nearest` function provides another example of a function with multiple " +"references in its arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به حاشیه‌نویسی " -"صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " +"نیاز به حاشیه‌نویسی صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" -msgstr "امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده می‌شوند:" +msgstr "" +"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " +"داده می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for validity by the " -"compiler. Note that this is not the case for raw pointers (unsafe), and this is a common " -"source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for " +"validity by the compiler. Note that this is not the case for raw pointers " +"(unsafe), and this is a common source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر برای " -"اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام (ناامن) صدق نمی‌کند " -"و این یکی از منابع رایج خطاها در Rust ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " +"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " +"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " +"ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. Most of the " -"time, elision and type inference mean these don't need to be written out. In more complicated " -"cases, lifetime annotations can help resolve ambiguity. Often, especially when prototyping, " -"it's easier to just work with owned data by cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have " +"lifetimes. Most of the time, elision and type inference mean these don't " +"need to be written out. In more complicated cases, lifetime annotations can " +"help resolve ambiguity. Often, especially when prototyping, it's easier to " +"just work with owned data by cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، _همیشه_ برای " -"قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی است که نیازی به نوشتن این " -"طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، " -"به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت " -"لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " +"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " +"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " +"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " +"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " +"صورت لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "طول عمر در ساختمان داده" #: src/lifetimes/struct-lifetimes.md -msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "" +"If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "" +"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -8728,28 +9541,31 @@ msgstr "\"{dog:?}\"" #: src/lifetimes/struct-lifetimes.md msgid "" -"In the above example, the annotation on `Highlight` enforces that the data underlying the " -"contained `&str` lives at least as long as any instance of `Highlight` that uses that data." +"In the above example, the annotation on `Highlight` enforces that the data " +"underlying the contained `&str` lives at least as long as any instance of " +"`Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` به مدت حداقل " -"برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " +"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " +"می‌کند، زنده بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker " -"throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " +"the borrow checker throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow checker) خطا " -"می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " +"(borrow checker) خطا می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This can be useful for " -"creating lightweight views, but it generally makes them somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This " +"can be useful for creating lightweight views, but it generally makes them " +"somewhat harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های اصلی را نگه " -"دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً استفاده از آنها را تا حدی " -"دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " +"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " +"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -8757,35 +9573,39 @@ msgstr "در صورت امکان، داده‌های ساختارها را به #: src/lifetimes/struct-lifetimes.md msgid "" -"Some structs with multiple references inside can have more than one lifetime annotation. This " -"can be necessary if there is a need to describe lifetime relationships between the references " -"themselves, in addition to the lifetime of the struct itself. Those are very advanced use " -"cases." +"Some structs with multiple references inside can have more than one lifetime " +"annotation. This can be necessary if there is a need to describe lifetime " +"relationships between the references themselves, in addition to the lifetime " +"of the struct itself. Those are very advanced use cases." msgstr "" -"برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین نشانه‌گذاری عمر داشته " -"باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین ارجاعات مختلف را به علاوه عمر " -"ساختار خود توصیف کنید. این موارد بسیار پیشرفته هستند." +"برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " +"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " +"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " +"بسیار پیشرفته هستند." #: src/lifetimes/exercise.md msgid "" -"In this exercise, you will build a parser for the [protobuf binary encoding](https://protobuf." -"dev/programming-guides/encoding/). Don't worry, it's simpler than it seems! This illustrates a " -"common parsing pattern, passing slices of data. The underlying data itself is never copied." +"In this exercise, you will build a parser for the [protobuf binary encoding]" +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " +"simpler than it seems! This illustrates a common parsing pattern, passing " +"slices of data. The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf.dev/" -"programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن است که به نظر " -"می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل عبور برش‌های داده است. " -"داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" +"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " +"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " +"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" -"Fully parsing a protobuf message requires knowing the types of the fields, indexed by their " -"field numbers. That is typically provided in a `proto` file. In this exercise, we'll encode " -"that information into `match` statements in functions that get called for each field." +"Fully parsing a protobuf message requires knowing the types of the fields, " +"indexed by their field numbers. That is typically provided in a `proto` " +"file. In this exercise, we'll encode that information into `match` " +"statements in functions that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس شماره‌های فیلد " -"ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. در این تمرین، ما این اطلاعات " -"را به صورت عبارات `match` در توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " +"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " +"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " +"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -8793,34 +9613,35 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each is implemented as a " -"\"tag\" followed by the value. The tag contains a field number (e.g., `2` for the `id` field " -"of a `Person` message) and a wire type defining how the payload should be determined from the " -"byte stream." +"A proto message is encoded as a series of fields, one after the next. Each " +"is implemented as a \"tag\" followed by the value. The tag contains a field " +"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " +"defining how the payload should be determined from the byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر فیلد به صورت " -"یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد (مانند `2` برای فیلد `id` در " -"پیام `Person`) و wire type است که نحوه تعیین بار را از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " +"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " +"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " +"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" -"Integers, including the tag, are represented with a variable-length encoding called VARINT. " -"Luckily, `parse_varint` is defined for you below. The given code also defines callbacks to " -"handle `Person` and `PhoneNumber` fields, and to parse a message into a series of calls to " -"those callbacks." +"Integers, including the tag, are represented with a variable-length encoding " +"called VARINT. Luckily, `parse_varint` is defined for you below. The given " +"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " +"to parse a message into a series of calls to those callbacks." msgstr "" -"اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی می‌شوند. " -"خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین بازخوانی‌هایی برای " -"مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به مجموعه‌ای از فراخوانی‌ها به آن " -"بازخوانی‌ها را تعریف می‌کند." +"اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " +"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " +"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " +"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" -"What remains for you is to implement the `parse_field` function and the `ProtoMessage` trait " -"for `Person` and `PhoneNumber`." +"What remains for you is to implement the `parse_field` function and the " +"`ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" -"برای شما باقی‌مانده است که تابع `parse_field` و ویژگی `ProtoMessage` را برای `Person` و " -"`PhoneNumber` پیاده‌سازی کنید." +"برای شما باقی‌مانده است که تابع `parse_field` و ویژگی `ProtoMessage` را برای " +"`Person` و `PhoneNumber` پیاده‌سازی کنید." #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" @@ -8833,16 +9654,19 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double type.\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float type.\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" " //I32, -- not needed for this exercise\n" msgstr "" @@ -8892,7 +9716,8 @@ msgid "\"Expected `u64` to be a `Varint` field\"" msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -8922,8 +9747,11 @@ msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" #: src/lifetimes/exercise.md -msgid "\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" -msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +msgid "" +"\"Based on the wire type, build a Field, consuming as many bytes as " +"necessary.\"" +msgstr "" +"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -8931,7 +9759,8 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -8943,16 +9772,18 @@ msgstr "" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, e.g. if you try to " -"parse an `i32` when there are fewer than 4 bytes left in the data buffer. In normal Rust code " -"we'd handle this with the `Result` enum, but for simplicity in this exercise we panic if any " -"errors are encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، مثلاً اگر " -"بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، تجزیه کنید. در کد " -"Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با " -"هرگونه خطا مواجه شویم، به جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در " -"روز چهارم، به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " +"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " +"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " +"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " +"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " +"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" @@ -8994,7 +9825,8 @@ msgid "Welcome to Day 4" msgstr "به روز ۱ خوش آمدید" #: src/welcome-day-4.md -msgid "Today we will cover topics relating to building large-scale software in Rust:" +msgid "" +"Today we will cover topics relating to building large-scale software in Rust:" msgstr "" #: src/welcome-day-4.md @@ -9015,12 +9847,14 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "" #: src/welcome-day-4.md -msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "" +"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 40 minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 40 " +"minutes. It contains:" msgstr "" #: src/iterators.md @@ -9039,10 +9873,10 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait supports " -"iterating over values in a collection. It requires a `next` method and provides lots of " -"methods. Many standard library types implement `Iterator`, and you can implement it yourself, " -"too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait supports iterating over values in a collection. It requires a `next` " +"method and provides lots of methods. Many standard library types implement " +"`Iterator`, and you can implement it yourself, too:" msgstr "" #: src/iterators/iterator.md @@ -9051,25 +9885,27 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming operations over collections " -"(e.g. `map`, `filter`, `reduce`, etc). This is the trait where you can find all the " -"documentation about them. In Rust these functions should produce the code as efficient as " -"equivalent imperative implementations." +"The `Iterator` trait implements many common functional programming " +"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " +"the trait where you can find all the documentation about them. In Rust these " +"functions should produce the code as efficient as equivalent imperative " +"implementations." msgstr "" #: src/iterators/iterator.md msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by collection types " -"such as `Vec` and references to them such as `&Vec` and `&[T]`. Ranges also implement " -"it. This is why you can iterate over a vector with `for i in some_vec { .. }` but `some_vec." -"next()` doesn't exist." +"`IntoIterator` is the trait that makes for loops work. It is implemented by " +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an iterator. The related " -"trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html) defines how " -"to create an iterator for a type. It is used automatically by the `for` loop." +"The `Iterator` trait tells you how to _iterate_ once you have created an " +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " +"It is used automatically by the `for` loop." msgstr "" #: src/iterators/intoiterator.md @@ -9078,8 +9914,8 @@ msgstr "\"point = {x}, {y}\"" #: src/iterators/intoiterator.md msgid "" -"Click through to the docs for `IntoIterator`. Every implementation of `IntoIterator` must " -"declare two types:" +"Click through to the docs for `IntoIterator`. Every implementation of " +"`IntoIterator` must declare two types:" msgstr "" #: src/iterators/intoiterator.md @@ -9092,8 +9928,8 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same `Item` type, which " -"means that it returns `Option`" +"Note that `IntoIter` and `Item` are linked: the iterator must have the same " +"`Item` type, which means that it returns `Option`" msgstr "" #: src/iterators/intoiterator.md @@ -9102,27 +9938,29 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Try iterating over the grid twice in `main`. Why does this fail? Note that `IntoIterator::" -"into_iter` takes ownership of `self`." +"Try iterating over the grid twice in `main`. Why does this fail? Note that " +"`IntoIterator::into_iter` takes ownership of `self`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference to the " -"`Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " +"reference to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in some_vector` will take " -"ownership of `some_vector` and iterate over owned elements from that vector. Use `for e in " -"&some_vector` instead, to iterate over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in " +"some_vector` will take ownership of `some_vector` and iterate over owned " +"elements from that vector. Use `for e in &some_vector` instead, to iterate " +"over references to elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets you build a " -"collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" +"std/iter/trait.Iterator.html)." msgstr "" #: src/iterators/fromiterator.md @@ -9140,39 +9978,42 @@ msgstr "" #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as shown. The `_` " -"shorthand used here lets Rust infer the type of the `Vec` elements." +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." msgstr "" #: src/iterators/fromiterator.md msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. Rewrite the " -"example to use this form." +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"Rewrite the example to use this form." msgstr "" #: src/iterators/fromiterator.md msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. There are also " -"more specialized implementations which let you do cool things like convert an `Iterator>` into a `Result, E>`." +"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " +"There are also more specialized implementations which let you do cool things " +"like convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods in the " -"[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to implement a " -"complex calculation." +"In this exercise, you will need to find and use some of the provided methods " +"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait to implement a complex calculation." msgstr "" #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests pass. Use an " -"iterator expression and `collect` the result to construct the return value." +"Copy the following code to and make the tests " +"pass. Use an iterator expression and `collect` the result to construct the " +"return value." msgstr "" #: src/iterators/exercise.md src/iterators/solution.md msgid "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -9200,14 +10041,14 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that describes how to build a " -"bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that " +"describes how to build a bundle of 1+ crates." msgstr "" #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and a library crate " -"compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and " +"a library crate compiles to a library." msgstr "" #: src/modules/modules.md @@ -9215,13 +10056,15 @@ msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md -msgid "Omitting the module content will tell Rust to look for it in another file:" +msgid "" +"Omitting the module content will tell Rust to look for it in another file:" msgstr "" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden.rs`. Similarly, a " -"`garden::vegetables` module can be found at `src/garden/vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden." +"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" +"vegetables.rs`." msgstr "" #: src/modules/filesystem.md @@ -9238,13 +10081,15 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments\". These document " -"the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md msgid "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" msgstr "" @@ -9262,14 +10107,14 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of `module.rs`, and " -"this is still a working alternative for editions after 2018." +"Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " +"`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` was because " -"many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod." +"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" #: src/modules/filesystem.md @@ -9277,7 +10122,9 @@ msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" #: src/modules/filesystem.md -msgid "The place rust will look for modules can be changed with a compiler directive:" +msgid "" +"The place rust will look for modules can be changed with a compiler " +"directive:" msgstr "" #: src/modules/filesystem.md @@ -9286,8 +10133,8 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module in a file named " -"`some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module " +"in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" #: src/modules/visibility.md @@ -9304,8 +10151,8 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all the descendants of " -"`foo`." +"In other words, if an item is visible in module `foo`, it's visible in all " +"the descendants of `foo`." msgstr "" #: src/modules/visibility.md @@ -9330,14 +10177,14 @@ msgstr "" #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public " -"visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " +"of public visibility." msgstr "" #: src/modules/visibility.md msgid "" -"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-" -"path-pubcrate-pubsuper-and-pubself)." +"See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" +"privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" #: src/modules/visibility.md @@ -9350,13 +10197,14 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of its descendants)." +"In any case, visibility must be granted to an ancestor module (and all of " +"its descendants)." msgstr "" #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You will typically see " -"something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You " +"will typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -9393,40 +10241,43 @@ msgstr "" #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the top-level `lib.rs` " -"in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the " +"top-level `lib.rs` in a crate might have" msgstr "" #: src/modules/paths.md msgid "" -"making `DiskStorage` and `NetworkStorage` available to other crates with a convenient, short " -"path." +"making `DiskStorage` and `NetworkStorage` available to other crates with a " +"convenient, short path." msgstr "" #: src/modules/paths.md msgid "" -"For the most part, only items that appear in a module need to be `use`'d. However, a trait " -"must be in scope to call any methods on that trait, even if a type implementing that trait is " -"already in scope. For example, to use the `read_to_string` method on a type implementing the " -"`Read` trait, you need to `use std::io::Read`." +"For the most part, only items that appear in a module need to be `use`'d. " +"However, a trait must be in scope to call any methods on that trait, even if " +"a type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to " +"`use std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged because it is " -"not clear which items are imported, and those might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is " +"discouraged because it is not clear which items are imported, and those " +"might change over time." msgstr "" #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. This library defines " -"a `Widget` trait and a few implementations of that trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. " +"This library defines a `Widget` trait and a few implementations of that " +"trait, as well as a `main` function." msgstr "" #: src/modules/exercise.md msgid "" -"It is typical to put each type or set of closely-related types into its own module, so each " -"widget type should get its own module." +"It is typical to put each type or set of closely-related types into its own " +"module, so each widget type should get its own module." msgstr "" #: src/modules/exercise.md @@ -9436,14 +10287,14 @@ msgstr "تنظیم" #: src/modules/exercise.md msgid "" -"The Rust playground only supports one file, so you will need to make a Cargo project on your " -"local filesystem:" +"The Rust playground only supports one file, so you will need to make a Cargo " +"project on your local filesystem:" msgstr "" #: src/modules/exercise.md msgid "" -"Edit the resulting `src/main.rs` to add `mod` statements, and add additional files in the " -"`src` directory." +"Edit the resulting `src/main.rs` to add `mod` statements, and add additional " +"files in the `src` directory." msgstr "" #: src/modules/exercise.md @@ -9476,7 +10327,8 @@ msgstr "" #: src/modules/exercise.md msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" @@ -9522,9 +10374,9 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, and get accustomed " -"to the required `mod`, `use`, and `pub` declarations. Afterward, discuss what organizations " -"are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, " +"and get accustomed to the required `mod`, `use`, and `pub` declarations. " +"Afterward, discuss what organizations are most idiomatic." msgstr "" #: src/modules/solution.md @@ -9610,8 +10462,9 @@ msgstr "" #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` module, using " -"`#[cfg(test)]` to conditionally compile them only when building tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested " +"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " +"building tests." msgstr "" #: src/testing/unit-tests.md @@ -9679,7 +10532,9 @@ msgid "The code will be compiled and executed as part of `cargo test`." msgstr "" #: src/testing/other.md -msgid "Adding `#` in the code will hide it from the docs, but will still compile/run it." +msgid "" +"Adding `#` in the code will hide it from the docs, but will still compile/" +"run it." msgstr "" #: src/testing/other.md @@ -9690,9 +10545,9 @@ msgstr "" #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful built-in lints. " -"[Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, organized into groups " -"that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful " +"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " +"more lints, organized into groups that can be enabled per-project." msgstr "" #: src/testing/lints.md @@ -9701,21 +10556,22 @@ msgstr "" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints visible here, but " -"those will not be shown once the code compiles. Switch to the Playground site to show those " -"lints." +"Run the code sample and examine the error message. There are also lints " +"visible here, but those will not be shown once the code compiles. Switch to " +"the Playground site to show those lints." msgstr "" #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show clippy warnings. Clippy " -"has extensive documentation of its lints, and adds new lints (including default-deny lints) " -"all the time." +"After resolving the lints, run `clippy` on the playground site to show " +"clippy warnings. Clippy has extensive documentation of its lints, and adds " +"new lints (including default-deny lints) all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " +"or via your editor." msgstr "" #: src/testing/exercise.md @@ -9724,13 +10580,14 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used to validate credit " -"card numbers. The algorithm takes a string as input and does the following to validate the " -"credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " +"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) برای اعتبارسنجی شماره‌های کارت " -"اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی دریافت می‌کند و برای اعتبارسنجی " -"شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای " +"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " +"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " +"انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -9739,19 +10596,21 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره " +"`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " +"می‌کنیم." #: src/testing/exercise.md 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`." +"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` تبدیل می‌شود." +"پس از دوبل کردن یک عدد، اگر اون جفت خروجی بیش از 9 باشد، ارقام را جمع کنید. " +"بنابراین، دوبل کردن `7` به `14` تبدیل می‌شود که به `1 + 4 = 5` تبدیل می‌شود." #: src/testing/exercise.md msgid "Sum all the undoubled and doubled digits." @@ -9763,18 +10622,20 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, along with two basic " -"unit tests that confirm that most of the algorithm is implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, " +"along with two basic unit tests that confirm that most of the algorithm is " +"implemented correctly." msgstr "" #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional tests to uncover " -"bugs in the provided implementation, fixing any bugs you find." +"Copy the code below to and write additional " +"tests to uncover bugs in the provided implementation, fixing any bugs you " +"find." msgstr "" -"کد زیر را به کپی کنید و تابع را پیاده‌سازی " -"کنید." +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -9851,8 +10712,11 @@ msgstr "" #: src/welcome-day-4-afternoon.md #, fuzzy msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 15 minutes. It contains:" -msgstr "با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"Including 10 minute breaks, this session should take about 2 hours and 15 " +"minutes. It contains:" +msgstr "" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/error-handling.md #, fuzzy @@ -9900,15 +10764,20 @@ msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" #: src/error-handling/panics.md -msgid "A panic will \"unwind\" the stack, dropping values just as if the functions had returned." +msgid "" +"A panic will \"unwind\" the stack, dropping values just as if the functions " +"had returned." msgstr "" #: src/error-handling/panics.md -msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "" +"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" #: src/error-handling/panics.md -msgid "By default, a panic will cause the stack to unwind. The unwinding can be caught:" +msgid "" +"By default, a panic will cause the stack to unwind. The unwinding can be " +"caught:" msgstr "" #: src/error-handling/panics.md @@ -9924,11 +10793,15 @@ msgid "\"oh no!\"" msgstr "\"oh no!\"" #: src/error-handling/panics.md -msgid "Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" +msgid "" +"Catching is unusual; do not attempt to implement exceptions with " +"`catch_unwind`!" msgstr "" #: src/error-handling/panics.md -msgid "This can be useful in servers which should keep running even if a single request crashes." +msgid "" +"This can be useful in servers which should keep running even if a single " +"request crashes." msgstr "" #: src/error-handling/panics.md @@ -9937,36 +10810,38 @@ msgstr "" #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://doc.rust-lang.org/" -"stable/std/result/enum.Result.html) enum, which we briefly saw when discussing standard " -"library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://" +"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " +"saw when discussing standard library types." msgstr "" #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` which contains an " -"error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` " +"which contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's type signature by " -"having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's " +"type signature by having the function return a `Result` value." msgstr "" #: src/error-handling/result.md msgid "" -"Like with `Option`, there is no way to forget to handle an error: You cannot access either the " -"success value or the error value without first pattern matching on the `Result` to check which " -"variant you have. Methods like `unwrap` make it easier to write quick-and-dirty code that " -"doesn't do robust error handling, but means that you can always see in your source code where " +"Like with `Option`, there is no way to forget to handle an error: You cannot " +"access either the success value or the error value without first pattern " +"matching on the `Result` to check which variant you have. Methods like " +"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " +"error handling, but means that you can always see in your source code where " "proper error handling is being skipped." msgstr "" #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling conventions that " -"students may be familiar with from other programming languages." +"It may be helpful to compare error handling in Rust to error handling " +"conventions that students may be familiar with from other programming " +"languages." msgstr "" #: src/error-handling/result.md @@ -9975,15 +10850,17 @@ msgstr "" #: src/error-handling/result.md msgid "" -"In most languages with exceptions, whether or not a function can throw an exception is not " -"visible as part of its type signature. This generally means that you can't tell when calling a " -"function if it may throw an exception or not." +"In most languages with exceptions, whether or not a function can throw an " +"exception is not visible as part of its type signature. This generally means " +"that you can't tell when calling a function if it may throw an exception or " +"not." msgstr "" #: src/error-handling/result.md msgid "" -"Exceptions generally unwind the call stack, propagating upward until a `try` block is reached. " -"An error originating deep in the call stack may impact an unrelated function further up." +"Exceptions generally unwind the call stack, propagating upward until a `try` " +"block is reached. An error originating deep in the call stack may impact an " +"unrelated function further up." msgstr "" #: src/error-handling/result.md @@ -9992,21 +10869,24 @@ msgstr "" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error value) separately " -"from the successful return value of the function. Examples include C and Go." +"Some languages have functions return an error number (or some other error " +"value) separately from the successful return value of the function. Examples " +"include C and Go." msgstr "" #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error value, in which case " -"you may be accessing an uninitialized or otherwise invalid success value." +"Depending on the language it may be possible to forget to check the error " +"value, in which case you may be accessing an uninitialized or otherwise " +"invalid success value." msgstr "" #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with the `Result` type, " -"but matching this type on every call can be cumbersome. The try-operator `?` is used to return " -"errors to the caller. It lets you turn the common" +"Runtime errors like connection-refused or file-not-found are handled with " +"the `Result` type, but matching this type on every call can be cumbersome. " +"The try-operator `?` is used to return errors to the caller. It lets you " +"turn the common" msgstr "" #: src/error-handling/try.md @@ -10040,19 +10920,22 @@ msgstr "" #: src/error-handling/try.md msgid "" -"Use the `fs::write` call to test out the different scenarios: no file, empty file, file with " -"username." +"Use the `fs::write` call to test out the different scenarios: no file, empty " +"file, file with username." msgstr "" #: src/error-handling/try.md msgid "" -"Note that `main` can return a `Result<(), E>` as long as it implements `std::process::" -"Termination`. In practice, this means that `E` implements `Debug`. The executable will print " -"the `Err` variant and return a nonzero exit status on error." +"Note that `main` can return a `Result<(), E>` as long as it implements `std::" +"process::Termination`. In practice, this means that `E` implements `Debug`. " +"The executable will print the `Err` variant and return a nonzero exit status " +"on error." msgstr "" #: src/error-handling/try-conversions.md -msgid "The effective expansion of `?` is a little more complicated than previously indicated:" +msgid "" +"The effective expansion of `?` is a little more complicated than previously " +"indicated:" msgstr "" #: src/error-handling/try-conversions.md @@ -10061,8 +10944,9 @@ msgstr "" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the type returned by " -"the function. This makes it easy to encapsulate errors into higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the " +"type returned by the function. This makes it easy to encapsulate errors into " +"higher-level errors." msgstr "" #: src/error-handling/try-conversions.md @@ -10079,29 +10963,31 @@ msgstr "" #: src/error-handling/try-conversions.md msgid "" -"The `?` operator must return a value compatible with the return type of the function. For " -"`Result`, it means that the error types have to be compatible. A function that returns " -"`Result` can only use `?` on a value of type `Result` if " -"`ErrorOuter` and `ErrorInner` are the same type or if `ErrorOuter` implements " -"`From`." +"The `?` operator must return a value compatible with the return type of the " +"function. For `Result`, it means that the error types have to be compatible. " +"A function that returns `Result` can only use `?` on a value " +"of type `Result` if `ErrorOuter` and `ErrorInner` are the " +"same type or if `ErrorOuter` implements `From`." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, especially when the " -"conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, " +"especially when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"There is no compatibility requirement for `Option`. A function returning `Option` can use " -"the `?` operator on `Option` for arbitrary `T` and `U` types." +"There is no compatibility requirement for `Option`. A function returning " +"`Option` can use the `?` operator on `Option` for arbitrary `T` and " +"`U` types." msgstr "" #: src/error-handling/try-conversions.md msgid "" -"A function that returns `Result` cannot use `?` on `Option` and vice versa. However, `Option::" -"ok_or` converts `Option` to `Result` whereas `Result::ok` turns `Result` into `Option`." +"A function that returns `Result` cannot use `?` on `Option` and vice versa. " +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -10110,9 +10996,10 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing our own enum " -"covering all the different possibilities. The `std::error::Error` trait makes it easy to " -"create a trait object that can contain any error." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" #: src/error-handling/error.md @@ -10133,41 +11020,44 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) or `std::num::" -"ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle different error cases " -"differently in the program. As such it's generally not a good idea to use `Box` in " -"the public API of a library, but it can be a good option in a program where you just want to " -"display the error message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom error type so it " -"can be boxed. But if you need to support the `no_std` attribute, keep in mind that the `std::" -"error::Error` trait is currently compatible with `no_std` in [nightly](https://github.com/rust-" -"lang/rust/issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed. But if you need to support the `no_std` " +"attribute, keep in mind that the `std::error::Error` trait is currently " +"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" +"issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/anyhow/) crates " -"are widely used to simplify error handling." +"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" +"anyhow/) crates are widely used to simplify error handling." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`thiserror` is often used in libraries to create custom error types that implement `From`." +"`thiserror` is often used in libraries to create custom error types that " +"implement `From`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in functions, including " -"adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in " +"functions, including adding contextual information to your errors." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -10200,8 +11090,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful attributes to help " -"define error types in a compact way." +"The `Error` derive macro is provided by `thiserror`, and has lots of useful " +"attributes to help define error types in a compact way." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -10218,8 +11108,9 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally " -"not a good choice for the public API of a library, but is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -10227,33 +11118,37 @@ msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" #: src/error-handling/thiserror-and-anyhow.md -msgid "Actual error type inside of it can be extracted for examination if necessary." +msgid "" +"Actual error type inside of it can be extracted for examination if necessary." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides " -"similar usage patterns and ergonomics to `(T, error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go " +"developers, as it provides similar usage patterns and ergonomics to `(T, " +"error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` types. `use " -"anyhow::Context` is necessary to enable `.context()` and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" #: src/error-handling/exercise.md msgid "" -"The following implements a very simple parser for an expression language. However, it handles " -"errors by panicking. Rewrite it to instead use idiomatic error handling and propagate errors " -"to a return from `main`. Feel free to use `thiserror` and `anyhow`." +"The following implements a very simple parser for an expression language. " +"However, it handles errors by panicking. Rewrite it to instead use idiomatic " +"error handling and propagate errors to a return from `main`. Feel free to " +"use `thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is working correctly, " -"update `Tokenizer` to implement `Iterator>` and handle that " -"in the parser." +"HINT: start by fixing error handling in the `parse` function. Once that is " +"working correctly, update `Tokenizer` to implement " +"`Iterator>` and handle that in the parser." msgstr "" #: src/error-handling/exercise.md src/error-handling/solution.md @@ -10349,17 +11244,21 @@ msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" #: src/unsafe-rust/unsafe.md -msgid "**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." +msgid "" +"**Unsafe Rust:** can trigger undefined behavior if preconditions are " +"violated." msgstr "" #: src/unsafe-rust/unsafe.md -msgid "We saw mostly safe Rust in this course, but it's important to know what Unsafe Rust is." +msgid "" +"We saw mostly safe Rust in this course, but it's important to know what " +"Unsafe Rust is." msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe code is usually small and isolated, and its correctness should be carefully documented. " -"It is usually wrapped in a safe abstraction layer." +"Unsafe code is usually small and isolated, and its correctness should be " +"carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" #: src/unsafe-rust/unsafe.md @@ -10388,16 +11287,17 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"We will briefly cover unsafe capabilities next. For full details, please see [Chapter 19.1 in " -"the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) and the [Rustonomicon]" -"(https://doc.rust-lang.org/nomicon/)." +"We will briefly cover unsafe capabilities next. For full details, please see " +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers have turned off some " -"compiler safety features and have to write correct code by themselves. It means the compiler " -"no longer enforces Rust's memory-safety rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers " +"have turned off some compiler safety features and have to write correct code " +"by themselves. It means the compiler no longer enforces Rust's memory-safety " +"rules." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -10411,7 +11311,8 @@ msgstr "\"مراقب باش!\"" #: src/unsafe-rust/dereferencing.md msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -10443,15 +11344,15 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write a comment for each " -"`unsafe` block explaining how the code inside it satisfies the safety requirements of the " -"unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write " +"a comment for each `unsafe` block explaining how the code inside it " +"satisfies the safety requirements of the unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"In the case of pointer dereferences, this means that the pointers must be [_valid_](https://" -"doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" +"In the case of pointer dereferences, this means that the pointers must be " +"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" #: src/unsafe-rust/dereferencing.md @@ -10459,7 +11360,9 @@ msgid "The pointer must be non-null." msgstr "" #: src/unsafe-rust/dereferencing.md -msgid "The pointer must be _dereferenceable_ (within the bounds of a single allocated object)." +msgid "" +"The pointer must be _dereferenceable_ (within the bounds of a single " +"allocated object)." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -10472,8 +11375,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object must be live and no " -"reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object " +"must be live and no reference may be used to access the memory." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -10482,9 +11385,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has the `'static` " -"lifetime, so `r3` has type `&'static String`, and thus outlives `s`. Creating a reference from " -"a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " +"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " +"outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md @@ -10502,11 +11405,13 @@ msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"However, since data races can occur, it is unsafe to read and write mutable static variables:" +"However, since data races can occur, it is unsafe to read and write mutable " +"static variables:" msgstr "" #: src/unsafe-rust/mutable-static.md -msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" #: src/unsafe-rust/mutable-static.md @@ -10515,16 +11420,17 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" -"The program here is safe because it is single-threaded. However, the Rust compiler is " -"conservative and will assume the worst. Try removing the `unsafe` and see how the compiler " -"explains that it is undefined behavior to mutate a static from multiple threads." +"The program here is safe because it is single-threaded. However, the Rust " +"compiler is conservative and will assume the worst. Try removing the " +"`unsafe` and see how the compiler explains that it is undefined behavior to " +"mutate a static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases where it might make " -"sense in low-level `no_std` code, such as implementing a heap allocator or working with some C " -"APIs." +"Using a mutable static is generally a bad idea, but there are some cases " +"where it might make sense in low-level `no_std` code, such as implementing a " +"heap allocator or working with some C APIs." msgstr "" #: src/unsafe-rust/unions.md @@ -10546,15 +11452,16 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally " -"needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They " +"are occasionally needed for interacting with C library APIs." msgstr "" #: src/unsafe-rust/unions.md msgid "" -"If you just want to reinterpret bytes as a different type, you probably want [`std::mem::" -"transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute.html) or a safe wrapper such " -"as the [`zerocopy`](https://crates.io/crates/zerocopy) crate." +"If you just want to reinterpret bytes as a different type, you probably want " +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." +"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" +"crates/zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -10563,15 +11470,17 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions you must uphold to " -"avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions " +"you must uphold to avoid undefined behaviour:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -#: src/android/interoperability/with-c.md src/android/interoperability/with-c/rust.md -#: src/android/interoperability/cpp/cpp-bridge.md src/exercises/chromium/build-rules.md -#: src/bare-metal/aps/inline-assembly.md src/bare-metal/aps/better-uart/using.md -#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/solutions-afternoon.md +#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md +#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md +#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "\"C\"" msgstr "\"C\"" @@ -10617,8 +11526,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular conditions to avoid " -"undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular " +"conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -10640,30 +11549,32 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can create UB if the " -"range is incorrect. `abs` is incorrect for a different reason: it is an external function " -"(FFI). Calling external functions is usually only a problem when those functions do things " -"with pointers which might violate Rust's memory model, but in general any C function might " -"have undefined behaviour under any arbitrary circumstances." +"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " +"create UB if the range is incorrect. `abs` is incorrect for a different " +"reason: it is an external function (FFI). Calling external functions is " +"usually only a problem when those functions do things with pointers which " +"might violate Rust's memory model, but in general any C function might have " +"undefined behaviour under any arbitrary circumstances." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://doc.rust-lang." -"org/reference/items/external-blocks.html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too]" +"(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done safely with " -"references." +"We wouldn't actually use pointers for a `swap` function - it can be done " +"safely with references." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an `unsafe` block. We can " -"prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it and see what happens. This " -"will likely change in a future Rust edition." +"Note that unsafe code is allowed within an unsafe function without an " +"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " +"Try adding it and see what happens. This will likely change in a future Rust " +"edition." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10672,14 +11583,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation must guarantee " -"particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation " +"must guarantee particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something like this](https://" -"docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something " +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10695,12 +11606,14 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining the requirements " -"for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining " +"the requirements for the trait to be safely implemented." msgstr "" #: src/unsafe-rust/unsafe-traits.md -msgid "The actual safety section for `AsBytes` is rather longer and more complicated." +msgid "" +"The actual safety section for `AsBytes` is rather longer and more " +"complicated." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10713,9 +11626,9 @@ msgstr "امن بودن FFI Wrapper" #: src/unsafe-rust/exercise.md msgid "" -"Rust has great support for calling functions through a _foreign function interface_ (FFI). We " -"will use this to build a safe wrapper for the `libc` functions you would use from C to read " -"the names of files in a directory." +"Rust has great support for calling functions through a _foreign function " +"interface_ (FFI). We will use this to build a safe wrapper for the `libc` " +"functions you would use from C to read the names of files in a directory." msgstr "" #: src/unsafe-rust/exercise.md @@ -10736,8 +11649,9 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) module. " -"There you find a number of string types which you need for the exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" +"ffi/) module. There you find a number of string types which you need for the " +"exercise:" msgstr "" #: src/unsafe-rust/exercise.md @@ -10750,8 +11664,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://doc.rust-lang." -"org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -10764,8 +11678,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`](https://doc.rust-" -"lang.org/std/ffi/struct.CString.html)" +"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" +"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -10778,8 +11692,8 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`](https://doc." -"rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " +"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" #: src/unsafe-rust/exercise.md @@ -10795,7 +11709,9 @@ msgid "You will convert between all these types:" msgstr "" #: src/unsafe-rust/exercise.md -msgid "`&str` to `CString`: you need to allocate space for a trailing `\\0` character," +msgid "" +"`&str` to `CString`: you need to allocate space for a trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md @@ -10803,36 +11719,39 @@ msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" #: src/unsafe-rust/exercise.md -msgid "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` character," +msgid "" +"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some unknown data\"," +"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " +"unknown data\"," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`](https://doc.rust-" -"lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," +"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to return it and " -"call `readdir` again." +"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " +"return it and call `readdir` again." msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful chapter about " -"FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " +"useful chapter about FFI." msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"Copy the code below to and fill in the missing functions and " -"methods:" +"Copy the code below to and fill in the missing " +"functions and methods:" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md @@ -10863,8 +11782,10 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md @@ -10972,96 +11893,102 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can write new services, " -"libraries, drivers or even firmware in Rust (or improve existing code as needed)." +"Rust is supported for system software on Android. This means that you can " +"write new services, libraries, drivers or even firmware in Rust (or improve " +"existing code as needed)." msgstr "" -"‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می توانید سرویس‌ها، " -"کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا در صورت نیاز کدهای موجود را " -"بهبود ببخشید)." +"‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " +"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to find a little " -"corner of your code base where we can move some lines of code to Rust. The fewer dependencies " -"and \"exotic\" types the better. Something that parses some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to " +"find a little corner of your code base where we can move some lines of code " +"to Rust. The fewer dependencies and \"exotic\" types the better. Something " +"that parses some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین سعی کنید " -"گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به Rust منتقل کنیم. هر چه " -"وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه " -"کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " +"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " +"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " +"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md -msgid "The speaker may mention any of the following given the increased use of Rust in Android:" +msgid "" +"The speaker may mention any of the following given the increased use of Rust " +"in Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " +"زیر اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-" -"android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-http3-in-android." -"html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/rutabaga_gfx." -"html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" msgstr "" -"کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/appendix/" -"rutabaga_gfx.html)" +"کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-" -"v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-binder-" -"v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android." -"html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-in-android." -"html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure you have " -"access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make " +"sure you have access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. مطمئن شوید " -"که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " +"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/start) for " -"details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/" +"setup/start) for details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/setup/start) " -"مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" +"docs/setup/start) مراجعه کنید." #: src/android/setup.md msgid "" -"Cuttlefish is a reference Android device designed to work on generic Linux desktops. MacOS " -"support is also planned." +"Cuttlefish is a reference Android device designed to work on generic Linux " +"desktops. MacOS support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی طراحی شده " -"است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " +"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is the ideal emulator " -"to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is " +"the ideal emulator to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل برای اجرای " -"بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " +"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "" +"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -11085,7 +12012,8 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "" +"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -11093,18 +12021,22 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static and shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static " +"and shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای static و share " -"را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " +"متغیرهای static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" msgstr "`rust_proc_macro`" #: src/android/build-rules.md -msgid "Produces a `proc-macro` Rust library. These are analogous to compiler plugins." -msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +msgid "" +"Produces a `proc-macro` Rust library. These are analogous to compiler " +"plugins." +msgstr "" +"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -11112,7 +12044,9 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." -msgstr "یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." +msgstr "" +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " +"می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -11128,20 +12062,23 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for a particular " -"protobuf." +"Generates source and produces a Rust library that provides an interface for " +"a particular protobuf." msgstr "" -"یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک protobuf خاص " -"فراهم می‌کند." +"یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " +"protobuf خاص فراهم می‌کند." #: src/android/build-rules.md msgid "`rust_bindgen`" msgstr "`rust_bindgen`" #: src/android/build-rules.md -msgid "Generates source and produces a Rust library containing Rust bindings to C libraries." +msgid "" +"Generates source and produces a Rust library containing Rust bindings to C " +"libraries." msgstr "" -"یک source تولید می‌کند و یک کتابخانه Rust حاوی پیوندهای Rust به کتابخانه‌های C تولید می‌کند." +"یک source تولید می‌کند و یک کتابخانه Rust حاوی پیوندهای Rust به کتابخانه‌های C " +"تولید می‌کند." #: src/android/build-rules.md msgid "We will look at `rust_binary` and `rust_library` next." @@ -11153,25 +12090,28 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages from the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages " +"from the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " +"اینترنت دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must also interop with C/" -"C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must " +"also interop with C/C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/C++/Java " -"همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " +"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-source variant " -"of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " +"استفاده در google3)." #: src/android/build-rules.md #, fuzzy @@ -11184,9 +12124,11 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, create the following " -"files:" -msgstr "اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد کنید:" +"Let us start with a simple application. At the root of an AOSP checkout, " +"create the following files:" +msgstr "" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " +"ایجاد کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -11197,7 +12139,8 @@ msgstr "_hello_rust/Android.bp_:" msgid "\"hello_rust\"" msgstr "\"hello_rust\"" -#: src/android/build-rules/binary.md src/android/build-rules/library.md src/android/logging.md +#: src/android/build-rules/binary.md src/android/build-rules/library.md +#: src/android/logging.md msgid "\"src/main.rs\"" msgstr "\"src/main.rs\"" @@ -11242,7 +12185,9 @@ msgstr "کتابخانه‌های Rust" #: src/android/build-rules/library.md msgid "You use `rust_library` to create a new Rust library for Android." -msgstr "شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده می‌کنید." +msgstr "" +"شما از `rust_library` برای ایجاد یک کتابخانه Rust جدید برای Android استفاده " +"می‌کنید." #: src/android/build-rules/library.md msgid "Here we declare a dependency on two libraries:" @@ -11255,11 +12200,13 @@ msgstr "‏ `libgreeting`, چیزی که در زیر تعریف می‌کنیم, #: src/android/build-rules/library.md #, fuzzy msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`](https://cs." -"android.com/android/platform/superproject/+/master:external/rust/crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://cs.android.com/" -"android/platform/superproject/+/master:external/rust/crates/) عرضه شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/) عرضه شده است." #: src/android/build-rules/library.md #, fuzzy @@ -11283,8 +12230,9 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md src/android/aidl/example-service/service.md -#: src/android/testing.md src/android/interoperability/java.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/service.md src/android/testing.md +#: src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -11313,23 +12261,25 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android.com/guide/" -"components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android." +"com/guide/components/aidl) is supported in Rust:" msgstr "" -"‏[Android Interface Definition Language (AIDL)](https://developer.android.com/guide/components/" -"aidl) در Rust پشتیبانی می‌شود:" +"‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" +"guide/components/aidl) در Rust پشتیبانی می‌شود:" #: src/android/aidl.md msgid "Rust code can call existing AIDL servers," @@ -11341,13 +12291,13 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" -"To illustrate how to use Rust with Binder, we're going to walk through the process of creating " -"a Binder interface. We're then going to both implement the described service and write client " -"code that talks to that service." +"To illustrate how to use Rust with Binder, we're going to walk through the " +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder را بررسی " -"کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را می‌نویسیم که با آن سرویس صحبت " -"می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " +"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " +"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -11359,8 +12309,10 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -11393,13 +12345,14 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match the package name " -"used in the AIDL file, i.e. the package is `com.example.birthdayservice` and the file is at " -"`aidl/com/example/IBirthdayService.aidl`." +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." +"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package استفاده شده در " -"فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example.birthdayservice` و این فایل در " -"`aidl/com/example/IBirthdayService.aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " +"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." +"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." +"aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -11407,9 +12360,11 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to talk to the " -"service." -msgstr "‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با سرویس" +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." +msgstr "" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"با سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -11417,28 +12372,35 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use this trait to talk to " -"the service." +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با سرویس‌ها " -"استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " +"صحبت با سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md -msgid "The generated bindings can be found at `out/soong/.intermediates//`." -msgstr "پیوندهای تولید شده را می توان در `out/soong/.intermediates//` یافت." +msgid "" +"The generated bindings can be found at `out/soong/.intermediates//`." +msgstr "" +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" +"` یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument and return types, " -"correspond the interface definition." +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." msgstr "" -"اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و بازگشتی، با تعریف " -"interface مطابقت دارد." +"اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " +"بازگشتی، با تعریف interface مطابقت دارد." #: src/android/aidl/example-service/service-bindings.md -msgid "`String` for an argument results in a different Rust type than `String` as a return type." +msgid "" +"`String` for an argument results in a different Rust type than `String` as a " +"return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " +"type برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -11464,45 +12426,51 @@ msgstr "/// The `IBirthdayService` implementation.\n" msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "\"Happy Birthday {name}, congratulations with the {years} years!\"" -#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "_birthday_service/Android.bp_:" msgstr "_birthday_service/Android.bp_:" -#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md msgid "\"libbirthdayservice\"" msgstr "\"libbirthdayservice\"" -#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md #, fuzzy msgid "\"birthdayservice\"" msgstr "\"birthdayservice\"" -#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"com.example.birthdayservice-rust\"" msgstr "\"com.example.birthdayservice-rust\"" -#: src/android/aidl/example-service/service.md src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"libbinder_rs\"" msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain why each of the " -"segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از بخش‌ها ضروری " -"است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " +"از بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to override? Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای override وجود " -"دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " +"برای override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -11539,22 +12507,24 @@ msgstr "\"birthday_server\"" msgid "\"src/server.rs\"" msgstr "سرورها" -#: src/android/aidl/example-service/server.md src/android/aidl/example-service/client.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md msgid "// To avoid dynamic link error.\n" msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case the " -"`BirthdayService` type, which implements the `IBirthdayService`) and starting it as a Binder " -"service has multiple steps, and may appear more complicated than students are used to if " -"they've used Binder from C++ or another language. Explain to students why each step is " -"necessary." +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " -"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند مرحله دارد و ممکن " -"است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. اگر آن‌ها از Binder برای C++ یا " -"زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " +"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " +"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " +"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " +"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -11562,31 +12532,33 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this case). This " -"type is generated by Binder and provides the common Binder functionality that would be " -"provided by the `BnBinder` base class in C++. We don't have inheritance in Rust, so instead we " -"use composition, putting our `BirthdayService` within the generated `BnBinderService`." +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " +"functionality that would be provided by the `BnBinder` base class in C++. We " +"don't have inheritance in Rust, so instead we use composition, putting our " +"`BirthdayService` within the generated `BnBinderService`." msgstr "" -"این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،`BnBirthdayService`). این " -"نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را ارائه می‌کند که توسط کلاس پایه `BnBinder` " -"در C++ ارائه می‌شود. ما در Rust ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب " -"composition می‌کنیم و `BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." +"این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " +"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " +"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object (the " -"`BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " -"«BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " +"(شی‏ «BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool and start listening " -"for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه کنید و شروع به " -"گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " +"اضافه کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -11596,14 +12568,16 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -11634,7 +12608,8 @@ msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md +#: src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -11669,60 +12644,67 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service that the client " -"has connected to." +"`Strong` is the trait object representing the service " +"that the client has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که کلاینت به آن " -"متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " +"که کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-process ref count " -"for the service trait object, and the global Binder ref count that tracks how many processes " -"have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون فرآیندی (in-" -"process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global Binder را که تعداد " -"فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " +"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " +"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " +"ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses the exact same " -"trait that the server implements. For a given Binder interface, there is a single Rust trait " -"generated that both client and server use." +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." msgstr "" -"توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، دقیقاً از همان " -"ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder interface معین، یک trait یا ویژگی " -"Rust ایجاد شده است که هم کلاینت و هم سرور از آن استفاده می کنند." +"توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " +"دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " +"از آن استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This should ideally be " -"defined in a common crate that both the client and server can depend on." +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." msgstr "" -"از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور ایده‌آل باید در یک " -"crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن وابسته باشند." +"از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " +"آن وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients specify a list of lines " -"for the birthday card:" +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم لیستی از خطوط را " -"برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " +"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -11730,11 +12712,13 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in Rust, i.e. " -"that idiomatic Rust types are used in the generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust ترجمه می‌شود، " -"به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " +"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " +"شده تا جایی که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -11772,8 +12756,10 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "TODO: Move code snippets into project files where they'll actually be built?" -msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "" +"TODO: Move code snippets into project files where they'll actually be built?" +msgstr "" +"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -11785,15 +12771,21 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "" +"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "" +"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md -msgid "References to AIDL objects and file handles can be sent between clients and services." -msgstr "ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." +msgid "" +"References to AIDL objects and file handles can be sent between clients and " +"services." +msgstr "" +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " +"کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -11802,7 +12794,8 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "" +"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -11877,11 +12870,12 @@ msgstr "`f64`" #: src/android/aidl/types/arrays.md msgid "" -"The array types (`T[]`, `byte[]`, and `List`) get translated to the appropriate Rust array " -"type depending on how they are used in the function signature:" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the " +"appropriate Rust array type depending on how they are used in the function " +"signature:" msgstr "" -"انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در function signature، " -"به Rust array type مناسب ترجمه می‌شوند:" +"انواع آرایه (`T[]`, `byte[]`, و `List`) بسته به نحوه استفاده از آنها در " +"function signature، به Rust array type مناسب ترجمه می‌شوند:" #: src/android/aidl/types/arrays.md #, fuzzy @@ -11908,19 +12902,22 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes `[T; N]`. Fixed-" -"size arrays can have multiple dimensions (e.g. `int[3][4]`). In the Java backend, fixed-size " -"arrays are represented as array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به `[T; N]`. " -"آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3][4]`. در Java backend، " -"آرایه‌های با اندازه ثابت به عنوان array type نمایش داده می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " +"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " +"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " +"type نمایش داده می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -11928,20 +12925,26 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-erased `IBinder` " -"interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface پاک‌شده ارسال " -"کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " +"interface پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" -msgstr "**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" +msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" -msgstr "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" #: src/android/aidl/types/objects.md msgid "/** The same thing, but using a binder object. */" @@ -11971,16 +12974,18 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " "`BnBirthdayService` that we saw previously." msgstr "" -"به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف `BnBirthdayService` است که قبلاً " -"دیدیم." +"به استفاده از `BnBirthdayInfoProvider` توجه کنید. این همان هدف " +"`BnBirthdayService` است که قبلاً دیدیم." #: src/android/aidl/types/parcelables.md #, fuzzy @@ -11988,8 +12993,10 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -11997,10 +13004,12 @@ msgid "/** The same thing, but with a parcelable. */" msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md -msgid "Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` type:" +msgid "" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای Binder ارسال " -"کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" +"سرورهای Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -12037,11 +13046,13 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -12051,18 +13062,21 @@ msgstr "\"Invalid file handle\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` (or any other " -"type that wraps an `OwnedFd`), and can be used to create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." msgstr "" -"‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک `File` (یا هر نوع " -"دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای ایجاد یک دسته `File` جدید در " -"طرف دیگر استفاده شود." +"‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " +"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md -msgid "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX sockets." +msgid "" +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های TCP، UDP و " -"UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " +"سوکت های TCP، UDP و UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -12070,11 +13084,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests work in AOSP. Use the " -"`rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests " +"work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم پرداخت. از " -"ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " +"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -12142,7 +13156,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -12152,7 +13167,8 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -12160,19 +13176,19 @@ msgstr "" #: src/android/testing.md msgid "" -"Notice how you only mention the root of the library crate. Tests are found recursively in " -"nested modules." +"Notice how you only mention the root of the library crate. Tests are found " +"recursively in nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی در ماژول‌های " -"تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " +"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" -"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test assertions using " -"_matchers_:" +"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " +"assertions using _matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه می‌دهد تا " -"assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " +"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -12184,46 +13200,55 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured error message pin-" -"pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که خطا را pin-" -"pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " +"که خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this example in a local " -"environment. Use `cargo add googletest` to quickly add it to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local اجرا " -"کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " +"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " +"add googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used macros and types]" -"(https://docs.rs/googletest/latest/googletest/prelude/index.html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used " +"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." +"html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://docs.rs/" -"googletest/latest/googletest/prelude/index.html) را وارد می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" +"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " +"می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider going through the " -"first chapter of [\"Advanced testing for Rust applications\"](https://rust-exercises.com/" -"advanced-testing/), a self-guided Rust course: it provides a guided introduction to the " -"library, with exercises to help you get comfortable with `googletest` macros, its matchers and " -"its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" -"این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش پیشرفته برای برنامه " -"های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-workshop)، یک دوره آموزشی Rust " -"را در نظر بگیرید: این یک مقدمه راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با " -"ماکروهای `googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." +"این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" +"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " +"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " +"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md -msgid "A particularly nice feature is that mismatches in multi-line strings are shown as a diff:" +msgid "" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " +"نشان داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -12250,99 +13275,113 @@ msgid "shows a color-coded diff (colors not shown here):" msgstr "تفاوت رنگی را نشان می‌دهد (رنگ ها در اینجا نشان‌داده نمی‌شوند):" #: src/android/testing/googletest.md -msgid "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/googletest/)." +msgid "" +"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" +"googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " +"در Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You need to " -"refactor your code to use traits, which you can then quickly mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " +"You need to refactor your code to use traits, which you can then quickly " +"mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده استفاده شده " -"است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس می‌توانید به سرعت آنها را " -"mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " +"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " +"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are other [mocking " -"libraries available on crates.io](https://crates.io/keywords/mock), in particular in the area " -"of mocking HTTP services. The other mocking libraries work in a similar fashion as Mockall, " -"meaning that they make it easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other [mocking libraries available on crates.io](https://crates.io/keywords/" +"mock), in particular in the area of mocking HTTP services. The other mocking " +"libraries work in a similar fashion as Mockall, meaning that they make it " +"easy to get a mock implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking دیگری در " -"crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در زمینه سرویس‌های mocking " -"HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی " -"یا mock یک ویژگی خاص را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " +"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " +"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " +"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " +"را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely isolate a test " -"from its dependencies. The immediate result is faster and more stable test execution. On the " -"other hand, the mocks can be configured wrongly and return output different from what the real " -"dependencies would do." +"Note that mocking is somewhat _controversial_: mocks allow you to completely " +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان را می‌دهند که " -"آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای سریع‌تر و پایدارتر تست است. از " -"طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی " -"انجام می دادند را برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " +"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " +"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " +"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " +"برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As an example, many " -"databases allow you to configure an in-memory backend. This means that you get the correct " -"behavior in your tests, plus they are fast and will automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." msgstr "" -"در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، بسیاری از " -"پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی کنید. این به این معنی است " -"که شما در تست های خود رفتار صحیح را دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار " -"پس از اجرای عملیات مخصوص به خود پاک می شوند." +"در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " +"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " +"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " +"مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" -"Similarly, many web frameworks allow you to start an in-process server which binds to a random " -"port on `localhost`. Always prefer this over mocking away the framework since it helps you " -"test your code in the real environment." +"Similarly, many web frameworks allow you to start an in-process server which " +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process دیگر " -"راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را به mock کردن " -"framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " +"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " +"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " +"را در محیط واقعی آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example in a local " -"environment. Use `cargo add mockall` to quickly add Mockall to an existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local اجرا کنید. " -"از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " +"پروژه Cargo موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up expectations which depend " -"on the arguments passed. Here we use this to mock a cat which becomes hungry 3 hours after the " -"last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که به استدلال های " -"ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat استفاده می‌کنیم که 3 ساعت پس " -"از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " +"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " +"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " +"گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be called to `n` --- " -"the mock will automatically panic when dropped if this isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند به`n` فراخوانی " -"شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف کنید به‌طور خودکار دچار " -"panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " +"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " +"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) or `stdout` (on-" -"host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) " +"or `stdout` (on-host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی host) استفاده " -"کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " +"(روی host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -12402,13 +13441,15 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -12418,8 +13459,11 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This means that you can:" -msgstr "‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما می‌توانید:" +"Rust has excellent support for interoperability with other languages. This " +"means that you can:" +msgstr "" +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " +"شما می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -12431,11 +13475,12 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a _foreign function " -"interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a " +"_foreign function interface_, also known as FFI." msgstr "" -"وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع خارج( _foreign " -"function interface_) که به نام FFI نیز شناخته می‌شود، استفاده می‌کنید." +"وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " +"خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " +"می‌کنید." #: src/android/interoperability/with-c.md msgid "Interoperability with C" @@ -12443,11 +13488,12 @@ msgstr "قابلیت همکاری با C" #: src/android/interoperability/with-c.md msgid "" -"Rust has full support for linking object files with a C calling convention. Similarly, you can " -"export Rust functions and call them from C." +"Rust has full support for linking object files with a C calling convention. " +"Similarly, you can export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به طور مشابه، می " -"توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " +"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " +"کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -12463,12 +13509,19 @@ msgid "\"{x}, {abs_x}\"" msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md -msgid "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise.md)." -msgstr "ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." +msgid "" +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." +msgstr "" +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " +"دیدیم." #: src/android/interoperability/with-c.md -msgid "This assumes full knowledge of the target platform. Not recommended for production." -msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgid "" +"This assumes full knowledge of the target platform. Not recommended for " +"production." +msgstr "" +"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -12480,11 +13533,11 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool can auto-" -"generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"tool can auto-generate bindings from a C header file." msgstr "" -"ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) می‌تواند اتصالات را " -"از یک فایل هدر C به طور خودکار ایجاد کند." +"ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." #: src/android/interoperability/with-c/bindgen.md msgid "First create a small C library:" @@ -12535,8 +13588,12 @@ msgid "\"libbirthday.c\"" msgstr "\"libbirthday.c\"" #: src/android/interoperability/with-c/bindgen.md -msgid "Create a wrapper header file for the library (not strictly needed in this example):" -msgstr "یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" +msgid "" +"Create a wrapper header file for the library (not strictly needed in this " +"example):" +msgstr "" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " +"نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -12586,34 +13643,40 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات (bindings) " -"اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " +"اتصالات (bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -12709,30 +13772,35 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the " -"name of the function. You can also use `#[export_name = \"some_name\"]` to specify whatever " -"name you want." +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " +"will just be the name of the function. You can also use `#[export_name = " +"\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط نام تابع خواهد " -"بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " +"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " +"برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability between Rust " -"and C++." -msgstr "این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe " +"interoperability between Rust and C++." +msgstr "" +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " +"می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -12740,13 +13808,14 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed from each language " -"to the other. You provide this description using extern blocks in a Rust module annotated with " -"the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed " +"from each language to the other. You provide this description using extern " +"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض دید قرار " -"می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust ارائه می‌کنید که با " -"attribute ماکروها `#[cxx::bridge]` شرح داده شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " +"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " +"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " +"شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -12756,11 +13825,13 @@ msgstr "\"org::blobstore\"" msgid "// Shared structs with fields visible to both languages.\n" msgstr "// Shared structs with fields visible to both languages.\n" -#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/generated-cpp.md +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/generated-cpp.md msgid "// Rust types and signatures exposed to C++.\n" msgstr "// Rust types and signatures exposed to C++.\n" -#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/rust-bridge.md +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/rust-bridge.md #: src/android/interoperability/cpp/generated-cpp.md #: src/android/interoperability/cpp/rust-result.md #: src/chromium/interoperability-with-cpp/example-bindings.md @@ -12769,17 +13840,20 @@ msgstr "// Rust types and signatures exposed to C++.\n" msgid "\"Rust\"" msgstr "\"Rust\"" -#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md msgid "// C++ types and signatures exposed to Rust.\n" msgstr "" -#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md #: src/android/interoperability/cpp/cpp-exception.md #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"C++\"" msgstr "\"C++\"" -#: src/android/interoperability/cpp/bridge.md src/android/interoperability/cpp/cpp-bridge.md +#: src/android/interoperability/cpp/bridge.md +#: src/android/interoperability/cpp/cpp-bridge.md msgid "\"include/blobstore.h\"" msgstr "\"include/blobstore.h\"" @@ -12789,21 +13863,25 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching Rust and C++ type/" -"function definitions in order to expose those items to both languages." +"From the declarations made in the bridge module, CXX will generate matching " +"Rust and C++ type/function definitions in order to expose those items to " +"both languages." msgstr "" -"از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/function در Rust و +" -"+C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." +"از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " +"دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/cargo-expand) " -"to view the expanded proc macro. For most of the examples you would use `cargo expand ::ffi` " -"to expand just the `ffi` module (though this doesn't apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/" +"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " +"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " +"(though this doesn't apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-expand) که " -"برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از `cargo expand ::ffi` " -"فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " +"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " +"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -12828,19 +13906,23 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in the parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in " +"the parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " +"والد قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ header file " -"containing the corresponding C++ declarations. The generated header has the same path as the " -"Rust source file containing the bridge, except with a .rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" +"+ header file containing the corresponding C++ declarations. The generated " +"header has the same path as the Rust source file containing the bridge, " +"except with a .rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C حاوی اعلان‌های +" -"+C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که فایل منبع Rust حاوی پل دارای " -"آن است، به جز استفاده از پسوند فایل rs.h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" +"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " +"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." +"h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -12865,19 +13947,21 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed in are accurate. " -"CXX performs static assertions that the signatures exactly correspond with what is declared in " -"C++." +"The programmer does not need to promise that the signatures they have typed " +"in are accurate. CXX performs static assertions that the signatures exactly " +"correspond with what is declared in C++." msgstr "" -"برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است ندارد. CXX اظهارات " -"ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C اعلام شده مطابقت دارند." +"برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " +"ندارد. CXX اظهارات ثابتی را انجام می دهد که signatureها دقیقاً با آنچه در ++C " +"اعلام شده مطابقت دارند." #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to call from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to " +"call from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust امن هستند را " -"اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " +"Rust امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -12889,13 +13973,14 @@ msgstr "فقط C-like (unit) enums پشتیبانی می‌شود." #: src/android/interoperability/cpp/shared-types.md msgid "" -"A limited number of traits are supported for `#[derive()]` on shared types. Corresponding " -"functionality is also generated for the C++ code, e.g. if you derive `Hash` also generates an " -"implementation of `std::hash` for the corresponding C++ type." +"A limited number of traits are supported for `#[derive()]` on shared types. " +"Corresponding functionality is also generated for the C++ code, e.g. if you " +"derive `Hash` also generates an implementation of `std::hash` for the " +"corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد مربوطه نیز " -"برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، پیاده‌سازی `std::hash` " -"برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " +"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " +"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -12908,13 +13993,15 @@ msgstr "Generated C++:" #: src/android/interoperability/cpp/shared-enums.md #, fuzzy msgid "" -"On the Rust side, the code generated for shared enums is actually a struct wrapping a numeric " -"value. This is because it is not UB in C++ for an enum class to hold a value different from " -"all of the listed variants, and our Rust representation needs to have the same behavior." +"On the Rust side, the code generated for shared enums is actually a struct " +"wrapping a numeric value. This is because it is not UB in C++ for an enum " +"class to hold a value different from all of the listed variants, and our " +"Rust representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی را بسته‌بندی " -"می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از همه انواع فهرست شده " -"داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " +"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " +"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " +"رفتار مشابهی داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -12925,21 +14012,28 @@ msgid "\"Success!\"" msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md -msgid "Rust functions that return `Result` are translated to exceptions on the C++ side." -msgstr "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." +msgid "" +"Rust functions that return `Result` are translated to exceptions on the C++ " +"side." +msgstr "" +"توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" -"The exception thrown will always be of type `rust::Error`, which primarily exposes a way to " -"get the error message string. The error message will come from the error type's `Display` impl." +"The exception thrown will always be of type `rust::Error`, which primarily " +"exposes a way to get the error message string. The error message will come " +"from the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول راهی برای " -"دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " +"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " +"خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to immediately terminate." -msgstr "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." +"A panic unwinding from Rust to C++ will always cause the process to " +"immediately terminate." +msgstr "" +"باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." #: src/android/interoperability/cpp/cpp-exception.md msgid "\"example/include/example.h\"" @@ -12952,21 +14046,24 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception on the C++ side " -"and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception " +"on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت ++C را می‌گیرند " -"و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " +"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " +"برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not declared by the CXX " -"bridge to return `Result`, the program calls C++'s `std::terminate`. The behavior is " -"equivalent to the same exception being thrown through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not " +"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" +"terminate`. The behavior is equivalent to the same exception being thrown " +"through a `noexcept` C++ function." msgstr "" -"اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت \"نتیجه\" اعلان " -"نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی می‌کند. این رفتار معادل همان " -"exception است که از طریق یک `noexcept` C++ function فعال می‌شود." +"اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " +"C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -13026,39 +14123,42 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments and returns of " -"extern functions." +"These types can be used in the fields of shared structs and the arguments " +"and returns of extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " +"functionها استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are a few reasons for " -"this:" +"Note that Rust's `String` does not map directly to `std::string`. There are " +"a few reasons for this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند دلیل برای این " -"وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " +"چند دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." -msgstr "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." +msgid "" +"`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgstr "" +"‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed directly between " -"languages." +"The two types have different layouts in memory and so can't be passed " +"directly between languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً بین زبان‌ها " -"منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " +"مستقیماً بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move semantics, so a `std::" -"string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move " +"semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، بنابراین " -"`std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " +"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -13068,10 +14168,11 @@ msgstr "ساخت در اندروید" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Create a `cc_library_static` to build the C++ library, including the CXX generated header and " -"source file." +"Create a `cc_library_static` to build the C++ library, including the CXX " +"generated header and source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " +"شده CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -13098,39 +14199,43 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the dependencies " -"for the CXX-generated C++ bindings. We'll show how these are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." msgstr "" -"به این نکته اشاره کنید که `libcxx_test_bridge_header` و `libcxx_test_bridge_code` وابستگی‌هایی " -"برای پیوندهای ++C تولید شده توسط CXX ​​هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"به این نکته اشاره کنید که `libcxx_test_bridge_header` و " +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" +"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in order to pull in " -"common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." msgstr "" -"توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-header` وابسته " -"باشید." +"توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" +"header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs](https://source.android." -"com/docs/setup/build/rust/building-rust-modules/android-rust-patterns#rust-cpp-interop-using-" -"cxx). You may want to share that link with the class so that students know where they can find " -"these instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید [the Android " -"docs](https://source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" -"patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید " -"تا دانش‌آموزان بدانند که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " +"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" +"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " +"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " +"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the CXX source file. " -"These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the " +"CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. سپس از اینها " -"به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " +"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -13173,23 +14278,28 @@ msgstr "\"lib.rs.cc\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"The `cxxbridge` tool is a standalone tool that generates the C++ side of the bridge module. It " -"is included in Android and available as a Soong tool." +"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " +"bridge module. It is included in Android and available as a Soong tool." msgstr "" -"ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در Android گنجانده شده " -"و به عنوان ابزار Soong در دسترس است." +"ابزار`cxxbridge` یک ابزار مستقل است که سمت ++C ماژول پل را تولید می‌کند. در " +"Android گنجانده شده و به عنوان ابزار Soong در دسترس است." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"By convention, if your Rust source file is `lib.rs` your header file will be named `lib.rs.h` " -"and your source file will be named `lib.rs.cc`. This naming convention isn't enforced, though." +"By convention, if your Rust source file is `lib.rs` your header file will be " +"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " +"convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و فایل منبع شما " -"`lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." +"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " +"اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md -msgid "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." -msgstr "یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." +msgid "" +"Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." +msgstr "" +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " +"دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -13205,13 +14315,14 @@ msgstr "قابلیت همکاری با جاوا" #: src/android/interoperability/java.md msgid "" -"Java can load shared objects via [Java Native Interface (JNI)](https://en.wikipedia.org/wiki/" -"Java_Native_Interface). The [`jni` crate](https://docs.rs/jni/) allows you to create a " -"compatible library." +"Java can load shared objects via [Java Native Interface (JNI)](https://en." +"wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" +"jni/) allows you to create a compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface (JNI)](https://" -"en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` crate](https://docs.rs/jni/) " -"به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " +"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " +"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " +"کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -13281,11 +14392,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with and try to " -"integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with " +"and try to integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و سعی می‌کنیم " -"مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " +"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -13297,11 +14408,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone in the class " -"having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone " +"in the class having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی است که یک قطعه " -"کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " +"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -13309,47 +14420,52 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party glue code to connect " -"between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party " +"glue code to connect between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص برای اتصال " -"بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " +"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've got a corner of the " -"code where you're displaying a UTF8 string to the user, feel free to follow this recipe in " -"your part of the codebase instead of the exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've " +"got a corner of the code where you're displaying a UTF8 string to the user, " +"feel free to follow this recipe in your part of the codebase instead of the " +"exact part we talk about." msgstr "" -"امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر گوشه‌ای از کد را " -"دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت دقیقی که در مورد آن صحبت " -"می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد دنبال کنید." +"امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " +"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " +"پایگاه کد دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build flags is OK, so long " -"as your code is relatively recent (commit position 1223636 onwards, corresponding to November " -"2023):" +"Make sure you can build and run Chromium. Any platform and set of build " +"flags is OK, so long as your code is relatively recent (commit position " +"1223636 onwards, corresponding to November 2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از build flag ها " -"بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit 1223636 به بعد، مربوط به " -"نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " +"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " +"commit 1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md #, fuzzy msgid "" -"(A component, debug build is recommended for quickest iteration time. This is the default!)" +"(A component, debug build is recommended for quickest iteration time. This " +"is the default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک حالت پیش‌فرض " -"است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " +"یک حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-code/) if you " -"aren't already at that point. Be warned: setting up to build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" +"the-code/) if you aren't already at that point. Be warned: setting up to " +"build Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium.org/developers/" -"how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." +"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " +"برای build Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -13361,21 +14477,25 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" -"This part of the course has a series of exercises which build on each other. We'll be doing " -"them spread throughout the course instead of just at the end. If you don't have time to " -"complete a certain part, don't worry: you can catch up in the next slot." +"This part of the course has a series of exercises which build on each other. " +"We'll be doing them spread throughout the course instead of just at the end. " +"If you don't have time to complete a certain part, don't worry: you can " +"catch up in the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها را به جای " -"اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای تکمیل قسمت خاصی وقت " -"ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " +"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " +"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " +"به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io](https://crates.io/). " -"Chromium is built using `gn` and `ninja` and a curated set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io]" +"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " +"set of dependencies." msgstr "" -"جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) استفاده می‌کند. " -"Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها ساخته شده است." +"جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " +"استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " +"ساخته شده است." #: src/chromium/cargo.md msgid "When writing code in Rust, your choices are:" @@ -13383,39 +14503,41 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e.g. " -"`rust_static_library` that we'll meet later). This uses Chromium's audited toolchain and " -"crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." +"gni` (e.g. `rust_static_library` that we'll meet later). This uses " +"Chromium's audited toolchain and crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای بررسی‌شده " -"Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " +"crateهای بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " +"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" +"docs/rust.md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium محدود کنید]" -"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " +"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded from the " -"internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " +"downloaded from the internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای دانلود شده از " -"اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " +"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code can be built " -"into the Chromium browser. At the same time, Cargo is an important part of the Rust ecosystem " -"and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " +"code can be built into the Chromium browser. At the same time, Cargo is an " +"important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان کد Rust را در " -"مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم Rust است و شما باید آن را در " -"جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " +"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " +"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -13427,112 +14549,127 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk profile of these " -"scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the " +"risk profile of these scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های این سناریوها " -"را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " +"ریسک‌های این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" -"Discuss which tools, libraries, and groups of people need to be trusted when using `gn` and " -"`ninja`, offline `cargo`, etc." +"Discuss which tools, libraries, and groups of people need to be trusted when " +"using `gn` and `ninja`, offline `cargo`, etc." msgstr "" -"در هنگام استفاده از `gn` و `ninja`و `cargo` آفلاین و غیره در مورد ابزارها، کتابخانه‌ها و " -"گروه‌هایی از افراد بحث کنید." +"در هنگام استفاده از `gn` و `ninja`و `cargo` آفلاین و غیره در مورد ابزارها، " +"کتابخانه‌ها و گروه‌هایی از افراد بحث کنید." #: src/chromium/cargo.md msgid "" -"Ask students to avoid peeking at the speaker notes before completing the exercise. Assuming " -"folks taking the course are physically together, ask them to discuss in small groups of 3-4 " -"people." +"Ask students to avoid peeking at the speaker notes before completing the " +"exercise. Assuming folks taking the course are physically together, ask them " +"to discuss in small groups of 3-4 people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران خودداری کنند. با " -"فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، از آنها بخواهید در گروه های " -"کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " +"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " +"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where Cargo may offer an " -"advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where " +"Cargo may offer an advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " +"را ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, one has access to " -"the rich ecosystem of crates.io libraries. There is a crate for almost anything and they are " -"usually quite pleasant to use. (`clap` for command-line parsing, `serde` for serializing/" -"deserializing to/from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, " +"one has access to the rich ecosystem of crates.io libraries. There is a " +"crate for almost anything and they are usually quite pleasant to use. " +"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" +"from various formats, `itertools` for working with iterators, etc.)." msgstr "" -"این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به اکوسیستم غنی " -"کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک crate وجود دارد و معمولاً " -"استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط فرمان، `serde` برای سریال‌سازی/" -"جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." +"این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " +"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " +"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " +"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` and start " -"writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo." +"toml` and start writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه کنید و شروع به " -"نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " +"اضافه کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" -"It may be worth comparing how CPAN helped make `perl` a popular choice. Or comparing with " -"`python` + `pip`." +"It may be worth comparing how CPAN helped make `perl` a popular choice. Or " +"comparing with `python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با `python` + " -"`pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " +"مقایسه با `python` + `pip`." #: src/chromium/cargo.md #, fuzzy msgid "" -"Development experience is made really nice not only by core Rust tools (e.g. using `rustup` to " -"switch to a different `rustc` version when testing a crate that needs to work on nightly, " -"current stable, and older stable) but also by an ecosystem of third-party tools (e.g. Mozilla " -"provides `cargo vet` for streamlining and sharing security audits; `criterion` crate gives a " +"Development experience is made really nice not only by core Rust tools (e.g. " +"using `rustup` to switch to a different `rustc` version when testing a crate " +"that needs to work on nightly, current stable, and older stable) but also by " +"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a " "streamlined way to run benchmarks)." msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای تغییر به " -"نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی پایداری‌های شبانه، فعلی و " -"قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً " -"موزیلا `cargo vet` را برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` " -"crate راهی ساده برای اجرای benchmark‌ها می‌دهد)." +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " +"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " +"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " +"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " +"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " +"راهی ساده برای اجرای benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." -msgstr "‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." +msgid "" +"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgstr "" +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " +"می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." -msgstr "ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." +msgstr "" +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " +"باشد." #: src/chromium/cargo.md -msgid "Broad, generic examples of projects where `cargo` may be the right choice:" +msgid "" +"Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for writing " -"command line tools. The breadth and ergonomics of libraries is comparable to Python, while " -"being more robust (thanks to the rich typesystem) and running faster (as a compiled, rather " -"than interpreted language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " +"for writing command line tools. The breadth and ergonomics of libraries is " +"comparable to Python, while being more robust (thanks to the rich " +"typesystem) and running faster (as a compiled, rather than interpreted " +"language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان محبوب می‌شود. " -"گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که قوی‌تر (به لطف تایپ سیستم " -"غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " +"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " +"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " +"زبان کامپایل شده و نه مفسری)." #: src/chromium/cargo.md msgid "" -"Participating in the Rust ecosystem requires using standard Rust tools like Cargo. Libraries " -"that want to get external contributions, and want to be used outside of Chromium (e.g. in " -"Bazel or Android/Soong build environments) should probably use Cargo." +"Participating in the Rust ecosystem requires using standard Rust tools like " +"Cargo. Libraries that want to get external contributions, and want to be " +"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " +"should probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. کتابخانه‌هایی " -"که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium استفاده شوند (مثلاً در " -"محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " +"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " +"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " +"باید از Cargo استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -13540,11 +14677,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which resulted in PRs with " -"performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which " +"resulted in PRs with performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با بهبود در عملکرد " -"می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " +"با بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -13552,52 +14689,58 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` for command-line " -"parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` " +"for command-line parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به `clap` و برای " -"فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " +"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when building and " -"bootstrapping Rust standard library when building Rust toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " +"when building and bootstrapping Rust standard library when building Rust " +"toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در هنگام ساخت و " -"راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " +"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " +"toolchain بود." #: src/chromium/cargo.md msgid "" -"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on third-party " -"libraries downloaded from the internet, but `run_gnrt.py` asks `cargo` that only `--locked` " -"content is allowed via `Cargo.lock`.)" +"`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " +"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " +"`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" -"‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به کتابخانه‌های شخص " -"ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` از `cargo` می‌پرسد که فقط " -"محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" +"‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." +"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " +"است.)" #: src/chromium/cargo.md -msgid "Students may identify the following items as being implicitly or explicitly trusted:" -msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgid "" +"Students may identify the following items as being implicitly or explicitly " +"trusted:" +msgstr "" +"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" -"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the Clang compiler, " -"the `rustc` sources (fetched from GitHub, reviewed by Rust compiler team), binary Rust " -"compiler downloaded for bootstrapping" +"`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the " +"Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " +"compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" -"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، منابع `rustc` " -"(برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر Rust باینری که برای راه اندازی " -"بارگیری شده است، بستگی دارد." +"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " +"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" -"`rustup` (it may be worth pointing out that `rustup` is developed under the umbrella of the " -"https://github.com/rust-lang/ organization - same as `rustc`)" +"`rustup` (it may be worth pointing out that `rustup` is developed under the " +"umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-lang/ - " -"همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" +"rust-lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -13605,20 +14748,23 @@ msgstr "`cargo`, `rustfmt`, ب." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for distributing the prebuilt " -"toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for " +"distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain از پیش‌ساخته " -"شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " +"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md -msgid "Rust libraries vendored into `//third_party/rust` (audited by security@chromium.org)" +msgid "" +"Rust libraries vendored into `//third_party/rust` (audited by " +"security@chromium.org)" msgstr "" -"کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط security@chromium.org)" +"کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " +"security@chromium.org)" #: src/chromium/cargo.md msgid "Other Rust libraries (some niche, some quite popular and commonly used)" @@ -13630,71 +14776,94 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as approved by Chromium's " -"[Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as " +"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" +"chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech Leads]" -"(https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " +"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" +"ATL_OWNERS) تأیید شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust is allowed for third party " -"libraries under various circumstances, including if they're the best option for performance or " -"for security." +"Chromium's policy on third party libraries is outlined [here](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." +"md#rust) - Rust is allowed for third party libraries under various " +"circumstances, including if they're the best option for performance or for " +"security." msgstr "" -"رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium.googlesource.com/" -"chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده است. Rust برای کتابخانه‌های " -"شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا " -"موارد امنیتی هستند." +"رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " +"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " +"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that nearly all such " -"libraries will require a small amount of first-party glue code." +"Very few Rust libraries directly expose a C/C++ API, so that means that " +"nearly all such libraries will require a small amount of first-party glue " +"code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) قرار می‌دهند، " -"به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " +"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " +"glue code اول شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" -": \"C++\" : : \"wrapper\" crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" +": \"C++\" : : \"wrapper\" " +"crate :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" -": \"C++\" : : \"wrapper\" crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" +": \"C++\" : : \"wrapper\" " +"crate :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should normally be kept in " -"`third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should " +"normally be kept in `third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust//" -"/wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" +"rust///wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -13706,13 +14875,15 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." -msgstr "نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." +msgstr "" +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " +"کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر مناسب ادامه " -"یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " +"مسیر مناسب ادامه یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -13720,20 +14891,23 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` for efficiency " -"--- its static rules allow maximum parallelism. Rust is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and " +"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " +"is no exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت کارایی بیشتر " -"ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر می‌سازد. Rust نیز از این قاعده " -"مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " +"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " +"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "" +"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "" +"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -13757,43 +14931,47 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to depend upon third party " -"code." +"You can also add `deps` on other Rust targets. Later we'll use this to " +"depend upon third party code." msgstr "" -"همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای وابستگی به کد شخص " -"ثالث استفاده خواهیم کرد." +"همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " +"وابستگی به کد شخص ثالث استفاده خواهیم کرد." #: src/chromium/build-rules.md msgid "" -"You must specify _both_ the crate root, _and_ a full list of sources. The `crate_root` is the " -"file given to the Rust compiler representing the root file of the compilation unit --- " -"typically `lib.rs`. `sources` is a complete list of all source files which `ninja` needs in " -"order to determine when rebuilds are necessary." +"You must specify _both_ the crate root, _and_ a full list of sources. The " +"`crate_root` is the file given to the Rust compiler representing the root " +"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " +"list of all source files which `ninja` needs in order to determine when " +"rebuilds are necessary." msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی است که به " -"کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- معمولاً به‌نام `lib.rs` " -"است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی است که `ninja` برای تعیین زمان لازم " -"برای بازسازی به آن‌ها نیاز دارد." +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " +"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " +"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " +"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " +"دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate is a " -"compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire " +"crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" -"(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد جمع‌آوری است. " -"`static_library` کوچک‌ترین واحد است.)" +"(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " +"جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using [gn's built-in " -"support for Rust static libraries](https://gn.googlesource.com/gn/+/main/docs/reference." -"md#func_static_library). The answer is that this template provides support for CXX interop, " -"Rust features, and unit tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using " +"[gn's built-in support for Rust static libraries](https://gn.googlesource." +"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " +"this template provides support for CXX interop, Rust features, and unit " +"tests, some of which we'll use later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای کتابخانه‌های " -"استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library) به " -"یک الگوی gn نیاز داریم. پاسخ این است که این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد " -"پشتیبانی می‌کند که بعداً از برخی از آنها استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " +"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " +"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " +"از برخی از آنها استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -13801,13 +14979,15 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't compile. If you " -"need unsafe Rust code, add `allow_unsafe = true` to the gn target. (Later in the course we'll " -"see circumstances where this is necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " +"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " +"the gn target. (Later in the course we'll see circumstances where this is " +"necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل نمی‌شود. اگر به " -"کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn اضافه کنید. (بعداً در دوره ما " -"شرایطی را خواهیم دید که در آن لازم است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " +"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " +"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " +"است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -13873,22 +15053,29 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than for C++. Visual " -"Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than " +"for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد ویژوال " -"استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " +"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " +"استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy -msgid "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust support" +msgid "" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " +"Rust support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی پشتیبانی از " -"Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " +"قبلی پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md -msgid "`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" -msgstr "‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" +msgid "" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output " +"directory)" +msgstr "" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " +"شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -13896,282 +15083,329 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-analyzer might be " -"beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-" +"analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های code annotation " -"و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " +"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a piece of Chromium-" -"related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a " +"piece of Chromium-related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به Chromium که " -"بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " +"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "" +"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" -"Place the cursor over the `QrCode::new` call (around line 26) in \\`qr_code_generator_ffi_glue." -"rs" +"Place the cursor over the `QrCode::new` call (around line 26) in " +"\\`qr_code_generator_ffi_glue.rs" msgstr "" -"مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در \\`qr_code_generator_ffi_glue.rs قرار " -"دهید" +"مکان نما را روی فراخوانی `QrCode::new` (حدود خط 26) در " +"\\`qr_code_generator_ffi_glue.rs قرار دهید" #: src/chromium/build-rules/vscode.md -msgid "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." -msgstr "نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = K)." +msgid "" +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " +"K)." +msgstr "" +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" +"CoC = K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This will take you " -"to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " +"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " -"(این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " +"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." +"rs` می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; the outline " -"is in the file explorer pane in vscode; typical vim/CoC bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " +"164; the outline is in the file explorer pane in vscode; typical vim/CoC " +"bindings = space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط 164؛ طرح کلی در " -"پنجره file explorer در vscode است؛ typical vim/CoC bindings = space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " +"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " +"bindings = space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the `QrCode::with_bits` " -"method)" +"Demo **type annotations** (there are quite a few nice examples in the " +"`QrCode::with_bits` method)" msgstr "" -"نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::with_bits` وجود دارد)" +"نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" +"with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will need to be rerun " -"after editing `BUILD.gn` files (which we will do a few times throughout the exercises in this " -"session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will " +"need to be rerun after editing `BUILD.gn` files (which we will do a few " +"times throughout the exercises in this session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های `BUILD.gn` " -"(که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " +"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " +"اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md -msgid "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" -msgstr "در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که حاوی:" +msgid "" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " +"containing:" +msgstr "" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " +"که حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety by the Rust " -"compiler, so you'll need to allow unsafe code in your `gn` target." +"**Important**: note that `no_mangle` here is considered a type of unsafety " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " +"target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی (type of " -"unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " +"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " +"`gn` target خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" -"Add this new Rust target as a dependency of `//ui/base:base`. Declare this function at the top " -"of `ui/base/resource/resource_bundle.cc` (later, we'll see how this can be automated by " -"bindings generation tools):" +"Add this new Rust target as a dependency of `//ui/base:base`. Declare this " +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " +"see how this can be automated by bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را در بالای `ui/" -"base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که چگونه می‌توان این کار را با " -"ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " +"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " +"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we suggest the " -"top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run Chromium, and ensure that " -"\"Hello from Rust!\" is printed lots of times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " +"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " +"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " +"times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما قسمت بالای " -"`ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. Chromium را Build و اجرا کنید " -"و مطمئن شوید که \"Hello from Rust!\" بارها چاپ می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " +"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " +"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " +"بارها چاپ می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in subsequent " -"exercises. If you've succeeded, you will be able to use right-click \"Go to definition\" on " -"`println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " +"in subsequent exercises. If you've succeeded, you will be able to use right-" +"click \"Go to definition\" on `println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار کند. این کار " -"در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک راست روی\"Go to " -"definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " +"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " +"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." -#: src/exercises/chromium/build-rules.md src/exercises/chromium/interoperability-with-cpp.md +#: src/exercises/chromium/build-rules.md +#: src/exercises/chromium/interoperability-with-cpp.md msgid "Where to find help" msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://" +"source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" +"l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" -"no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" +"abi.html#the-no_mangle-attribute)" msgstr "" -"اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" -"no_mangle-attribute)" +"اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." +"html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md -msgid "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" -msgstr "اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" +msgid "" +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." +"extern.html)" +msgstr "" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" -"reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" -"reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" +"languages/rust)" msgstr "" -"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/languages/rust)" +"[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" +"languages/rust)" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-denominator interop " -"language, C. Both C++ and Rust can natively declare and call C ABI functions. Later in the " -"course, we'll connect C++ directly to Rust." +"This example is unusual because it boils down to the lowest-common-" +"denominator interop language, C. Both C++ and Rust can natively declare and " +"call C ABI functions. Later in the course, we'll connect C++ directly to " +"Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. بعداً در دوره، +" -"+C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " +"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to generate two " -"functions with the same name, and Rust can no longer guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " +"Rust to generate two functions with the same name, and Rust can no longer " +"guarantee that the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به Rust اجازه دهد " -"دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که تابع مورد نظر فراخوانی شده " -"است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " +"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " +"کند که تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md msgid "" -"If you need a pure Rust executable, you can also do that using the `rust_executable` gn " -"template." +"If you need a pure Rust executable, you can also do that using the " +"`rust_executable` gn template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " -"الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " +"از الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same source file as the " -"code being tested. This was covered [earlier](../testing.md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same " +"source file as the code being tested. This was covered [earlier](../testing." +"md) in the course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد مورد آزمایش " -"قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " +"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " +"پوشش داده شده بود و به این صورت است:" #: src/chromium/testing.md msgid "" -"In Chromium we place unit tests in a separate source file and we continue to follow this " -"practice for Rust --- this makes tests consistently discoverable and helps to avoid rebuilding " -"`.rs` files a second time (in the `test` configuration)." +"In Chromium we place unit tests in a separate source file and we continue to " +"follow this practice for Rust --- this makes tests consistently discoverable " +"and helps to avoid rebuilding `.rs` files a second time (in the `test` " +"configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این روش را برای " -"Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف باشند و کمک می‌کند از بازسازی " -"فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " +"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " +"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " +"`test`) جلوگیری شود." #: src/chromium/testing.md -msgid "This results in the following options for testing Rust code in Chromium:" +msgid "" +"This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md -msgid "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." -msgstr "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." +msgid "" +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" +"rust`." +msgstr "" +"تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when Rust code is " -"just a thin FFI layer and the existing unit tests provide sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " +"when Rust code is just a thin FFI layer and the existing unit tests provide " +"sufficient coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. زمانی که کد " -"Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای ویژگی‌هایی که ارائه " -"می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " +"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " +"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its public API (using " -"`pub mod for_testing { ... }` if needed). This is the subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its " +"public API (using `pub mod for_testing { ... }` if needed). This is the " +"subject of the next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی آن استفاده " -"می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده می‌کنند. این موضوع در چند " -"اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " +"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " +"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" -"Mention that native Rust tests of third-party crates should eventually be exercised by " -"Chromium bots. (Such testing is needed rarely --- only after adding or updating third-party " -"crates.)" +"Mention that native Rust tests of third-party crates should eventually be " +"exercised by Chromium bots. (Such testing is needed rarely --- only after " +"adding or updating third-party crates.)" msgstr "" -"ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط روبات‌های Chromium " -"انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از افزودن یا به‌روز‌رسانی crateهای شخص " -"ثالث.)" +"ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " +"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md -msgid "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" +msgid "" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " +"used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل Rust `gtest` " -"استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " +"مقابل Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a thin FFI glue) and " -"therefore uses the existing C++ unit tests for testing both the C++ and the Rust " -"implementation (parameterizing the tests so they enable or disable Rust using a " -"`ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a " +"thin FFI glue) and therefore uses the existing C++ unit tests for testing " +"both the C++ and the Rust implementation (parameterizing the tests so they " +"enable or disable Rust using a `ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و بنابراین از " -"unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند (تست‌ها را پارامتر می‌کند تا " -"Rust را با استفاده از یک `ScopedFeatureList` آن را فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " +"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " +"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " +"`ScopedFeatureList` آن را فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe implementation of pixel " -"transformations that are provided by `libpng` but missing in the `png` crate - e.g. RGBA => " -"BGRA, or gamma correction. Such functionality may benefit from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe " +"implementation of pixel transformations that are provided by `libpng` but " +"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " +"functionality may benefit from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی داشته باشد که " -"توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به عنوان مثال. RGBA => BGRA یا " -"تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust " -"نوشته شده است بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " +"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " +"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " +"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " +"بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/" -"rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/testing/" -"rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" +"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md -msgid "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" +msgid "" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " +"attribute)" msgstr "" -"از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از `#[gtest(...)]` attribute)" +"از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " +"`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking and not " -"terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " +"panicking and not terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی assertion " -"ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " +"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -14179,11 +15413,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing test binary that " -"already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing " +"test binary that already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که از قبل حاوی " -"تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " +"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -14205,11 +15439,11 @@ msgstr "" #: src/chromium/testing/build-gn.md msgid "" -"Authoring Rust tests in a separate `static_library` also works, but requires manually " -"declaring the dependency on the support libraries:" +"Authoring Rust tests in a separate `static_library` also works, but requires " +"manually declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام دستی وابستگی " -"به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " +"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -14251,17 +15485,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import and use " -"`my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an explicit `crate_name` for " -"`my_rust_lib` so its crate name is computed based on the full target path and name. " -"Fortunately we can avoid working with such an unwieldy name by using the `chromium::import!` " -"macro from the automatically-imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " +"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " +"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " +"computed based on the full target path and name. Fortunately we can avoid " +"working with such an unwieldy name by using the `chromium::import!` macro " +"from the automatically-imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " -"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح برای " -"`my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل هدف محاسبه می‌شود. " -"خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` از `chromium` crate که به‌طور " -"خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " +"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " +"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " +"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " +"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " +"درنتیجه از کار با چنین نامی پرهیز کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -14273,28 +15509,30 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude." -"rs%20pub.use.*%5Cbimport%5Cb;%20-f:third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::" -"import` macro." +"More information can be found in [the doc comment](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" +"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use." -"*%5Cbimport%5Cb;%20-f:third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه " -"`chromium::import`." +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" +"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" +"import`." #: src/chromium/testing/chromium-import-macro.md msgid "" -"`rust_static_library` supports specifying an explicit name via `crate_name` property, but " -"doing this is discouraged. And it is discouraged because the crate name has to be globally " -"unique. crates.io guarantees uniqueness of its crate names so `cargo_crate` GN targets " -"(generated by the `gnrt` tool covered in a later section) use short crate names." +"`rust_static_library` supports specifying an explicit name via `crate_name` " +"property, but doing this is discouraged. And it is discouraged because the " +"crate name has to be globally unique. crates.io guarantees uniqueness of its " +"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " +"covered in a later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، اما انجام " -"این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح سراسری منحصر‌به‌فرد باشد. " -"crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین می‌کند، بنابراین اهداف`cargo_crate` GN " -"(تولید شده توسط ابزار `gnrt` که در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده " -"می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " +"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " +"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " +"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " +"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -14310,11 +15548,13 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding two integers " -"received as arguments, computing the nth Fibonacci number, summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding " +"two integers received as arguments, computing the nth Fibonacci number, " +"summing integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن دو عدد صحیح " -"دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " +"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " +"اعداد صحیح در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -14326,101 +15566,122 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "" +"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new tools being " -"developed all the time. At the moment, Chromium uses a tool called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new " +"tools being developed all the time. At the moment, Chromium uses a tool " +"called CXX." msgstr "" -"جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای جدیدی که همیشه در " -"حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX استفاده می‌کند." +"جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " +"CXX استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition language (which looks a " -"lot like Rust) and then CXX tools generate declarations for functions and types in both Rust " -"and C++." +"You describe your whole language boundary in an interface definition " +"language (which looks a lot like Rust) and then CXX tools generate " +"declarations for functions and types in both Rust and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار شبیه Rust به " -"نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع و تایپ‌ها در Rust و ++C " -"ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " +"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " +"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md -msgid "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using this." -msgstr "برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." +msgid "" +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " +"using this." +msgstr "" +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " +"ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just the same as you " -"previously did. Point out that automating the process has the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just " +"the same as you previously did. Point out that automating the process has " +"the following benefits:" msgstr "" -"از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را انجام می‌دهد که " -"قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند دارای مزایای زیر است:" +"از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " +"فرآیند دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool guarantees that the C++ and Rust sides match (e.g. you get compile errors if the " -"`#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, but with out-of-sync manual " -"bindings you'd get Undefined Behavior)" +"The tool guarantees that the C++ and Rust sides match (e.g. you get compile " +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " +"definitions, but with out-of-sync manual bindings you'd get Undefined " +"Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::bridge]` با " -"تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای کامپایل مواجه می‌شوید اما با " -"اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " +"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " +"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " +"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" -"The tool automates generation of FFI thunks (small, C-ABI-compatible, free functions) for non-" -"C features (e.g. enabling FFI calls into Rust or C++ methods; manual bindings would require " -"authoring such top-level, free functions manually)" +"The tool automates generation of FFI thunks (small, C-ABI-compatible, free " +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " +"methods; manual bindings would require authoring such top-level, free " +"functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای ویژگی های غیر " -"C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور خودکار انجام می دهد؛ اتصال های " -"دستی نیاز به نوشتن چنین عملکردهای سطح بالا و رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " +"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " +"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " +"بالا و رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " +"کنند - به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee any particular " -"ABI or memory layout. With manual bindings `std::span` / `&[T]` have to be manually " -"destructured and rebuilt out of a pointer and length - this is error-prone given that each " -"language represents empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't " +"guarantee any particular ABI or memory layout. With manual bindings `std::" +"span` / `&[T]` have to be manually destructured and rebuilt out of a " +"pointer and length - this is error-prone given that each language represents " +"empty slices slightly differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی را تضمین " -"نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت دستی تخریب شود و از یک " -"pointer و length به صورت مجدد ساخته شود - با توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت " -"نشان می‌دهد، درنتیجه مستعد خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " +"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " +"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " +"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " +"خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are natively " -"supported. With manual bindings, one would have to pass C-ABI-compatible raw pointers, which " -"would increase lifetime and memory-safety risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " +"are natively supported. With manual bindings, one would have to pass C-ABI-" +"compatible raw pointers, which would increase lifetime and memory-safety " +"risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` به صورت native " -"پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-ABI-compatible raw pointers را " -"پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " +"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " +"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " +"طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" -"`rust::String` and `CxxString` types understand and maintain differences in string " -"representation across the languages (e.g. `rust::String::lossy` can build a Rust string from " -"non-UTF8 input and `rust::String::c_str` can NUL-terminate a string)." +"`rust::String` and `CxxString` types understand and maintain differences in " +"string representation across the languages (e.g. `rust::String::lossy` can " +"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" +"terminate a string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها درک و حفظ " -"می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را از ورودی غیر UTF8 و " -"`rust::String::c_str` بسازد و می‌تواند یک string را با NUL خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " +"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " +"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " +"string را با NUL خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` modules inside `." -"rs` source code." +"CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " +"modules inside `.rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." +"rs` اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -14436,13 +15697,14 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural macro does " -"complex things to it. The generated code is quite a bit more sophisticated - though this does " -"still result in a `mod` called `ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " +"procedural macro does complex things to it. The generated code is quite a " +"bit more sophisticated - though this does still result in a `mod` called " +"`ffi` in your code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` کارهای پیچیده‌ای " -"برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این کار همچنان منجر به یک `mod` " -"به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" +"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " +"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -14462,61 +15724,74 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, but this is " -"misleading. This header is never interpreted by Rust, but simply `#include`d in the generated " -"C++ code for the benefit of C++ compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by " +"Rust, but this is misleading. This header is never interpreted by Rust, but " +"simply `#include`d in the generated C++ code for the benefit of C++ " +"compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه کننده است. این " -"هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد ++C تولید‌شده برای کامپایلرهای +" -"+C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " +"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " +"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://cxx.rs/bindings." -"html)." +"By far the most useful page when using CXX is the [type reference](https://" +"cxx.rs/bindings.html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx.rs/bindings." -"html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" +"(https://cxx.rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "Your Rust-C++ interface is sufficiently simple that you can declare all of it." +msgid "" +"Your Rust-C++ interface is sufficiently simple that you can declare all of " +"it." msgstr "" -"اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا declare کنید." +"اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " +"declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example `std::unique_ptr`, " -"`std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example " +"`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" -"شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای مثال`std::" -"unique_ptr`, `std::string`, `&[u8]` و غیره." +"شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " +"مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "It has many limitations --- for example lack of support for Rust's `Option` type." -msgstr "این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." +msgid "" +"It has many limitations --- for example lack of support for Rust's `Option` " +"type." +msgstr "" +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " +"Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well isolated \"leaf nodes\" " -"rather than for arbitrary Rust-C++ interop. When considering a use-case for Rust in Chromium, " -"a good starting point is to draft the CXX bindings for the language boundary to see if it " -"appears simple enough." +"These limitations constrain us to using Rust in Chromium only for well " +"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " +"considering a use-case for Rust in Chromium, a good starting point is to " +"draft the CXX bindings for the language boundary to see if it appears simple " +"enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" به خوبی ایزوله " -"شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن یک مورد استفاده برای Rust " -"در Chromium، یک نقطه شروع خوب این است که پیش نویس پیوندهای CXX برای مرز زبان (language " -"boundary) را پیش‌نویس کنید تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " +"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " +"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " +"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " +"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "You should also discuss some of the other sticky points with CXX, for example:" +msgid "" +"You should also discuss some of the other sticky points with CXX, for " +"example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "Its error handling is based around C++ exceptions (given on the next slide)" +msgid "" +"Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -14525,11 +15800,12 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C++ " -"exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " +"on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ exception متکی " -"است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" +"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " +"جایگزین‌های آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -14538,11 +15814,12 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be passed across " -"the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " +"be passed across the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این مستلزم آن است " -"که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " +"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " +"باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -14550,20 +15827,22 @@ msgstr "یک type اولیه (مانند `u32` یا `usize`)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable default value to " -"use in a failure case (_unlike_ `Box`)." +"A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " +"default value to use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای یک مقدار " -"پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " +"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " +"`Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed when `T` is a Rust " -"type, which cannot be passed across the FFI boundary, and cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed " +"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " +"cannot be stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است زمانی مورد " -"نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و نمی تواند در " -"`UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " +"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " +"کند و نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -14571,15 +15850,19 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` representing failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` " +"representing failure)" msgstr "" -"به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` نشان‌دهنده یک شکست " -"است)" +"به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " +"نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been needed in practice." -msgstr "حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." +"Preserving error details is in theory possible, but so far hasn't been " +"needed in practice." +msgstr "" +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " +"است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -14587,15 +15870,16 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"The QR code generator is [an example](https://source.chromium.org/chromium/chromium/src/+/main:" -"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to communicate success " -"vs failure, and where the successful result can be passed across the FFI boundary:" +"The QR code generator is [an example](https://source.chromium.org/chromium/" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." +"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " +"used to communicate success vs failure, and where the successful result can " +"be passed across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:components/" -"qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;drc=7bf1b75b9101ca2013) است که در آن " -"بولی برای ارتباط موفقیت در مق‌بل شکست و جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد " -"استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" +"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " +"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -14603,33 +15887,37 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. This is not the size " -"of the vector, but the size of the QR code (and admittedly it is a bit redundant - this is the " -"square root of the size of the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. " +"This is not the size of the vector, but the size of the QR code (and " +"admittedly it is a bit redundant - this is the square root of the size of " +"the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه بردار نیست " -"بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " +"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " +"جذر اندازه بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` before calling into " -"the Rust function. Creation of a Rust reference that points to uninitialized memory results in " -"Undefined Behavior (unlike in C++, when only the act of dereferencing such memory results in " -"UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` " +"before calling into the Rust function. Creation of a Rust reference that " +"points to uninitialized memory results in Undefined Behavior (unlike in C++, " +"when only the act of dereferencing such memory results in UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` اشاره کنیم. " -"ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار نامشخص می‌شود (برخلاف ++C، " -"زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " +"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " +"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " +"حافظه‌ای منجر به UB می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable references to C++ data: " -"the answer is that C++ data can’t be moved around like Rust data, because it may contain self-" -"referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable " +"references to C++ data: the answer is that C++ data can’t be moved around " +"like Rust data, because it may contain self-referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل تغییر به " -"داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند داده‌های Rust جابه‌جا " -"کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " +"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " +"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " +"خودارجاعی (self-referential pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -14637,11 +15925,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the successful result cannot be " -"passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the " +"successful result cannot be passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI عبور کند و چه " -"کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " +"FFI عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -14665,27 +15953,31 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types cannot cross the " -"FFI boundary without indirection of a `Box`. We can't have an `out_parameter: &mut " -"PngReader`, because CXX doesn't allow C++ to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " +"types cannot cross the FFI boundary without indirection of a `Box`. We " +"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " +"to store Rust objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این نوع نمیتوانند " -"بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم `out_parameter: &mut " -"PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " +"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " +"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " +"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary generics nor " -"templates, we can still pass them across the FFI boundary by manually specializing / " -"monomorphizing them into a non-generic type. In the example `ResultOfPngReader` is a non-" -"generic type that forwards into appropriate methods of `Result` (e.g. into `is_err`, " -"`unwrap`, and/or `as_mut`)." -msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی نمی‌کند، ما " -"همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی تخصصی/تک‌شکلی " -"( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در مثال `ResultOfPngReader` یک " -"نوع non-generic است که به متدهای مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/" -"یا «as_mut» ارسال می‌شود." +"This example illustrates that even though CXX doesn't support arbitrary " +"generics nor templates, we can still pass them across the FFI boundary by " +"manually specializing / monomorphizing them into a non-generic type. In the " +"example `ResultOfPngReader` is a non-generic type that forwards into " +"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " +"`as_mut`)." +msgstr "" +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " +"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " +"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " +"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " +"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " +"ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -14693,11 +15985,13 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node where we want to " -"use Rust. You'd typically have one for each `rust_static_library`. Just add" +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" +"node where we want to use Rust. You'd typically have one for each " +"`rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust استفاده کنیم " -"را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " +"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " +"یکی دارید. پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -14714,7 +16008,9 @@ msgstr "" "```" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md -msgid "to your existing `rust_static_library` target alongside `crate_root` and `sources`." +msgid "" +"to your existing `rust_static_library` target alongside `crate_root` and " +"`sources`." msgstr "به هدف `rust_static_library` موجود در کنار `crate_root` و `sources`." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md @@ -14727,43 +16023,49 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium C++ types to CXX " -"Rust types --- for example [`SpanToRustSlice`](https://source.chromium.org/chromium/chromium/" -"src/+/main:base/containers/span_rust.h;l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium " +"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" +"l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به انواع CXX Rust " -"پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source.chromium.org/chromium/" -"chromium/src /+/main:base/containers/span_rust.h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " +"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." +"h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" -msgstr "دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" +msgstr "" +"دانش‌آموزان ممکن است بپرسند --- چرا هنوز به `allow_unsafe = true` نیاز داریم؟" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. Calling back " -"and forth to C/C++ from Rust may do arbitrary things to memory, and compromise the safety of " -"Rust's own data layouts. Presence of _too many_ `unsafe` keywords in C/C++ interop can harm " -"the signal-to-noise ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust binary can cause " -"unexpected behavior from Rust's perspective." -msgstr "" -"پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. فراخوانی مجدد و " -"برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام دهد و ایمنی طرح‌بندی داده‌های " -"خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به " -"نسبت سیگنال به نویز چنین کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/" -"writing/the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث " -"رفتار غیرمنتظره از دیدگاه Rust شود." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " +"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " +"to memory, and compromise the safety of Rust's own data layouts. Presence of " +"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " +"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" +"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " +"binary can cause unexpected behavior from Rust's perspective." +msgstr "" +"پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " +"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " +"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " +"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" +"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " +"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The narrow answer lies in the diagram at the top of [this page](../interoperability-with-cpp." -"md) --- behind the scenes, CXX generates Rust `unsafe` and `extern \"C\"` functions just like " -"we did manually in the previous section." +"The narrow answer lies in the diagram at the top of [this page](../" +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " +"`unsafe` and `extern \"C\"` functions just like we did manually in the " +"previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است --- در پشت " -"صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل به صورت دستی انجام " -"دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " +"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " +"در بخش قبل به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -14775,21 +16077,21 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a single " -"function, to be called from C++, called `hello_from_rust`, taking no parameters and returning " -"no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which " +"specifies a single function, to be called from C++, called " +"`hello_from_rust`, taking no parameters and returning no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را مشخص می‌کند که " -"باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه پارامتر و هیچ مقداری " -"برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " +"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " +"بدون اینکه پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and `#[no_mangle]`. " -"This is now just a standard Rust function." +"Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " +"`#[no_mangle]`. This is now just a standard Rust function." msgstr "" -"تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` تغییر دهید. حالا " -"این فقط یک تابع استاندارد Rust است." +"تابع `hello_from_rust` قبلی خود را برای حذف `extern \"C\"` و `#[no_mangle]` " +"تغییر دهید. حالا این فقط یک تابع استاندارد Rust است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Modify your `gn` target to build these bindings." @@ -14797,11 +16099,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, include the " -"generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. " +"Instead, include the generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، فایل هِدِر تولید " -"شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " +"عوض، فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -14813,11 +16115,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how flexible Rust in " -"Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how " +"flexible Rust in Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید که Rust در " -"Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " +"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -14829,27 +16131,29 @@ msgstr "از Rust دوباره به ++C فراخوانی کنید. درنهای #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An additional header file which you can `include!` from your `cxx::bridge`. You'll need to " -"declare your C++ function in that new header file." +"An additional header file which you can `include!` from your `cxx::bridge`. " +"You'll need to declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما باید تابع ++C " -"خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " +"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the `unsafe` keyword in " -"your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++.html#functions-and-member-" -"functions)." +"An `unsafe` block to call such a function, or alternatively specify the " +"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" +"extern-c++.html#functions-and-member-functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` را در `#[cxx::" -"bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx.rs/extern-c++.html#functions-" -"and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " +"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" +"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md -msgid "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" +msgid "" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"` را وارد " -"کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" +"cxx.h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -14861,32 +16165,35 @@ msgstr "ارسال یک reference از یک C++ object به Rust ." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Intentionally get the Rust function signatures mismatched from the `#[cxx::bridge]`, and get " -"used to the errors you see." +"Intentionally get the Rust function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به خطاهایی که می " -"بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " +"و به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Intentionally get the C++ function signatures mismatched from the `#[cxx::bridge]`, and get " -"used to the errors you see." +"Intentionally get the C++ function signatures mismatched from the `#[cxx::" +"bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به خطاهایی که می " -"بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " +"به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " +"own some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند دارای یک C++ " -"object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " +"بتواند دارای یک C++ object باشد." #: src/exercises/chromium/interoperability-with-cpp.md -msgid "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a `Box`)." +msgid "" +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " +"need a `Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: شما به یک " -"`Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " +"(نکته: شما به یک `Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -14902,12 +16209,13 @@ msgstr "قسمت سوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Now you understand the strengths and limitations of CXX interop, think of a couple of use-" -"cases for Rust in Chromium where the interface would be sufficiently simple. Sketch how you " -"might define that interface." +"Now you understand the strengths and limitations of CXX interop, think of a " +"couple of use-cases for Rust in Chromium where the interface would be " +"sufficiently simple. Sketch how you might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای Rust در " -"Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " +"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " +"تعریف این رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -14915,11 +16223,11 @@ msgstr "یک [`cxx` binding reference](https://cxx.rs/bindings.html)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"The [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/" -"main:build/rust/rust_static_library.gni;l=16)" +"The [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" -"یک [`rust_static_library` gn template](https://source.chromium.org/chromium/chromium/src/+/" -"main:build/rust/rust_static_library.gni;l=16)" +"یک [`rust_static_library` gn template](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" @@ -14927,31 +16235,35 @@ msgstr "برخی از سؤالاتی که ممکن است با آن مواجه #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X and Y are both " -"function types. This is because your C++ function doesn't quite match the declaration in your " -"`cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X " +"and Y are both function types. This is because your C++ function doesn't " +"quite match the declaration in your `cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر دو نوع تابع " -"هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " +"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " +"`cxx::bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. Doesn't that risk UB? " -"For CXX's _opaque_ types, no, because they are zero-sized. For CXX trivial types yes, it's " -"_possible_ to cause UB, although CXX's design makes it quite difficult to craft such an " -"example." +"I seem to be able to freely convert C++ references into Rust references. " +"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" +"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " +"CXX's design makes it quite difficult to craft such an example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB را ندارد؟ " -"برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع بی‌اهمیت CXX بله، ممکن است " -"باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " +"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " +"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " +"نمونه‌ای را بسیار دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://crates.io). It's " -"_very easy_ for Rust crates to depend upon one another. So they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://" +"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " +"they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) یافت می‌شوند. " -"وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." +"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " +"آنها این کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -15002,18 +16314,20 @@ msgid "For a Chromium engineer, this has pros and cons:" msgstr "برای یک مهندس Chromium، این مزایا و معایب دارد:" #: src/chromium/adding-third-party-crates.md -msgid "All crates use a common build system so we can automate their inclusion into Chromium..." +msgid "" +"All crates use a common build system so we can automate their inclusion into " +"Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها در Chromium " -"را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " +"آن‌ها در Chromium را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely have to bring in " -"multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely " +"have to bring in multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود چندین " -"کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " +"بود چندین کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -15037,13 +16351,15 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. These are managed " -"through a single [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/+/main:" -"third_party/rust/chromium_crates_io/Cargo.toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. " +"These are managed through a single [`Cargo.toml`](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." +"toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. اینها از طریق " -"یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " +"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " +"می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -15065,35 +16381,41 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"As with any other `Cargo.toml`, you can specify [more details about the dependencies](https://" -"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) --- most commonly, you'll want " -"to specify the `features` that you wish to enable in the crate." +"As with any other `Cargo.toml`, you can specify [more details about the " +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" +"dependencies.html) --- most commonly, you'll want to specify the `features` " +"that you wish to enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://doc.rust-lang." -"org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- معمولاً شما می‌خواهید " -"«ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" +"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " +"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " +"کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"When adding a crate to Chromium, you'll often need to provide some extra information in an " -"additional file, `gnrt_config.toml`, which we'll meet next." +"When adding a crate to Chromium, you'll often need to provide some extra " +"information in an additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" -"هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، `gnrt_config." -"toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." +"هنگام افزودن crate به Chromium، اغلب باید اطلاعات اضافی را در یک فایل اضافی، " +"`gnrt_config.toml` ارائه کنید، که در ادامه با آن آشنا خواهیم شد." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/" -"src/+/main:third_party/rust/chromium_crates_io/gnrt_config.toml). This contains Chromium-" -"specific extensions to crate handling." +"Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml). This contains Chromium-specific extensions to crate handling." msgstr "" -"در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/chromium/chromium/" -"src/+/main:third_party/rust/chromium_crates_io/gnrt_config.toml) قرار دارد. این شامل " -"برنامه‌های extension مخصوص Chromium برای مدیریت crate است." +"در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " +"crate است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md -msgid "If you add a new crate, you should specify at least the `group`. This is one of:" -msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +msgid "" +"If you add a new crate, you should specify at least the `group`. This is one " +"of:" +msgstr "" +"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -15102,23 +16424,27 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this file to specify where " -"its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this " +"file to specify where its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن فایل (های) مجوز " -"آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " +"یافتن فایل (های) مجوز آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file to resolve problems." +"Later, we'll see some other things you will need to configure in this file " +"to resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " +"مشاهده خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md -msgid "A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` rules." +msgid "" +"A tool called `gnrt` knows how to download crates and how to generate `BUILD." +"gn` rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD.gn` را ایجاد " -"کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " +"`BUILD.gn` را ایجاد کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -15126,12 +16452,14 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running this command you will " -"be downloading and running its dependencies from `crates.io`. See [the earlier section](../" -"cargo.md) discussing this security decision." +"Although the `gnrt` tool is part of the Chromium source code, by running " +"this command you will be downloading and running its dependencies from " +"`crates.io`. See [the earlier section](../cargo.md) discussing this security " +"decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن را از " -"`crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " +"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." +"md) را در مورد این تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -15147,37 +16475,46 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete set of crates " -"required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete " +"set of crates required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های مورد نیاز " -"Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " +"جعبه‌های مورد نیاز Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Chromium maintains patches for some crates, kept in `//third_party/rust/chromium_crates_io/" -"patches`. These will be reapplied automatically, but if patching fails you may need to take " -"manual action." +"Chromium maintains patches for some crates, kept in `//third_party/rust/" +"chromium_crates_io/patches`. These will be reapplied automatically, but if " +"patching fails you may need to take manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" -"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال می‌شوند، اما اگر " -"وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" +"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " +"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" -msgstr "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" +msgid "" +"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgstr "" +"هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Now run `git status`. You should find:" msgstr "اکنون `git status` را اجرا کنید. شما باید این موارد را پیدا کنید:" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" -msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +msgid "" +"At least one new crate source code in `third_party/rust/chromium_crates_io/" +"vendor`" +msgstr "" +"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "At least one new `BUILD.gn` in `third_party/rust//v`" -msgstr "حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" +msgid "" +"At least one new `BUILD.gn` in `third_party/rust//v`" +msgstr "" +"حداقل یک `BUILD.gn` جدید در `third_party/rust//v`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "An appropriate `README.chromium`" @@ -15185,36 +16522,46 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://doc.rust-lang.org/" -"cargo/reference/semver.html)." -msgstr "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه کنید." +"The \"major semver version\" is a [Rust \"semver\" version number](https://" +"doc.rust-lang.org/cargo/reference/semver.html)." +msgstr "" +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Take a close look, especially at the things generated in `third_party/rust`." -msgstr "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." +msgid "" +"Take a close look, especially at the things generated in `third_party/rust`." +msgstr "" +"نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium it's to allow " -"multiple incompatible versions of a crate, which is discouraged but sometimes necessary in the " -"Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium " +"it's to allow multiple incompatible versions of a crate, which is " +"discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" -"کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه ناسازگار از crateها " -"را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع می‌شود ولی گاهی اوقات ضروری است." +"کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " +"منع می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" -"If your build fails, it may be because of a `build.rs`: programs which do arbitrary things at " -"build time. This is fundamentally at odds with the design of `gn` and `ninja` which aim for " -"static, deterministic, build rules to maximize parallelism and repeatability of builds." +"If your build fails, it may be because of a `build.rs`: programs which do " +"arbitrary things at build time. This is fundamentally at odds with the " +"design of `gn` and `ninja` which aim for static, deterministic, build rules " +"to maximize parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که کارهای دلخواه " -"را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی `gn` و `ninja` است که هدفشان " -"قواعد build ایستا، قطعی برای به حداکثر رساندن موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " +"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " +"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " +"رساندن موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "Some `build.rs` actions are automatically supported; others require action:" -msgstr "برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام دارند:" +msgid "" +"Some `build.rs` actions are automatically supported; others require action:" +msgstr "" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " +"اقدام دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -15270,31 +16617,33 @@ msgstr "سایر اقدامات دلخواه" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" -"Fortunately, most crates don't contain a build script, and fortunately, most build scripts " -"only do the top two actions." +"Fortunately, most crates don't contain a build script, and fortunately, most " +"build scripts only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها تنها دو عمل " -"اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " +"scriptها تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If `ninja` complains about missing files, check the `build.rs` to see if it writes source code " -"files." +"If `ninja` complains about missing files, check the `build.rs` to see if it " +"writes source code files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که آیا کدهای " -"منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " +"ببینید که آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add `build-script-" -"outputs` to the crate. If this is a transitive dependency, that is, one on which Chromium code " -"should not directly depend, also add `allow-first-party-usage=false`. There are several " -"examples already in that file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " +"add `build-script-outputs` to the crate. If this is a transitive dependency, " +"that is, one on which Chromium code should not directly depend, also add " +"`allow-first-party-usage=false`. There are several examples already in that " +"file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر دهید تا `build-" -"script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، یعنی وابستگی که کد Chromium " -"نباید مستقیماً به آن وابسته باشد، پس `allow-first-party-usage=false` را نیز اضافه کنید. چندین " -"نمونه از قبل در آن فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " +"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " +"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " +"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " +"فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -15312,25 +16661,28 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate `BUILD.gn` files " -"to inform ninja that this particular output file is input to subsequent build steps." +"Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " +"`BUILD.gn` files to inform ninja that this particular output file is input " +"to subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا فایل‌های " -"`BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی خاص ورودی مراحل build " -"بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " +"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " +"فایل خروجی خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/C++ " -"libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/crates/bindgen) within " -"their build scripts. These actions can't be supported in a Chromium context --- our gn, ninja " -"and LLVM build system is very specific in expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build و link " -"کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از [`bindgen`](https://" -"crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در " -"زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build " -"actionsها بسیار خاص است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " +"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" +"crates.io/crates/bindgen) within their build scripts. These actions can't be " +"supported in a Chromium context --- our gn, ninja and LLVM build system is " +"very specific in expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " +"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " +"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " +"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " +"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " +"است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -15347,25 +16699,27 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - see for " -"example the [patches against the `cxx` crate](https://source.chromium.org/chromium/chromium/" -"src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - and will be applied " -"automatically by `gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" +"` - see for example the [patches against the `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - and will be applied automatically by " +"`gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` نگهداری شوند - " -"برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium.org/chromium/chromium/src/+/" -"main:third_party/rust/chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند " -"به‌طور خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" +"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " +"خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending on a crate is " -"simple. Find your `rust_static_library` target, and add a `dep` on the `:lib` target within " -"your crate." +"Once you've added a third-party crate and generated build rules, depending " +"on a crate is simple. Find your `rust_static_library` target, and add a " +"`dep` on the `:lib` target within your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه به نوع crate " -"می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا کنید و یک `dep` روی هدف `:" -"lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " +"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " +"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -15375,13 +16729,15 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" @@ -15409,39 +16765,44 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Adding new libraries is subject to Chromium's standard [policies](https://chromium." -"googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review), but of " -"course also subject to security review. As you may be bringing in not just a single crate but " -"also transitive dependencies, there may be a lot of code to review. On the other hand, safe " +"Adding new libraries is subject to Chromium's standard [policies](https://" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Third_party-review), but of course also subject to security review. As " +"you may be bringing in not just a single crate but also transitive " +"dependencies, there may be a lot of code to review. On the other hand, safe " "Rust code can have limited negative side effects. How should you review it?" msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/src/+/refs/" -"heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما البته موضوع بررسی " -"امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد " -"کنید، ممکن است کدهای زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند " -"عوارض جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" +"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " +"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " +"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " +"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " +"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet](https://mozilla.github." -"io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet]" +"(https://mozilla.github.io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla.github.io/cargo-" -"vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" +"mozilla.github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "Meanwhile, for each new crate addition, we are checking for the following:" +msgid "" +"Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? If the build system " -"for each crate contains a `build.rs` or procedural macros, work out what they're for. Are they " -"compatible with the way Chromium is normally built?" +"Understand why each crate is used. What's the relationship between crates? " +"If the build system for each crate contains a `build.rs` or procedural " +"macros, work out what they're for. Are they compatible with the way Chromium " +"is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر جعبه حاوی " -"`build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که آن‌ها برای چه چیزی هستند. " -"آیا آنها با روشی که Chromium به طور معمول ساخته و built می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " +"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " +"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " +"ساخته و built می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -15450,21 +16811,25 @@ msgstr "بررسی کنید که هر crate به نظر برسد که به خو #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known vulnerabilities " -"(first you'll need to `cargo install cargo-audit`, which ironically involves downloading lots " -"of dependencies from the internet[2](../cargo.md))" +"Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " +"vulnerabilities (first you'll need to `cargo install cargo-audit`, which " +"ironically involves downloading lots of dependencies from the internet[2](../" +"cargo.md))" msgstr "" -"از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی cargo برای بررسی " -"آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` که از قضا شامل دانلود " -"وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" +"از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" +"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." +"md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium.googlesource." -"com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." +"md#unsafe-code-in-safe-languages)" msgstr "" -"مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium.googlesource.com/" -"chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages) خوب است" +"مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" +"in-safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -15472,21 +16837,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place that might have been " -"maliciously inserted. (You can't realistically aim for 100% perfection here: there's often " -"just too much code.)" +"Read all the code at a sufficient level to look for anything out of place " +"that might have been maliciously inserted. (You can't realistically aim for " +"100% perfection here: there's often just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد شده باشد را " -"بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ درصدی باشید: اغلب کدهای " -"زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " +"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " +"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium.org` to work out the " -"right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium." +"org` to work out the right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار کنید تا راه " -"درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " +"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -15501,8 +16866,12 @@ msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "کد Crate را در `//third_party/rust/chromium_crates_io`." #: src/chromium/adding-third-party-crates/checking-in.md -msgid "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//`" -msgstr "متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" +msgid "" +"Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" +"`" +msgstr "" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" +"`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -15510,69 +16879,72 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into " -"the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config." +"toml` changes, into the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن Chromium " -"قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " +"مخزن Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` files may result in " -"some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` " +"files may result in some files being skipped." msgstr "" -"**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `.gitignore` ممکن است " -"منجر به حذف برخی از فایل‌ها شود." +"**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." +"gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." #: src/chromium/adding-third-party-crates/checking-in.md #, fuzzy msgid "" -"As you do so, you might find presubmit checks fail because of non-inclusive language. This is " -"because Rust crate data tends to include names of git branches, and many projects still use " -"non-inclusive terminology there. So you may need to run:" +"As you do so, you might find presubmit checks fail because of non-inclusive " +"language. This is because Rust crate data tends to include names of git " +"branches, and many projects still use non-inclusive terminology there. So " +"you may need to run:" msgstr "" -"در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان غیرمطرح با شکست " -"مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام شاخه‌های git می‌شوند و بسیاری از " -"پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد " -"را اجرا کنید:" +"در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " +"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " +"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to keep it up to date " -"with any security fixes](https://chromium.googlesource.com/chromium/src/+/main/docs/" -"adding_to_third_party.md#add-owners). It is hoped that we will soon automate this for Rust " -"crates, but for now, it's still your responsibility just as it is for any other third party " -"dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to " +"keep it up to date with any security fixes](https://chromium.googlesource." +"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " +"hoped that we will soon automate this for Rust crates, but for now, it's " +"still your responsibility just as it is for any other third party dependency." msgstr "" -"شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه اصلاحات امنیتی " -"به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/main/docs/" -"adding_to_third_party.md#add-owners). امید است که ما به زودی این را برای crateهای Rust خودکار " -"کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این " -"مسئولیت را دارید." +"شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " +"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " +"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" -"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the crate's [default " -"features](https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature). Assume " -"that the crate will be used in shipping Chromium, but won't be used to handle untrustworthy " -"input." +"Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " +"crate's [default features](https://doc.rust-lang.org/cargo/reference/" +"features.html#the-default-feature). Assume that the crate will be used in " +"shipping Chromium, but won't be used to handle untrustworthy input." msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های پیش‌فرض]" -"(https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature). فرض کنید از " -"crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های " -"غیرقابل اعتماد استفاده نمی‌شود." +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " +"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " +"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " +"نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead and do that " -"now if you like. Or, you could create a new [`rust_executable` target](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " +"ahead and do that now if you like. Or, you could create a new " +"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" +"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" -"(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل می‌توانید این کار " -"را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable'](https://source.chromium.org /" -"chromium/chromium/src/+/main:build/rust/rust_executable.gni) جدید ایجاد کنید که از `uwuify` " -"استفاده می‌کند)." +"(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " +"می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" +"(https://source.chromium.org /chromium/chromium/src/+/main:build/rust/" +"rust_executable.gni) جدید ایجاد کنید که از `uwuify` استفاده می‌کند)." #: src/exercises/chromium/third-party.md msgid "Students will need to download lots of transitive dependencies." @@ -15616,15 +16988,18 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to turn off the default " -"features." +"If students are downloading even more than that, they probably forgot to " +"turn off the default features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های پیش‌فرض را " -"خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " +"ویژگی‌های پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md -msgid "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" -msgstr "با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" +msgid "" +"Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" +msgstr "" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " +"crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -15632,11 +17007,11 @@ msgstr " برای جمع‌آوری آن --- تمرین کنید" #: src/exercises/chromium/bringing-it-together.md msgid "" -"In this exercise, you're going to add a whole new Chromium feature, bringing together " -"everything you already learned." +"In this exercise, you're going to add a whole new Chromium feature, bringing " +"together everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی را که قبلاً یاد " -"گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " +"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -15644,38 +17019,46 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. It's important that " -"we get Chromium for Pixies delivered to them as soon as possible." +"A community of pixies has been discovered living in a remote rainforest. " +"It's important that we get Chromium for Pixies delivered to them as soon as " +"possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم است که " -"Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " +"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md -msgid "The requirement is to translate all Chromium's UI strings into Pixie language." -msgstr "لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." +msgid "" +"The requirement is to translate all Chromium's UI strings into Pixie " +"language." +msgstr "" +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " +"شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie language is very close " -"to English, and it turns out there's a Rust crate which does the translation." +"There's not time to wait for proper translations, but fortunately pixie " +"language is very close to English, and it turns out there's a Rust crate " +"which does the translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie بسیار نزدیک به " -"انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " +"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " +"که ترجمه را انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"In fact, you already [imported that crate in the previous exercise](https://crates.io/crates/" -"uwuify)." +"In fact, you already [imported that crate in the previous exercise](https://" +"crates.io/crates/uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" +"crates/uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and diligence. Don't ship " -"this!)" +"(Obviously, real translations of Chrome require incredible care and " +"diligence. Don't ship this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این مورد را ارسال " -"نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " +"این مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -15683,77 +17066,85 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all strings before " -"display. In this special build of Chromium, it should always do this irrespective of the " -"setting of `mangle_localized_strings_`." +"Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " +"strings before display. In this special build of Chromium, it should always " +"do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را قبل از نمایش " -"یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات `mangle_localized_strings_` " -"همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " +"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " +"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, you should have " -"created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, " +"you should have created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را برای pixies " -"ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " +"را برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and will probably " -"decide that it's better to do the conversion on the C++ side using `base::UTF16ToUTF8` and " -"back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " +"and will probably decide that it's better to do the conversion on the C++ " +"side using `base::UTF16ToUTF8` and back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و احتمالاً " -"تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::UTF16ToUTF8` انجام " -"دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " +"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " +"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If students decide to do the conversion on the Rust side, they'll need to consider [`String::" -"from_utf16`](https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf16), " -"consider error handling, and consider which [CXX supported types can transfer a lot of u16s]" -"(https://cxx.rs/binding/slice.html)." +"If students decide to do the conversion on the Rust side, they'll need to " +"consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." +"String.html#method.from_utf16), consider error handling, and consider which " +"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" +"slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. taking and returning " -"strings by value, or taking a mutable reference to a string. If a mutable reference is used, " -"CXX will likely tell the student that they need to use [`Pin`](https://doc.rust-lang.org/std/" -"pin/). You may need to explain what `Pin` does, and then explain why CXX needs it for mutable " -"references to C++ data: the answer is that C++ data can't be moved around like Rust data, " -"because it may contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. گرفتن و " -"برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک string. اگر از یک مرجع " -"قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که باید از [`Pin`](https://doc.rust-" -"lang.org/std/pin/) استفاده کند. ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید " -"که چرا CXX به آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های " -"C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" -"referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. " +"taking and returning strings by value, or taking a mutable reference to a " +"string. If a mutable reference is used, CXX will likely tell the student " +"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " +"need to explain what `Pin` does, and then explain why CXX needs it for " +"mutable references to C++ data: the answer is that C++ data can't be moved " +"around like Rust data, because it may contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " +"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " +"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " +"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " +"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " +"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " +"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " +"نشانگرهای خودارجاعی (self-referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need to depend on " -"a `rust_static_library` target. The student probably already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " +"need to depend on a `rust_static_library` target. The student probably " +"already did this." msgstr "" -"هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف `rust_static_library` " -"وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده است." +"هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " +"داده است." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The `rust_static_library` target will need to depend on `//third_party/rust/uwuify/v0_2:lib`." -msgstr "هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته باشد." +"The `rust_static_library` target will need to depend on `//third_party/rust/" +"uwuify/v0_2:lib`." +msgstr "" +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " +"وابسته باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs](https://chromium-" -"review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs]" +"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review.googlesource." -"com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -15761,15 +17152,16 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people who are familiar " -"with the basics of Rust (perhaps from completing the Comprehensive Rust course), and ideally " -"also have some experience with bare-metal programming in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people " +"who are familiar with the basics of Rust (perhaps from completing the " +"Comprehensive Rust course), and ideally also have some experience with bare-" +"metal programming in some other language such as C." msgstr "" #: src/bare-metal.md msgid "" -"Today we will talk about 'bare-metal' Rust: running Rust code without an OS underneath us. " -"This will be divided into several parts:" +"Today we will talk about 'bare-metal' Rust: running Rust code without an OS " +"underneath us. This will be divided into several parts:" msgstr "" #: src/bare-metal.md @@ -15790,18 +17182,21 @@ msgstr "" #: src/bare-metal.md msgid "" -"For the microcontroller part of the course we will use the [BBC micro:bit](https://microbit." -"org/) v2 as an example. It's a [development board](https://tech.microbit.org/hardware/) based " -"on the Nordic nRF52833 microcontroller with some LEDs and buttons, an I2C-connected " -"accelerometer and compass, and an on-board SWD debugger." +"For the microcontroller part of the course we will use the [BBC micro:bit]" +"(https://microbit.org/) v2 as an example. It's a [development board](https://" +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " +"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " +"an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "" +"To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" #: src/bare-metal.md -msgid "And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "" +"And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md @@ -15926,21 +17321,21 @@ msgstr "" #: src/bare-metal/minimal.md msgid "" -"Depending on the target, you may need to compile with `panic = \"abort\"` to avoid an error " -"about `eh_personality`." +"Depending on the target, you may need to compile with `panic = \"abort\"` to " +"avoid an error about `eh_personality`." msgstr "" #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to define your own entry " -"point. This will typically involve a linker script and some assembly code to set things up " -"ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to " +"define your own entry point. This will typically involve a linker script and " +"some assembly code to set things up ready for Rust code to run." msgstr "" #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-lang.org/stable/" -"std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc." +"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" #: src/bare-metal/alloc.md @@ -15962,26 +17357,28 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy system allocator. " -"Other crates are available, or you can write your own or hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy " +"system allocator. Other crates are available, or you can write your own or " +"hook into your existing allocator." msgstr "" #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in this case it " -"can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " +"in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" #: src/bare-metal/alloc.md msgid "" -"If any crate in your dependency tree depends on `alloc` then you must have exactly one global " -"allocator defined in your binary. Usually this is done in the top-level binary crate." +"If any crate in your dependency tree depends on `alloc` then you must have " +"exactly one global allocator defined in your binary. Usually this is done in " +"the top-level binary crate." msgstr "" #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate is linked in " -"so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " +"crate is linked in so we get its panic handler." msgstr "" #: src/bare-metal/alloc.md @@ -15990,18 +17387,20 @@ msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex M " -"microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for " +"Cortex M microcontrollers." msgstr "" #: src/bare-metal/microcontrollers.md -msgid "Next we'll look at how to access peripherals, with increasing levels of abstraction." +msgid "" +"Next we'll look at how to access peripherals, with increasing levels of " +"abstraction." msgstr "" #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, because " -"returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" +"> !`, because returning to the reset handler doesn't make sense." msgstr "" #: src/bare-metal/microcontrollers.md @@ -16010,8 +17409,8 @@ msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning on an LED on " -"our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try " +"turning on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -16026,7 +17425,8 @@ msgstr "" msgid "// PIN_CNF fields\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" @@ -16037,18 +17437,22 @@ msgid "" " // aliases exist.\n" msgstr "" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to the first row." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " +"to the first row." msgstr "" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md -#: src/bare-metal/microcontrollers/hals.md src/bare-metal/microcontrollers/board-support.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/hals.md +#: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" msgstr "" @@ -16058,27 +17462,28 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust wrappers for memory-" -"mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) " -"files." +"[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" +"pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by silicon vendors which " -"describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by " +"silicon vendors which describe the memory map of the device." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"They are organised by peripheral, register, field and value, with names, descriptions, " -"addresses and so on." +"They are organised by peripheral, register, field and value, with names, " +"descriptions, addresses and so on." msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects which patch the " -"mistakes, add missing details, and publish the generated crates." +"SVD files are often buggy and incomplete, so there are various projects " +"which patch the mistakes, add missing details, and publish the generated " +"crates." msgstr "" #: src/bare-metal/microcontrollers/pacs.md @@ -16087,8 +17492,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac -- -d --no-" -"show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " +"pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -16097,9 +17502,10 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-implementation-crates) " -"for many microcontrollers provide wrappers around various peripherals. These generally " -"implement traits from [`embedded-hal`](https://crates.io/crates/embedded-hal)." +"[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" +"implementation-crates) for many microcontrollers provide wrappers around " +"various peripherals. These generally implement traits from [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal)." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -16107,13 +17513,14 @@ msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "" #: src/bare-metal/microcontrollers/hals.md -msgid "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." +msgid "" +"`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, GD32, nRF, " -"NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various " +"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -16122,19 +17529,20 @@ msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"Board support crates provide a further level of wrapping for a specific board for convenience." +"Board support crates provide a further level of wrapping for a specific " +"board for convenience." msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, and a bit of " -"initialisation." +"In this case the board support crate is just providing more useful names, " +"and a bit of initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "" -"The crate may also include drivers for some on-board devices outside of the microcontroller " -"itself." +"The crate may also include drivers for some on-board devices outside of the " +"microcontroller itself." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -16155,27 +17563,29 @@ msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. Once a pin is " -"moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can " +"exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you can’t keep use the " -"old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you " +"can’t keep use the old instance afterwards." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, the configuration " -"state of a GPIO pin. This encodes the state machine into the type system, and ensures that you " -"don't try to use a pin in a certain way without properly configuring it first. Illegal state " -"transitions are caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, " +"the configuration state of a GPIO pin. This encodes the state machine into " +"the type system, and ensures that you don't try to use a pin in a certain " +"way without properly configuring it first. Illegal state transitions are " +"caught at compile time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but not vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but " +"not vice-versa." msgstr "" #: src/bare-metal/microcontrollers/type-state.md @@ -16184,8 +17594,8 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a number of traits " -"covering common microcontroller peripherals:" +"The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " +"number of traits covering common microcontroller peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -16206,50 +17616,54 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out into " -"[`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`](https://crates.io/" -"crates/embedded-can) and [`rand_core`](https://crates.io/crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-embedded-" -"rust#driver-crates) in terms of these traits, e.g. an accelerometer driver might need an I2C " -"or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/" +"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring them, as " -"initialisation and configuration is usually highly platform-specific." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other platforms such as Linux " -"on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other " +"platforms such as Linux on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides async versions of " -"the traits." +"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " +"async versions of the traits." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another approach to non-" -"blocking I/O, based on the [`nb`](https://crates.io/crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like OpenOCD but " -"better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " +"like OpenOCD but better integrated." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md -msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgid "" +"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -16262,36 +17676,42 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real Time Transfers) " -"output and connect GDB. It's configured by an `Embed.toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " +"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." +"toml` file in your project directory." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm standard " -"protocol over USB for an in-circuit debugger to access the CoreSight Debug Access Port of " -"various Arm Cortex processors. It's what the on-board debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " +"an Arm standard protocol over USB for an in-circuit debugger to access the " +"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " +"on-board debugger on the BBC micro:bit uses." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a range from " -"SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " +"is a range from SEGGER." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " +"Serial Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md -msgid "probe-rs is a library which you can integrate into your own tools if you want to." +msgid "" +"probe-rs is a library which you can integrate into your own tools if you " +"want to." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) " -"lets VSCode and other IDEs debug code running on any supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" +"adapter-protocol/) lets VSCode and other IDEs debug code running on any " +"supported microcontroller." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -16300,8 +17720,8 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host and the " -"target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " +"host and the target through a number of ringbuffers." msgstr "" #: src/bare-metal/microcontrollers/debugging.md @@ -16324,7 +17744,8 @@ msgstr "" msgid "In GDB, try running:" msgstr "" -#: src/bare-metal/microcontrollers/other-projects.md src/bare-metal/aps/other-projects.md +#: src/bare-metal/microcontrollers/other-projects.md +#: src/bare-metal/aps/other-projects.md msgid "Other projects" msgstr "" @@ -16337,7 +17758,8 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "Shared resource management, message passing, task scheduling, timer queue" +msgid "" +"Shared resource management, message passing, task scheduling, timer queue" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -16353,7 +17775,9 @@ msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "Security-focused RTOS with preemptive scheduling and Memory Protection Unit support" +msgid "" +"Security-focused RTOS with preemptive scheduling and Memory Protection Unit " +"support" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -16362,7 +17786,8 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, " +"unprivileged drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -16371,8 +17796,8 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github.io/book/" -"overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." +"github.io/book/overview/using-the-standard-library.html)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -16385,8 +17810,8 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling rather than a " -"proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " +"scheduling rather than a proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -16394,26 +17819,35 @@ msgid "Cortex-M only." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "" +"Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "FreeRTOS is mostly written in C, but there are Rust bindings for writing applications." +msgid "" +"FreeRTOS is mostly written in C, but there are Rust bindings for writing " +"applications." msgstr "" #: src/exercises/bare-metal/morning.md -msgid "We will read the direction from an I2C compass, and log the readings to a serial port." +msgid "" +"We will read the direction from an I2C compass, and log the readings to a " +"serial port." msgstr "" #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-morning.md) provided." -msgstr "پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه کنید." +"After looking at the exercises, you can look at the [solutions](solutions-" +"morning.md) provided." +msgstr "" +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " +"نگاه کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial port. If you " -"have time, try displaying it on the LEDs somehow too, or use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port. If you have time, try displaying it on the LEDs somehow too, or " +"use the buttons somehow." msgstr "" #: src/exercises/bare-metal/compass.md @@ -16422,42 +17856,46 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) and " -"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) crates, as well as the [micro:" -"bit hardware](https://tech.microbit.org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" +"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" +"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." +"org/hardware/)." msgstr "" #: src/exercises/bare-metal/compass.md -msgid "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." +msgid "" +"The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "" #: src/exercises/bare-metal/compass.md -msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "" +"TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` trait. The " -"[`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/hal/struct.Twim.html) " -"struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct.Board.html) " -"struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/pdf/" -"nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " +"this exercise." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the " -"`compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `compass` directory for the following files." msgstr "" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md @@ -16481,7 +17919,8 @@ msgid "See the serial output on Linux with:" msgstr "" #: src/exercises/bare-metal/compass.md -msgid "Or on Mac OS something like (the device name may be slightly different):" +msgid "" +"Or on Mac OS something like (the device name may be slightly different):" msgstr "" #: src/exercises/bare-metal/compass.md @@ -16530,7 +17969,8 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" msgstr "" @@ -16540,26 +17980,29 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now let's try " -"writing something for Cortex-A. For simplicity we'll just work with QEMU's aarch64 ['virt']" -"(https://qemu-project.gitlab.io/qemu/system/arm/virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " +"Now let's try writing something for Cortex-A. For simplicity we'll just work " +"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" +"virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" -"Broadly speaking, microcontrollers don't have an MMU or multiple levels of privilege " -"(exception levels on Arm CPUs, rings on x86), while application processors do." +"Broadly speaking, microcontrollers don't have an MMU or multiple levels of " +"privilege (exception levels on Arm CPUs, rings on x86), while application " +"processors do." msgstr "" #: src/bare-metal/aps.md msgid "" -"QEMU supports emulating various different machines or board models for each architecture. The " -"'virt' board doesn't correspond to any particular real hardware, but is designed purely for " -"virtual machines." +"QEMU supports emulating various different machines or board models for each " +"architecture. The 'virt' board doesn't correspond to any particular real " +"hardware, but is designed purely for virtual machines." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "Before we can start running Rust code, we need to do some initialisation." +msgid "" +"Before we can start running Rust code, we need to do some initialisation." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -16569,7 +18012,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -16588,7 +18032,8 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -16598,7 +18043,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -16637,60 +18083,69 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, zeroing the BSS, and " -"setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, " +"zeroing the BSS, and setting up the stack pointer." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the object file which " -"containing statically allocated variables which are initialised to zero. They are omitted from " -"the image, to avoid wasting space on zeroes. The compiler assumes that the loader will take " -"care of zeroing them." +"The BSS (block starting symbol, for historical reasons) is the part of the " +"object file which containing statically allocated variables which are " +"initialised to zero. They are omitted from the image, to avoid wasting space " +"on zeroes. The compiler assumes that the loader will take care of zeroing " +"them." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and the image is loaded, " -"but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and " +"the image is loaded, but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "We need to enable the MMU and cache before reading or writing any memory. If we don't:" +msgid "" +"We need to enable the MMU and cache before reading or writing any memory. If " +"we don't:" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-none` target " -"which sets `+strict-align` to prevent the compiler generating unaligned accesses, so it should " -"be fine in this case, but this is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-" +"unknown-none` target which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses, so it should be fine in this case, but this " +"is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem is that the " -"VM is accessing memory directly with the cache disabled, while the host has cacheable aliases " -"to the same memory. Even if the host doesn't explicitly access the memory, speculative " -"accesses can lead to cache fills, and then changes from one or the other will get lost when " -"the cache is cleaned or the VM enables the cache. (Cache is keyed by physical address, not VA " -"or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost when the cache " +"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " +"not VA or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity maps the " -"first 1 GiB of address space for devices, the next 1 GiB for DRAM, and another 1 GiB higher up " -"for more devices. This matches the memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " +"identity maps the first 1 GiB of address space for devices, the next 1 GiB " +"for DRAM, and another 1 GiB higher up for more devices. This matches the " +"memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md -msgid "We also set up the exception vector (`vbar_el1`), which we'll see more about later." +msgid "" +"We also set up the exception vector (`vbar_el1`), which we'll see more about " +"later." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 (EL1). If you need " -"to run at a different exception level you'll need to modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 " +"(EL1). If you need to run at a different exception level you'll need to " +"modify `entry.S` accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -16699,12 +18154,13 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with Rust code. For " -"example, to make an HVC (hypervisor call) to tell the firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with " +"Rust code. For example, to make an HVC (hypervisor call) to tell the " +"firmware to power off the system:" msgstr "" -"گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی استفاده کنیم. به " -"عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به firmware بگویید سیستم را " -"خاموش کند:" +"گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " +"که به firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -16753,57 +18209,67 @@ msgstr "\"w7\"" #: src/bare-metal/aps/inline-assembly.md msgid "" -"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/smccc) crate " -"which has wrappers for all these functions.)" +"(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" +"smccc) crate which has wrappers for all these functions.)" msgstr "" -"(اگر واقعاُ می‌خواهید این کار را انجام دهید، از crate مربوطه [`smccc`](https://crates.io/crates/" -"smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این عملکردها است.)" +"(اگر واقعاُ می‌خواهید این کار را انجام دهید، از crate مربوطه [`smccc`](https://" +"crates.io/crates/smccc) استفاده کنید که دارای بسته‌بندی(wrapper) برای همه این " +"عملکردها است.)" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of functions to manage " -"system and CPU power states, among other things. It is implemented by EL3 firmware and " -"hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of " +"functions to manage system and CPU power states, among other things. It is " +"implemented by EL3 firmware and hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای مدیریت وضعیت‌های " -"power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط میان‌افزار EL3 و hypervisor در " -"بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " +"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " +"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the inline assembly " -"code, and ignore its contents afterwards. We need to use `inout` rather than `in` because the " -"call could potentially clobber the contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the " +"inline assembly code, and ignore its contents afterwards. We need to use " +"`inout` rather than `in` because the call could potentially clobber the " +"contents of the registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی به 0 " -"مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به جای `in` استفاده " -"کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " +"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " +"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " +"محتویات رجیسترها را مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is called from " -"our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " +"it is called from our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه ورودی (entry " -"point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " +"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used by the " -"bootloader to pass things like a pointer to the device tree. According to the standard aarch64 " -"calling convention (which is what `extern \"C\"` specifies to use), registers `x0`–`x7` are " -"used for the first 8 arguments passed to a function, so `entry.S` doesn't need to do anything " +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " +"used by the bootloader to pass things like a pointer to the device tree. " +"According to the standard aarch64 calling convention (which is what `extern " +"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " +"arguments passed to a function, so `entry.S` doesn't need to do anything " "special except make sure it doesn't change these registers." msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader برای ارسال " -"چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد فراخوانی استاندارد aarch64 (که " -"همان چیزی است که `extern \"C\"` برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان " -"اول ارسال شده به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست " -"کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " +"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " +"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " +"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " +"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " +"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " +"نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md -msgid "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." -msgstr "مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا کنید." +msgid "" +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" +"examples`." +msgstr "" +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -16818,39 +18284,49 @@ msgid "Never hold a reference." msgstr "هرگز reference‌ای را نگه ندارید." #: src/bare-metal/aps/mmio.md -msgid "`addr_of!` lets you get fields of structs without creating an intermediate reference." +msgid "" +"`addr_of!` lets you get fields of structs without creating an intermediate " +"reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " +"ساختارها را دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent the compiler or " -"hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent " +"the compiler or hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته باشد، " -"بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " +"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " +"حذف آنها جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the compiler may assume that " -"the value read is the same as the value just written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the " +"compiler may assume that the value read is the same as the value just " +"written, and not bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر ممکن است فرض " -"کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " +"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " +"است و در واقع خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but this is unsound. " -"Whenever a reference exist, the compiler may choose to dereference it." +"Some existing crates for volatile access to hardware do hold references, but " +"this is unsound. Whenever a reference exist, the compiler may choose to " +"dereference it." msgstr "" -"برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای referenceهایی " -"هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته باشد، کامپایلر ممکن است " -"انتخاب کند که reference آن را لغو کند." +"برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " +"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md -msgid "Use the `addr_of!` macro to get struct field pointers from a pointer to the struct." +msgid "" +"Use the `addr_of!` macro to get struct field pointers from a pointer to the " +"struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " +"ساختار استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -16858,11 +18334,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/ddi0183/g) UART, " -"so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" +"documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/g) به‌عنوان " -"UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -16877,8 +18353,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -16886,8 +18364,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -16921,44 +18401,51 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is because as long as " -"the caller of `Uart::new` guarantees that its safety requirements are met (i.e. that there is " -"only ever one instance of the driver for a given UART, and nothing else aliasing its address " -"space), then it is always safe to call `write_byte` later because we can assume the necessary " -"preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is " +"because as long as the caller of `Uart::new` guarantees that its safety " +"requirements are met (i.e. that there is only ever one instance of the " +"driver for a given UART, and nothing else aliasing its address space), then " +"it is always safe to call `write_byte` later because we can assume the " +"necessary preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن هستند. این " -"به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که الزامات ایمنی آن برآورده " -"شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار " -"فضای آدرس آن را ندارد)، پس همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم " -"پیش‌شرط‌های لازم را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " +"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " +"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " +"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " +"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " +"را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but `write_byte` unsafe), but " -"that would be much less convenient to use as every place that calls `write_byte` would need to " -"reason about the safety" +"We could have done it the other way around (making `new` safe but " +"`write_byte` unsafe), but that would be much less convenient to use as every " +"place that calls `write_byte` would need to reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما `write_byte` " -"را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر مکانی که `write_byte` را صدا " -"می‌زند باید در مورد ایمنی یا safety استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " +"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " +"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " +"استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving the burden of proof " -"for soundness from a large number of places to a smaller number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving " +"the burden of proof for soundness from a large number of places to a smaller " +"number of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت عملکردی از " -"تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " +"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md -msgid "We derived the `Debug` trait. It would be useful to implement a few more traits too." -msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +msgid "" +"We derived the `Debug` trait. It would be useful to implement a few more " +"traits too." +msgstr "" +"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -16970,14 +18457,20 @@ msgstr "" "// accessed from any context.\n" #: src/bare-metal/aps/uart/traits.md -msgid "Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type." +msgid "" +"Implementing `Write` lets us use the `write!` and `writeln!` macros with our " +"`Uart` type." msgstr "" -"پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ `Uart` خود " -"استفاده کنیم." +"پیاده‌سازی `Write`به ما امکان می‌دهد از ماکروهای `write!` و `writeln!` با تایپ " +"`Uart` خود استفاده کنیم." #: src/bare-metal/aps/uart/traits.md -msgid "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/examples`." -msgstr "مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا کنید." +msgid "" +"Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" +"examples`." +msgstr "" +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -16986,15 +18479,17 @@ msgstr "یک درایور UART بهتر" #: src/bare-metal/aps/better-uart.md #, fuzzy msgid "" -"The PL011 actually has [a bunch more registers](https://developer.arm.com/documentation/" -"ddi0183/g/programmers-model/summary-of-registers), and adding offsets to construct pointers to " -"access them is error-prone and hard to read. Plus, some of them are bit fields which would be " -"nice to access in a structured way." +"The PL011 actually has [a bunch more registers](https://developer.arm.com/" +"documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " +"offsets to construct pointers to access them is error-prone and hard to " +"read. Plus, some of them are bit fields which would be nice to access in a " +"structured way." msgstr "" -"‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/documentation/ddi0183/g/" -"programmers-model/summary-of-registers) و اضافه کردن offset برای ساختن اشاره‌گرها برای دسترسی " -"به آنها مستعدخطا است و حتی فرآبند خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit " -"هستند که دسترسی به آنها به روشی ساختاریافته خوب است." +"‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" +"documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " +"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " +"به آنها به روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -17158,9 +18653,11 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " +"working with bitflags." msgstr "" -"این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با bitflags مفید است." +"این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " +"bitflags مفید است." #: src/bare-metal/aps/better-uart/bitflags.md #, fuzzy @@ -17214,31 +18711,36 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a bunch of " -"method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " +"with a bunch of method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی متد برای " -"دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " +"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "We can use a struct to represent the memory layout of the UART's registers." -msgstr "ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." +msgid "" +"We can use a struct to represent the memory layout of the UART's registers." +msgstr "" +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " +"کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" -"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) " -"tells the compiler to lay the struct fields out in order, following the same rules as C. This " -"is necessary for our struct to have a predictable layout, as default Rust representation " -"allows the compiler to (among other things) reorder fields however it sees fit." -msgstr "" -"‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-representation) به " -"کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این پیروی از قوانین مشابه با زبان C " -"است. این کار را برای ساختار ما برای داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض " -"Rust به کامپایلر اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " +"[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" +"representation) tells the compiler to lay the struct fields out in order, " +"following the same rules as C. This is necessary for our struct to have a " +"predictable layout, as default Rust representation allows the compiler to " +"(among other things) reorder fields however it sees fit." +msgstr "" +"‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " +"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " +"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " +"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " "کند." #: src/bare-metal/aps/better-uart/driver.md @@ -17285,11 +18787,11 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields without " -"creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"fields without creating an intermediate reference, which would be unsound." msgstr "" -"به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای جداگانه بدون ایجاد " -"یک reference میانی توجه کنید، که ممکن است نادرست باشد." +"به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " +"جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md msgid "Using it" @@ -17297,11 +18799,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, and echo incoming " -"bytes." +"Let's write a small program using our driver to write to the serial console, " +"and echo incoming bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم و بایت‌های " -"ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " +"بنویسیم و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -17327,7 +18829,8 @@ msgstr "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" msgid "b'\\r'" msgstr "b'\\r'" -#: src/bare-metal/aps/better-uart/using.md src/concurrency/async-pitfalls/cancellation.md +#: src/bare-metal/aps/better-uart/using.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "b'\\n'" msgstr "b'\\n'" @@ -17341,23 +18844,30 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` function is called " -"from our entry point code in `entry.S`. See the speaker notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از کد نقطه ورودی " -"ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " +"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " +"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md -msgid "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." -msgstr "مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." +msgid "" +"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +msgstr "" +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`](https://crates.io/" -"crates/log) crate. We can do this by implementing the `Log` trait." +"It would be nice to be able to use the logging macros from the [`log`]" +"(https://crates.io/crates/log) crate. We can do this by implementing the " +"`Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/log) استفاده " -"کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" +"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " +"دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -17369,72 +18879,87 @@ msgid "/// Initialises UART logger.\n" msgstr "/// Initialises UART logger.\n" #: src/bare-metal/aps/logging.md -msgid "The unwrap in `log` is safe because we initialise `LOGGER` before calling `set_logger`." +msgid "" +"The unwrap in `log` is safe because we initialise `LOGGER` before calling " +"`set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " +"مقداردهی اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." msgstr "قبل از استفاده از لاگر باید مقداردهی اولیه کنیم." -#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/logging/using.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "\"{info}\"" msgstr "\"{info}\"" #: src/bare-metal/aps/logging/using.md msgid "Note that our panic handler can now log details of panics." -msgstr "توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." +msgstr "" +"توجه داشته باشید که panic handler ما اکنون می تواند جزئیات panic را ثبت کند." #: src/bare-metal/aps/logging/using.md -msgid "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/examples`." -msgstr "مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا کنید." +msgid "" +"Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" +"examples`." +msgstr "" +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/exceptions.md msgid "" -"AArch64 defines an exception vector table with 16 entries, for 4 types of exceptions " -"(synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, current EL with SPx, lower " -"EL using AArch64, lower EL using AArch32). We implement this in assembly to save volatile " -"registers to the stack before calling into Rust code:" +"AArch64 defines an exception vector table with 16 entries, for 4 types of " +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " +"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " +"We implement this in assembly to save volatile registers to the stack before " +"calling into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، IRQ، FIQ، " -"SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL using AArch64, lower EL " -"using AArch32) تعریف می‌کند. ما این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار " -"(volatile) را قبل از فراخوانی Rust در stack ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " +"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " +"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " +"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " +"فراخوانی Rust در stack ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "" +"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current EL exceptions, or " -"between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current " +"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 برای استثناهای " -"پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " +"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't expect any of them to " -"actually happen." +"For this example we just log the exception and power down, as we don't " +"expect any of them to actually happen." msgstr "" -"برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار نداریم هیچ یک از " -"آنها واقعاً اتفاق بیفتد." +"برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " +"نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or less like different " -"threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will control what we can share " -"between them, just like with threads. For example, if we want to share some value between " -"exception handlers and the rest of the program, and it's `Send` but not `Sync`, then we'll " -"need to wrap it in something like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or " +"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." +"md) will control what we can share between them, just like with threads. For " +"example, if we want to share some value between exception handlers and the " +"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " +"it in something like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای مختلف فکر " -"کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که می‌توانیم بین آنها به " -"اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین " -"handlerهای exception و بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " -"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " +"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." +"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " +"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " +"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " +"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " +"قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -17455,24 +18980,27 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception handling, " -"page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " +"exception handling, page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " +"exception و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" -"Some dodginess around cache maintenance and initialisation in Rust, not necessarily a good " -"example to copy for production code." +"Some dodginess around cache maintenance and initialisation in Rust, not " +"necessarily a good example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای کپی کردن برای " -"کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " +"برای کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -17484,102 +19012,120 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. This will " -"read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " +"enabled. This will read and write memory (e.g. the stack). However:" msgstr "" -"آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا می‌کند. این کار " -"memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" +"آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " +"بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-unknown-" -"none` which sets `+strict-align` to prevent the compiler generating unaligned accesses so it " -"should be alright, but this is not necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with " +"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses so it should be alright, but this is not " +"necessarily the case in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-unknown-none` " -"ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر " -"جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " +"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " +"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " +"صحیح باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem is that the " -"VM is accessing memory directly with the cache disabled, while the host has cacheable aliases " -"to the same memory. Even if the host doesn't explicitly access the memory, speculative " -"accesses can lead to cache fills, and then changes from one or the other will get lost. Again " -"this is alright in this particular case (running directly on the hardware with no hypervisor), " -"but isn't a good pattern in general." +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost. Again this is " +"alright in this particular case (running directly on the hardware with no " +"hypervisor), but isn't a good pattern in general." msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. مشکل این است " -"که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا می‌کند، درحالی‌که host دارای " -"alias قابل کَش برای همان حافظه است. حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، " -"دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " -"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما " -"به‌طورکلی الگوی خوبی نیست." +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " +"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " +"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " +"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " +"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " +"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " +"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" msgstr "جعبه‌های (crates) کاربردی" #: src/bare-metal/useful-crates.md -msgid "We'll go over a few crates which solve some common problems in bare-metal programming." -msgstr "ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل می‌کند." +msgid "" +"We'll go over a few crates which solve some common problems in bare-metal " +"programming." +msgstr "" +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " +"را حل می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits and macros " -"for safely converting between byte sequences and other types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " +"traits and macros for safely converting between byte sequences and other " +"types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی را برای تبدیل " -"ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " +"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but can be useful " -"for working with structures shared with hardware e.g. by DMA, or sent over some external " -"interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " +"but can be useful for working with structures shared with hardware e.g. by " +"DMA, or sent over some external interface." msgstr "" -"این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده نمی‌کند)، اما می‌تواند " -"برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط DMA، یا از طریق برخی از رابط‌های خارجی " -"ارسال می‌شود." +"این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " +"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is valid, and so can " -"safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is " +"valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" -"‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است پیاده‌سازی کرد و " -"بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل کرد." +"‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " +"تبدیل کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Attempting to derive `FromBytes` for these types would fail, because `RequestType` doesn't use " -"all possible u32 values as discriminants, so not all byte patterns are valid." +"Attempting to derive `FromBytes` for these types would fail, because " +"`RequestType` doesn't use all possible u32 values as discriminants, so not " +"all byte patterns are valid." msgstr "" -"تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا `RequestType` از همه " -"مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، بنابراین همه الگوهای بایت معتبر نیستند." +"تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " +"`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " +"بنابراین همه الگوهای بایت معتبر نیستند." #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." -msgstr "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." +msgid "" +"`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgstr "" +"‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-example/`. (It " -"won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"zerocopy-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا کنید. (به دلیل " -"وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" +"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you create page " -"tables according to the AArch64 Virtual Memory System Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " +"you create page tables according to the AArch64 Virtual Memory System " +"Architecture." msgstr "" -"این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما امکان می‌دهد page " -"tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." +"این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " +"کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -17598,41 +19144,50 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should be straightforward " -"to add." -msgstr "در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده باشد." +"For now it only supports EL1, but support for other exception levels should " +"be straightforward to add." +msgstr "" +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " +"ساده باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android.com/android/" -"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android." +"com/android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/platform/" -"superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/) استفاده می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware or under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware " +"or under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت QEMU اجرا " -"شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " +"یا تحت QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a third-party " -"crate implementing a basic buddy system allocator. It can be used both for [`LockedHeap`]" -"(https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " -"implementing [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so " -"you can use the standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating " -"other address space. For example, we might want to allocate MMIO space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک third-party " -"crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن را هم برای ['LockedHeap']" -"(https://docs.rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " -"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) " -"استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " -"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را " -"برای PCI BARها اختصاص دهیم:" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " +"is a third-party crate implementing a basic buddy system allocator. It can " +"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " +"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " +"allocating other address space. For example, we might want to allocate MMIO " +"space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " +"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " +"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " +"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " +"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " +"اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -17640,85 +19195,102 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-example/`. (It " -"won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"allocator-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا کنید. (به " -"دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " +"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without heap allocation. " -"[`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector backed by an array or " -"slice, which could be statically allocated or on the stack, which keeps track of how many " -"elements are used and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without " +"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " +"this: a vector backed by an array or slice, which could be statically " +"allocated or on the stack, which keeps track of how many elements are used " +"and panics if you try to use more than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما بدون heap " -"allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را فراهم می‌کند: یک برداری که " -"توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که " -"تعداد عناصر استفاده شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را " -"استفاده کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " +"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " +"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " +"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " +"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " +"کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md -msgid "`tinyvec` requires that the element type implement `Default` for initialisation." -msgstr "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." +msgid "" +"`tinyvec` requires that the element type implement `Default` for " +"initialisation." +msgstr "" +"‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." #: src/bare-metal/useful-crates/tinyvec.md -msgid "The Rust Playground includes `tinyvec`, so this example will run fine inline." +msgid "" +"The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " +"داخلی اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are not available " -"in `core` or `alloc`. How can we manage synchronisation or interior mutability, such as for " -"sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " +"are not available in `core` or `alloc`. How can we manage synchronisation or " +"interior mutability, such as for sharing state between different CPUs?" msgstr "" -"‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا `alloc` موجود " -"نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند اشتراک‌گذاری وضعیت بین CPU‌های " -"مختلف را مدیریت کنیم؟" +"‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " +"`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " +"اشتراک‌گذاری وضعیت بین CPU‌های مختلف را مدیریت کنیم؟" #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based equivalents of many " -"of these primitives." +"The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " +"equivalents of many of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، بسیاری از این " -"موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " +"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." -msgstr "اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." +msgstr "" +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " +"کنید." #: src/bare-metal/useful-crates/spin.md msgid "" -"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, `Barrier` and " -"`Once` from `std::sync`; and `Lazy` for lazy initialisation." +"`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " +"`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و `Once` از " -"`std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " +"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful types for " -"late initialisation with a slightly different approach to `spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " +"useful types for late initialisation with a slightly different approach to " +"`spin::once::Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های مفیدی برای " -"مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " +"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" +"once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "The Rust Playground includes `spin`, so this example will run fine inline." -msgstr "‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا می‌شود." +msgid "" +"The Rust Playground includes `spin`, so this example will run fine inline." +msgstr "" +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` Soong rule to " -"build your Rust code, then a `cc_binary` with a linker script to produce the binary itself, " -"and then a `raw_binary` to convert the ELF to a raw binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a " +"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " +"with a linker script to produce the binary itself, and then a `raw_binary` " +"to convert the ELF to a raw binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong برای ساخت کد " -"Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script برای تولید binary استفاده " -"کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " +"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " +"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " +"ELF به یک raw binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -17727,27 +19299,32 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md #, fuzzy msgid "" -"For VMs running under crosvm on aarch64, the [vmbase](https://android.googlesource.com/" -"platform/packages/modules/Virtualization/+/refs/heads/main/libs/libvmbase/) library provides a " -"linker script and useful defaults for the build rules, along with an entry point, UART console " -"logging and more." +"For VMs running under crosvm on aarch64, the [vmbase](https://android." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" -"برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/master/vmbase/) یک " -"اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، " -"UART console logging و موارد دیگر." +"برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" +"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " +"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " +"موارد دیگر." #: src/bare-metal/android/vmbase.md -msgid "The `main!` macro marks your main function, to be called from the `vmbase` entry point." -msgstr "این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی شود." +msgid "" +"The `main!` macro marks your main function, to be called from the `vmbase` " +"entry point." +msgstr "" +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " +"فراخوانی شود." #: src/bare-metal/android/vmbase.md msgid "" -"The `vmbase` entry point handles console initialisation, and issues a PSCI_SYSTEM_OFF to " -"shutdown the VM if your main function returns." +"The `vmbase` entry point handles console initialisation, and issues a " +"PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main function، یک " -"PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " +"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -17755,52 +19332,58 @@ msgstr "ما یک درایور برای دستگاه PL031 real-time clock خو #: src/exercises/bare-metal/afternoon.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-afternoon.md) " -"provided." +"After looking at the exercises, you can look at the [solutions](solutions-" +"afternoon.md) provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +"شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/documentation/ddi0224/c) " -"real-time clock at 0x9010000. For this exercise, you should write a driver for it." +"The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " +"you should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/documentation/" -"ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." +"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " +"برای آن بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the [`chrono`](https://" -"crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the " +"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`](https://" -"crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " +"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given time, e.g. 3 " -"seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-lang.org/core/hint/fn." -"spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given " +"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" +"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" -"از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر بمانید، به عنوان " -"مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`](https://doc.rust-lang.org/core/" -"hint/fn.spin_loop.html) inside the loop.)" +"از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " +"بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" +"(https://doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by the RTC match. You " -"can use the driver provided in the [`arm-gic`](https://docs.rs/arm-gic/) crate to configure " -"the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by " +"the RTC match. You can use the driver provided in the [`arm-gic`](https://" +"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را مدیریت کنید. " -"می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/arm-gic/) برای پیکربندی Arm " -"Generic Interrupt Controller استفاده کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " +"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" +"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -17808,24 +19391,27 @@ msgstr "از وقفه RTC استفاده کنید که به عنوان `IntId::s #: src/exercises/bare-metal/rtc.md msgid "" -"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::wfi()`, which will " -"cause the core to sleep until it receives an interrupt." +"Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" +"wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به حالت Sleep " -"درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" +"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " +"به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look in the `rtc` " -"directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `rtc` directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های زیر را در " -"دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " +"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the exercise):" -msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " +"the exercise):" +msgstr "" +"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -18003,8 +19589,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -18012,8 +19600,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -18042,10 +19632,12 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -18066,12 +19658,14 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -18093,49 +19687,58 @@ msgid "Welcome to Concurrency in Rust" msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md -msgid "Rust has full support for concurrency using OS threads with mutexes and channels." +msgid "" +"Rust has full support for concurrency using OS threads with mutexes and " +"channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از mutex ها و " -"channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " +"از mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" -"The Rust type system plays an important role in making many concurrency bugs compile time " -"bugs. This is often referred to as _fearless concurrency_ since you can rely on the compiler " -"to ensure correctness at runtime." +"The Rust type system plays an important role in making many concurrency bugs " +"compile time bugs. This is often referred to as _fearless concurrency_ since " +"you can rely on the compiler to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان کامپایل ایفا " -"می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless concurrency_) شناخته می‌شود زیرا " -"می‌توانید به کامپایلر برای اطمینان از صحت در زمان اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " +"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " +"زمان اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 20 minutes. It contains:" +"Including 10 minute breaks, this session should take about 3 hours and 20 " +"minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. شامل موارد زیر " -"است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " +"بکشد. شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: thread‌ها، " -"سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " +"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md -msgid "The type system gives us safety for concurrency without any special features." -msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgid "" +"The type system gives us safety for concurrency without any special features." +msgstr "" +"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e.g., a called " -"function that might mutate an argument or save references to it to read later) save us from " -"multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند یک تابع " -"فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای خواندن بعد ذخیره کند) " -"ما را از مشکلات multi-threading نجات می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " +"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " +"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " +"می‌دهند. " -#: src/concurrency/threads.md src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/threads.md src/concurrency/shared-state.md +#: src/concurrency/async.md msgid "This segment should take about 30 minutes. It contains:" msgstr "این بخش باید حدود ۳۰ دقیقه طول بکشد و شامل موارد زیر است:" @@ -18153,7 +19756,8 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the end of `main`." +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." msgstr "" #: src/concurrency/threads/plain.md @@ -18162,30 +19766,41 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." -msgstr "‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." +msgstr "" +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " +"کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." -msgstr "‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها است." +msgstr "" +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " +"آن‌ها است." #: src/concurrency/threads/plain.md msgid "Run the example." msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md -msgid "5ms timing is loose enough that main and spawned threads stay mostly in lockstep." +msgid "" +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." msgstr "" -"زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها عمدتاً همگام " -"می‌مانند." +"زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " +"عمدتاً همگام می‌مانند." #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" -msgstr "توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان می‌رسد!" +msgstr "" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " +"پایان می‌رسد!" #: src/concurrency/threads/plain.md -msgid "This is because main ends the program and spawned threads do not make it persist." +msgid "" +"This is because main ends the program and spawned threads do not make it " +"persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " +"تداوم آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -18197,27 +19812,27 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. " -"Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a `JoinHandle`. " -"به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) method that blocks." +"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) method that blocks." msgstr "" -"`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) متد آن بلاک‌ها." +"`JoinHandle` دارد [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) متد آن بلاک‌ها." #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the thread to " -"finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " +"the thread to finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا منتظر بمانید تا " -"thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " +"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -18229,21 +19844,26 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method." -"join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method." -"join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md -msgid "Use the `Result` return value from `handle.join()` to get access to the returned value." -msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +msgid "" +"Use the `Result` return value from `handle.join()` to get access to the " +"returned value." +msgstr "" +"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -18251,19 +19871,21 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "" +"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://doc.rust-lang.org/" -"std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://" +"doc.rust-lang.org/std/any/index.html)." msgstr "" -"دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`](https://doc.rust-" -"lang.org/std/any/index.html)." +"دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" +"(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "" +"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -18276,8 +19898,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق شده را " -"برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " +"مشتق شده را برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -18285,15 +19907,17 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just return and leave " -"them running." +"Main kills child threads when it returns, but another function would just " +"return and leave them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return می‌شود و آنها " -"را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " +"return می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" -msgstr "این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض می‌کند!" +msgstr "" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " +"نقض می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -18305,27 +19929,28 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope.html) for " -"this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" +"fn.scope.html) for this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/thread/fn.scope." -"html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" +"std/thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all the threads are " -"guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all " +"the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین می‌شود، " -"بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " +"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably " -"by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one " +"thread, or immutably by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با یک thread یا " -"غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " +"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " +"بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -18333,8 +19958,8 @@ msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts are connected " -"via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two " +"parts are connected via the channel, but you only see the end-points." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -18343,14 +19968,15 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` " -"(so you can make multiple producers) but `Receiver` does not." +"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " +"implement `Clone` (so you can make multiple producers) but `Receiver` does " +"not." msgstr "" #: src/concurrency/channels/senders-receivers.md msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` " -"or `Receiver` is dropped and the channel is closed." +"`send()` and `recv()` return `Result`. If they return `Err`, it means the " +"counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md @@ -18374,25 +20000,27 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "With bounded (synchronous) channels, `send` can block the current thread:" +msgid "" +"With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the channel for the new " -"message. The thread can be blocked indefinitely if there is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the " +"channel for the new message. The thread can be blocked indefinitely if there " +"is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) if the channel is " -"closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) " +"if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". Every send will " -"block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". " +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -18404,42 +20032,49 @@ msgid "Sync" msgstr "همگام سازی" #: src/concurrency/send-sync/marker-traits.md -msgid "How does Rust know to forbid shared access across threads? The answer is in two traits:" +msgid "" +"How does Rust know to forbid shared access across threads? The answer is in " +"two traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " +"دو trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is `Send` if it is " -"safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " +"is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" -"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که جابجایی `T` در " -"امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." +"‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " +"جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is `Sync` if it is " -"safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " +"is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" -"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که جابجایی یک `&T` در " -"سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` است." +"‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " +"`Sync` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The compiler will " -"automatically derive them for your types as long as they only contain `Send` and `Sync` types. " -"You can also implement them manually when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" -"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). کامپایلر به‌طور " -"خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای انواع `Send` و `Sync` باشند. " -"شما همچنین می توانید آنها را به صورت دستی پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن " -"معتبر است." +"‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " +"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " +"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-safety properties." +"One can think of these traits as markers that the type has certain thread-" +"safety properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" +"safety خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -18447,34 +20082,39 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if it is safe to " -"move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " +"if it is safe to move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc.rust-lang.org/" -"std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" +"doc.rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will run in that " -"thread. So the question is when you can allocate a value in one thread and deallocate it in " -"another." +"The effect of moving ownership to another thread is that _destructors_ will " +"run in that thread. So the question is when you can allocate a value in one " +"thread and deallocate it in another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " -"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی می‌توانید یک " -"مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " +"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " +"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " +"thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from a single thread." -msgstr "به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." +"As an example, a connection to the SQLite library must only be accessed from " +"a single thread." +msgstr "" +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " +"باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if it is safe to " -"access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " +"if it is safe to access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) است، " -"اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." +"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " +"همزمان امن باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -18486,23 +20126,27 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is thread-safe for " -"shared use, it is also thread-safe to pass references of it across threads." +"This statement is essentially a shorthand way of saying that if a type is " +"thread-safe for shared use, it is also thread-safe to pass references of it " +"across threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده مشترک امن باشد، " -"انتقال ارجاعات (pass references) آن به threadها نیز امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " +"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " +"امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across multiple threads " -"without the risk of data races or other synchronization issues, so it is safe to move it to " -"another thread. A reference to the type is also safe to move to another thread, because the " -"data it references can be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across " +"multiple threads without the risk of data races or other synchronization " +"issues, so it is safe to move it to another thread. A reference to the type " +"is also safe to move to another thread, because the data it references can " +"be accessed from any thread safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را در چند thread " -"بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک گذاشت، بنابراین انتقال آن به " -"thread‌ای دیگر امن است. ارجاع به تایپ نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی " -"که به آن ارجاع می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " +"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " +"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " +"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " +"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -18530,7 +20174,8 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "" +"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -18538,12 +20183,16 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "" +"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md -msgid "The generic types are typically `Send + Sync` when the type parameters are `Send + Sync`." +msgid "" +"The generic types are typically `Send + Sync` when the type parameters are " +"`Send + Sync`." msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند.`Send + Sync`." +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " +"هستند.`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -18551,11 +20200,11 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. Typically because of " -"interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. " +"Typically because of interior mutability:" msgstr "" -"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور معمول به دلیل " -"تغییرپذیری داخلی(interior mutability):" +"این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " +"معمول به دلیل تغییرپذیری داخلی(interior mutability):" #: src/concurrency/send-sync/examples.md msgid "`mpsc::Receiver`" @@ -18576,19 +20225,21 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple threads, but they cannot " -"be moved to another thread:" -msgstr "این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل کرد:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" +msgstr "" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on the thread which " -"created them. However, an already-locked mutex can have its guarded variable read by any " -"thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on " +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" -"‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در threadای که آنها " -"را ایجاد کرده است، توزیع شوند." +"‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " +"threadای که آنها را ایجاد کرده است، توزیع شوند." #: src/concurrency/send-sync/examples.md msgid "`!Send + !Sync`" @@ -18596,21 +20247,25 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" -msgstr "این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل کرد:" +msgstr "" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md msgid "" -"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-atomic reference " -"count." +"`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" +"atomic reference count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " +"مراجع غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" -"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency considerations." +"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " +"considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است ملاحظات همزمانی " -"خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " +"است ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -18622,11 +20277,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-only access " -"via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " +"read-only access via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا دسترسی read-only " -"مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " +"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -18638,31 +20293,36 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that uses atomic " -"operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " +"that uses atomic operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات atomic " -"استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " +"عملیات atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and `Sync` if and " -"only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " +"and `Sync` if and only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. `Send` و " -"`Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " +"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " +"آنها را پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but after that the use of " -"the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but " +"after that the use of the `T` is free." msgstr "" -"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن استفاده از `T` آزاد است." +"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن " +"استفاده از `T` آزاد است." #: src/concurrency/shared-state/arc.md -msgid "Beware of reference cycles, `Arc` does not use a garbage collector to detect them." +msgid "" +"Beware of reference cycles, `Arc` does not use a garbage collector to detect " +"them." msgstr "" -"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها استفاده نمی‌کند." +"مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " +"استفاده نمی‌کند." #: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." @@ -18670,13 +20330,15 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual exclusion " -"_and_ allows mutable access to `T` behind a read-only interface (another form of [interior " -"mutability](../../borrowing/interior-mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " +"mutual exclusion _and_ allows mutable access to `T` behind a read-only " +"interface (another form of [interior mutability](../../borrowing/interior-" +"mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که حذف متقابل " -"_و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only interface (شکل دیگری از " -"[تغییرپذیری (mutable) داخلی](../../borrowing/interior-mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " +"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " +"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" +"borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -18684,33 +20346,45 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" -"struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " +"implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" -"struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " +"کامل آن داریم." #: src/concurrency/shared-state/mutex.md -msgid "`Mutex` in Rust looks like a collection with just one element --- the protected data." +msgid "" +"`Mutex` in Rust looks like a collection with just one element --- the " +"protected data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " +"(protected) به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md -msgid "It is not possible to forget to acquire the mutex before accessing the protected data." -msgstr "نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش کرد." +msgid "" +"It is not possible to forget to acquire the mutex before accessing the " +"protected data." +msgstr "" +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " +"فراموش کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that " -"the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The " +"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین می‌کند که`&mut " -"T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " +"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md -msgid "`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements `Send`." +msgid "" +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " +"implements `Send`." msgstr "" -"‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` استفاده‌ می‌کنند." +"‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " +"استفاده‌ می‌کنند." #: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." @@ -18722,15 +20396,17 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal that " -"the data it protected might be in an inconsistent state. Calling `lock()` on a poisoned mutex " -"fails with a [`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). You " -"can call `into_inner()` on the error to recover the data regardless." -msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» می‌شود تا نشان " -"دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. فراخوانی `lock()` در یک " -"mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang.org/std/sync/struct.PoisonError.html) " -"انجام نمی‌شود. می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." +msgstr "" +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" +"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " +"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " +"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " +"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " "فراخوانی کنید." #: src/concurrency/shared-state/example.md @@ -18750,26 +20426,31 @@ msgid "Notable parts:" msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md -msgid "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." +msgid "" +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " +"orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " +"between threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل تغییر (mutable) " -"بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " +"قابل تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` " -"was added to the lambda signature." +"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " +"thread. Note `move` was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل کرد. نکته `move` " -"به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " +"منتقل کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md -msgid "Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." +msgid "" +"Blocks are introduced to narrow the scope of the `LockGuard` as much as " +"possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -18778,29 +20459,33 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has their own place at the " -"table. There is a fork between each plate. The dish served is a kind of spaghetti which has to " -"be eaten with two forks. Each philosopher can only alternately think and eat. Moreover, a " -"philosopher can only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, not eating. After " -"an individual philosopher finishes eating, they will put down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز دارد. بین هر " -"بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که باید با دو چنگال خورده شود. " -"هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند " -"اسپاگتی خود را زمانی بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " -"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس " -"از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has " +"their own place at the table. There is a fork between each plate. The dish " +"served is a kind of spaghetti which has to be eaten with two forks. Each " +"philosopher can only alternately think and eat. Moreover, a philosopher can " +"only eat their spaghetti when they have both a left and right fork. Thus two " +"forks will only be available when their two nearest neighbors are thinking, " +"not eating. After an individual philosopher finishes eating, they will put " +"down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " +"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " +"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " +"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " +"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " +"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " +"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " +"پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) for this exercise. " -"Copy the code below to a file called `src/main.rs`, fill out the blanks, and test that `cargo " -"run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) " +"for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی نیاز دارید. کد " -"زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر کنید و آزمایش کنید که `cargo " -"run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " +"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " +"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -18914,41 +20599,49 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It should start at a " -"webpage and check that links on the page are valid. It should recursively check other pages on " -"the same domain and keep doing this until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It " +"should start at a webpage and check that links on the page are valid. It " +"should recursively check other pages on the same domain and keep doing this " +"until all pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. باید از یک " -"صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. باید به‌صورت بازگشتی صفحات " -"دیگر را در همان دامنه بررسی کند و این کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " +"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " +"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " +"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/reqwest/). You will " -"also need a way to find links, we can use [`scraper`](https://docs.rs/scraper/). Finally, " -"we'll need some way of handling errors, we will use [`thiserror`](https://docs.rs/thiserror/)." +"For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`]" +"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " +"we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز دارید. شما " -"همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از [`reqwest`](https://docs.rs/" -"reqwest/) استفاده کنیم. در نهایت، ما به روشی برای رسیدگی به خطاها نیاز داریم پس درنتیجه از " -"[`thiserror`](https://docs.rs/thiserror/) استفاده خواهیم کرد." +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " +"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " +"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" -msgstr "یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام کنید:" +msgstr "" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " +"اعلام کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"If `cargo add` fails with `error: no such subcommand`, then please edit the `Cargo.toml` file " -"by hand. Add the dependencies listed below." +"If `cargo add` fails with `error: no such subcommand`, then please edit the " +"`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` را دستی " -"ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." +"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "" +"The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "" +"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -18960,7 +20653,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -18973,45 +20667,53 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://www.google.org/`." +"You can now download the start page. Try with a small site such as `https://" +"www.google.org/`." msgstr "" -"اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www.google.org/` " -"امتحان کنید." +"اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." +"google.org/` امتحان کنید." #: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "فایل `src/main.rs` شما باید چیزی شبیه به این باشد:" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "\"request error: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"bad http response: {0}\"" msgstr "\"bad http response: {0}\"" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "\"بررسی {:#}\"" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "\"href\"" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" -#: src/concurrency/sync-exercises/link-checker.md src/concurrency/sync-exercises/solutions.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "\"https://www.google.org\"" @@ -19029,19 +20731,22 @@ msgstr "این کد را در `src/main.rs` اجرا کنید" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Use threads to check the links in parallel: send the URLs to be checked to a channel and let a " -"few threads check the URLs in parallel." +"Use threads to check the links in parallel: send the URLs to be checked to a " +"channel and let a few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند به یک channel " -"ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " +"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " +"بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google.org` domain. Put an " -"upper limit of 100 pages or so so that you don't end up being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google." +"org` domain. Put an upper limit of 100 pages or so so that you don't end up " +"being blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google.org» استخراج " -"کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." +"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " +"نهایت توسط سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -19068,8 +20773,10 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "/// Determine whether links within the given page should be extracted.\n" -msgstr "/// Determine whether links within the given page should be extracted.\n" +msgid "" +"/// Determine whether links within the given page should be extracted.\n" +msgstr "" +"/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -19095,46 +20802,57 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed concurrently by executing " -"each task until it would block, then switching to another task that is ready to make progress. " -"The model allows running a larger number of tasks on a limited number of threads. This is " -"because the per-task overhead is typically very low and operating systems provide primitives " -"for efficiently identifying I/O that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر کار تا زمانی که " -"مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است سوئیچ می‌شود. این مدل اجازه " -"می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار " -"هر task معمولاً بسیار کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " +"\"Async\" is a concurrency model where multiple tasks are executed " +"concurrently by executing each task until it would block, then switching to " +"another task that is ready to make progress. The model allows running a " +"larger number of tasks on a limited number of threads. This is because the " +"per-task overhead is typically very low and operating systems provide " +"primitives for efficiently identifying I/O that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " +"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " +"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " +"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " +"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " "ادامه هستند فراهم می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work that may be " -"completed in the future. Futures are \"polled\" until they signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work " +"that may be completed in the future. Futures are \"polled\" until they " +"signal that they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن است در آینده " -"تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، «polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " +"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " +"ندهند، «polled» می‌شوند." #: src/concurrency/welcome-async.md -msgid "Futures are polled by an async runtime, and several different runtimes are available." -msgstr "‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس هستند." +msgid "" +"Futures are polled by an async runtime, and several different runtimes are " +"available." +msgstr "" +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " +"دسترس هستند." #: src/concurrency/welcome-async.md msgid "" -"Python has a similar model in its `asyncio`. However, its `Future` type is callback-based, and " -"not polled. Async Python programs require a \"loop\", similar to a runtime in Rust." +"Python has a similar model in its `asyncio`. However, its `Future` type is " +"callback-based, and not polled. Async Python programs require a \"loop\", " +"similar to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر callback است و " -"poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " +"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " +"runtime در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language runtime implements " -"the event loop, so many of the details of Promise resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language " +"runtime implements the event loop, so many of the details of Promise " +"resolution are hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. runtime زبان " -"حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از جزئیات واضح در Promise پنهان " -"می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " +"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " +"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -19142,9 +20860,12 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy -msgid "At a high level, async Rust code looks very much like \"normal\" sequential code:" +msgid "" +"At a high level, async Rust code looks very much like \"normal\" sequential " +"code:" msgstr "" -"در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" sequential code):" +"در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " +"sequential code):" #: src/concurrency/async/async-await.md #, fuzzy @@ -19153,11 +20874,11 @@ msgstr "\"Count is: {i}!\"" #: src/concurrency/async/async-await.md msgid "" -"Note that this is a simplified example to show the syntax. There is no long running operation " -"or any real concurrency in it!" +"Note that this is a simplified example to show the syntax. There is no long " +"running operation or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی مدت یا هیچ " -"هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " +"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -19165,128 +20886,141 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." -msgstr "برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." +msgstr "" +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " +"کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return type with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return " +"type with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک future جایگزین " -"می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " +"یک future جایگزین می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the compiler on how to use " -"the returned future." +"You cannot make `main` async, without additional instructions to the " +"compiler on how to use the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future بازگشتی، " -"`main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " +"future بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md msgid "" -"You need an executor to run async code. `block_on` blocks the current thread until the " -"provided future has run to completion." +"You need an executor to run async code. `block_on` blocks the current thread " +"until the provided future has run to completion." msgstr "" -"برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که thread رشته فعلی " -"را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." +"برای اجرای کدهای همگام به یک اجرا‌ کننده (executor) نیاز دارید.`block_on` که " +"thread رشته فعلی را تا زمانی که future ارائه شده تکمیل شود مسدود می‌کند." #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. Unlike `block_on`, `." -"await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. " +"Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` can only be used inside an `async` function (or block; these are introduced later)." +"`.await` can only be used inside an `async` function (or block; these are " +"introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در آینده معرفی " -"می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " +"مورد در آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, implemented by " -"objects that represent an operation that may not be complete yet. A future can be polled, and " -"`poll` returns a [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " +"trait, implemented by objects that represent an operation that may not be " +"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، اجرا شده " -"توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده باشد. می‌توان یک future " -"را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/std/task/enum.Poll.html) را " -"برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " +"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " +"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but uncommon) to implement " -"`Future` for your own types. For example, the `JoinHandle` returned from `tokio::spawn` " -"implements `Future` to allow joining to it." +"An async function returns an `impl Future`. It's also possible (but " +"uncommon) to implement `Future` for your own types. For example, the " +"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " +"joining to it." msgstr "" -"یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) پیاده‌سازی `Future` " -"برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` برگردانده شده از `tokio::spawn` " -"`Future` را پیاده‌سازی می‌کند تا امکان پیوستن (joining) به آن را فراهم کند." +"یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " +"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " +"امکان پیوستن (joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function to pause until " -"that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function " +"to pause until that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا زمانی که " -"Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " +"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the links to show the " -"implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the " +"links to show the implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای نمایش " -"پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " +"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async code, rather than " -"building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async " +"code, rather than building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر نوشتن کدهای " -"async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " +"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md -msgid "`Context` allows a Future to schedule itself to be polled again when an event occurs." +msgid "" +"`Context` allows a Future to schedule itself to be polled again when an " +"event occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll مجدد " -"برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " +"poll مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into that future remain " -"valid. This is required to allow references to remain valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into " +"that future remain valid. This is required to allow references to remain " +"valid after an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future معتبر باقی " -"می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `.await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " +"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " +"ماندن پس از `.await` لازم است." #: src/concurrency/async/runtimes.md msgid "" -"A _runtime_ provides support for performing operations asynchronously (a _reactor_) and is " -"responsible for executing futures (an _executor_). Rust does not have a \"built-in\" runtime, " -"but several options are available:" +"A _runtime_ provides support for performing operations asynchronously (a " +"_reactor_) and is responsible for executing futures (an _executor_). Rust " +"does not have a \"built-in\" runtime, but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و مسئول اجرای " -"futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " +"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " +"اما چندین گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" -"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of functionality like " -"[Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github.com/hyperium/tonic) for gRPC." +"[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" +"github.com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به خوبی توسعه " -"یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://github) .com/hyperium/" -"tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " +"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " +"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a basic runtime " -"in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " +"a basic runtime in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل یک runtime " -"اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " +"شامل یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -19294,33 +21028,35 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" -"Several larger applications have their own runtimes. For example, [Fuchsia](https://fuchsia." -"googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/src/lib.rs) already has one." +"Several larger applications have their own runtimes. For example, [Fuchsia]" +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" +"async/src/lib.rs) already has one." msgstr "" -"چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، [Fuchsia](https://" -"fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/src/lib.rs) اکنون یکی " -"runtime دارد." +"چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " +"[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" +"fuchsia-async/src/lib.rs) اکنون یکی runtime دارد." #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust playground. The " -"playground also does not permit any I/O, so most interesting async things can't run in the " -"playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust " +"playground. The playground also does not permit any I/O, so most interesting " +"async things can't run in the playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان Rust پشتیبانی " -"می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین بیشتر چیزهای async جالب " -"نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " +"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " +"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" -"Futures are \"inert\" in that they do not do anything (not even start an I/O operation) unless " -"there is an executor polling them. This differs from JS Promises, for example, which will run " -"to completion even if they are never used." +"Futures are \"inert\" in that they do not do anything (not even start an I/O " +"operation) unless there is an executor polling them. This differs from JS " +"Promises, for example, which will run to completion even if they are never " +"used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/O را شروع " -"نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling کند. به عنوان مثال، " -"این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا " -"خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " +"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " +"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " +"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -19329,7 +21065,8 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "" +"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -19358,7 +21095,8 @@ msgstr "تابع `spawn` یک \"task\" جدید و همزمان ایجاد می #: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." -msgstr "توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." +msgstr "" +"توجه: `spawn` یک `Future` می‌گیرد، شما `.await` را در `count_to` صدا نمی‌زنید." #: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" @@ -19366,11 +21104,12 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" -"Why does `count_to` not (usually) get to 10? This is an example of async cancellation. `tokio::" -"spawn` returns a handle which can be awaited to wait until it finishes." +"Why does `count_to` not (usually) get to 10? This is an example of async " +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " +"until it finishes." msgstr "" -"چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. `tokio::spawn` یک " -"handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." +"چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " +"`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." #: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." @@ -19386,15 +21125,17 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make progress. That future " -"may have one or more nested futures that its `poll` method polls, corresponding loosely to a " -"call stack. Concurrency within a task is possible by polling multiple child futures, such as " -"racing a timer and an I/O operation." +"A task has a single top-level future which the executor polls to make " +"progress. That future may have one or more nested futures that its `poll` " +"method polls, corresponding loosely to a call stack. Concurrency within a " +"task is possible by polling multiple child futures, such as racing a timer " +"and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را poll می‌کند. آن " -"future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` آن را `poll` می‌کند، که به طور " -"ناپایداری با یک stack فراخوانی شده مطابقت دارد. همزمانی در یک task با poll از چندین child " -"future، مانند رقابت یک تایمر و یک عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " +"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " +"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " +"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " +"یک تایمر و یک عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -19426,42 +21167,53 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"Thanks for dialing in, {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "Copy this example into your prepared `src/main.rs` and run it from there." -msgstr "این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." +msgid "" +"Copy this example into your prepared `src/main.rs` and run it from there." +msgstr "" +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " +"کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/man-page/" -"linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix." +"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" +"telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/nc/) یا " -"[telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" +"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with a few connected " -"clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with " +"a few connected clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه taskهایی " -"وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " +"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a closure, but does not " -"take any arguments. Its return value is a Future, similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a " +"closure, but does not take any arguments. Its return value is a Future, " +"similar to an `async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ استدلالی " -"ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " +"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md -msgid "Refactor the async block into a function, and improve the error handling using `?`." -msgstr "بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." +msgid "" +"Refactor the async block into a function, and improve the error handling " +"using `?`." +msgstr "" +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " +"بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "" +"Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "" +"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md #, fuzzy @@ -19490,15 +21242,16 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "" +"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the [morning class](../" -"channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the " +"[morning class](../channels.md)." msgstr "" -"به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../channels.md) دیده " -"می‌شود." +"به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" +"channels.md) دیده می‌شود." #: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" @@ -19506,30 +21259,32 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" -"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that implement both `sync` " -"and `async` `send` and `recv`. This can be convenient for complex applications with both IO " -"and heavy CPU processing tasks." +"The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " +"implement both `sync` and `async` `send` and `recv`. This can be convenient " +"for complex applications with both IO and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی است که `sync` " -"و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای برنامه‌های پیچیده با taskهای " -"پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " +"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " +"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to combine them with other " -"`future`s to combine them and create complex control flow." +"What makes working with `async` channels preferable is the ability to " +"combine them with other `future`s to combine them and create complex control " +"flow." msgstr "" -"چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر `future` برای ترکیب " -"آنها و ایجاد جریان کنترل پیچیده است." +"چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " +"`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns a collection of " -"their results. This is similar to `Promise.all` in JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns " +"a collection of their results. This is similar to `Promise.all` in " +"JavaScript or `asyncio.gather` in Python." msgstr "" -"عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و مجموعه‌ای " -"(collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در JavaScript یا `asyncio." -"gather` در پایتون است." +"عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " +"در JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md #, fuzzy @@ -19552,55 +21307,62 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but you must know how " -"many futures you will have at compile time. This is currently in the `futures` crate, soon to " -"be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but " +"you must know how many futures you will have at compile time. This is " +"currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، اما باید " -"بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در جعبه (crate از نوع " -"`futures` است که به زودی در `std::future` تثبیت می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " +"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " +"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " +"می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would cause your program " -"to stall." +"The risk of `join` is that one of the futures may never resolve, this would " +"cause your program to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث می‌شود برنامه " -"شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " +"باعث می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all requests to an http " -"service as well as a database query. Try adding a `tokio::time::sleep` to the future, using " -"`futures::join!`. This is not a timeout (that requires `select!`, explained in the next " -"chapter), but demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all " +"requests to an http service as well as a database query. Try adding a " +"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " +"timeout (that requires `select!`, explained in the next chapter), but " +"demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن (`join!`) همه " -"درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید `tokio::time::sleep` را با " -"استفاده از `futures::join!` به future اضافه کنید. این یک timeout نیست (که به `select!`نیاز " -"دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " +"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " +"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " +"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " +"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and responds to that future's " -"result. In JavaScript, this is similar to `Promise.race`. In Python, it compares to `asyncio." -"wait(task_set, return_when=asyncio.FIRST_COMPLETED)`." +"A select operation waits until any of a set of futures is ready, and " +"responds to that future's result. In JavaScript, this is similar to `Promise." +"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به نتیجه آن future " -"پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و در پایتون با `asyncio." -"wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " +"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " +"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)` قابل مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, each of the form " -"`pattern = future => statement`. When a `future` is ready, its return value is destructured by " -"the `pattern`. The `statement` is then run with the resulting variables. The `statement` " -"result becomes the result of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, " +"each of the form `pattern = future => statement`. When a `future` is ready, " +"its return value is destructured by the `pattern`. The `statement` is then " +"run with the resulting variables. The `statement` result becomes the result " +"of the `select!` macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که هر کدام به " -"شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` آماده است، مقدار بازگشتی " -"آن توسط `pattern` تخریب می‌شود. سپس `statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه " -"`statement` نتیجه‌ي ماکرو `select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " +"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " +"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " +"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " +"`select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -19622,26 +21384,29 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, or for a timeout. " -"Change the `sleep` to sleep longer to see it fail. Why does the `send` also fail in this " -"situation?" +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a task reacts to " -"events in a loop. That has some pitfalls, which will be discussed in the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" -"Async / await provides convenient and efficient abstraction for concurrent asynchronous " -"programming. However, the async/await model in Rust also comes with its share of pitfalls and " -"footguns. We illustrate some of them in this chapter." +"Async / await provides convenient and efficient abstraction for concurrent " +"asynchronous programming. However, the async/await model in Rust also comes " +"with its share of pitfalls and footguns. We illustrate some of them in this " +"chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous فراهم می‌کند. " -"با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و pitfallها و footgunها همراه است. " -"برخی از آنها را در این فصل توضیح می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " +"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " +"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " +"می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -19653,13 +21418,15 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that CPU blocking " -"tasks will block the executor and prevent other tasks from being executed. An easy workaround " -"is to use async equivalent methods where possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that " +"CPU blocking tasks will block the executor and prevent other tasks from " +"being executed. An easy workaround is to use async equivalent methods where " +"possible." msgstr "" -"اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان (concurrent) اجرا شوند. " -"این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن executor و جلوگیری از اجرای سایر " -"تسک‌ها می‌شود. یک راه حل آسان این است که در صورت امکان از متدهای معادل async استفاده کنید." +"اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " +"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " +"است که در صورت امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -19672,80 +21439,94 @@ msgid "\"current_thread\"" msgstr "\"current_thread\"" #: src/concurrency/async-pitfalls/blocking-executor.md -msgid "Run the code and see that the sleeps happen consecutively rather than concurrently." +msgid "" +"Run the code and see that the sleeps happen consecutively rather than " +"concurrently." msgstr "" -"کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت همزمان " -"(concurrent)." +"کد را اجرا کنید و ببینید که sleep‌ها به طور متوالی اتفاق می‌افتند و نه به صورت " +"همزمان (concurrent)." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the effect more " -"obvious, but the bug is still present in the multi-threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This " +"makes the effect more obvious, but the bug is still present in the multi-" +"threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را آشکارتر " -"می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " +"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " +"دارد." #: src/concurrency/async-pitfalls/blocking-executor.md -msgid "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." -msgstr "‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." +msgid "" +"Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." +msgstr "" +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " +"باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual thread and " -"transforms its handle into a future without blocking the executor." +"Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " +"thread and transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و handle آن را " -"بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " +"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"You should not think of tasks as OS threads. They do not map 1 to 1 and most executors will " -"allow many tasks to run on a single OS thread. This is particularly problematic when " -"interacting with other libraries via FFI, where that library might depend on thread-local " -"storage or map to specific OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in " -"such situations." +"You should not think of tasks as OS threads. They do not map 1 to 1 and most " +"executors will allow many tasks to run on a single OS thread. This is " +"particularly problematic when interacting with other libraries via FFI, " +"where that library might depend on thread-local storage or map to specific " +"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " +"situations." msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ به ۱ پشتیبانی " -"نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک thread سیستم عامل اجرا شوند. " -"این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه " -"ممکن است به ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی " -"داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " +"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " +"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " +"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " +"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " +"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause another task to block, " -"and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause " +"another task to block, and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` ممکن است باعث " -"مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." +"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " +"thread در حال اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The type returned is " -"the result of a compiler transformation which turns local variables into data stored inside " -"the future." +"Async blocks and functions return types implementing the `Future` trait. The " +"type returned is the result of a compiler transformation which turns local " +"variables into data stored inside the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. نوع برگشتی " -"نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " +"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " +"ذخیره شده در future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because of that, the " -"future should never be moved to a different memory location, as it would invalidate those " -"pointers." +"Some of those variables can hold pointers to other local variables. Because " +"of that, the future should never be moved to a different memory location, as " +"it would invalidate those pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به همین دلیل، " -"future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " +"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " +"این pointerها را باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"To prevent moving the future type in memory, it can only be polled through a pinned pointer. " -"`Pin` is a wrapper around a reference that disallows all operations that would move the " -"instance it points to into a different memory location." +"To prevent moving the future type in memory, it can only be polled through a " +"pinned pointer. `Pin` is a wrapper around a reference that disallows all " +"operations that would move the instance it points to into a different memory " +"location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می توان آن را " -"بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی را که می‌تواند نمونه‌ای را " -"که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " +"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " +"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " +"متفاوت منتقل کند را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -19798,136 +21579,154 @@ msgstr "\"Welcome to chat! Type a message\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically call `select!` in " -"a loop." +"You may recognize this as an example of the actor pattern. Actors typically " +"call `select!` in a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. بازیگران " -"معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " +"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md -msgid "This serves as a summation of a few of the previous lessons, so take your time with it." -msgstr "این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن کنید." +msgid "" +"This serves as a summation of a few of the previous lessons, so take your " +"time with it." +msgstr "" +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " +"آن کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the `select!`. " -"This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " +"the `select!`. This will never execute. Why?" msgstr "" -"به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به `select!` اضافه " -"کنید. این مورد هرگز اجرا نمی شود. چرا؟" +"به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " +"`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "" +"Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" -"This still doesn't work. Follow the compiler errors, adding `&mut` to the `timeout_fut` in the " -"`select!` to work around the move, then using `Box::pin`:" +"This still doesn't work. Follow the compiler errors, adding `&mut` to the " +"`timeout_fut` in the `select!` to work around the move, then using `Box::" +"pin`:" msgstr "" -"این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به `timeout_fut` در " -"`select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` استفاده کنید:" +"این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" +"pin` استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" -"This compiles, but once the timeout expires it is `Poll::Ready` on every iteration (a fused " -"future would help with this). Update to reset `timeout_fut` every time it expires:" +"This compiles, but once the timeout expires it is `Poll::Ready` on every " +"iteration (a fused future would help with this). Update to reset " +"`timeout_fut` every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::Ready` است " -"(future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی `timeout_fut` هر بار که منقضی " -"می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " +"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " +"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" -"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently stabilized, with " -"older code often using `tokio::pin!`) is also an option, but that is difficult to use for a " -"future that is reassigned." +"Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " +"stabilized, with older code often using `tokio::pin!`) is also an option, " +"but that is difficult to use for a future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت شده است، با " -"کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه است، اما استفاده از آن " -"برای futureای که دوباره تخصیص داده می‌شود دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " +"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " +"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " +"دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that will send to a " -"`oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that " +"will send to a `oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد کنید که هر " -"100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " +"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, the Rust borrow " -"checker would prevent self-referential data from being moved, as the references cannot outlive " -"the data they point to. However, the code transformation for async blocks and functions is not " -"verified by the borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, " +"the Rust borrow checker would prevent self-referential data from being " +"moved, as the references cannot outlive the data they point to. However, the " +"code transformation for async blocks and functions is not verified by the " +"borrow checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده می شوند. به " -"طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری می‌کند، زیرا منابع " -"نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای " -"بلوک‌ها و توابع async توسط borrow checker تأیید نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " +"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " +"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " +"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " +"borrow checker تأیید نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its place using a pinned " -"pointer. However, it can still be moved through an unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its " +"place using a pinned pointer. However, it can still be moved through an " +"unpinned pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از یک pointer پین " -"شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق یک pointer بدون پین جابجا " -"کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " +"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " +"از طریق یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut Self` to refer " -"to the instance. That's why it can only be called on a pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " +"`&mut Self` to refer to the instance. That's why it can only be called on a " +"pinned pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به نمونه " -"(instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک اشاره‌‌گر پین شده فراخوانی " -"کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " +"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " +"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 release. This required " -"support for using return-position `impl Trait` (RPIT) in traits, as the desugaring for `async " -"fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی برای استفاده " -"از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا شیرین‌زدایی (desugaring) برای " -"`async fn` شامل `-> impl Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " +"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " +"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " +"Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around `async fn` and RPIT " -"in traits:" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT در ویژگی‌ها " -"وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " +"RPIT در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns of borrowing " -"cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین برخی از الگوهای " -"قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " +"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not `dyn` compatible." +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند با `dyn` " -"سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " +"می‌کنند با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/latest/" -"async_trait/) provides a workaround through a macro, with some caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) provides a workaround through a macro, with some " +"caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/latest/" -"async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " +"چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -19941,42 +21740,46 @@ msgstr "\"slept for {}ms\"" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"`async_trait` is easy to use, but note that it's using heap allocations to achieve this. This " -"heap allocation has performance overhead." +"`async_trait` is easy to use, but note that it's using heap allocations to " +"achieve this. This heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف از heap " -"allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " +"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " +"عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and probably not worth " -"describing in-depth. Niko Matsakis did a good job of explaining them in [this post](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) if you are " -"interested in digging deeper." +"The challenges in language support for `async trait` are deep Rust and " +"probably not worth describing in-depth. Niko Matsakis did a good job of " +"explaining them in [this post](https://smallcultfollowing.com/babysteps/" +"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " +"digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش توصیف عمیق در " -"اینجا را ندارند. Niko Matsakis در [این پست](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما " -"به این موضوع علاقه‌مند هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " +"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " +"هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of time and adding it to " -"the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of " +"time and adding it to the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به Vec اضافه " -"کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " +"را به Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Dropping a future implies it can never be polled again. This is called _cancellation_ and it " -"can occur at any `await` point. Care is needed to ensure the system works correctly even when " -"futures are cancelled. For example, it shouldn't deadlock or lose data." +"Dropping a future implies it can never be polled again. This is called " +"_cancellation_ and it can occur at any `await` point. Care is needed to " +"ensure the system works correctly even when futures are cancelled. For " +"example, it shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این حالت " -"_cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از عملکرد صحیح سیستم " -"حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به " -"بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " +"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " +"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " +"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -19995,27 +21798,35 @@ msgstr "\"tick!\"" #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"The compiler doesn't help with cancellation-safety. You need to read API documentation and " -"consider what state your `async fn` holds." +"The compiler doesn't help with cancellation-safety. You need to read API " +"documentation and consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و در نظر بگیرید " -"که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " +"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md -msgid "Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-handling)." +msgid "" +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " +"error-handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " +"به خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "اسن مثال بخش‌هایی از string را از دست می‌دهد." #: src/concurrency/async-pitfalls/cancellation.md -msgid "Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." -msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +msgid "" +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " +"dropped." +msgstr "" +"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md -msgid "`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" +msgid "" +"`LinesReader` can be made cancellation-safe by making `buf` part of the " +"struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -20025,29 +21836,33 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) " -"is cancellation-safe because it keeps track of whether a tick has been 'delivered'." +"[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." +"html#method.tick) is cancellation-safe because it keeps track of whether a " +"tick has been 'delivered'." msgstr "" -"‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval.html#method.tick) " -"برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick تحویل داده شده است." +"‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " +"tick تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method." -"read) is cancellation-safe because it either returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) is cancellation-safe because it either " +"returns or doesn't read data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method." -"read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " +"برمی‌گرداند یا نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt." -"html#method.read_line) is similar to the example and _isn't_ cancellation-safe. See its " -"documentation for details and alternatives." +"[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " +"cancellation-safe. See its documentation for details and alternatives." msgstr "" -"‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncBufReadExt." -"html#method.read_line) مشابه مثال است و شبیه cancellation-safe نیست. برای جزئیات و موارد " -"جایگزین به مستندات آن مراجعه کنید." +"‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" +"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -20057,20 +21872,21 @@ msgstr "فلسفه Dining --- Async" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a description of the " -"problem." +"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " +"description of the problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers.md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" +"philosophers.md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-locally.md) for this " -"exercise. Copy the code below to a file called `src/main.rs`, fill out the blanks, and test " -"that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-" +"locally.md) for this exercise. Copy the code below to a file called `src/" +"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) نیاز دارید. " -"کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر کنید و تست کنید که `cargo " -"run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." +"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " +"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -20086,11 +21902,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. You can use the " -"following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. " +"You can use the following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. می‌توانید از " -"`Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " +"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -20101,8 +21917,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-" -"thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" msgstr "" "```toml\n" @@ -20112,17 +21928,17 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-multi-" -"thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module from the `tokio` " -"crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module " +"from the `tokio` crate." msgstr "" -"همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` crate استفاده " -"کنید." +"همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " +"crate استفاده کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" @@ -20130,25 +21946,28 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast chat application. " -"We have a chat server that the clients connect to and publish their messages. The client reads " -"user messages from the standard input, and sends them to the server. The chat server " -"broadcasts each message that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast " +"chat application. We have a chat server that the clients connect to and " +"publish their messages. The client reads user messages from the standard " +"input, and sends them to the server. The chat server broadcasts each message " +"that it receives to all the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast chat استفاده " -"کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت " -"پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را " -"که دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " +"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " +"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " +"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " +"دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn." -"channel.html) on the server, and [`tokio_websockets`](https://docs.rs/tokio-websockets/) for " -"the communication between the client and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" +"(https://docs.rs/tokio-websockets/) for the communication between the client " +"and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/broadcast/fn." -"channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/tokio-websockets/) برای " -"ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" +"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -20171,8 +21990,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", \"server\", " -"\"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -20185,8 +22004,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", \"server\", " -"\"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -20195,46 +22014,50 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" -"You are going to need the following functions from `tokio` and [`tokio_websockets`](https://" -"docs.rs/tokio-websockets/). Spend a few minutes to familiarize yourself with the API." +"You are going to need the following functions from `tokio` and " +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " +"to familiarize yourself with the API." msgstr "" -"شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-websockets/) نیاز " -"دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." +"شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" +"websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt." -"html#method.next) implemented by `WebSocketStream`: for asynchronously reading messages from a " -"Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " +"asynchronously reading messages from a Websocket Stream." msgstr "" -"‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait.StreamExt." -"html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان پیام‌ها از یک جریان وب سوکت." +"‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " +"ناهمزمان پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt." -"html#method.send) implemented by `WebSocketStream`: for asynchronously sending messages on a " -"Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " +"asynchronously sending messages on a Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait.SinkExt." -"html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال ناهمزمان پیام‌ها در یک " -"Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " +"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method." -"next_line): for asynchronously reading user messages from the standard input." +"[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." +"html#method.next_line): for asynchronously reading user messages from the " +"standard input." msgstr "" -"‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines.html#method." -"next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." +"‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " +"استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender." -"html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Sender." -"html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -20242,29 +22065,34 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` file. In this " -"project, we need two binaries. One for the client, and one for the server. You could " -"potentially make them two separate Cargo projects, but we are going to put them in a single " -"Cargo project with two binaries. For this to work, the client and the server code should go " -"under `src/bin` (see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" +"Normally in a Cargo project, you can have only one binary, and one `src/main." +"rs` file. In this project, we need two binaries. One for the client, and one " +"for the server. You could potentially make them two separate Cargo projects, " +"but we are going to put them in a single Cargo project with two binaries. " +"For this to work, the client and the server code should go under `src/bin` " +"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" "targets.html#binaries))." msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/main.rs` داشته " -"باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و دیگری برای سرور. شما به طور " -"بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo " -"واحد با دو باینری قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " -"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) " -"مراجعه کنید )." +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " +"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " +"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " +"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " +"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " +"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." +"html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/bin/client.rs`, " -"respectively. Your task is to complete these files as described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/" +"bin/client.rs`, respectively. Your task is to complete these files as " +"described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی کنید. وظیفه " -"شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " +"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " +"شده است تکمیل کنید." -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "_src/bin/server.rs_:" @@ -20273,30 +22101,36 @@ msgstr "_src/bin/server.rs_:" msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "// TODO: For a hint, see the description of the task below.\n" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "\"127.0.0.1:2000\"" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"listening on port 2000\"" msgstr "\"listening on port 2000\"" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"New connection from {addr:?}\"" msgstr "\"New connection from {addr:?}\"" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "// Wrap the raw TCP stream into a websocket.\n" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "_src/bin/client.rs_:" -#: src/concurrency/async-exercises/chat-app.md src/concurrency/async-exercises/solutions.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "\"ws://127.0.0.1:2000\"" msgstr "\"ws://127.0.0.1:2000\"" @@ -20319,13 +22153,14 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous loop. One " -"task receives messages from the client and broadcasts them. The other sends messages received " -"by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a " +"continuous loop. One task receives messages from the client and broadcasts " +"them. The other sends messages received by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده کنید. یک task " -"پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده " -"توسط سرور را برای کاربر ارسال می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " +"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " +"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " +"می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -20333,21 +22168,22 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: As before, use `tokio::select!` in a continuous loop for concurrently performing two " -"tasks: (1) reading user messages from standard input and sending them to the server, and (2) " -"receiving messages from the server, and displaying them for the user." +"Hint: As before, use `tokio::select!` in a continuous loop for concurrently " +"performing two tasks: (1) reading user messages from standard input and " +"sending them to the server, and (2) receiving messages from the server, and " +"displaying them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task استفاده کنید: " -"(۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و (۲) دریافت پیام از سرور و " -"نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " +"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " +"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Optional: Once you are done, change the code to broadcast messages to all clients, but the " -"sender of the message." +"Optional: Once you are done, change the code to broadcast messages to all " +"clients, but the sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز فرستنده پیام، " -"منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " +"جز فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -20415,28 +22251,33 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده باشید و برای‌ شما " -"مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " +"برده باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not perfect, so if you " -"spotted any mistakes or have ideas for improvements, please get in [contact with us on GitHub]" -"(https://github.com/google/comprehensive-rust/discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not " +"perfect, so if you spotted any mistakes or have ideas for improvements, " +"please get in [contact with us on GitHub](https://github.com/google/" +"comprehensive-rust/discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی را مشاهده " -"کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید](https://github.com/" -"google/comprehensive-rust/discussions) وارد شوید. ما دوست داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " +"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " +"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " +"شوید. ما دوست داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many Rust terms. For " -"translations, this also serves to connect the term back to the English original." +"The following is a glossary which aims to give a short definition of many " +"Rust terms. For translations, this also serves to connect the term back to " +"the English original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان Rust است. " -"برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " +"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " +"انگلیسی است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -20458,18 +22299,19 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the relationship between types." +"A type associated with a specific trait. Useful for defining the " +"relationship between types." msgstr "" #: src/glossary.md msgid "" "Bare-metal Rust: \n" -"Low-level Rust development, often deployed to a system without an operating system. See [Bare-" -"metal Rust](bare-metal.md)." +"Low-level Rust development, often deployed to a system without an operating " +"system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-metal Rust]" -"(bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " +"[Bare-metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -20508,7 +22350,8 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable program." +"The process of converting source code into executable code or a usable " +"program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -20527,7 +22370,8 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " +"می‌شود." #: src/glossary.md msgid "" @@ -20549,7 +22393,8 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "" +"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -20562,7 +22407,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in a program." +"The order in which the individual statements or instructions are executed in " +"a program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -20578,12 +22424,12 @@ msgstr "" #: src/glossary.md msgid "" "enumeration: \n" -"A data type that holds one of several named constants, possibly with an associated tuple or " -"struct." +"A data type that holds one of several named constants, possibly with an " +"associated tuple or struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار مرتبط، نگه " -"می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " +"ساختار مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" @@ -20596,7 +22442,8 @@ msgstr "" #: src/glossary.md msgid "" "error handling: \n" -"The process of managing and responding to errors that occur during program execution." +"The process of managing and responding to errors that occur during program " +"execution." msgstr "" "error handling: \n" "فرآیند مدیریت و پاسخگویی به خطاهایی که در حین اجرای برنامه رخ می‌دهد." @@ -20620,20 +22467,22 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are " +"no longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " +"نمی‌شوند را آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling code reuse with " -"different data types." +"A feature that allows writing code with placeholders for types, enabling " +"code reuse with different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده مجدد از کد با " -"انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " +"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -20646,8 +22495,8 @@ msgstr "" #: src/glossary.md msgid "" "integration test: \n" -"A type of test that verifies the interactions between different parts or components of a " -"system." +"A type of test that verifies the interactions between different parts or " +"components of a system." msgstr "" "integration test: \n" "نوعی تست که تعامل بین بخش‌ها یا اجزای مختلف یک سیستم را تأیید می‌کند." @@ -20655,12 +22504,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and cannot be used as an " -"identifier." +"A reserved word in a programming language that has a specific meaning and " +"cannot be used as an identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به عنوان شناسه یا " -"سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " +"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -20668,19 +22517,20 @@ msgid "" "A collection of precompiled routines or code that can be used by programs." msgstr "" "library: \n" -"مجموعه‌ای از routine‌ها یا کدهای از پیش کامپایل شده که می تواند توسط برنامه‌ها استفاده شود." +"مجموعه‌ای از routine‌ها یا کدهای از پیش کامپایل شده که می تواند توسط برنامه‌ها " +"استفاده شود." #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when normal functions are " -"not enough. A typical example is `format!`, which takes a variable number of arguments, which " -"isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when " +"normal functions are not enough. A typical example is `format!`, which takes " +"a variable number of arguments, which isn't supported by Rust functions." msgstr "" "macro: \n" -"ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده می‌شوند که توابع " -"عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از آرگومان‌ها را می‌گیرد که توسط " -"توابع Rust پشتیبانی نمی‌شوند." +"ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " +"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -20694,21 +22544,22 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the value of an " -"expression." +"A control flow construct in Rust that allows for pattern matching on the " +"value of an expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " +"فراهم می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer needed, leading to a " -"gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer " +"needed, leading to a gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر به افزایش " -"تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " +"منجر به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -20721,11 +22572,12 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, to organize code " -"in Rust." +"A namespace that contains definitions, such as functions, types, or traits, " +"to organize code in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " +"Rust است." #: src/glossary.md msgid "" @@ -20738,7 +22590,8 @@ msgstr "" #: src/glossary.md msgid "" "mutable: \n" -"A property in Rust that allows variables to be modified after they have been declared." +"A property in Rust that allows variables to be modified after they have been " +"declared." msgstr "" "mutable: \n" "یک ویژگی در Rust که به متغیرها اجازه می‌دهد پس از اعلان، اصلاح شوند." @@ -20746,16 +22599,18 @@ msgstr "" #: src/glossary.md msgid "" "ownership: \n" -"The concept in Rust that defines which part of the code is responsible for managing the memory " -"associated with a value." +"The concept in Rust that defines which part of the code is responsible for " +"managing the memory associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " +"مقدار است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of the program." +"An unrecoverable error condition in Rust that results in the termination of " +"the program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -20771,11 +22626,12 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against an expression in " -"Rust." +"A combination of values, literals, or structures that can be matched against " +"an expression in Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " +"مطابقت داده شوند." #: src/glossary.md msgid "" @@ -20788,39 +22644,40 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task or solve a " -"particular problem." +"A set of instructions that a computer can execute to perform a specific task " +"or solve a particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک مشکل خاصی " -"اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک مشکل خاص اجرا " -"کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاص اجرا کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which the method is " -"called." +"The first parameter in a Rust method that represents the instance on which " +"the method is called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " +"می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object is tracked, and " -"the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object " +"is tracked, and the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که شمارش به صفر " -"می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " +"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -20828,12 +22685,14 @@ msgid "" "A keyword in Rust used to indicate the value to be returned from a function." msgstr "" "return: \n" -"یک کلمه کلیدی در Rust برای نشان دادن مقداری که باید از یک تابع برگردانده شود استفاده می‌شود." +"یک کلمه کلیدی در Rust برای نشان دادن مقداری که باید از یک تابع برگردانده شود " +"استفاده می‌شود." #: src/glossary.md msgid "" "Rust: \n" -"A systems programming language that focuses on safety, performance, and concurrency." +"A systems programming language that focuses on safety, performance, and " +"concurrency." msgstr "" "Rust: \n" "یک زبان برنامه‌نویسی سیستمی که بر safety، کارایی و concurrency تمرکز دارد." @@ -20867,12 +22726,12 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, preventing memory-related " -"errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, " +"preventing memory-related errors." msgstr "" "safe: \n" -"به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن (borrowing) پایبند " -"است و از خطاهای مربوط به حافظه جلوگیری می‌کند." +"به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " +"(borrowing) پایبند است و از خطاهای مربوط به حافظه جلوگیری می‌کند." #: src/glossary.md msgid "" @@ -20893,33 +22752,38 @@ msgstr "" #: src/glossary.md msgid "" "static: \n" -"A keyword in Rust used to define static variables or items with a `'static` lifetime." +"A keyword in Rust used to define static variables or items with a `'static` " +"lifetime." msgstr "" "static: \n" -"یک کلمه کلیدی در Rust برای تعریف متغیرهای ثابت یا موارد با طول عمر `'static` استفاده می‌شود." +"یک کلمه کلیدی در Rust برای تعریف متغیرهای ثابت یا موارد با طول عمر `'static` " +"استفاده می‌شود." #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" "string: \n" -"نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings](references/strings." -"html) مراجعه کنید." +"نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" +"(references/strings.html) مراجعه کنید." #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different types under a single " -"name." +"A composite data type in Rust that groups together variables of different " +"types under a single name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " +"می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other functions." +"A Rust module containing functions that test the correctness of other " +"functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -20935,7 +22799,8 @@ msgstr "" #: src/glossary.md msgid "" "thread safety: \n" -"The property of a program that ensures correct behavior in a multithreaded environment." +"The property of a program that ensures correct behavior in a multithreaded " +"environment." msgstr "" "thread safety: \n" "ویژگی برنامه‌ای که رفتار صحیح را در یک محیط multithread تضمین می‌کند." @@ -20943,46 +22808,49 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to achieve polymorphism " -"in Rust." +"A collection of methods defined for an unknown type, providing a way to " +"achieve polymorphism in Rust." msgstr "" "trait: \n" -"مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به polymorphism در Rust " -"ارائه می‌دهد." +"مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " +"polymorphism در Rust ارائه می‌دهد." #: src/glossary.md #, fuzzy msgid "" "trait bound: \n" -"An abstraction where you can require types to implement some traits of your interest." +"An abstraction where you can require types to implement some traits of your " +"interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان به typeها " -"نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " +"علاقه‌تان به typeها نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple fields have no names, " -"and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple " +"fields have no names, and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام هستند و با شماره " -"ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " +"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values of a particular " -"kind in Rust." +"A classification that specifies which operations can be performed on values " +"of a particular kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " +"در Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or expression." +"The ability of the Rust compiler to deduce the type of a variable or " +"expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -20990,12 +22858,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading to unpredictable " -"program behavior." +"Actions or conditions in Rust that have no specified result, often leading " +"to unpredictable program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل پیش‌بینی " -"برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " +"غیرقابل پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" @@ -21003,17 +22871,18 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " +"یکی در یک زمان خاص." #: src/glossary.md msgid "" "unit test: \n" -"Rust comes with built-in support for running small unit tests and larger integration tests. " -"See [Unit Tests](testing/unit-tests.html)." +"Rust comes with built-in support for running small unit tests and larger " +"integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر ارائه می‌شود. " -"[Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " +"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -21021,17 +22890,18 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " +"شده است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe Rust](unsafe-" -"rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See " +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. [Unsafe Rust] " -"(unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " +"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -21046,8 +22916,11 @@ msgid "Other Rust Resources" msgstr "سایر منابع برای Rust" #: src/other-resources.md -msgid "The Rust community has created a wealth of high-quality and free resources online." -msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +msgid "" +"The Rust community has created a wealth of high-quality and free resources " +"online." +msgstr "" +"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -21055,41 +22928,47 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" -msgstr "پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" +msgstr "" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " +"می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical free book " -"about Rust. Covers the language in detail and includes a few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " +"canonical free book about Rust. Covers the language in detail and includes a " +"few projects for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف در مورد Rust " -"که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " +"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " +"پروژه برای ساخت نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust syntax via a " -"series of examples which showcase different constructs. Sometimes includes small exercises " -"where you are asked to expand on the code in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " +"Rust syntax via a series of examples which showcase different constructs. " +"Sometimes includes small exercises where you are asked to expand on the code " +"in the examples." msgstr "" -"‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust syntax را به کمک " -"یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش می‌گذارد. گاهی اوقات شامل تمرین‌های " -"کوچکی می‌شود که از شما خواسته می‌شود کد را در مثال‌ها گسترش دهید." +"‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " +"syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " +"در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of the standard " -"library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " +"of the standard library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه استاندارد برای " -"Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " +"کتابخانه استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book which describes " -"the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " +"book which describes the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر و مدل حافظه " -"Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " +"گرامر و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -21097,27 +22976,33 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" -"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, including working " -"with raw pointers and interfacing with other languages (FFI)." +"[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " +"including working with raw pointers and interfacing with other languages " +"(FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش می‌دهد، از " -"جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " +"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " +"(FFI) را تشریح می‌کند." #: src/other-resources.md msgid "" -"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): covers the new " -"asynchronous programming model which was introduced after the Rust Book was written." +"[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " +"covers the new asynchronous programming model which was introduced after the " +"Rust Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل برنامه‌نویسی " -"ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " +"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " +"پس از نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an introduction to " -"using Rust on embedded devices without an operating system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"an introduction to using Rust on embedded devices without an operating " +"system." msgstr "" -"‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): مقدمه‌ای بر استفاده " -"از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل می‌شود." +"‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " +"شامل می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -21129,103 +23014,115 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from the " -"perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " +"from the perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را از دیدگاه " -"برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " +"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): covers " -"Rust from the perspective of developers who write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs.html): که " -"Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " +"زبان C می‌نویسند پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers the syntax of " -"Rust using side-by-side comparisons with other languages such as C, C++, Java, JavaScript, and " -"Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): " +"covers the syntax of Rust using side-by-side comparisons with other " +"languages such as C, C++, Java, JavaScript, and Python." msgstr "" -"‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که syntax مورد " -"استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، Java، JavaScript و " -"Python پوشش می‌دهد." +"‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " +"C++، Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " +"you learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک به یادگیری " -"Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " +"کمک به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): a " -"series of small presentations covering both basic and advanced part of the Rust language. " -"Other topics such as WebAssembly, and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): a series of small presentations covering both basic " +"and advanced part of the Rust language. Other topics such as WebAssembly, " +"and async/await are also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/index.html): " -"مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را پوشش می‌دهد. موضوعات دیگری " -"مانند WebAssembly و async/wait نیز پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " +"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " +"پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" -"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-testing/): a self-" -"paced workshop that goes beyond Rust's built-in testing framework. It covers `googletest`, " -"snapshot testing, mocking as well as how to write your own custom test harness." +"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" +"testing/): a self-paced workshop that goes beyond Rust's built-in testing " +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-testing-" -"workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این `googletest`، تست " -"snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" +"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " +"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " +"تست‌های سفارشی خود را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) " -"and [Take your first steps with Rust](https://docs.microsoft.com/en-us/learn/paths/rust-first-" -"steps/): two Rust guides aimed at new developers. The first is a set of 35 videos and the " -"second is a set of 11 modules which covers Rust syntax and basic constructs." +"[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" +"series-to-rust/) and [Take your first steps with Rust](https://docs." +"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " +"new developers. The first is a set of 35 videos and the second is a set of " +"11 modules which covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-series-to-rust/) " -"و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. com/en-us/learn/paths/rust-" -"first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و " -"دومی مجموعه‌ای از ۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" +"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" +"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " +"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " +"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github.io/too-many-" -"lists/): in-depth exploration of Rust's memory management rules, through implementing a few " -"different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." +"github.io/too-many-lists/): in-depth exploration of Rust's memory management " +"rules, through implementing a few different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/too-many-" -"lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." +"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " +"نوع مختلف list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for even more Rust " -"books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " +"for even more Rust books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های بیشتر در مورد " -"Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " +"کتاب‌های بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust documentation. See the page " -"on [other resources](other-resources.md) for a full list of useful resources." +"The material here builds on top of the many great sources of Rust " +"documentation. See the page on [other resources](other-resources.md) for a " +"full list of useful resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست کامل منابع " -"مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " +"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 license, " -"please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/main/LICENSE) for " -"details." +"The material of Comprehensive Rust is licensed under the terms of the Apache " +"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" +"rust/blob/main/LICENSE) for details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر به ['LICENSE']" -"(https://github.com/google/comprehensive-rust/blob/main/LICENSE) مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " +"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" +"LICENSE) مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -21233,13 +23130,14 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by Example](https://doc." -"rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-example/` directory for " -"details, including the license terms." +"Some examples and exercises have been copied and adapted from [Rust by " +"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " +"`third_party/rust-by-example/` directory for details, including the license " +"terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-example/) کپی " -"و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-by-" -"example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" +"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " +"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -21247,12 +23145,13 @@ msgstr "‏ Rust در تمرین‌ها" #: src/credits.md msgid "" -"Some exercises have been copied and adapted from [Rust on Exercism](https://exercism.org/" -"tracks/rust). Please see the `third_party/rust-on-exercism/` directory for details, including " -"the license terms." +"Some exercises have been copied and adapted from [Rust on Exercism](https://" +"exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " +"directory for details, including the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس شده‌اند. لطفاً " -"برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " +"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " +"`third_party/rust-on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -21260,13 +23159,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section uses an image from " -"[CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory for details, including the " -"license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section " +"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " +"directory for details, including the license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از [CXX](https://" -"cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، دایرکتوری `third_party/cxx/` " -"را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " +"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " +"license، دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -21275,25 +23174,31 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` keyword makes them " -#~ "capture by value." +#~ "By default, closures will capture by reference if they can. The `move` " +#~ "keyword makes them capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. کلمه کلیدی " -#~ "`move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " +#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " +#~ "value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/build/bazel/" -#~ "introduction), [ChromeOS](https://chromium.googlesource.com/chromiumos/bazel/), and " -#~ "[Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." +#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/bazel/" -#~ "introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/bazel/) وجود دارد و " -#~ "انتقال [Fuchsia](https://source.android.com/docs/setup/build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." +#~ "com/docs/setup/build/bazel/introduction) به Bazel." -#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "" +#~ "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "" +#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "" +#~ "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -21317,38 +23222,46 @@ msgstr "" #~ msgstr "\"Winner is {winner:?}\"" #~ msgid "" -#~ "In this example, we have a race between a cat and a dog. `first_animal_to_finish_race` " -#~ "listens to both channels and will pick whichever arrives first. Since the dog takes 50ms, " -#~ "it wins against the cat that take 500ms." +#~ "In this example, we have a race between a cat and a dog. " +#~ "`first_animal_to_finish_race` listens to both channels and will pick " +#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " +#~ "cat that take 500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر دو channelها " -#~ "گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، " -#~ "در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " +#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." +#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " +#~ "می‌کشد تا پیروز شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are supposed to receive only " -#~ "one `send`." +#~ "You can use `oneshot` channels in this example as the channels are " +#~ "supposed to receive only one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها فقط یک `send` " -#~ "را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " +#~ "کانال‌ها فقط یک `send` را دریافت کنند." -#~ msgid "Try adding a deadline to the race, demonstrating selecting different sorts of futures." -#~ msgstr "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان دهید." +#~ msgid "" +#~ "Try adding a deadline to the race, demonstrating selecting different " +#~ "sorts of futures." +#~ msgstr "" +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " +#~ "نشان دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their futures. It is easiest to " -#~ "use when every execution of `select!` creates new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their " +#~ "futures. It is easiest to use when every execution of `select!` creates " +#~ "new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future آنها را لغو " -#~ "می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد می‌کند، راحت‌ترین استفاده از " -#~ "آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " +#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " +#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but this can lead to " -#~ "issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but " +#~ "this can lead to issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما این کار " -#~ "می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " +#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " +#~ "(pinning slide) شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -21384,8 +23297,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات " -#~ "بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -21398,8 +23311,12 @@ msgstr "" #~ msgid "Blocks are delimited by curly braces." #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." -#~ msgid "Line comments are started with `//`, block comments are delimited by `/* ... */`." -#~ msgstr "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص می‌شوند." +#~ msgid "" +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." +#~ msgstr "" +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " +#~ "مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -21407,25 +23324,28 @@ msgstr "" #~ msgid "Variable assignment is done with `=`, comparison is done with `==`." #~ msgstr "انتساب متغیر با `=` انجام می‌شود، مقایسه با `==` انجام می‌شود." -#~ msgid "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgid "" +#~ "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "" +#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; 3]" +#~ "[20, 30, 40], [0; " +#~ "3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), (T1, T2), …" +#~ "(), (T,), " +#~ "(T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" -#~ "(), ('x',), ('x', 1.2), …" +#~ "(), ('x',), " +#~ "('x', 1.2), …" #~ msgid "Array assignment and access:" #~ msgstr "انتساب و دسترسی به آرایه:" @@ -21441,26 +23361,31 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, and the only " -#~ "valid value of that type --- that is to say both the type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. این هم یک نوع " -#~ "است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد " -#~ "استفاده می‌شود، همانطور که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " +#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " +#~ "که در اسلاید بعدی خواهیم دید. " #, fuzzy #~ msgid "" -#~ "You can think of it as `void` that can be familiar to you from other programming languages." +#~ "You can think of it as `void` that can be familiar to you from other " +#~ "programming languages." #~ msgstr "" -#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های برنامه‌نویسی " -#~ "برایتان آشنا باشد." +#~ "می‌توانید آن را به عنوان `void` در نظر بگیرید که ممکن است از سایر زبان‌های " +#~ "برنامه‌نویسی برایتان آشنا باشد." #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" -#~ msgstr "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." +#~ msgstr "" +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " +#~ "کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -21469,24 +23394,31 @@ msgstr "" #~ msgid "Add more values to the array." #~ msgstr "مقادیر بیشتری را به آرایه اضافه کنید." -#~ msgid "Point out that how `..` will expand to account for different number of elements." -#~ msgstr "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." +#~ msgid "" +#~ "Point out that how `..` will expand to account for different number of " +#~ "elements." +#~ msgstr "" +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +#~ "یافت." -#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "" +#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" -#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و `[a@..,b]` را نشان دهید." +#~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " +#~ "`[a@..,b]` را نشان دهید." #~ msgid "Hard-code both functions to operate on 3 × 3 matrices." #~ msgstr "هر دو تابع را برای کار بر روی ماتریس‌های 3 × 3 هاردکد کنید." #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-scoped values that " -#~ "cannot be moved or reallocated during the execution of the program." +#~ "Static and constant variables are two different ways to create globally-" +#~ "scoped values that cannot be moved or reallocated during the execution of " +#~ "the program." #~ msgstr "" -#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال (قابل دسترس در کل " -#~ "برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا دوباره تعریف شوند." +#~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " +#~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " +#~ "دوباره تعریف شوند." #~ msgid "Properties table:" #~ msgstr "جدول خاصیت‌ها:" @@ -21518,16 +23450,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust اطلاعات " -#~ "بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل تغییر به یک برش از " -#~ "رشته‌ است." +#~ "&str یک مرجع غیرقابل " +#~ "تغییر به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -21755,10 +23687,13 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "" +#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." -#~ msgid "Day 2: Memory management, ownership, compound data types, and the standard library." +#~ msgid "" +#~ "Day 2: Memory management, ownership, compound data types, and the " +#~ "standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -21791,24 +23726,30 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and `continue`." -#~ msgstr "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و `continue`. " +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " +#~ "and `continue`." +#~ msgstr "" +#~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " +#~ "`continue`. " #~ msgid "" -#~ "The idea for the first day is to show _just enough_ of Rust to be able to speak about the " -#~ "famous borrow checker. The way Rust handles memory is a major feature and we should show " -#~ "students this right away." +#~ "The idea for the first day is to show _just enough_ of Rust to be able to " +#~ "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 یک ویژگی مهم " -#~ "است و باید آن را بلافاصله به دانشجویان نشان دهیم." +#~ "ایده برای روز اول این است که فقط به اندازه کافی از Rust را نشان دهیم تا " +#~ "بتوانیم در مورد بررسی کننده قرض `borrow checker` معروف صحبت کنیم.نحوه " +#~ "مدیریت حافظه توسط Rust یک ویژگی مهم است و باید آن را بلافاصله به " +#~ "دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over the schedule. We " -#~ "suggest splitting the day into two parts (following the slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over " +#~ "the schedule. We suggest splitting the day into two parts (following the " +#~ "slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس می دهیدما " -#~ "پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -21817,11 +23758,11 @@ msgstr "" #~ msgstr "بعد از ظهر: ۱۳:۰۰ تا ۱۶:۰۰" #~ msgid "" -#~ "You can of course adjust this as necessary. Please make sure to include breaks, we " -#~ "recommend a break every hour!" +#~ "You can of course adjust this as necessary. Please make sure to include " +#~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را نیز درنظر " -#~ "بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -21860,50 +23801,56 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop will always end, " -#~ "but this is not yet proved. Edit the code and play with different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این است که حلقه " -#~ "همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و با ورودی‌های مختلف بازی " -#~ "کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to trigger type " -#~ "inference. Try with `i8` instead and trigger a runtime integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا استنتاج نوع " -#~ "را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match the format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها با قالب رشته " -#~ "(`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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." +#~ "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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد است، باید از " -#~ "‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::fmt` which has " -#~ "the rules of the formatting mini-language. It's important that the students become familiar " -#~ "with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که " -#~ "قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان با جستجو در کتابخانه " -#~ "استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " +#~ "`std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::fmt documentation" +#~ "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` را " -#~ "توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات " +#~ "محلی ‍`std::fmt` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -21915,12 +23862,15 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" -#~ msgid "Despite just 29 lines of code, this C example contains serious bugs in at least 11:" +#~ msgid "" +#~ "Despite just 29 lines of code, this C example contains serious bugs in at " +#~ "least 11:" #~ msgstr "با وجود تنها ۲۹ خط کد، این مثال C حداقل 11 باگ جدی دارد: " #~ msgid "Assignment `=` instead of equality comparison `==` (line 28)" @@ -21938,7 +23888,9 @@ msgstr "" #~ msgid "Forgotten `break` in a `switch` statement (line 32)" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" -#~ msgid "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow (line 29)" +#~ msgid "" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -21955,42 +23907,46 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning level, even in the " -#~ "latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش " +#~ "فرض کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" -#~ "Absolutely not, these kind of bugs have lead to serious security vulnerabilities in the " -#~ "past. Some examples:" +#~ "Absolutely not, these kind of bugs have lead to serious security " +#~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" #~ msgid "" -#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor Attempt of 2003]" -#~ "(https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003)" +#~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " +#~ "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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of " +#~ "2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-" +#~ "of-2003)" #~ msgid "" -#~ "Forgotten braces in multi-line `if`: [The Apple goto fail vulnerability](https://dwheeler." -#~ "com/essays/apple-goto-fail.html)" +#~ "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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability]" +#~ "(https://dwheeler.com/essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](https://" -#~ "nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " -#~ "" +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke " +#~ "sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-" +#~ "hole-the-break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -22012,111 +23968,127 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence you can't " -#~ "accidentally forget a `break`." +#~ "`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 را فراموش کنید." +#~ "دستور`match` (به عنوان معادل Rust برای `switch`) فرو نمی‌پاشد (منظور fall-" +#~ "through پذیر بودن ان است) ، بنابراین نمی‌توانید به طور تصادفی یک break را " +#~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding `Box` leaves the " -#~ "scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` مورد نظر اسکوپ " -#~ "مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get یک برش " -#~ "(`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند " +#~ "و در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی " +#~ "تابعی که با `#[must_use]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" -#~ msgstr "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgstr "" +#~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" -#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak) " -#~ "to leak a pointer. A use of this could be to get runtime-initialized and runtime-sized " -#~ "static variables" +#~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." +#~ "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) برای نشت دادن یک اشاره‌گر استفاده کنید.یک مورد استفاده از این کار " -#~ "می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/" +#~ "boxed/struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.html) to make " -#~ "the compiler \"forget\" about a value (meaning the destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" +#~ "std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را " +#~ "فراموش کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-lang.org/book/ch15-06-" -#~ "reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory leak and Rust does " -#~ "not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر می‌گیرند و " -#~ "Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood as \"Pretty much " -#~ "no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" -#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه _تصادفی_» درنظر گرفته " -#~ "شود." +#~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " +#~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang.org/rustc/" -#~ "codegen-options/index.html#overflow-checks) compile-time flag. If enabled, the program will " -#~ "panic (a controlled crash of the program), otherwise you get wrap-around semantics. By " -#~ "default, you get panics in debug mode (`cargo build`) and wrap-around in release mode " +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be disabled " -#~ "directly with the `unsafe` keyword. However, `unsafe` allows you to call functions such as " -#~ "`slice::get_unchecked` which does not do bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور مستقیم با " -#~ "کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان می‌دهد توابعی مانند " -#~ "`slice::get_unchecked` را صدا بزنید که بررسی محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." -#~ msgstr "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده است." +#~ msgstr "" +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -22125,88 +24097,97 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for higher-level " -#~ "programming constructs with memory or CPU. For example, writing a loop using `for` should " -#~ "result in roughly the same low level instructions as using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " +#~ "شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +#~ "«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for " +#~ "باید تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار " +#~ "`iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also known as 'sum " -#~ "types', which allow the type system to express things like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also 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` را بیان کند." #~ msgid "" -#~ "Remind people to read the errors --- many developers have gotten used to ignore lengthy " -#~ "compiler output. The Rust compiler is significantly more talkative than other compilers. It " -#~ "will often provide you with _actionable_ feedback, ready to copy-paste into your code." +#~ "Remind people to read the errors --- many developers have gotten used to " +#~ "ignore lengthy compiler output. The Rust compiler is significantly more " +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" -#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به نادیده گرفتن خروجی " -#~ "طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها " -#~ "است. اغلب بازخوردهای _عملیاتی_ را در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد " -#~ "شما هستند." +#~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, Python, and Go. Rust " -#~ "does not come with several things you might consider standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک است. زبان Rust " -#~ "با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/rand/) " -#~ "را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" -#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`](https://docs.rs/" -#~ "rustls/) را ببینید." +#~ "پشتیبانی از SSL یا TLS، اما میتوانید [کتابخانه `rusttls`]" +#~ "(https://docs.rs/rustls/) را ببینید." #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library cannot go away, so " -#~ "it has to be very stable. For the examples above, the Rust community is still working on " -#~ "finding the best solution --- and perhaps there isn't a single \"best solution\" for some " -#~ "of these things." +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this makes it trivial " -#~ "to download and compile third-party crates. A consequence of this is that the standard " -#~ "library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار آسان می کند. یکی از پیامدهای این امر این است که " -#~ "کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و " +#~ "این امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help " -#~ "with this by letting you compare health metrics for crates to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." #~ msgstr "" -#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates به شما کمک می‌کنند تا یک مورد خوب و قابل " -#~ "اعتماد را پیدا کنید." +#~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ msgid "" -#~ "[rust-analyzer](https://rust-analyzer.github.io/) is a well supported LSP implementation " -#~ "used in major IDEs and text editors." +#~ "[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‌ها و " -#~ "ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است " +#~ "که در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -22216,111 +24197,131 @@ msgstr "" #~ msgid "Like C++, Rust has references:" #~ msgstr "مانند C++، راست دارای مراجع است:" -#~ msgid "We must dereference `ref_x` when assigning to it, similar to C and C++ pointers." +#~ msgid "" +#~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " +#~ "pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values over their lifetime." +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." #~ msgstr "" -#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر مختلفی ارجاع داده " -#~ "شوند." +#~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " +#~ "مختلفی ارجاع داده شوند." #~ msgid "A reference is said to \"borrow\" the value it refers to." #~ msgstr "گفته می‌شود که یک مرجع مقدار مورد اشاره خود را «قرض می‌گیرد»." -#~ msgid "Rust is tracking the lifetimes of all references to ensure they live long enough." +#~ msgid "" +#~ "Rust is tracking the lifetimes of all references to ensure they live long " +#~ "enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " -#~ msgid "You can borrow `&str` slices from `String` via `&` and optionally range selection." +#~ msgid "" +#~ "You can borrow `&str` slices from `String` via `&` and optionally range " +#~ "selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و انتخاب محدوده به " -#~ "صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." #~ msgid "" -#~ "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) interview " -#~ "question:" +#~ "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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward declarations nor headers " -#~ "are necessary. " +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره می‌کنیم. نیازی " -#~ "به اعلان از قبل تابع `main` یا در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains `=n`, which causes " -#~ "it to include the upper bound." +#~ "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` است که باعث می‌شود " -#~ "محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "All language items in Rust can be documented using special `///` syntax." -#~ msgstr "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgstr "" +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but in real code they " -#~ "should be present." +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما در کدهای " -#~ "دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need not be addressed " -#~ "here." +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." #~ msgstr "" -#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار می‌گیرد و نیازی به " -#~ "پرداختن به آنها در اینجا نیست." +#~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " +#~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" -#~ "Rustdoc comments can contain code snippets that we can run and test using `cargo test`. We " -#~ "will discuss these tests in the [Testing section](../testing/doc-tests.html)." +#~ "Rustdoc comments can contain code snippets that we can run and test using " +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." #~ msgstr "" -#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست نویسی](../testing/doc-tests." -#~ "html) در مورد این تست‌ها بحث خواهیم کرد." +#~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a method is an " -#~ "instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" -#~ msgid "We will look much more at methods in today's exercise and in tomorrow's class." +#~ msgid "" +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را از `main` " -#~ "فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static methods are commonly " -#~ "used to initialize structs (but don't have to). The actual constructor, `Rectangle { width, " -#~ "height }`, could be called directly. See the [Rustnomicon](https://doc.rust-lang.org/" -#~ "nomicon/constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." #~ msgid "" -#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such static methods " -#~ "can take arbitrary parameters." +#~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " +#~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، با ارگمان‌های " -#~ "یک سازنده `Rectangle::square(width: u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -22344,12 +24345,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind of limited " -#~ "polymorphism on argument types. We will see more details in a later section." +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد می‌تواند نوعی " -#~ "چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات بیشتر را در بخش‌های بعدی " -#~ "خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -22367,87 +24369,99 @@ msgstr "" #~ msgstr "چند نکته را هنگام حل تمرین‌ها درنظر بگیرید:" #~ msgid "" -#~ "Use a local Rust installation, if possible. This way you can get auto-completion in your " -#~ "editor. See the page about [Using Cargo](../../cargo.md) for details on installing Rust." +#~ "Use a local Rust installation, if possible. This way you can get auto-" +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل خودکار در " -#~ "ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه مربوط به [استفاده از " -#~ "کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets lose their state if " -#~ "you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج شوید، به " -#~ "حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." #~ msgid "" -#~ "Rust will not automatically apply _implicit conversions_ between types ([unlike C++]" -#~ "(https://en.cppreference.com/w/cpp/language/implicit_conversion)). You can see this in a " -#~ "program like this:" +#~ "Rust will not automatically apply _implicit conversions_ between types " +#~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C+" -#~ "+`](https://en.cppreference.com/w/cpp/language/implicit_conversion)).به عنوان مثال " -#~ "میتوانید این را در یک برنامه ببینید:" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/std/convert/" -#~ "trait.From.html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " -#~ "traits to let us convert between them. The `From` trait has a single `from()` method and " -#~ "similarly, the `Into` trait has a single `into()` method. Implementing these traits is " -#~ "how a type expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را " -#~ "دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "همه انواع عدد صحیح راست، تریت‌های (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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which means that we can " -#~ "convert a variable `x` of type `i8` to an `i16` by calling `i16::from(x)`. Or, simpler, " -#~ "with `x.into()`, because `From for i16` implementation automatically create an " -#~ "implementation of `Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع `i8` را با فراخوانی " -#~ "`i16::from(x)` به یک `i16` تبدیل کنیم. یا به " -#~ "شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From``From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, so it is " -#~ "sufficient to only implement `From` to get a respective `Into` implementation automatically." +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "implementation automatically." #~ msgstr "" -#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع خودتان نیز صدق " -#~ "می‌کند، بنابراین کافیست فقط `From` را پیاده‌سازی کنید تا به طور خودکار " -#~ "پیاده‌سازی `Into` مربوطه را دریافت کنید." +#~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " +#~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای انجام تبدیل " -#~ "استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." #~ msgid "" -#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, `i128`) to see " -#~ "which types you can convert to which other types. Try converting small types to big types " -#~ "and the other way around. Check the [standard library documentation](https://doc.rust-lang." -#~ "org/std/convert/trait.From.html) to see if `From` is implemented for the pairs you check." +#~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " +#~ "`i128`) to see which types you can convert to which other types. Try " +#~ "converting small types to big types and the other way around. Check the " +#~ "[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` برای تبدیل " -#~ "انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) " +#~ "تغییر دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل " +#~ "کنید. سعی کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات " +#~ "کتابخانه استاندارد](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را بررسی کنید تا ببینید آیا `From` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -22455,363 +24469,426 @@ msgstr "" #~ msgid "We saw that an array can be declared like this:" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " -#~ msgid "You can print such an array by asking for its debug representation with `{:?}`:" +#~ msgid "" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ " -#~ "کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" -#~ msgid "Rust lets you iterate over things like arrays and ranges using the `for` keyword:" +#~ msgid "" +#~ "Rust lets you iterate over things like arrays and ranges using the `for` " +#~ "keyword:" #~ msgstr "" -#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی چیزهایی مانند " -#~ "آرایه‌ها و رنج‌ها پیمایش کنید:" +#~ "راست به شما این امکان را می‌دهد تا با استفاده از کلمه کلیدی `for` بر روی " +#~ "چیزهایی مانند آرایه‌ها و رنج‌ها پیمایش کنید:" #~ msgid "Bonus Question" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your argument and " -#~ "return types? Something like `&[&[i32]]` for a two-dimensional slice-of-slices. Why or why " -#~ "not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" #~ msgstr "" -#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` " -#~ "برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://" -#~ "docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ msgid "" -#~ "The solution and the answer to the bonus section are available in the [Solution](solutions-" -#~ "morning.md#arrays-and-for-loops) section." +#~ "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) موجود " -#~ "است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-" +#~ "and-for-loops) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for " +#~ "n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." #~ msgid "" -#~ "The loop would have been one that consumes the array. This is a change [introduced in the " -#~ "2021 Edition](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays." -#~ "html)." +#~ "The loop would have been one that consumes the array. This is a change " +#~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال " +#~ "۲۰۲۱ معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/" +#~ "IntoIterator-for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, then `[i32; 3]` is " -#~ "also a copy type." +#~ "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]` نیز یک نوع کپی است." +#~ "یک کپی آرایه ضمنی رخ می‌داد. از آنجایی که `i32` یک نوع کپی است، پس `[i32; 3]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally evaluate one of " -#~ "two blocks, but the blocks can have a value which then becomes the value of the `if` " -#~ "expression. Other control flow expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود که یکی از ۲ " -#~ "بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این بلاک های `if` میتوانند یک " -#~ "مقدار را برگرداند و در اصطلاح یک مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این " -#~ "کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is the return value:" -#~ msgstr "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار برگشتی است: " +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" +#~ msgstr "" +#~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " +#~ "برگشتی است: " -#~ msgid "The point of this slide is to show that blocks have a type and value in Rust. " -#~ msgstr "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار هستند. " +#~ msgid "" +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " +#~ msgstr "" +#~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " +#~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely related to the " -#~ "[`while let` loop](while-let-expressions.md). It will automatically call `into_iter()` on " -#~ "the expression and then iterate over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور " +#~ "نزدیکی به حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. " +#~ "حلقه `for` به طور خودکار `into_iter()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." -#~ msgstr "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." +#~ msgstr "" +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که ویژگی `Iterator` را " -#~ "پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." -#~ msgid "`step_by` is a method that returns another `Iterator` that skips every other element. " +#~ msgid "" +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه عناصر را " -#~ "برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." #~ 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()`." +#~ "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()` " -#~ "تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را " +#~ "قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v.iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" #~ msgid "" -#~ "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/expressions/loop-" -#~ "expr.html#infinite-loops) which creates an endless loop." +#~ "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) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/" +#~ "expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" -#~ msgstr "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" +#~ msgstr "" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن " -#~ "را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the types less and less " -#~ "as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و کمتر آن را " -#~ "نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic container without the " -#~ "code ever explicitly specifying the contained type, using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در یک کانتینر " -#~ "عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک جایگزین برای اعلام نوع " -#~ "داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " #~ msgid "" -#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) " -#~ "relies on [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html), " -#~ "which [`HashSet`](https://doc.rust-lang.org/std/collections/struct.HashSet.html#impl-" -#~ "FromIterator%3CT%3E-for-HashSet%3CT,+S%3E) implements." +#~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." +#~ "[`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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse memory locations when " -#~ "shadowing an immutable variable in a scope, even if the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که قبلا برای یک " -#~ "متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل تغییر داریم استفاده کند. " -#~ "حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" -#~ "This page offers an enum type `CoinFlip` with two variants `Heads` and `Tails`. You might " -#~ "note the namespace when using variants." +#~ "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`ها، به این اینگونه نام‌ها توجه کنید." +#~ "در این صفحه نوع`Enum`به اسم `CoinFlip` که دارای `Heads` و `Tails` می‌باشد. " +#~ "هنگام استفاده از `Enum`ها، به این اینگونه نام‌ها توجه کنید." #~ msgid "In both, associated functions are defined within an `impl` block." #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده " +#~ "باشند. سپس می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There is no fall-through " -#~ "like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There " +#~ "is no fall-through like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از بالا به پایین " -#~ "نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." #~ msgid "" -#~ "The match expression has a value. The value is the last expression in the match arm which " -#~ "was executed." +#~ "The match expression has a value. The value is the last expression in the " +#~ "match arm which was executed." #~ msgstr "" -#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی `match` ای است که " -#~ "اجرا شده است." +#~ "عبارت `match` دارای یک مقدار بازگشتی است. این مقدار آخرین عبارت در بازوی " +#~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد " -#~ "جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته " +#~ "باشد، سپس کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه " +#~ "توی match اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." -#~ msgid "It is possible to retrieve the discriminant by calling `std::mem::discriminant()`" +#~ msgid "" +#~ "It is possible to retrieve the discriminant by calling `std::mem::" +#~ "discriminant()`" #~ msgstr "" -#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد تشخیصی پنهان را " -#~ "دریافت کرد." +#~ "می توان با فراخوانی `std::mem::discriminant()` فیلد " +#~ "تشخیصی پنهان را دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs where comparing field " -#~ "values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت `PartialEq` بر " -#~ "برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top " -#~ "level `struct Click { ... }`. The inlined version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." #~ msgstr "" -#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::" -#~ "Click(Click)` با `struct Click { ... }` در سطح بالا نیست.برای " -#~ "مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را پیاده‌سازی کند." +#~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." -#~ msgid "Rust enums are packed tightly, taking constraints due to alignment into account:" +#~ msgid "" +#~ "Rust enums are packed tightly, taking constraints due to alignment into " +#~ "account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های ناشی از هم " -#~ "ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" -#~ msgid "Internally Rust is using a field (discriminant) to keep track of the enum variant." +#~ msgid "" +#~ "Internally Rust is using a field (discriminant) to keep track of the enum " +#~ "variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای `enum` استفاده " -#~ "می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی حافظه 1 بایت، فضای " -#~ "مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): اندازه توی حافظه 1 " -#~ "بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی حافظه ۸ بایت، ، " -#~ "فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" #~ msgid "" -#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer optimization, see " -#~ "below)." +#~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " +#~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): اندازه توی حافظه ۸ " -#~ "بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" -#~ msgid "Niche optimization: Rust will merge unused bit patterns for the enum discriminant." +#~ msgid "" +#~ "Niche optimization: Rust will merge unused bit patterns for the enum " +#~ "discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain more than 256 " -#~ "`Option`s together." +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد `Option` را به " -#~ "صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/" -#~ "let_else.html) construct allows to do a destructuring assignment, or if it fails, execute a " -#~ "block which is required to abort normal control flow (with `panic`/`return`/`break`/" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-" +#~ "lang.org/rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک " +#~ "انتساب به صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا " +#~ "کند که برای خاتمه دادن به جریان کنترل عادی (با panic/return/break/" +#~ "continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-" +#~ "expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از " +#~ "این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." -#~ msgstr "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." +#~ msgstr "" +#~ "مقادر بازگشتی از دستور `match` را در متغییری ذخیره کنید و آن را چاپ کنید." #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و خطا را توضیح دهید." +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot match against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان `String` تطبیق الگو " -#~ "کنیم؟" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our case, this turns " -#~ "`Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "as_deref() یک `Option` را به `Option<&T::Target>` تبدیل می‌کند. در مورد ما، این `Option` " +#~ "را به `Option<&str>` تبدیل می‌کند." -#~ msgid "We can now use pattern matching to match against the `&str` inside `Option`." +#~ msgid "" +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل `Option` " -#~ "استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`." +#~ "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`، به نمایش نحوه " -#~ "کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف " +#~ "`q`، به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable patterns, as the term can " -#~ "show up in error messages." +#~ "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) " -#~ "باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار " +#~ "(irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" -#~ msgid "Destructuring of slices of unknown length also works with patterns of fixed length." -#~ msgstr "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می کند." +#~ msgid "" +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." +#~ msgstr "" +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." #~ 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:" +#~ "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_ به یک الگو اضافه کنید. این یک عبارت بولین دلخواه است که " -#~ "در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "You can use the variables defined in the pattern in your if expression." -#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -22826,34 +24903,42 @@ msgstr "" #~ msgstr "تمرینی درباره تطبیق الگو" #~ 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." +#~ "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`ها پیاده‌سازی کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " +#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " +#~ "کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based memory management, " -#~ "and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت حافظه مبتنی بر " -#~ "اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` and `Arc`." -#~ msgstr "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." +#~ msgstr "" +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -22865,72 +24950,90 @@ msgstr "" #~ msgstr "شما خودتان حافظه انباشت را تخصیص داده و تخصیص‌زدایی می‌کنید." #~ msgid "" -#~ "If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory " -#~ "leaks." +#~ "If not done with care, this can lead to crashes, bugs, security " +#~ "vulnerabilities, and memory leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی و نشتی حافظه " -#~ "شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" -#~ msgstr "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" +#~ msgstr "" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and `free`: the pointer is " -#~ "lost and we cannot deallocate the memory. Worse, freeing the pointer twice, or accessing a " -#~ "freed pointer can lead to exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه نشت می‌کند: " -#~ "اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، آزاد کردن مجدد اشاره گر " -#~ "یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل " -#~ "سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "Constructors and destructors let you hook into the lifetime of an object." -#~ msgstr "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgstr "" +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object is destroyed. The " -#~ "compiler guarantees that this happens, even if an exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را آزاد کنید. " -#~ "کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and gives you smart " -#~ "pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." #~ msgstr "" -#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده می‌شود و به شما " -#~ "اشاره گرهای هوشمند می‌دهد." +#~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " +#~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory allocated on " -#~ "the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به حافظه‌ای که روی " -#~ "انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." -#~ msgstr "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا می‌شود." +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgstr "" +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "Special move constructors are used when passing ownership to a function:" -#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic memory management:" -#~ msgstr "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" +#~ msgstr "" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." -#~ msgid "A garbage collector finds unused memory and deallocates it for the programmer." +#~ msgid "" +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." #~ msgstr "" -#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس تخصیص‌زدایی (آزاد) " -#~ "می‌کند." +#~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " +#~ "تخصیص‌زدایی (آزاد) می‌کند." #~ msgid "Java Example" #~ msgstr "مثالی در Java" @@ -22948,39 +25051,43 @@ msgstr "" #~ msgstr "ایمن و صحیح مانند جاوا، اما بدون جمع‌آوری زباله." #~ msgid "Scope-based like C++, but the compiler enforces full adherence." -#~ msgstr "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت می‌کند." +#~ msgstr "" +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even have no cost at " -#~ "runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، برخی مانند C " -#~ "هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." #~ msgid "" -#~ "If asked how at this point, you can mention that in Rust this is usually handled by RAII " -#~ "wrapper types such as [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), or [Arc](https://doc.rust-lang.org/std/sync/struct.Arc.html). These " -#~ "encapsulate ownership and memory allocation via various means, and prevent the potential " -#~ "errors in C." +#~ "If asked how at this point, you can mention that in Rust this is usually " +#~ "handled by RAII wrapper types such as [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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید " +#~ "به این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی " +#~ "[Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -22991,16 +25098,18 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a way to generate code " -#~ "in Rust at compile time. In this case the default implementations of `Copy` and `Clone` " -#~ "traits are generated." +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای " +#~ "تولید کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض " +#~ "صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From fbe7b2d2118f282b79555a67974cd555fd15c1d8 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 13 Sep 2024 00:29:38 +0330 Subject: [PATCH 76/92] fa: fix error again --- po/fa.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fa.po b/po/fa.po index a6e535d08d6..f13cb695b8f 100644 --- a/po/fa.po +++ b/po/fa.po @@ -6418,7 +6418,7 @@ msgstr "\"bat\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"armadillo\"" -msgstr "\"آرمادیلو\"" +msgstr "\"armadillo\"" #: src/generics/exercise.md msgid "" From 3739dd0d0b7e6a09265f76e8b6e06cc12f34321e Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 13 Sep 2024 23:16:27 +0330 Subject: [PATCH 77/92] fa: Scattered reforms part 2 --- po/fa.po | 1032 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 737 insertions(+), 295 deletions(-) diff --git a/po/fa.po b/po/fa.po index f13cb695b8f..4f157e097fd 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-13 00:14+0330\n" +"PO-Revision-Date: 2024-09-13 23:14+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -566,7 +566,7 @@ msgstr "" #: src/SUMMARY.md msgid "`FromIterator`" -msgstr "" +msgstr "`FromIterator`" #: src/SUMMARY.md src/iterators.md src/iterators/exercise.md msgid "Exercise: Iterator Method Chaining" @@ -637,7 +637,7 @@ msgstr "" #: src/SUMMARY.md msgid "`Error` Trait" -msgstr "" +msgstr "`Error` Trait" #: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md msgid "`thiserror` and `anyhow`" @@ -1009,7 +1009,7 @@ msgstr "یک مثال ساده" #: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md msgid "`alloc`" -msgstr "" +msgstr "`alloc`" #: src/SUMMARY.md src/bare-metal/microcontrollers.md msgid "Microcontrollers" @@ -1126,7 +1126,7 @@ msgstr "" #: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md msgid "`aarch64-paging`" -msgstr "" +msgstr "`aarch64-paging`" #: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md msgid "`buddy_system_allocator`" @@ -1355,6 +1355,14 @@ msgid "" "io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." "com/google/comprehensive-rust/stargazers)" msgstr "" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" +"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" +"[GitHub contributors](https://img.shields.io/github/contributors/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/" +"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" #: src/index.md msgid "" @@ -3009,7 +3017,7 @@ msgstr "" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" -msgstr "\"Hello 🌍!\"" +msgstr "\"سلام 🌍!\"" #: src/types-and-values/hello-world.md msgid "What you see:" @@ -3366,9 +3374,8 @@ msgid "// The base case.\n" msgstr "//حالت پایه\n" #: src/types-and-values/exercise.md src/control-flow-basics/exercise.md -#, fuzzy msgid "\"Implement this\"" -msgstr "پیاده سازی" +msgstr "\"این را پیاده‌سازی کن\"" #: src/types-and-values/exercise.md msgid "// The recursive case.\n" @@ -3405,7 +3412,7 @@ msgstr "" #: src/control-flow-basics/if.md msgid "\"zero!\"" -msgstr "\"zero!\"" +msgstr "\"صفر!\"" #: src/control-flow-basics/if.md msgid "\"biggish\"" @@ -4084,7 +4091,7 @@ msgstr "\"matrix: {:#?}\"" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "\"transposed: {:#?}\"" -msgstr "\"transposed: {:#?}\"" +msgstr "\"جابجا شده است: {:#?}\"" #: src/references.md src/smart-pointers.md src/borrowing.md #: src/concurrency/async-pitfalls.md @@ -4327,7 +4334,7 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md src/std-traits/read-and-write.md msgid "\"World\"" -msgstr "\"World\"" +msgstr "\"دنیا\"" #: src/references/strings.md msgid "\"s1: {s1}\"" @@ -4335,7 +4342,7 @@ msgstr "\"s1: {s1}\"" #: src/references/strings.md msgid "\"Hello \"" -msgstr "\"Hello \"" +msgstr "\"سلام\"" #: src/references/strings.md src/memory-management/move.md msgid "\"s2: {s2}\"" @@ -4589,7 +4596,7 @@ msgstr "\"از یک دانشمند حوزه موشک در ناسا بپرس\"" #: src/bare-metal/microcontrollers/type-state.md #: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" -msgstr "" +msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" @@ -4638,16 +4645,19 @@ msgstr "" "است:" #: src/user-defined-types/enums.md +#, fuzzy msgid "// Simple variant\n" -msgstr "" +msgstr "// Simple variant\n" #: src/user-defined-types/enums.md +#, fuzzy msgid "// Tuple variant\n" -msgstr "" +msgstr "// Tuple variant\n" #: src/user-defined-types/enums.md +#, fuzzy msgid "// Struct variant\n" -msgstr "" +msgstr "// Struct variant\n" #: src/user-defined-types/enums.md msgid "\"On this turn: {:?}\"" @@ -4819,9 +4829,8 @@ msgstr "" "نمی‌شوند:" #: src/user-defined-types/static.md -#, fuzzy msgid "\"Welcome to RustOS 3.14\"" -msgstr "به روز ۱ خوش آمدید" +msgstr "\"به RustOS 3.14 خوش آمدید\"" #: src/user-defined-types/static.md msgid "\"{BANNER}\"" @@ -4887,8 +4896,9 @@ msgid "" msgstr "" #: src/user-defined-types/aliases.md +#, fuzzy msgid "// Aliases are more useful with long, complex types:\n" -msgstr "" +msgstr "// Aliases are more useful with long, complex types:\n" #: src/user-defined-types/aliases.md msgid "C programmers will recognize this as similar to a `typedef`." @@ -4910,39 +4920,50 @@ msgid "" msgstr "" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "" "/// An event in the elevator system that the controller must react to.\n" msgstr "" +"/// An event in the elevator system that the controller must react to.\n" #: src/user-defined-types/exercise.md +#, fuzzy msgid "// TODO: add required variants\n" -msgstr "" +msgstr "// TODO: add required variants\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "/// A direction of travel.\n" -msgstr "" +msgstr "/// A direction of travel.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "/// The car has arrived on the given floor.\n" -msgstr "" +msgstr "/// The car has arrived on the given floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "/// The car doors have opened.\n" -msgstr "" +msgstr "/// The car doors have opened.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "/// The car doors have closed.\n" -msgstr "" +msgstr "/// The car doors have closed.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "" "/// A directional button was pressed in an elevator lobby on the given " "floor.\n" msgstr "" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md +#, fuzzy msgid "/// A floor button was pressed in the elevator car.\n" -msgstr "" +msgstr "/// A floor button was pressed in the elevator car.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy @@ -4951,11 +4972,11 @@ msgstr "\"یک مسافر طبقه همکف دکمه بالا را فشار دا #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" -msgstr "" +msgstr "\"ماشین به طبقه همکف رسیده است: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door opened: {:?}\"" -msgstr "" +msgstr "\"در ماشین باز شد: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" @@ -4963,43 +4984,51 @@ msgstr "\"یک مسافر دکمه طبقه 3 را فشار داده است: {:? #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" -msgstr "" +msgstr "\"در ماشین بسته شد: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the 3rd floor: {:?}\"" -msgstr "" +msgstr "\"ماشین به طبقه ۳ رسیده است: {:?}\"" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// A button was pressed.\n" -msgstr "" +msgstr "/// A button was pressed.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// The car has arrived at the given floor.\n" -msgstr "" +msgstr "/// The car has arrived at the given floor.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// The car's doors have opened.\n" -msgstr "" +msgstr "/// The car's doors have opened.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// The car's doors have closed.\n" -msgstr "" +msgstr "/// The car's doors have closed.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// A floor is represented as an integer.\n" -msgstr "" +msgstr "/// A floor is represented as an integer.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// A user-accessible button.\n" -msgstr "" +msgstr "/// A user-accessible button.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// A button in the elevator lobby on the given floor.\n" -msgstr "" +msgstr "/// A button in the elevator lobby on the given floor.\n" #: src/user-defined-types/solution.md +#, fuzzy msgid "/// A floor button within the car.\n" -msgstr "" +msgstr "/// A floor button within the car.\n" #: src/welcome-day-2.md msgid "Welcome to Day 2" @@ -5062,11 +5091,11 @@ msgstr "الگوها می توانند مقادیر ساده ای باشند، #: src/pattern-matching/match.md msgid "'x'" -msgstr "" +msgstr "'x'" #: src/pattern-matching/match.md msgid "'q'" -msgstr "" +msgstr "'q'" #: src/pattern-matching/match.md msgid "\"Quitting\"" @@ -5076,19 +5105,19 @@ msgstr "\"ترک کردن\"" #: src/generics/solution.md src/std-traits/solution.md #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" -msgstr "" +msgstr "'a'" #: src/pattern-matching/match.md msgid "'s'" -msgstr "" +msgstr "'s'" #: src/pattern-matching/match.md msgid "'w'" -msgstr "" +msgstr "'w'" #: src/pattern-matching/match.md msgid "'d'" -msgstr "" +msgstr "'d'" #: src/pattern-matching/match.md msgid "\"Moving around\"" @@ -5097,12 +5126,12 @@ msgstr "\"حرکت در اطراف\"" #: src/pattern-matching/match.md src/error-handling/exercise.md #: src/error-handling/solution.md msgid "'0'" -msgstr "" +msgstr "'0'" #: src/pattern-matching/match.md src/error-handling/exercise.md #: src/error-handling/solution.md msgid "'9'" -msgstr "" +msgstr "'9'" #: src/pattern-matching/match.md msgid "\"Number input\"" @@ -5114,7 +5143,7 @@ msgstr "\"حروف کوچک: {key}\"" #: src/pattern-matching/match.md msgid "\"Something else\"" -msgstr "" +msgstr "\"یک چیز دیگر\"" #: src/pattern-matching/match.md msgid "" @@ -5211,7 +5240,7 @@ msgstr "مانند tuple ها، ساختار را نیز می توان با تط #: src/pattern-matching/destructuring-structs.md msgid "\"x.0 = 1, b = {b}, y = {y}\"" -msgstr "" +msgstr "\"x.0 = 1, b = {b}, y = {y}\"" #: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" @@ -5219,7 +5248,7 @@ msgstr "" #: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" -msgstr "" +msgstr "\"در y = {y} ، سایر فیلدها نادیده گرفته شدند\"" #: src/pattern-matching/destructuring-structs.md msgid "Change the literal values in `foo` to match with the other patterns." @@ -5263,7 +5292,7 @@ msgstr "\"{n} تقسیم به دو است {half}\"" #: src/pattern-matching/destructuring-enums.md msgid "\"sorry, an error happened: {msg}\"" -msgstr "" +msgstr "\"با عرض‌پوزش، خطایی رخ داده است: {msg}\"" #: src/pattern-matching/destructuring-enums.md msgid "" @@ -5357,8 +5386,9 @@ msgstr "" "یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md +#, fuzzy msgid "\"slept for {:?}\"" -msgstr "" +msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.md msgid "" @@ -5382,7 +5412,7 @@ msgstr "\"یک string خالی دریافت کردم\"" #: src/pattern-matching/let-control-flow.md msgid "\"got None\"" -msgstr "" +msgstr "\"هیچ‌کدام\"" #: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md msgid "\"result: {:?}\"" @@ -5535,20 +5565,24 @@ msgstr "" "panic مدیریت کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#, fuzzy msgid "/// An operation to perform on two subexpressions.\n" -msgstr "" +msgstr "/// An operation to perform on two subexpressions.\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#, fuzzy msgid "/// An expression, in tree form.\n" -msgstr "" +msgstr "/// An expression, in tree form.\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#, fuzzy msgid "/// An operation on two subexpressions.\n" -msgstr "" +msgstr "/// An operation on two subexpressions.\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#, fuzzy msgid "/// A literal value\n" -msgstr "" +msgstr "/// A literal value\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "\"division by zero\"" @@ -5567,29 +5601,32 @@ msgstr "" "کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md +#, fuzzy msgid "// No receiver, a static method\n" -msgstr "" +msgstr "// No receiver, a static method\n" #: src/methods-and-traits/methods.md +#, fuzzy msgid "// Exclusive borrowed read-write access to self\n" -msgstr "" +msgstr "// Exclusive borrowed read-write access to self\n" #: src/methods-and-traits/methods.md +#, fuzzy msgid "// Shared and read-only borrowed access to self\n" -msgstr "" +msgstr "// Shared and read-only borrowed access to self\n" #: src/methods-and-traits/methods.md msgid "\"Recorded {} laps for {}:\"" msgstr "\"ضبط {} دور برای {}:\"" #: src/methods-and-traits/methods.md -#, fuzzy msgid "\"Lap {idx}: {lap} sec\"" msgstr "\"Lap {idx}: {lap} sec\"" #: src/methods-and-traits/methods.md +#, fuzzy msgid "// Exclusive ownership of self\n" -msgstr "" +msgstr "// Exclusive ownership of self\n" #: src/methods-and-traits/methods.md msgid "\"Race {} is finished, total lap time: {}\"" @@ -5729,12 +5766,14 @@ msgstr "" "ایجاد کنید. آنها مشابه interface ها هستند:" #: src/methods-and-traits/traits.md +#, fuzzy msgid "/// Return a sentence from this pet.\n" -msgstr "" +msgstr "/// Return a sentence from this pet.\n" #: src/methods-and-traits/traits.md +#, fuzzy msgid "/// Print a string to the terminal greeting this pet.\n" -msgstr "" +msgstr "/// Print a string to the terminal greeting this pet.\n" #: src/methods-and-traits/traits.md msgid "" @@ -5759,7 +5798,7 @@ msgstr "\"اوه تو چثدر زیبا هستی! اسمت چیه؟ {}\"" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Woof, my name is {}!\"" -msgstr "" +msgstr "\" Woof، نام من {} است!\"" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md @@ -5859,20 +5898,23 @@ msgstr "" "شوند، به شرح زیر:" #: src/methods-and-traits/deriving.md +#, fuzzy msgid "// Default trait adds `default` constructor.\n" -msgstr "" +msgstr "// Default trait adds `default` constructor.\n" #: src/methods-and-traits/deriving.md +#, fuzzy msgid "// Clone trait adds `clone` method.\n" -msgstr "" +msgstr "// Clone trait adds `clone` method.\n" #: src/methods-and-traits/deriving.md msgid "\"EldurScrollz\"" msgstr "\"dog\"" #: src/methods-and-traits/deriving.md +#, fuzzy msgid "// Debug trait adds support for printing with `{:?}`.\n" -msgstr "" +msgstr "// Debug trait adds support for printing with `{:?}`.\n" #: src/methods-and-traits/deriving.md msgid "\"{:?} vs. {:?}\"" @@ -5927,12 +5969,13 @@ msgstr "" "نوع‌های دیگری از پوشش‌دهنده‌ها ممکن است در یک ابزار لاگ مفید باشند؟" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#, fuzzy msgid "/// Log a message at the given verbosity level.\n" -msgstr "" +msgstr "/// Log a message at the given verbosity level.\n" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"verbosity={verbosity}: {message}\"" -msgstr "" +msgstr "\"اطلاعات بیشتر={verbosity}: {message}\"" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"FYI\"" @@ -5940,15 +5983,17 @@ msgstr "\"FYI\"" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"Uhoh\"" -msgstr "" +msgstr "\"اوهو\"" #: src/methods-and-traits/exercise.md +#, fuzzy msgid "// TODO: Define and implement `VerbosityFilter`.\n" -msgstr "" +msgstr "// TODO: Define and implement `VerbosityFilter`.\n" #: src/methods-and-traits/solution.md +#, fuzzy msgid "/// Only log messages up to the given verbosity level.\n" -msgstr "" +msgstr "/// Only log messages up to the given verbosity level.\n" #: src/welcome-day-2-afternoon.md msgid "" @@ -5984,8 +6029,9 @@ msgstr "" "یا ذخیره‌شده تخصیص دهید." #: src/generics/generic-functions.md +#, fuzzy msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" -msgstr "" +msgstr "/// Pick `even` or `odd` depending on the value of `n`.\n" #: src/generics/generic-functions.md msgid "\"picked a number: {:?}\"" @@ -6166,8 +6212,9 @@ msgstr "" "می‌توانید این کار را با استفاده از `T: Trait` یا `impl Trait` انجام دهید:" #: src/generics/trait-bounds.md +#, fuzzy msgid "// struct NotClonable;\n" -msgstr "" +msgstr "// struct NotClonable;\n" #: src/generics/trait-bounds.md msgid "\"{pair:?}\"" @@ -6223,10 +6270,13 @@ msgstr "" "و مقادیر بازگشتی استفاده کرد:" #: src/generics/impl-trait.md +#, fuzzy msgid "" "// Syntactic sugar for:\n" "// fn add_42_millions>(x: T) -> i32 {\n" msgstr "" +"// Syntactic sugar for:\n" +"// fn add_42_millions>(x: T) -> i32 {\n" #: src/generics/impl-trait.md msgid "\"{many}\"" @@ -6238,7 +6288,7 @@ msgstr "\"{many_more}\"" #: src/generics/impl-trait.md msgid "\"debuggable: {debuggable:?}\"" -msgstr "" +msgstr "\"قابل دیباگ: {debuggable:?}\"" #: src/generics/impl-trait.md msgid "" @@ -6304,16 +6354,18 @@ msgid "\"Miau!\"" msgstr "\"Miau!\"" #: src/generics/dyn-trait.md +#, fuzzy msgid "// Uses generics and static dispatch.\n" -msgstr "" +msgstr "// Use the system timer as a delay provider.\n" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Hello, who are you? {}\"" msgstr "\"سلام، شما کی هستید؟ {}\"" #: src/generics/dyn-trait.md +#, fuzzy msgid "// Uses type-erasure and dynamic dispatch.\n" -msgstr "" +msgstr "// Uses type-erasure and dynamic dispatch.\n" #: src/generics/dyn-trait.md msgid "" @@ -6392,21 +6444,22 @@ msgstr "" "rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md +#, fuzzy msgid "// TODO: implement the `min` function used in `main`.\n" -msgstr "" +msgstr "// TODO: implement the `min` function used in `main`.\n" #: src/generics/exercise.md src/generics/solution.md #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" -msgstr "" +msgstr "'z'" #: src/generics/exercise.md src/generics/solution.md msgid "'7'" -msgstr "" +msgstr "'7'" #: src/generics/exercise.md src/generics/solution.md msgid "'1'" -msgstr "" +msgstr "'1'" #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" @@ -6535,12 +6588,17 @@ msgid "In fact, you can document your own code:" msgstr "در واقع، شما می‌توانید کد خود را مستند کنید:" #: src/std-types/docs.md +#, fuzzy msgid "" "/// Determine whether the first argument is divisible by the second " "argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" +"///\n" +"/// If the second argument is zero, the result is false.\n" #: src/std-types/docs.md msgid "" @@ -6564,10 +6622,13 @@ msgstr "" "`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md +#, fuzzy msgid "" "//! This module contains functionality relating to divisibility of " "integers.\n" msgstr "" +"//! This module contains functionality relating to divisibility of " +"integers.\n" #: src/std-types/docs.md msgid "" @@ -6602,7 +6663,7 @@ msgstr "\"پیدا کردن نوع بازگشتی{position:?}\"" #: src/std-types/option.md msgid "'Z'" -msgstr "" +msgstr "'Z'" #: src/std-types/option.md msgid "\"Character not found\"" @@ -6670,7 +6731,7 @@ msgstr "\"نمی‌توان محتوای فایل را خواند\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" -msgstr "" +msgstr "\"دفتر خاطرات باز نشد: {err}\"" #: src/std-types/result.md msgid "" @@ -6722,7 +6783,7 @@ msgstr "\"s1: len = {}, capacity = {}\"" #: src/std-types/string.md msgid "'!'" -msgstr "" +msgstr "'!'" #: src/std-types/string.md msgid "\"s2: len = {}, capacity = {}\"" @@ -6862,27 +6923,30 @@ msgstr "" #: src/std-types/vec.md msgid "\"v1: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"v1: len = {}, capacity = {}\"" #: src/std-types/vec.md msgid "\"v2: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"v2: len = {}, capacity = {}\"" #: src/std-types/vec.md +#, fuzzy msgid "// Canonical macro to initialize a vector with elements.\n" -msgstr "" +msgstr "// Canonical macro to initialize a vector with elements.\n" #: src/std-types/vec.md +#, fuzzy msgid "// Retain only the even elements.\n" -msgstr "" +msgstr "// Retain only the even elements.\n" #: src/std-types/vec.md msgid "\"{v3:?}\"" msgstr "\"{v3:?}\"" #: src/std-types/vec.md +#, fuzzy msgid "// Remove consecutive duplicates.\n" -msgstr "" +msgstr "// Remove consecutive duplicates.\n" #: src/std-types/vec.md msgid "" @@ -6962,7 +7026,7 @@ msgstr "\"Les Misérables\"" #: src/std-types/hashmap.md msgid "\"We know about {} books, but not Les Misérables.\"" -msgstr "" +msgstr "\"ما درباره {} کتاب می دانیم، اما Les Misérables نه.\"" #: src/std-types/hashmap.md msgid "\"Alice's Adventure in Wonderland\"" @@ -6977,8 +7041,9 @@ msgid "\"{book} is unknown.\"" msgstr "\"{book} ناشناخته است.\"" #: src/std-types/hashmap.md +#, fuzzy msgid "// Use the .entry() method to insert a value if nothing is found.\n" -msgstr "" +msgstr "// Use the .entry() method to insert a value if nothing is found.\n" #: src/std-types/hashmap.md msgid "\"{page_counts:#?}\"" @@ -7005,7 +7070,7 @@ msgstr "\"هری پاتر و سنگ جادو\"" #: src/std-types/hashmap.md msgid "\"The Hunger Games\"" -msgstr "" +msgstr "\"The Hunger Games\"" #: src/std-types/hashmap.md msgid "Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." @@ -7094,25 +7159,30 @@ msgstr "" "تعداد جستجوهای هش مورد نیاز برای پیاده‌سازی متد `count` را به نصف کاهش دهید." #: src/std-types/exercise.md src/std-types/solution.md +#, fuzzy msgid "" "/// Counter counts the number of times each value of type T has been seen.\n" msgstr "" +"/// Counter counts the number of times each value of type T has been seen.\n" #: src/std-types/exercise.md src/std-types/solution.md +#, fuzzy msgid "/// Create a new Counter.\n" -msgstr "" +msgstr "/// Create a new Counter.\n" #: src/std-types/exercise.md src/std-types/solution.md +#, fuzzy msgid "/// Count an occurrence of the given value.\n" -msgstr "" +msgstr "/// Count an occurrence of the given value.\n" #: src/std-types/exercise.md src/std-types/solution.md +#, fuzzy msgid "/// Return the number of times the given value has been seen.\n" -msgstr "" +msgstr "/// Return the number of times the given value has been seen.\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"saw {} values equal to {}\"" -msgstr "" +msgstr "\"مقادیر {} برابر با {} را دیده‌شده\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"apple\"" @@ -7470,8 +7540,9 @@ msgid "\"{default_struct:#?}\"" msgstr "\"{default_struct:#?}\"" #: src/std-traits/default.md +#, fuzzy msgid "\"Y is set!\"" -msgstr "\"Y is set!\"" +msgstr "\" مقدار Y وارد شده است!\"" #: src/std-traits/default.md msgid "\"{almost_default_struct:#?}\"" @@ -7556,9 +7627,8 @@ msgid "\"add_3\"" msgstr "\"add_3: {}\"" #: src/std-traits/closures.md -#, fuzzy msgid "\"accumulate\"" -msgstr "\"accumulate: {}\"" +msgstr "\"تجمیع: {}\"" #: src/std-traits/closures.md #, fuzzy @@ -8045,6 +8115,26 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" +"```bob\n" +" Stack Heap\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - -.\n" +": : : :\n" +": s1 \"(inaccessible)\" : : :\n" +": +-----------+-------+ : : +----+----+----+----+----+----+ :\n" +": | ptr | o---+---+--+--+-->| H | e | l | l | o | ! | :\n" +": | len | 6 | : | : +----+----+----+----+----+----+ :\n" +": | capacity | 6 | : | : :\n" +": +-----------+-------+ : | : :\n" +": : | `- - - - - - - - - - - - - - - - - - -'\n" +": s2 : |\n" +": +-----------+-------+ : |\n" +": | ptr | o---+---+--'\n" +": | len | 6 | :\n" +": | capacity | 6 | :\n" +": +-----------+-------+ :\n" +": :\n" +"`- - - - - - - - - - - - - -'\n" +"```" #: src/memory-management/move.md msgid "" @@ -8470,51 +8560,61 @@ msgid "Fill in the missing pieces." msgstr "جا‌های خالی را پر کنید." #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "/// A representation of a software package.\n" -msgstr "" +msgstr "/// A representation of a software package.\n" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "" "/// Return a representation of this package as a dependency, for use in\n" " /// building other packages.\n" msgstr "" +"/// Return a representation of this package as a dependency, for use in\n" +" /// building other packages.\n" #: src/memory-management/exercise.md msgid "\"1\"" -msgstr "" +msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" +"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" #: src/memory-management/exercise.md msgid "\"2\"" msgstr "\"2\"" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "/// Set the package version.\n" -msgstr "" +msgstr "/// Set the package version.\n" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "/// Set the package authors.\n" -msgstr "" +msgstr "/// Set the package authors.\n" #: src/memory-management/exercise.md msgid "\"3\"" msgstr "\"3\"" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "/// Add an additional dependency.\n" -msgstr "" +msgstr "/// Add an additional dependency.\n" #: src/memory-management/exercise.md msgid "\"4\"" msgstr "\"4\"" #: src/memory-management/exercise.md src/memory-management/solution.md +#, fuzzy msgid "/// Set the language. If not set, language defaults to None.\n" -msgstr "" +msgstr "/// Set the language. If not set, language defaults to None.\n" #: src/memory-management/exercise.md msgid "\"5\"" @@ -8526,7 +8626,7 @@ msgstr "\"base64: {base64:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.13\"" -msgstr "" +msgstr "\"0.13\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64: {base64:?}\"" @@ -8538,7 +8638,7 @@ msgstr "\"log\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.4\"" -msgstr "" +msgstr "\"0.4\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log: {log:?}\"" @@ -8546,7 +8646,7 @@ msgstr "\"log: {log:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" -msgstr "" +msgstr "\"serde\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"djmitche\"" @@ -8558,11 +8658,11 @@ msgstr "\"4.0\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde: {serde:?}\"" -msgstr "" +msgstr "\"serde: {serde:?}\"" #: src/memory-management/solution.md msgid "\"0.1\"" -msgstr "" +msgstr "\"0.1\"" #: src/smart-pointers.md msgid "Box" @@ -8604,12 +8704,14 @@ msgstr "" "`Box` دارند:" #: src/smart-pointers/box.md +#, fuzzy msgid "/// A non-empty list: first element and the rest of the list.\n" -msgstr "" +msgstr "/// A non-empty list: first element and the rest of the list.\n" #: src/smart-pointers/box.md +#, fuzzy msgid "/// An empty list.\n" -msgstr "" +msgstr "/// An empty list.\n" #: src/smart-pointers/box.md msgid "\"{list:?}\"" @@ -8636,6 +8738,24 @@ msgid "" "- - - - -'\n" "```" msgstr "" +"```bob\n" +" Stack Heap\n" +".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " +"- - - - -.\n" +": : : :\n" +": " +"list : : :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": : : :\n" +": : : :\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" +"```" #: src/smart-pointers/box.md msgid "" @@ -8897,6 +9017,62 @@ msgid "" "- -'\n" "```" msgstr "" +"```bob\n" +" Stack Heap\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " +"- -.\n" +": : : :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" +": | len | 2 | : | : +-------+-------+ " +"^ :\n" +": | capacity | 2 | : | : ^ " +"| :\n" +": +-----------+-------+ : | : | " +"'-------. :\n" +": : | : | data:" +"\"Dog\"| :\n" +": : | : | +-------+--|-------" +"+ :\n" +"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " +"| :\n" +" `--+-->| o o | o o-|----->| age | 5 " +"| :\n" +" : +-|---+-|---+ +-------+----------" +"+ :\n" +" : | " +"| :\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" +" | |\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" +" : | | " +"vtable :\n" +" : | | +----------------------" +"+ :\n" +" : | `----->| \"::" +"talk\" | :\n" +" : | +----------------------" +"+ :\n" +" : | " +"vtable :\n" +" : | +----------------------" +"+ :\n" +" : '----------->| \"::" +"talk\" | :\n" +" : +----------------------" +"+ :\n" +" : :\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" +"```" #: src/smart-pointers/trait-objects.md msgid "" @@ -8973,27 +9149,34 @@ msgstr "" "مقادیر را به ترتیب (in-order) برگرداند." #: src/smart-pointers/exercise.md src/smart-pointers/solution.md +#, fuzzy msgid "/// A node in the binary tree.\n" -msgstr "" +msgstr "/// A node in the binary tree.\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md +#, fuzzy msgid "/// A possibly-empty subtree.\n" -msgstr "" +msgstr "/// A possibly-empty subtree.\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md +#, fuzzy msgid "" "/// A container storing a set of values, using a binary tree.\n" "///\n" "/// If the same value is added multiple times, it is only stored once.\n" msgstr "" +"/// A container storing a set of values, using a binary tree.\n" +"///\n" +"/// If the same value is added multiple times, it is only stored once.\n" #: src/smart-pointers/exercise.md msgid "// Implement `new`, `insert`, `len`, and `has` for `Subtree`.\n" -msgstr "" +msgstr "// Implement `new`, `insert`, `len`, and `has` for `Subtree`.\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md +#, fuzzy msgid "// not a unique item\n" -msgstr "" +msgstr "// not a unique item\n" #: src/smart-pointers/solution.md src/android/testing/googletest.md msgid "\"bar\"" @@ -9217,8 +9400,9 @@ msgstr "" "نمی‌توانند نقض شوند." #: src/borrowing/interior-mutability.md +#, fuzzy msgid "// Note that `cell` is NOT declared as mutable.\n" -msgstr "" +msgstr "// Note that `cell` is NOT declared as mutable.\n" #: src/borrowing/interior-mutability.md msgid "`RefCell`" @@ -9244,11 +9428,15 @@ msgid "" msgstr "" #: src/borrowing/interior-mutability.md +#, fuzzy msgid "" "// This triggers an error at runtime.\n" " // let other = cell.borrow();\n" " // println!(\"{}\", *other);\n" msgstr "" +"// This triggers an error at runtime.\n" +" // let other = cell.borrow();\n" +" // println!(\"{}\", *other);\n" #: src/borrowing/interior-mutability.md msgid "\"{cell:?}\"" @@ -9337,7 +9525,7 @@ msgstr "" msgid "" "\"Update a user's statistics based on measurements from a visit to the " "doctor\"" -msgstr "" +msgstr "\"به‌روزرسانی آمار یک کاربر بر اساس اندازه‌گیری معبار بازدید از پزشک\"" #: src/borrowing/exercise.md src/borrowing/solution.md #: src/android/build-rules/library.md @@ -9388,8 +9576,9 @@ msgstr "" "پیچیده‌تر می‌شوند." #: src/lifetimes/lifetime-annotations.md +#, fuzzy msgid "// What is the lifetime of p3?\n" -msgstr "" +msgstr "// What is the lifetime of p3?\n" #: src/lifetimes/lifetime-annotations.md msgid "\"p3: {p3:?}\"" @@ -9525,11 +9714,12 @@ msgstr "\"Bye {text}!\"" #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" -msgstr "" +msgstr "\"روباه قهوه‌ای به‌سرعت از روی سگ تنبل می‌پرد.\"" #: src/lifetimes/struct-lifetimes.md +#, fuzzy msgid "// erase(text);\n" -msgstr "" +msgstr "// erase(text);\n" #: src/lifetimes/struct-lifetimes.md msgid "\"{fox:?}\"" @@ -9644,14 +9834,17 @@ msgstr "" "`Person` و `PhoneNumber` پیاده‌سازی کنید." #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// A wire type as seen on the wire.\n" -msgstr "" +msgstr "/// A wire type as seen on the wire.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// The Varint WireType indicates the value is a single VARINT.\n" -msgstr "" +msgstr "/// The Varint WireType indicates the value is a single VARINT.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" " /// little-endian order containing a 64-bit signed integer or double " @@ -9661,38 +9854,56 @@ msgid "" "a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" +"/// The I64 WireType indicates that the value is precisely 8 bytes in\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" +" //I64, -- not needed for this exercise\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" +" /// VARINT followed by exactly that number of bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" " // little-endian order containing a 32-bit signed integer or float " "type.\n" " //I32, -- not needed for this exercise\n" msgstr "" +"// The I32 WireType indicates that the value is precisely 4 bytes in\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" +" //I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// A field's value, typed based on the wire type.\n" -msgstr "" +msgstr "/// A field's value, typed based on the wire type.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "//I64(i64), -- not needed for this exercise\n" -msgstr "" +msgstr "//I64(i64), -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "//I32(i32), -- not needed for this exercise\n" -msgstr "" +msgstr "//I32(i32), -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// A field, containing the field number and its value.\n" -msgstr "" +msgstr "/// A field, containing the field number and its value.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "//1 => WireType::I64, -- not needed for this exercise\n" -msgstr "" +msgstr "//1 => WireType::I64, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "//5 => WireType::I32, -- not needed for this exercise\n" -msgstr "" +msgstr "//5 => WireType::I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid wire type: {value}\"" @@ -9703,9 +9914,8 @@ msgid "\"Expected string to be a `Len` field\"" msgstr "\"انتظار می‌رود که رشته یک فیلد Len باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md -#, fuzzy msgid "\"Invalid string\"" -msgstr "String" +msgstr "\"نامعتبر string\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Expected bytes to be a `Len` field\"" @@ -9716,35 +9926,43 @@ msgid "\"Expected `u64` to be a `Varint` field\"" msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "" "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" msgstr "\"بایت کافی برای varint نیست\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "" "// This is the last byte of the VARINT, so convert it to\n" " // a u64 and return it.\n" msgstr "" +"// This is the last byte of the VARINT, so convert it to\n" +" // a u64 and return it.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "// More than 7 bytes is invalid.\n" -msgstr "" +msgstr "// More than 7 bytes is invalid.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Too many bytes for varint\"" -msgstr "" +msgstr "\"تعداد بایت‌های زیادی برای varint\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// Convert a tag into a field number and a WireType.\n" -msgstr "" +msgstr "/// Convert a tag into a field number and a WireType.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "/// Parse a field, returning the remaining bytes\n" -msgstr "" +msgstr "/// Parse a field, returning the remaining bytes\n" #: src/lifetimes/exercise.md msgid "" @@ -9758,6 +9976,7 @@ msgid "\"Return the field, and any un-consumed bytes.\"" msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md +#, fuzzy msgid "" "/// Parse a message in the given data, calling `T::add_field` for each field " "in\n" @@ -9765,10 +9984,16 @@ msgid "" "///\n" "/// The entire input is consumed.\n" msgstr "" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" +"/// the message.\n" +"///\n" +"/// The entire input is consumed.\n" #: src/lifetimes/exercise.md +#, fuzzy msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" -msgstr "" +msgstr "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" #: src/lifetimes/exercise.md msgid "" @@ -9791,16 +10016,17 @@ msgstr "\"استفاده از len در `usize` معتبر نیست\"" #: src/lifetimes/solution.md msgid "\"Unexpected EOF\"" -msgstr "" +msgstr "\"EOF غیر منتظره\"" #: src/lifetimes/solution.md +#, fuzzy msgid "// skip everything else\n" -msgstr "" +msgstr "// skip everything else\n" #: src/lifetimes/solution.md src/modules/exercise.md src/modules/solution.md #: src/testing/unit-tests.md src/testing/solution.md msgid "\"\"" -msgstr "" +msgstr "\".\"" #: src/lifetimes/solution.md #, fuzzy @@ -9962,6 +10188,9 @@ msgid "" "lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" "std/iter/trait.Iterator.html)." msgstr "" +"گزینه [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator." +"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/" +"iter/trait.Iterator.html) یک مجموعه یا collection بسازید." #: src/iterators/fromiterator.md #, fuzzy @@ -10011,6 +10240,7 @@ msgid "" msgstr "" #: src/iterators/exercise.md src/iterators/solution.md +#, fuzzy msgid "" "/// Calculate the differences between elements of `values` offset by " "`offset`,\n" @@ -10018,6 +10248,11 @@ msgid "" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" +"/// wrapping around from the end of `values` to the beginning.\n" +"///\n" +"/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" #: src/modules.md src/modules/paths.md msgid "use, super, self" @@ -10087,23 +10322,30 @@ msgid "" msgstr "" #: src/modules/filesystem.md +#, fuzzy msgid "" "//! This module implements the garden, including a highly performant " "germination\n" "//! implementation.\n" msgstr "" +"//! This module implements the garden, including a highly performant " +"germination\n" +"//! implementation.\n" #: src/modules/filesystem.md +#, fuzzy msgid "// Re-export types from this module.\n" -msgstr "" +msgstr "// Re-export types from this module.\n" #: src/modules/filesystem.md +#, fuzzy msgid "/// Sow the given seed packets.\n" -msgstr "" +msgstr "/// Sow the given seed packets.\n" #: src/modules/filesystem.md +#, fuzzy msgid "/// Harvest the produce in the garden that is ready.\n" -msgstr "" +msgstr "/// Harvest the produce in the garden that is ready.\n" #: src/modules/filesystem.md msgid "" @@ -10129,7 +10371,7 @@ msgstr "" #: src/modules/filesystem.md msgid "\"some/path.rs\"" -msgstr "" +msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" @@ -10221,7 +10463,7 @@ msgstr "" #: src/modules/paths.md msgid "`foo` or `self::foo` refers to `foo` in the current module," -msgstr "" +msgstr "در واقع `foo` یا `self::foo` به `foo` در ماژول فعلی اشاره دارد،" #: src/modules/paths.md msgid "`super::foo` refers to `foo` in the parent module." @@ -10306,31 +10548,39 @@ msgid "Here's the single-module implementation of the GUI library:" msgstr "" #: src/modules/exercise.md src/modules/solution.md +#, fuzzy msgid "/// Natural width of `self`.\n" -msgstr "" +msgstr "/// Natural width of `self`.\n" #: src/modules/exercise.md src/modules/solution.md +#, fuzzy msgid "/// Draw the widget into a buffer.\n" -msgstr "" +msgstr "/// Draw the widget into a buffer.\n" #: src/modules/exercise.md src/modules/solution.md +#, fuzzy msgid "/// Draw the widget on standard output.\n" -msgstr "" +msgstr "/// Draw the widget on standard output.\n" #: src/modules/exercise.md src/modules/solution.md msgid "\"{buffer}\"" msgstr "\"{buffer}\"" #: src/modules/exercise.md +#, fuzzy msgid "// Add 4 paddings for borders\n" -msgstr "" +msgstr "// Add 4 paddings for borders\n" #: src/modules/exercise.md +#, fuzzy msgid "" "// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " "the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" +" // ?-operator here instead of .unwrap().\n" #: src/modules/exercise.md src/modules/solution.md msgid "\"+-{:-. Then use\n" " // the ?-operator here instead of .unwrap().\n" msgstr "" +"// TODO: after learning about error handling, you can change\n" +" // draw_into to return Result<(), std::fmt::Error>. Then use\n" +" // the ?-operator here instead of .unwrap().\n" #: src/modules/solution.md msgid "// ---- src/main.rs ----\n" -msgstr "" +msgstr "// ---- src/main.rs ----\n" #: src/testing/unit-tests.md msgid "Unit Tests" @@ -10468,9 +10730,8 @@ msgid "" msgstr "" #: src/testing/unit-tests.md -#, fuzzy msgid "\"Hello World\"" -msgstr "سلام دنیا" +msgstr "\"سلام دنیا!\"" #: src/testing/unit-tests.md msgid "This lets you unit test private helpers." @@ -10497,8 +10758,9 @@ msgid "Create a `.rs` file under `tests/`:" msgstr "" #: src/testing/other.md +#, fuzzy msgid "// tests/my_library.rs\n" -msgstr "" +msgstr "// tests/my_library.rs\n" #: src/testing/other.md msgid "These tests only have access to the public API of your crate." @@ -10513,6 +10775,7 @@ msgid "Rust has built-in support for documentation tests:" msgstr "" #: src/testing/other.md +#, fuzzy msgid "" "/// Shortens a string to the given length.\n" "///\n" @@ -10522,6 +10785,13 @@ msgid "" "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" "/// ```\n" msgstr "" +"/// Shortens a string to the given length.\n" +"///\n" +"/// ```\n" +"/// # use playground::shorten_string;\n" +"/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" +"/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" +"/// ```\n" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." @@ -10553,6 +10823,8 @@ msgstr "" #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" +"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب " +"است، درست است؟ {}\"" #: src/testing/lints.md msgid "" @@ -10662,12 +10934,14 @@ msgid "\"8273 1232 7352 0569\"" msgstr "\"8273 1232 7352 0569\"" #: src/testing/solution.md +#, fuzzy msgid "// This is the buggy version that appears in the problem.\n" -msgstr "" +msgstr "// This is the buggy version that appears in the problem.\n" #: src/testing/solution.md +#, fuzzy msgid "// This is the solution and passes all of the tests below.\n" -msgstr "" +msgstr "// This is the solution and passes all of the tests below.\n" #: src/testing/solution.md msgid "\"1234 5678 1234 5670\"" @@ -10679,7 +10953,7 @@ msgstr "\"آیا {cc_number} یک شماره کارت اعتباری معتبر #: src/testing/solution.md msgid "\"yes\"" -msgstr "" +msgstr "\"بله\"" #: src/testing/solution.md msgid "\"no\"" @@ -10691,23 +10965,23 @@ msgstr "\"foo 0 0\"" #: src/testing/solution.md msgid "\" \"" -msgstr "" +msgstr "\" \"" #: src/testing/solution.md msgid "\" \"" -msgstr "" +msgstr "\" \"" #: src/testing/solution.md msgid "\" \"" -msgstr "" +msgstr "\" \"" #: src/testing/solution.md msgid "\"0\"" -msgstr "" +msgstr "\"0\"" #: src/testing/solution.md msgid "\" 0 0 \"" -msgstr "" +msgstr "\" 0 0 \"" #: src/welcome-day-4-afternoon.md #, fuzzy @@ -10741,7 +11015,7 @@ msgstr "" #: src/error-handling/panics.md msgid "\"v[100]: {}\"" -msgstr "" +msgstr "\"v[100]: {}\"" #: src/error-handling/panics.md msgid "Panics are for unrecoverable and unexpected errors." @@ -10898,8 +11172,9 @@ msgid "We can use this to simplify our error handling code:" msgstr "" #: src/error-handling/try.md +#, fuzzy msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" -msgstr "" +msgstr "//fs::write(\"config.dat\", \"alice\").unwrap();\n" #: src/error-handling/try.md src/error-handling/try-conversions.md #: src/error-handling/thiserror-and-anyhow.md @@ -10908,7 +11183,7 @@ msgstr "\"config.dat\"" #: src/error-handling/try.md src/error-handling/try-conversions.md msgid "\"username or error: {username:?}\"" -msgstr "" +msgstr "\"نام‌کاربری یا خطا: {username:?}\"" #: src/error-handling/try.md msgid "Simplify the `read_username` function to use `?`." @@ -10958,8 +11233,9 @@ msgid "\"Found no username in {path}\"" msgstr "\"در این {path} نام کاربری یافت نشد\"" #: src/error-handling/try-conversions.md +#, fuzzy msgid "//std::fs::write(\"config.dat\", \"\").unwrap();\n" -msgstr "" +msgstr "//std::fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" @@ -11073,12 +11349,13 @@ msgid "\"Failed to read\"" msgstr "\"شکست در خواندن\"" #: src/error-handling/thiserror-and-anyhow.md +#, fuzzy msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" -msgstr "" +msgstr "//fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/thiserror-and-anyhow.md msgid "\"Username: {username}\"" -msgstr "" +msgstr "\"نام‌کاربری: {username}\"" #: src/error-handling/thiserror-and-anyhow.md msgid "\"Error: {err:?}\"" @@ -11152,48 +11429,54 @@ msgid "" msgstr "" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// An arithmetic operator.\n" -msgstr "" +msgstr "/// An arithmetic operator.\n" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// A token in the expression language.\n" -msgstr "" +msgstr "/// A token in the expression language.\n" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// An expression in the expression language.\n" -msgstr "" +msgstr "/// An expression in the expression language.\n" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// A reference to a variable.\n" -msgstr "" +msgstr "/// A reference to a variable.\n" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// A literal number.\n" -msgstr "" +msgstr "/// A literal number.\n" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "/// A binary operation.\n" -msgstr "" +msgstr "/// A binary operation.\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'_'" -msgstr "" +msgstr "'_'" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'+'" -msgstr "" +msgstr "'+'" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'-'" -msgstr "" +msgstr "'-'" #: src/error-handling/exercise.md msgid "\"Unexpected character {c}\"" -msgstr "" +msgstr "\"کاراکتر غیرمنتظره {c}\"" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"Unexpected end of input\"" -msgstr "" +msgstr "\"پایان غیرمنتظره در ورودی\"" #: src/error-handling/exercise.md msgid "\"Invalid 32-bit integer'\"" @@ -11201,11 +11484,12 @@ msgstr "\"عدد صحیح 32-bit نامعتبر\"" #: src/error-handling/exercise.md msgid "\"Unexpected token {tok:?}\"" -msgstr "" +msgstr "\"توکن غیرمنتظره {tok:?}\"" #: src/error-handling/exercise.md src/error-handling/solution.md +#, fuzzy msgid "// Look ahead to parse a binary operation if present.\n" -msgstr "" +msgstr "// Look ahead to parse a binary operation if present.\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"10+foo+20-30\"" @@ -11217,15 +11501,15 @@ msgstr "\"{expr:?}\"" #: src/error-handling/solution.md msgid "\"Unexpected character '{0}' in input\"" -msgstr "" +msgstr "\"کاراکتر غیرمنتظره \"{0}\" در ورودی\"" #: src/error-handling/solution.md msgid "\"Tokenizer error: {0}\"" -msgstr "" +msgstr "\"خطای توکن‌سازی: {0}\"" #: src/error-handling/solution.md msgid "\"Unexpected token {0:?}\"" -msgstr "" +msgstr "\"توکن (token) غیرمنتظره {0:?}\"" #: src/error-handling/solution.md msgid "\"Invalid number\"" @@ -11242,12 +11526,15 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" +"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان " +"پذیر نیست." #: src/unsafe-rust/unsafe.md msgid "" "**Unsafe Rust:** can trigger undefined behavior if preconditions are " "violated." msgstr "" +"در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." #: src/unsafe-rust/unsafe.md msgid "" @@ -11309,6 +11596,7 @@ msgid "\"careful!\"" msgstr "\"مراقب باش!\"" #: src/unsafe-rust/dereferencing.md +#, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" " // be non-null and properly aligned, the objects underlying the " @@ -11317,20 +11605,24 @@ msgid "" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" +"// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" +" // from which they were obtained are live throughout the whole unsafe\n" +" // block, and they are not accessed either through the references or\n" +" // concurrently through any other pointers.\n" #: src/unsafe-rust/dereferencing.md -#, fuzzy msgid "\"r1 is: {}\"" -msgstr "\"r1 is: {}\"" +msgstr "\"r1 برابر هست: {}\"" #: src/unsafe-rust/dereferencing.md msgid "\"uhoh\"" -msgstr "" +msgstr "\"اوهو\"" #: src/unsafe-rust/dereferencing.md -#, fuzzy msgid "\"r2 is: {}\"" -msgstr "\"r2 is: {}\"" +msgstr "\"r2 برابر هست: {}\"" #: src/unsafe-rust/dereferencing.md msgid "" @@ -11341,6 +11633,12 @@ msgid "" " println!(\"r3 is: {}\", *r3);\n" " */" msgstr "" +"// NOT SAFE. DO NOT DO THIS.\n" +" /*\n" +" let r3: &String = unsafe { &*r1 };\n" +" drop(s);\n" +" println!(\"r3 is: {}\", *r3);\n" +" */" #: src/unsafe-rust/dereferencing.md msgid "" @@ -11395,13 +11693,12 @@ msgid "It is safe to read an immutable static variable:" msgstr "" #: src/unsafe-rust/mutable-static.md -#, fuzzy msgid "\"Hello, world!\"" -msgstr "سلام دنیا" +msgstr "\"سلام دنیا!\"" #: src/unsafe-rust/mutable-static.md msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" -msgstr "" +msgstr "\"HELLO_WORLD: {HELLO_WORLD}\"" #: src/unsafe-rust/mutable-static.md msgid "" @@ -11410,9 +11707,11 @@ msgid "" msgstr "" #: src/unsafe-rust/mutable-static.md +#, fuzzy msgid "" "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" msgstr "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" #: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" @@ -11489,10 +11788,13 @@ msgid "\"🗻∈🌏\"" msgstr "\"🗻∈🌏\"" #: src/unsafe-rust/unsafe-functions.md +#, fuzzy msgid "" "// SAFETY: The indices are in the correct order, within the bounds of the\n" " // string slice, and lie on UTF-8 sequence boundaries.\n" msgstr "" +"// SAFETY: The indices are in the correct order, within the bounds of the\n" +" // string slice, and lie on UTF-8 sequence boundaries.\n" #: src/unsafe-rust/unsafe-functions.md msgid "\"emoji: {}\"" @@ -11503,14 +11805,17 @@ msgid "\"char count: {}\"" msgstr "\"char count: {}\"" #: src/unsafe-rust/unsafe-functions.md +#, fuzzy msgid "" "// SAFETY: `abs` doesn't deal with pointers and doesn't have any safety\n" " // requirements.\n" msgstr "" +"// SAFETY: `abs` doesn't deal with pointers and doesn't have any safety\n" +" // requirements.\n" #: src/unsafe-rust/unsafe-functions.md msgid "\"Absolute value of -3 according to C: {}\"" -msgstr "" +msgstr "\"مقدار مطلق ۳- طبق C: {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" @@ -11519,6 +11824,10 @@ msgid "" " // println!(\"char count: {}\", count_chars(unsafe {\n" " // emojis.get_unchecked(0..3) }));\n" msgstr "" +"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" +" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" +" // println!(\"char count: {}\", count_chars(unsafe {\n" +" // emojis.get_unchecked(0..3) }));\n" #: src/unsafe-rust/unsafe-functions.md msgid "Writing Unsafe Functions" @@ -11531,6 +11840,7 @@ msgid "" msgstr "" #: src/unsafe-rust/unsafe-functions.md +#, fuzzy msgid "" "/// Swaps the values pointed to by the given pointers.\n" "///\n" @@ -11538,10 +11848,16 @@ msgid "" "///\n" "/// The pointers must be valid and properly aligned.\n" msgstr "" +"/// Swaps the values pointed to by the given pointers.\n" +"///\n" +"/// # Safety\n" +"///\n" +"/// The pointers must be valid and properly aligned.\n" #: src/unsafe-rust/unsafe-functions.md +#, fuzzy msgid "// SAFETY: ...\n" -msgstr "" +msgstr "// SAFETY: ...\n" #: src/unsafe-rust/unsafe-functions.md msgid "\"a = {}, b = {}\"" @@ -11594,15 +11910,20 @@ msgid "" msgstr "" #: src/unsafe-rust/unsafe-traits.md +#, fuzzy msgid "" "/// ...\n" "/// # Safety\n" "/// The type must have a defined representation and no padding.\n" msgstr "" +"/// ...\n" +"/// # Safety\n" +"/// The type must have a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md +#, fuzzy msgid "// SAFETY: `u32` has a defined representation and no padding.\n" -msgstr "" +msgstr "// SAFETY: `u32` has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md msgid "" @@ -11637,15 +11958,15 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" -msgstr "" +msgstr "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" #: src/unsafe-rust/exercise.md msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" -msgstr "" +msgstr "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" #: src/unsafe-rust/exercise.md msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" -msgstr "" +msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" @@ -11667,6 +11988,8 @@ msgid "" "[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" "(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" @@ -11681,6 +12004,8 @@ msgid "" "[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" "(https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" +"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" +"(https://doc.rust-lang.org/std/ffi/struct.CString.html)" #: src/unsafe-rust/exercise.md msgid "NUL-terminated" @@ -11695,6 +12020,8 @@ msgid "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " "[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) و [`OsString`]" +"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" #: src/unsafe-rust/exercise.md msgid "OS-specific" @@ -11723,6 +12050,8 @@ msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" +"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " +"پیدا کند." #: src/unsafe-rust/exercise.md msgid "" @@ -11735,6 +12064,9 @@ msgid "" "`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" +"از `&[u8]` به `&OsStr`: `&OsStr` گامی به سوی `OsString` است، از [`OsStrExt`]" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد " +"آن استفاده کنید،" #: src/unsafe-rust/exercise.md msgid "" @@ -11756,26 +12088,32 @@ msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" -msgstr "" +msgstr "\"macos\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#, fuzzy msgid "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html.\n" -msgstr "" +msgstr "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#, fuzzy msgid "" "// Layout according to the Linux man page for readdir(3), where ino_t and\n" " // off_t are resolved according to the definitions in\n" " // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h}.\n" msgstr "" +"// Layout according to the Linux man page for readdir(3), where ino_t and\n" +" // off_t are resolved according to the definitions in\n" +" // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h}.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#, fuzzy msgid "// Layout according to the macOS man page for dir(5).\n" -msgstr "" +msgstr "// Layout according to the macOS man page for dir(5).\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"x86_64\"" -msgstr "" +msgstr "\"x86_64\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" @@ -11787,29 +12125,40 @@ msgid "" " // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " "PowerPC.\n" msgstr "" +"// See https://github.com/rust-lang/libc/issues/414 and the section on\n" +" // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" +" //\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" msgstr "\"readdir$INODE64\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#, fuzzy msgid "" "// Call opendir and return a Ok value if that worked,\n" " // otherwise return Err with a message.\n" msgstr "" +"// Call opendir and return a Ok value if that worked,\n" +" // otherwise return Err with a message.\n" #: src/unsafe-rust/exercise.md msgid "// Keep calling readdir until we get a NULL pointer back.\n" -msgstr "" +msgstr "// Keep calling readdir until we get a NULL pointer back.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#, fuzzy msgid "// Call closedir as needed.\n" -msgstr "" +msgstr "// Call closedir as needed.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md #: src/android/interoperability/with-c/rust.md msgid "\".\"" -msgstr "" +msgstr "\".\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"files: {:#?}\"" @@ -11820,32 +12169,41 @@ msgid "\"Invalid path: {err}\"" msgstr "\"مسیر نامعتبر: {err}\"" #: src/unsafe-rust/solution.md +#, fuzzy msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" -msgstr "" +msgstr "// SAFETY: path.as_ptr() cannot be NULL.\n" #: src/unsafe-rust/solution.md msgid "\"Could not open {:?}\"" msgstr "\"نمی‌توان {:?} را باز کرد\"" #: src/unsafe-rust/solution.md +#, fuzzy msgid "" "// Keep calling readdir until we get a NULL pointer back.\n" " // SAFETY: self.dir is never NULL.\n" msgstr "" +"// Keep calling readdir until we get a NULL pointer back.\n" +" // SAFETY: self.dir is never NULL.\n" #: src/unsafe-rust/solution.md +#, fuzzy msgid "// We have reached the end of the directory.\n" -msgstr "" +msgstr "// We have reached the end of the directory.\n" #: src/unsafe-rust/solution.md +#, fuzzy msgid "" "// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" " // terminated.\n" msgstr "" +"// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" +" // terminated.\n" #: src/unsafe-rust/solution.md +#, fuzzy msgid "// SAFETY: self.dir is not NULL.\n" -msgstr "" +msgstr "// SAFETY: self.dir is not NULL.\n" #: src/unsafe-rust/solution.md msgid "\"Could not close {:?}\"" @@ -11861,7 +12219,7 @@ msgstr "\"نویسه غیر UTF-8 در مسیر\"" #: src/unsafe-rust/solution.md msgid "\"..\"" -msgstr "" +msgstr "\"..\"" #: src/unsafe-rust/solution.md msgid "\"foo.txt\"" @@ -11869,7 +12227,7 @@ msgstr "\"foo.txt\"" #: src/unsafe-rust/solution.md msgid "\"The Foo Diaries\\n\"" -msgstr "" +msgstr "\"این خاطرات Foo است \\n\"" #: src/unsafe-rust/solution.md msgid "\"bar.png\"" @@ -12135,7 +12493,6 @@ msgid "_hello_rust/Android.bp_:" msgstr "_hello_rust/Android.bp_:" #: src/android/build-rules/binary.md -#, fuzzy msgid "\"hello_rust\"" msgstr "\"hello_rust\"" @@ -12153,13 +12510,13 @@ msgid "//! Rust demo.\n" msgstr "//! Rust demo.\n" #: src/android/build-rules/binary.md src/android/build-rules/library.md +#, fuzzy msgid "/// Prints a greeting to standard output.\n" msgstr "/// Prints a greeting to standard output.\n" #: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md -#, fuzzy msgid "\"Hello from Rust!\"" -msgstr "\"Hello from Rust!\"" +msgstr "\"سلام از Rust!\"" #: src/android/build-rules/binary.md msgid "You can now build, push, and run the binary:" @@ -12209,7 +12566,6 @@ msgstr "" "crates/) عرضه شده است." #: src/android/build-rules/library.md -#, fuzzy msgid "\"hello_rust_with_dep\"" msgstr "\"hello_rust_with_dep\"" @@ -12241,6 +12597,7 @@ msgid "_hello_rust/src/lib.rs_:" msgstr "_hello_rust/src/lib.rs_:" #: src/android/build-rules/library.md +#, fuzzy msgid "//! Greeting library.\n" msgstr "//! Greeting library.\n" @@ -12249,9 +12606,8 @@ msgid "/// Greet `name`.\n" msgstr "/// Greet `name`.\n" #: src/android/build-rules/library.md -#, fuzzy msgid "\"Hello {name}, it is very nice to meet you!\"" -msgstr "\"Hello {name}, it is very nice to meet you!\"" +msgstr "\"سلام {name}، از آشنایی با شما بسیار خوشحالم!\"" #: src/android/build-rules/library.md msgid "You build, push, and run the binary like before:" @@ -12485,6 +12841,7 @@ msgid "_birthday_service/src/server.rs_:" msgstr "_birthday_service/src/server.rs_:" #: src/android/aidl/example-service/server.md +#, fuzzy msgid "//! Birthday service.\n" msgstr "//! Birthday service.\n" @@ -12503,9 +12860,8 @@ msgid "\"birthday_server\"" msgstr "\"birthday_server\"" #: src/android/aidl/example-service/server.md -#, fuzzy msgid "\"src/server.rs\"" -msgstr "سرورها" +msgstr "\"src/server.rs\"" #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md @@ -13056,9 +13412,8 @@ msgstr "" " // object.\n" #: src/android/aidl/types/file-descriptor.md -#, fuzzy msgid "\"Invalid file handle\"" -msgstr "\"Invalid file handle\"" +msgstr "\"کنترل فایل نامعتبر\"" #: src/android/aidl/types/file-descriptor.md msgid "" @@ -13099,7 +13454,6 @@ msgid "\"libleftpad\"" msgstr "\"libleftpad\"" #: src/android/testing.md -#, fuzzy msgid "\"leftpad\"" msgstr "leftpad\"" @@ -13108,7 +13462,6 @@ msgid "\"libleftpad_test\"" msgstr "\"libleftpad_test\"" #: src/android/testing.md -#, fuzzy msgid "\"leftpad_test\"" msgstr "\"leftpad_test\"" @@ -13418,14 +13771,12 @@ msgid "\"rust\"" msgstr "\"rust\"" #: src/android/logging.md -#, fuzzy msgid "\"Starting program.\"" -msgstr "\"Starting program.\"" +msgstr "\"شروع برنامه.\"" #: src/android/logging.md -#, fuzzy msgid "\"Things are going fine.\"" -msgstr "\"Things are going fine.\"" +msgstr "\"کارها خوب پیش می‌رود.\"" #: src/android/logging.md #, fuzzy @@ -13624,9 +13975,8 @@ msgid "Finally, we can use the bindings in our Rust program:" msgstr "در نهایت، می‌توانیم از bindingها در برنامه Rust خود استفاده کنیم:" #: src/android/interoperability/with-c/bindgen.md -#, fuzzy msgid "\"print_birthday_card\"" -msgstr "\"print_birthday_card\"" +msgstr "\"چاپ_کارت_تولد\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"main.rs\"" @@ -13720,9 +14070,8 @@ msgid "\"x ({x}) is smallest!\"" msgstr "\"x ({x}) is smallest!\"" #: src/android/interoperability/with-c/rust.md -#, fuzzy msgid "\"y ({y}) is probably larger than x ({x})\"" -msgstr "\"y ({y}) is probably larger than x ({x})\"" +msgstr "\" مقدارy ({y}) احتمالا بزرگتر از x ({x}) است\"" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.h_" @@ -13842,8 +14191,9 @@ msgstr "\"Rust\"" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/cpp-bridge.md +#, fuzzy msgid "// C++ types and signatures exposed to Rust.\n" -msgstr "" +msgstr "// C++ types and signatures exposed to Rust.\n" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/cpp-bridge.md @@ -14348,7 +14698,7 @@ msgstr "\"system\"" #: src/android/interoperability/java.md msgid "\"Hello, {input}!\"" -msgstr "\"Hello, {input}!\"" +msgstr "\"سلام, {input}!\"" #: src/android/interoperability/java.md msgid "_interoperability/java/Android.bp_:" @@ -14449,7 +14799,6 @@ msgstr "" "commit 1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md -#, fuzzy msgid "" "(A component, debug build is recommended for quickest iteration time. This " "is the default!)" @@ -15936,6 +16285,7 @@ msgid "\"gfx::rust_bindings\"" msgstr "\"gfx::rust_bindings\"" #: src/chromium/interoperability-with-cpp/error-handling-png.md +#, fuzzy msgid "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" @@ -17237,11 +17587,11 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`Future` and `async`/`await`" -msgstr "" +msgstr "`Future` و `async`/`await`" #: src/bare-metal/no_std.md msgid "`fence`, `AtomicBool`, `AtomicPtr`, `AtomicU32`..." -msgstr "" +msgstr "`fence`, `AtomicBool`, `AtomicPtr`, `AtomicU32`..." #: src/bare-metal/no_std.md msgid "`Duration`" @@ -17261,7 +17611,7 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`Error`" -msgstr "" +msgstr "`Error`" #: src/bare-metal/no_std.md msgid "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" @@ -17339,16 +17689,19 @@ msgid "" msgstr "" #: src/bare-metal/alloc.md +#, fuzzy msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" -msgstr "" +msgstr "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" #: src/bare-metal/alloc.md +#, fuzzy msgid "// Give the allocator some memory to allocate.\n" -msgstr "" +msgstr "// Give the allocator some memory to allocate.\n" #: src/bare-metal/alloc.md +#, fuzzy msgid "// Now we can do things that require heap allocation.\n" -msgstr "" +msgstr "// Now we can do things that require heap allocation.\n" #: src/bare-metal/alloc.md #, fuzzy @@ -17414,34 +17767,42 @@ msgid "" msgstr "" #: src/bare-metal/microcontrollers/mmio.md +#, fuzzy msgid "/// GPIO port 0 peripheral address\n" -msgstr "" +msgstr "/// GPIO port 0 peripheral address\n" #: src/bare-metal/microcontrollers/mmio.md +#, fuzzy msgid "// GPIO peripheral offsets\n" -msgstr "" +msgstr "// GPIO peripheral offsets\n" #: src/bare-metal/microcontrollers/mmio.md +#, fuzzy msgid "// PIN_CNF fields\n" -msgstr "" +msgstr "// PIN_CNF fields\n" #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md +#, fuzzy msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" -msgstr "" +msgstr "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" #: src/bare-metal/microcontrollers/mmio.md +#, fuzzy msgid "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" msgstr "" +"// SAFETY: The pointers are to valid peripheral control registers, and no\n" +" // aliases exist.\n" #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md +#, fuzzy msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" -msgstr "" +msgstr "// Set pin 28 low and pin 21 high to turn the LED on.\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" @@ -17466,6 +17827,9 @@ msgid "" "wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" "pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" +"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust " +"عمدتاً ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD]" +"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -17507,6 +17871,10 @@ msgid "" "various peripherals. These generally implement traits from [`embedded-hal`]" "(https://crates.io/crates/embedded-hal)." msgstr "" +"این [crateهای HAL]‌(https://github.com/rust-embedded/wesome-embedded-rust#hal-" +"implementation-crates) برای بسیاری از میکروکنترلرها بسته‌بندی‌هایی را در اطراف " +"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" @@ -17554,12 +17922,14 @@ msgid "The type state pattern" msgstr "" #: src/bare-metal/microcontrollers/type-state.md +#, fuzzy msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" -msgstr "" +msgstr "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md +#, fuzzy msgid "// pin_input.is_high(); // Error, moved.\n" -msgstr "" +msgstr "// pin_input.is_high(); // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" @@ -17647,6 +18017,8 @@ msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" +" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " +"نسخه‌های async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" @@ -17654,12 +18026,17 @@ msgid "" "another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" "crates/nb) crate." msgstr "" +"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد " +"دیگری را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// " +"crates.io/crates/nb) crate است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " "like OpenOCD but better integrated." msgstr "" +"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی " +"جاسازی شده است، مانند OpenOCD است، اما بهتر یکپارچه شده است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -17751,7 +18128,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "[RTIC](https://rtic.rs/)" -msgstr "" +msgstr "[RTIC](https://rtic.rs/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "\"Real-Time Interrupt-driven Concurrency\"" @@ -17764,7 +18141,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" -msgstr "" +msgstr "[Embassy](https://embassy.dev/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "`async` executors with priorities, timers, networking, USB" @@ -17772,7 +18149,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" -msgstr "" +msgstr "[TockOS](https://www.tockos.org/documentation/getting-started)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -17792,7 +18169,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" -msgstr "" +msgstr "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -17933,46 +18310,54 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md msgid "([back to exercise](compass.md))" -msgstr "" +msgstr "([back to exercise](compass.md))" #: src/exercises/bare-metal/solutions-morning.md msgid "// Configure serial port.\n" -msgstr "" +msgstr "// Configure serial port.\n" #: src/exercises/bare-metal/solutions-morning.md +#, fuzzy msgid "// Use the system timer as a delay provider.\n" -msgstr "" +msgstr "// Use the system timer as a delay provider.\n" #: src/exercises/bare-metal/solutions-morning.md +#, fuzzy msgid "// Set up the I2C controller and Inertial Measurement Unit.\n" -msgstr "" +msgstr "// Set up the I2C controller and Inertial Measurement Unit.\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"Setting up IMU...\"" -msgstr "" +msgstr "\"راه اندازی IMU...\"" #: src/exercises/bare-metal/solutions-morning.md +#, fuzzy msgid "// Set up display and timer.\n" -msgstr "" +msgstr "// Set up display and timer.\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"Ready.\"" msgstr "\"آماده.\"" #: src/exercises/bare-metal/solutions-morning.md +#, fuzzy msgid "// Read compass data and log it to the serial port.\n" -msgstr "" +msgstr "// Read compass data and log it to the serial port.\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"{},{},{}\\t{},{},{}\"" msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md +#, fuzzy msgid "" "// If button A is pressed, switch to the next mode and briefly blink all " "LEDs\n" " // on.\n" msgstr "" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" +" // on.\n" #: src/bare-metal/aps.md msgid "Application processors" @@ -18080,6 +18465,78 @@ msgid "" " b 2b\n" "```" msgstr "" +"```armasm\n" +".section .init.entry, \"ax\"\n" +".global entry\n" +"entry:\n" +" /*\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" +" * caches.\n" +" */\n" +" adrp x30, idmap\n" +" msr ttbr0_el1, x30\n" +"\n" +" mov_i x30, .Lmairval\n" +" msr mair_el1, x30\n" +"\n" +" mov_i x30, .Ltcrval\n" +" /* Copy the supported PA range into TCR_EL1.IPS. */\n" +" mrs x29, id_aa64mmfr0_el1\n" +" bfi x30, x29, #32, #4\n" +"\n" +" msr tcr_el1, x30\n" +"\n" +" mov_i x30, .Lsctlrval\n" +"\n" +" /*\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" +" * potentially stale local TLB entries before they start being used.\n" +" */\n" +" isb\n" +" tlbi vmalle1\n" +" ic iallu\n" +" dsb nsh\n" +" isb\n" +"\n" +" /*\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" +" * has completed.\n" +" */\n" +" msr sctlr_el1, x30\n" +" isb\n" +"\n" +" /* Disable trapping floating point access in EL1. */\n" +" mrs x30, cpacr_el1\n" +" orr x30, x30, #(0x3 << 20)\n" +" msr cpacr_el1, x30\n" +" isb\n" +"\n" +" /* Zero out the bss section. */\n" +" adr_l x29, bss_begin\n" +" adr_l x30, bss_end\n" +"0: cmp x29, x30\n" +" b.hs 1f\n" +" stp xzr, xzr, [x29], #16\n" +" b 0b\n" +"\n" +"1: /* Prepare the stack. */\n" +" adr_l x30, boot_stack_end\n" +" mov sp, x30\n" +"\n" +" /* Set up exception vector. */\n" +" adr x30, vector_table_el1\n" +" msr vbar_el1, x30\n" +"\n" +" /* Call into Rust code. */\n" +" bl main\n" +"\n" +" /* Loop forever waiting for interrupts. */\n" +"2: wfi\n" +" b 2b\n" +"```" #: src/bare-metal/aps/entry-point.md msgid "" @@ -19454,7 +19911,6 @@ msgid "Bare Metal Rust Afternoon" msgstr "بعدازظهربا Bare Metal Rust" #: src/exercises/bare-metal/solutions-afternoon.md -#, fuzzy msgid "([back to exercise](rtc.md))" msgstr "([back to exercise](rtc.md))" @@ -19478,7 +19934,6 @@ msgid "/// The IRQ used by the PL031 RTC.\n" msgstr "/// The IRQ used by the PL031 RTC.\n" #: src/exercises/bare-metal/solutions-afternoon.md -#, fuzzy msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" msgstr "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" @@ -19518,7 +19973,6 @@ msgid "\"Waiting for {}\"" msgstr "\"Waiting for {}\"" #: src/exercises/bare-metal/solutions-afternoon.md -#, fuzzy msgid "\"matched={}, interrupt_pending={}\"" msgstr "\"matched={}, interrupt_pending={}\"" @@ -20162,7 +20616,7 @@ msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." #: src/concurrency/send-sync/examples.md msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." -msgstr "`i8`, `f32`, `bool`, `char`, `&str`, ..." +msgstr "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." #: src/concurrency/send-sync/examples.md msgid "`String`, `Option`, `Vec`, `Box`, ..." @@ -20567,6 +21021,7 @@ msgid "// Create philosophers\n" msgstr "// Create philosophers\n" #: src/concurrency/sync-exercises/dining-philosophers.md +#, fuzzy msgid "// Make each of them think and eat 100 times\n" msgstr "// Make each of them think and eat 100 times\n" @@ -20919,6 +21374,8 @@ msgid "" "`.await` asynchronously waits for the completion of another operation. " "Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" +"همیشه `await` به طور ناهمزمان (asyn) منتظر تکمیل یک عملیات دیگر است. برخلاف " +"`block_on` یک `await` معمولاً thread فعلی را مسدود نمی‌کند." #: src/concurrency/async/async-await.md msgid "" @@ -21081,7 +21538,6 @@ msgid "\"Count in task: {i}!\"" msgstr "\"شمارش task: {i}!\"" #: src/concurrency/async/runtimes/tokio.md -#, fuzzy msgid "\"Main task: {i}\"" msgstr "\"Main task: {i}\"" @@ -21142,7 +21598,6 @@ msgid "\"127.0.0.1:0\"" msgstr "\"127.0.0.1:0\"" #: src/concurrency/async/tasks.md -#, fuzzy msgid "\"listening on port {}\"" msgstr "\"listening on port {}\"" @@ -21162,9 +21617,8 @@ msgid "\"socket error\"" msgstr "\"socket error\"" #: src/concurrency/async/tasks.md -#, fuzzy msgid "\"Thanks for dialing in, {name}!\\n\"" -msgstr "\"Thanks for dialing in, {name}!\\n\"" +msgstr "\"از تماس تلفنی متشکریم، {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md msgid "" @@ -21216,14 +21670,12 @@ msgstr "" "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md -#, fuzzy msgid "\"Received {count} pings so far.\"" -msgstr "\"Received {count} pings so far.\"" +msgstr "\"تاکنون {count} عدد ping دریافت شده است.\"" #: src/concurrency/async-control-flow/channels.md -#, fuzzy msgid "\"ping_handler complete\"" -msgstr "\"ping_handler complete\"" +msgstr "\"ping_handler کامل‌شده‌است\"" #: src/concurrency/async-control-flow/channels.md #, fuzzy @@ -21287,17 +21739,14 @@ msgstr "" "در JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md -#, fuzzy msgid "\"https://google.com\"" msgstr "\"https://google.com\"" #: src/concurrency/async-control-flow/join.md -#, fuzzy msgid "\"https://httpbin.org/ip\"" msgstr "\"https://httpbin.org/ip\"" #: src/concurrency/async-control-flow/join.md -#, fuzzy msgid "\"https://play.rust-lang.org/\"" msgstr "\"https://play.rust-lang.org/\"" @@ -21371,7 +21820,7 @@ msgstr "\"{msg}\"" #: src/concurrency/async-control-flow/select.md msgid "\"timeout\"" -msgstr "" +msgstr "\"timeout\"" #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -21573,9 +22022,8 @@ msgid "\"failed waiting for response\"" msgstr "\"failed waiting for response\"" #: src/concurrency/async-pitfalls/pin.md -#, fuzzy msgid "\"work result for iteration {i}: {resp}\"" -msgstr "\"Welcome to chat! Type a message\"" +msgstr "\"نتیجه کار برای تکرار {i}: {resp}\"" #: src/concurrency/async-pitfalls/pin.md msgid "" @@ -21787,12 +22235,10 @@ msgid "\"not UTF-8\"" msgstr "\"not UTF-8\"" #: src/concurrency/async-pitfalls/cancellation.md -#, fuzzy msgid "\"hi\\nthere\\n\"" msgstr "\"hi\\nthere\\n\"" #: src/concurrency/async-pitfalls/cancellation.md -#, fuzzy msgid "\"tick!\"" msgstr "\"tick!\"" @@ -22108,15 +22554,13 @@ msgstr "\"127.0.0.1:2000\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md -#, fuzzy msgid "\"listening on port 2000\"" msgstr "\"listening on port 2000\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md -#, fuzzy msgid "\"New connection from {addr:?}\"" -msgstr "\"New connection from {addr:?}\"" +msgstr "\"اتصال جدید از {addr:?}\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md @@ -22214,14 +22658,12 @@ msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "// tx is dropped here, so we don't need to explicitly drop it later\n" #: src/concurrency/async-exercises/solutions.md -#, fuzzy msgid "\"Here is a thought: {thought}\"" -msgstr "\"Here is a thought: {thought}\"" +msgstr "\"در اینجا یک ایده وجود دارد: {thought}\"" #: src/concurrency/async-exercises/solutions.md -#, fuzzy msgid "\"Welcome to chat! Type a message\"" -msgstr "\"Welcome to chat! Type a message\"" +msgstr "\"به chat خوش آمدید! یک پیام تایپ کنید\"" #: src/concurrency/async-exercises/solutions.md #, fuzzy From 7dcd08803bbc2eabbf072ec9a220a814263472a8 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 13 Sep 2024 23:35:51 +0330 Subject: [PATCH 78/92] fa: Scattered reforms part 2b --- po/fa.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/fa.po b/po/fa.po index 4f157e097fd..263355b2150 100644 --- a/po/fa.po +++ b/po/fa.po @@ -9700,7 +9700,7 @@ msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" -msgstr "طول عمر در ساختمان داده" +msgstr "Lifetimes in Data Structures" #: src/lifetimes/struct-lifetimes.md msgid "" @@ -9714,7 +9714,7 @@ msgstr "\"Bye {text}!\"" #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" -msgstr "\"روباه قهوه‌ای به‌سرعت از روی سگ تنبل می‌پرد.\"" +msgstr "\"The quick brown fox jumps over the lazy dog.\"" #: src/lifetimes/struct-lifetimes.md #, fuzzy From 961019aa9d571249b044d62a195677bed663e5b5 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 16 Sep 2024 01:07:54 +0330 Subject: [PATCH 79/92] fa: Scattered reforms part 3 --- po/fa.po | 136 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 86 insertions(+), 50 deletions(-) diff --git a/po/fa.po b/po/fa.po index 263355b2150..250e1755fa5 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-13 23:14+0330\n" +"PO-Revision-Date: 2024-09-16 01:06+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -558,11 +558,11 @@ msgstr "" #: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md msgid "`Iterator`" -msgstr "" +msgstr "`Iterator`" #: src/SUMMARY.md src/iterators/intoiterator.md msgid "`IntoIterator`" -msgstr "" +msgstr "`IntoIterator`" #: src/SUMMARY.md msgid "`FromIterator`" @@ -893,7 +893,7 @@ msgstr "تمرین‌ها" #: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md msgid "`rust_gtest_interop` Library" -msgstr "" +msgstr "`rust_gtest_interop` Library" #: src/SUMMARY.md src/chromium/testing/build-gn.md msgid "GN Rules for Rust Tests" @@ -901,7 +901,7 @@ msgstr "" #: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md msgid "`chromium::import!` Macro" -msgstr "" +msgstr "`chromium::import!` Macro" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md #, fuzzy @@ -1001,7 +1001,7 @@ msgstr "با Bare Metal: صبح" #: src/SUMMARY.md src/bare-metal/no_std.md msgid "`no_std`" -msgstr "" +msgstr "`no_std`" #: src/SUMMARY.md msgid "A Minimal Example" @@ -1037,7 +1037,7 @@ msgstr "انواع State Pattern" #: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md msgid "`embedded-hal`" -msgstr "" +msgstr "`embedded-hal`" #: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md #, fuzzy @@ -1130,7 +1130,7 @@ msgstr "`aarch64-paging`" #: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md msgid "`buddy_system_allocator`" -msgstr "" +msgstr "`buddy_system_allocator`" #: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md msgid "`tinyvec`" @@ -1138,7 +1138,7 @@ msgstr "" #: src/SUMMARY.md src/bare-metal/useful-crates/spin.md msgid "`spin`" -msgstr "" +msgstr "`spin`" #: src/SUMMARY.md #, fuzzy @@ -1190,7 +1190,7 @@ msgstr "کانال‌های محدود" #: src/SUMMARY.md src/concurrency/send-sync.md msgid "`Send` and `Sync`" -msgstr "" +msgstr "`Send` و `Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/marker-traits.md @@ -1200,11 +1200,11 @@ msgstr "صفت‌های بیشتر" #: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" -msgstr "" +msgstr "`Send`" #: src/SUMMARY.md src/concurrency/send-sync/sync.md msgid "`Sync`" -msgstr "" +msgstr "`Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/examples.md @@ -1218,11 +1218,11 @@ msgstr "ناحیه‌های مشترک" #: src/SUMMARY.md src/concurrency/shared-state/arc.md msgid "`Arc`" -msgstr "" +msgstr "`Arc`" #: src/SUMMARY.md src/concurrency/shared-state/mutex.md msgid "`Mutex`" -msgstr "" +msgstr "`Mutex`" #: src/SUMMARY.md src/memory-management/review.md #: src/error-handling/try-conversions.md src/concurrency/shared-state.md @@ -1253,7 +1253,7 @@ msgstr "مبانی Async" #: src/SUMMARY.md src/concurrency/async/async-await.md msgid "`async`/`await`" -msgstr "" +msgstr "`async`/`await`" #: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md msgid "Futures" @@ -1305,7 +1305,7 @@ msgstr "مسدود کردن Executor" #: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md msgid "`Pin`" -msgstr "" +msgstr "`Pin`" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/async-traits.md @@ -4674,6 +4674,8 @@ msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" +" `Direction` یک type با گونه‌های مختلف است. دو مقدار `Direction` وجود دارد: " +"`Direction::Left` و `Direction::Right`." #: src/user-defined-types/enums.md msgid "" @@ -4772,7 +4774,7 @@ msgstr "" #: src/user-defined-types/const.md msgid "`const`" -msgstr "" +msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy @@ -4818,7 +4820,7 @@ msgstr "" #: src/user-defined-types/static.md msgid "`static`" -msgstr "" +msgstr "`static`" #: src/user-defined-types/static.md msgid "" @@ -5638,7 +5640,7 @@ msgstr "\"جایزه بزرگ موناکو\"" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" -msgstr "" +msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" @@ -10125,6 +10127,11 @@ msgid "" "and `&[T]`. Ranges also implement it. This is why you can iterate over a " "vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" +"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه " +"(collection) توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند " +"`&Vec` و `&[T]` پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین " +"دلیل است که می‌توانید روی یک بردار با `برای i در some_vec { .. }` تکرار کنید، " +"اما درنهایت `some_vec.next()`وجود ندارد." #: src/iterators/intoiterator.md msgid "" @@ -10146,11 +10153,12 @@ msgstr "" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," -msgstr "" +msgstr "ء `Item`: نوعی که باید تکرار شود، مانند `i8`،" #: src/iterators/intoiterator.md msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." msgstr "" +" `IntoIter`: یک «Iterator» تایپ است که با متد `into_iter` برگردانده شده است." #: src/iterators/intoiterator.md msgid "" @@ -10199,7 +10207,7 @@ msgstr "\"prime_squares: {prime_squares:?}\"" #: src/iterators/fromiterator.md msgid "`Iterator` implements" -msgstr "" +msgstr "پیاده‌سازی `Iterator`" #: src/iterators/fromiterator.md msgid "There are two ways to specify `B` for this method:" @@ -10308,11 +10316,11 @@ msgstr "" #: src/modules/filesystem.md msgid "`src/lib.rs` (for a library crate)" -msgstr "" +msgstr "`src/lib.rs` (for a library crate)" #: src/modules/filesystem.md msgid "`src/main.rs` (for a binary crate)" -msgstr "" +msgstr "`src/main.rs` (for a binary crate)" #: src/modules/filesystem.md msgid "" @@ -10479,7 +10487,7 @@ msgstr "" #: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." -msgstr "" +msgstr "یک `bar::foo` به `foo` در `bar` crate اشاره دارد." #: src/modules/paths.md msgid "" @@ -11335,6 +11343,8 @@ msgid "" "`anyhow` is often used by applications to help with error handling in " "functions, including adding contextual information to your errors." msgstr "" +" اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " +"اطلاعات متنی به خطاهای شما، استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "\"Found no username in {0}\"" @@ -11363,7 +11373,7 @@ msgstr "\"Error: {err:?}\"" #: src/error-handling/thiserror-and-anyhow.md msgid "`thiserror`" -msgstr "" +msgstr "`thiserror`" #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11381,7 +11391,7 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow`" -msgstr "" +msgstr "`anyhow`" #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11389,10 +11399,13 @@ msgid "" "it's again generally not a good choice for the public API of a library, but " "is widely used in applications." msgstr "" +" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " +"ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " +"در برنامه‌های مختلف استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." -msgstr "" +msgstr "`anyhow::Result`یک type مستعار برای است`Result`." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11412,6 +11425,9 @@ msgid "" "`Option` types. `use anyhow::Context` is necessary to enable `.context()` " "and `.with_context()` on those types." msgstr "" +"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و " +"`Option` پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `." +"context()` و `.with_context()` در آن typeها ضروری است." #: src/error-handling/exercise.md msgid "" @@ -11872,6 +11888,12 @@ msgid "" "might violate Rust's memory model, but in general any C function might have " "undefined behaviour under any arbitrary circumstances." msgstr "" +"تابع `get_unchecked`، مانند اکثر توابع `_unchecked`، ناامن است، زیرا اگر در " +"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: " +"این یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است " +"که آن توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه " +"Rust را نقض کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه " +"رفتار نامشخصی داشته باشد." #: src/unsafe-rust/unsafe-functions.md msgid "" @@ -13174,7 +13196,7 @@ msgstr "بولین‌ها`boolean`" #: src/android/aidl/types/primitives.md msgid "`byte`" -msgstr "" +msgstr "`byte`" #: src/android/aidl/types/primitives.md msgid "`i8`" @@ -15093,7 +15115,7 @@ msgstr "" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." -msgstr "`cargo`, `rustfmt`, ب." +msgstr "`cargo`, `rustfmt`,سایر موارد." #: src/chromium/cargo.md msgid "" @@ -17555,11 +17577,11 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`core`" -msgstr "" +msgstr "`core`" #: src/bare-metal/no_std.md msgid "`std`" -msgstr "" +msgstr "`std`" #: src/bare-metal/no_std.md msgid "Slices, `&str`, `CStr`" @@ -17567,19 +17589,19 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`NonZeroU8`..." -msgstr "" +msgstr "`net`" #: src/bare-metal/no_std.md msgid "`Option`, `Result`" -msgstr "" +msgstr "`Option`, `Result`" #: src/bare-metal/no_std.md msgid "`Display`, `Debug`, `write!`..." -msgstr "" +msgstr "`Display`, `Debug`, `write!`..." #: src/bare-metal/no_std.md msgid "`panic!`, `assert_eq!`..." -msgstr "" +msgstr "`panic!`, `assert_eq!`..." #: src/bare-metal/no_std.md msgid "`NonNull` and all the usual pointer-related functions" @@ -17595,11 +17617,11 @@ msgstr "`fence`, `AtomicBool`, `AtomicPtr`, `AtomicU32`..." #: src/bare-metal/no_std.md msgid "`Duration`" -msgstr "" +msgstr "`Duration`" #: src/bare-metal/no_std.md msgid "`Box`, `Cow`, `Arc`, `Rc`" -msgstr "" +msgstr "`Box`, `Cow`, `Arc`, `Rc`" #: src/bare-metal/no_std.md msgid "`Vec`, `BinaryHeap`, `BtreeMap`, `LinkedList`, `VecDeque`" @@ -17607,7 +17629,7 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`String`, `CString`, `format!`" -msgstr "" +msgstr "`String`, `CString`, `format!`" #: src/bare-metal/no_std.md msgid "`Error`" @@ -17615,11 +17637,12 @@ msgstr "`Error`" #: src/bare-metal/no_std.md msgid "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" -msgstr "" +msgstr "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" #: src/bare-metal/no_std.md +#, fuzzy msgid "`File` and the rest of `fs`" -msgstr "" +msgstr "یک `File` و بقیه در `fs`." #: src/bare-metal/no_std.md msgid "`println!`, `Read`, `Write`, `Stdin`, `Stdout` and the rest of `io`" @@ -17627,15 +17650,15 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`Path`, `OsString`" -msgstr "" +msgstr "`Path`, `OsString`" #: src/bare-metal/no_std.md msgid "`net`" -msgstr "" +msgstr "`net`" #: src/bare-metal/no_std.md msgid "`Command`, `Child`, `ExitCode`" -msgstr "" +msgstr "`Command`, `Child`, `ExitCode`" #: src/bare-metal/no_std.md msgid "`spawn`, `sleep` and the rest of `thread`" @@ -17643,11 +17666,11 @@ msgstr "" #: src/bare-metal/no_std.md msgid "`SystemTime`, `Instant`" -msgstr "" +msgstr "`SystemTime`, `Instant`" #: src/bare-metal/no_std.md msgid "`HashMap` depends on RNG." -msgstr "" +msgstr "یک `HashMap` به RNG وابسته است." #: src/bare-metal/no_std.md msgid "`std` re-exports the contents of both `core` and `alloc`." @@ -17714,6 +17737,9 @@ msgid "" "system allocator. Other crates are available, or you can write your own or " "hook into your existing allocator." msgstr "" +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/alloc.md msgid "" @@ -17733,6 +17759,8 @@ msgid "" "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " "crate is linked in so we get its panic handler." msgstr "" +"برای اطمینان از اینکه `panic_halt` crate لینک شده است، استفاده `extern crate " +"panic_halt as _` ضروری است، بنابراین panic handler آن را دریافت می‌کنیم." #: src/bare-metal/alloc.md msgid "This example will build but not run, as it doesn't have an entry point." @@ -17878,7 +17906,7 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" -msgstr "" +msgstr "// Create HAL wrapper for GPIO port 0.\n" #: src/bare-metal/microcontrollers/hals.md msgid "" @@ -17915,7 +17943,7 @@ msgstr "" #: src/bare-metal/microcontrollers/board-support.md msgid "`microbit-v2` includes a simple driver for the LED matrix." -msgstr "" +msgstr "ء `microbit-v2` شامل یک درایور ساده برای ماتریس LED است." #: src/bare-metal/microcontrollers/type-state.md msgid "The type state pattern" @@ -18057,6 +18085,9 @@ msgid "" "(Real Time Transfers) output and connect GDB. It's configured by an `Embed." "toml` file in your project directory." msgstr "" +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18065,6 +18096,11 @@ msgid "" "CoreSight Debug Access Port of various Arm Cortex processors. It's what the " "on-board debugger on the BBC micro:bit uses." msgstr "" +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک " +"پروتکل استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی " +"به پورت CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد " +"استفاده قرار گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از " +"آن استفاده می‌کند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18145,7 +18181,7 @@ msgstr "[Embassy](https://embassy.dev/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "`async` executors with priorities, timers, networking, USB" -msgstr "" +msgstr "اجرا کننده‌های `async` اولویت‌دار، تایمرها، شبکه، USB" #: src/bare-metal/microcontrollers/other-projects.md msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" @@ -20767,8 +20803,8 @@ msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" -"‏'Arc::clone()' هزینه عملیات atomic را دارد که اجرا می‌شود، اما پس از آن " -"استفاده از `T` آزاد است." +"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن " +"استفاده از 'T' آزاد است." #: src/concurrency/shared-state/arc.md msgid "" From 6fc3a188ee32f9b6053a0a5b2d05dcce1cb1cb34 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 21 Sep 2024 20:13:48 +0330 Subject: [PATCH 80/92] fa: Try to complete Farsi part1 --- po/fa.po | 299 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 236 insertions(+), 63 deletions(-) diff --git a/po/fa.po b/po/fa.po index 250e1755fa5..792e70a27b7 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-16 01:06+0330\n" +"PO-Revision-Date: 2024-09-21 20:09+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -625,11 +625,11 @@ msgstr "مدیریت خطا" #: src/SUMMARY.md src/error-handling.md src/error-handling/panics.md msgid "Panics" -msgstr "" +msgstr "در مورد Panicها" #: src/SUMMARY.md src/error-handling.md src/error-handling/try.md msgid "Try Operator" -msgstr "" +msgstr "عملگرد Try" #: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md msgid "Try Conversions" @@ -714,7 +714,7 @@ msgstr "رابط (Interface)" #: src/SUMMARY.md msgid "Service API" -msgstr "" +msgstr "Service API" #: src/SUMMARY.md #, fuzzy @@ -749,7 +749,7 @@ msgstr "انواع" #: src/SUMMARY.md src/android/aidl/types/primitives.md msgid "Primitive Types" -msgstr "" +msgstr "انواع اولیه" #: src/SUMMARY.md src/android/aidl/types/arrays.md #, fuzzy @@ -768,7 +768,7 @@ msgstr "متغیرها" #: src/SUMMARY.md src/android/aidl/types/file-descriptor.md msgid "Sending Files" -msgstr "" +msgstr "ارسال فایل‌ها" #: src/SUMMARY.md src/android/testing/googletest.md msgid "GoogleTest" @@ -804,11 +804,11 @@ msgstr "با C++" #: src/SUMMARY.md src/android/interoperability/cpp/bridge.md msgid "The Bridge Module" -msgstr "" +msgstr "ماژول پل" #: src/SUMMARY.md msgid "Rust Bridge" -msgstr "" +msgstr "Rust Bridge" #: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md msgid "Generated C++" @@ -820,11 +820,11 @@ msgstr "" #: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md msgid "Shared Types" -msgstr "" +msgstr "انواع مشترک" #: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md msgid "Shared Enums" -msgstr "" +msgstr "Shared Enums" #: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md msgid "Rust Error Handling" @@ -872,7 +872,7 @@ msgstr "" #: src/SUMMARY.md msgid "Policy" -msgstr "" +msgstr "قواعد" #: src/SUMMARY.md #, fuzzy @@ -957,7 +957,7 @@ msgstr "" #: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md msgid "Resolving Problems" -msgstr "" +msgstr "حل مشکلات" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md @@ -976,7 +976,7 @@ msgstr "" #: src/SUMMARY.md msgid "Reviews and Audits" -msgstr "" +msgstr "بررسی‌ها و ممیزی‌ها" #: src/SUMMARY.md msgid "Checking into Chromium Source Code" @@ -1017,7 +1017,7 @@ msgstr "میکروکنترلرها" #: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md msgid "Raw MMIO" -msgstr "Raw MMIO" +msgstr "MMIO خام" #: src/SUMMARY.md msgid "PACs" @@ -2242,6 +2242,9 @@ msgid "" "may provide an outdated version. Therefore, it is recommended to install " "Rust from the official site." msgstr "" +"در macOS، می‌توانید از [Homebrew](https://brew.sh/) برای نصب Rust استفاده " +"کنید، اما ممکن است یک نسخه قدیمی باشد. بنابراین توصیه می شود Rust را از سایت " +"رسمی نصب کنید." #: src/cargo/rust-ecosystem.md msgid "The Rust Ecosystem" @@ -4581,7 +4584,7 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" -msgstr "" +msgstr "\"({}, {})\"" #: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" @@ -4603,6 +4606,9 @@ msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" +"\n" +"‏Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " +"اولیه (primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." @@ -4625,10 +4631,12 @@ msgid "" "Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "for instance using booleans as integers." msgstr "" +"Rust معمولاً چیزهای غیر واضح را دوست ندارد، مانند automatic unwrapping یا " +"به‌عنوان‌مثال استفاده از booleanها به عنوان اعداد صحیح." #: src/user-defined-types/tuple-structs.md msgid "Operator overloading is discussed on Day 3 (generics)." -msgstr "" +msgstr "مبحث Operator overloading در روز سوم مورد بحث قرار می گیرد (generics)." #: src/user-defined-types/tuple-structs.md msgid "" @@ -4709,6 +4717,7 @@ msgstr "" #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." msgstr "" +"Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" @@ -6491,7 +6500,7 @@ msgstr "Option" #: src/std-types.md src/std-types/result.md src/error-handling.md msgid "Result" -msgstr "Result" +msgstr "نتیجه" #: src/std-types.md src/std-types/string.md msgid "String" @@ -6657,7 +6666,7 @@ msgstr "\"Löwe 老虎 Léopard Gepardi\"" #: src/std-types/option.md msgid "'é'" -msgstr "" +msgstr "'é'" #: src/std-types/option.md msgid "\"find returned {position:?}\"" @@ -7351,12 +7360,17 @@ msgstr "" "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." #: src/std-traits/operators.md +#, fuzzy msgid "" "The `Not` trait (`!` operator) is notable because it does not \"boolify\" " "like the same operator in C-family languages; instead, for integer types it " "negates each bit of the number, which arithmetically is equivalent to " "subtracting it from -1: `!5 == -6`." msgstr "" +"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در " +"زبان‌های خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، " +"هر بیت از عدد را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == " +"-6` است." #: src/std-traits/from-and-into.md #, fuzzy @@ -10056,6 +10070,8 @@ msgstr "به روز ۱ خوش آمدید" msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" +"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش " +"خواهیم داد:" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." @@ -10066,7 +10082,6 @@ msgid "Modules and visibility." msgstr "" #: src/welcome-day-4.md -#, fuzzy msgid "Testing." msgstr "تست‌کردن" @@ -10106,6 +10121,11 @@ msgid "" "method and provides lots of methods. Many standard library types implement " "`Iterator`, and you can implement it yourself, too:" msgstr "" +"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"از تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` " +"نیاز دارد و متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد " +"`Iterator` را پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی " +"کنید:" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" @@ -10119,6 +10139,10 @@ msgid "" "functions should produce the code as efficient as equivalent imperative " "implementations." msgstr "" +"ویژگی `Iterator` بسیاری از عملیات برنامه‌نویسی تابعی رایج را روی collectionها " +"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که " +"در آن می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع " +"باید کد را به اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." #: src/iterators/iterator.md msgid "" @@ -10140,6 +10164,10 @@ msgid "" "iter/trait.IntoIterator.html) defines how to create an iterator for a type. " "It is used automatically by the `for` loop." msgstr "" +"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، " +"_iterate_ کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص " +"می‌کند. به طور خودکار توسط حلقه `for` استفاده می‌شود." #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" @@ -10165,6 +10193,9 @@ msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" +"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده " +"(iterator) باید همان `Item` type را داشته باشد، به این معنی که " +"`Option` را برمی‌گرداند." #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." @@ -10175,6 +10206,8 @@ msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" +"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ " +"توجه داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." #: src/iterators/intoiterator.md msgid "" @@ -10273,6 +10306,8 @@ msgstr "" #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" +"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت " +"داشته باشیم:" #: src/modules/modules.md msgid "\"In the foo module\"" @@ -10287,6 +10322,8 @@ msgid "" "Packages provide functionality and include a `Cargo.toml` file that " "describes how to build a bundle of 1+ crates." msgstr "" +"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` " +"می‌شوند که نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." #: src/modules/modules.md msgid "" @@ -10301,7 +10338,7 @@ msgstr "" #: src/modules/filesystem.md msgid "" "Omitting the module content will tell Rust to look for it in another file:" -msgstr "" +msgstr "حذف محتوای ماژول به Rust می‌گوید که آن را در فایل دیگری جستجو کند:" #: src/modules/filesystem.md msgid "" @@ -10312,7 +10349,7 @@ msgstr "" #: src/modules/filesystem.md msgid "The `crate` root is in:" -msgstr "" +msgstr "ریشه`crate` در:" #: src/modules/filesystem.md msgid "`src/lib.rs` (for a library crate)" @@ -10397,7 +10434,7 @@ msgstr "" #: src/modules/visibility.md msgid "Parent and sibling items are always visible." -msgstr "" +msgstr "کزینه‌های sibling و sibling همیشه قابل مشاهده است." #: src/modules/visibility.md msgid "" @@ -10436,6 +10473,8 @@ msgid "" "See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" "privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" +"این آدرس با ببینید [Rust Reference](https://doc.rust-lang.org/reference/" +"visibility-and-privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." #: src/modules/visibility.md msgid "Configuring `pub(crate)` visibility is a common pattern." @@ -10463,7 +10502,7 @@ msgstr "مسیر" #: src/modules/paths.md msgid "Paths are resolved as follows:" -msgstr "" +msgstr "مسیرها (Paths) به شرح زیر حل می‌شوند:" #: src/modules/paths.md msgid "As a relative path:" @@ -10516,6 +10555,9 @@ msgid "" "discouraged because it is not clear which items are imported, and those " "might change over time." msgstr "" +"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع " +"شده است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر " +"کنند." #: src/modules/exercise.md msgid "" @@ -10549,7 +10591,7 @@ msgstr "" #: src/modules/exercise.md msgid "Source" -msgstr "" +msgstr "منبع" #: src/modules/exercise.md msgid "Here's the single-module implementation of the GUI library:" @@ -10720,7 +10762,7 @@ msgstr "تست‌های واحد (Unit Tests)" #: src/testing/unit-tests.md msgid "Rust and Cargo come with a simple unit test framework:" -msgstr "" +msgstr "Rust and Cargo با یک چارچوب تست واحد ساده ارائه می شود:" #: src/testing/unit-tests.md msgid "Unit tests are supported throughout your code." @@ -10736,6 +10778,9 @@ msgid "" "`tests` module, using `#[cfg(test)]` to conditionally compile them only when " "building tests." msgstr "" +"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` " +"تودرتو قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت " +"مشروط تنها در هنگام build تست‌ها کامپایل کنند." #: src/testing/unit-tests.md msgid "\"Hello World\"" @@ -10748,10 +10793,11 @@ msgstr "" #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." msgstr "" +"ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." -msgstr "" +msgstr "تست‌ها را در playground اجرا کنید تا نتیجه‌های آن‌ها را نشان‌دهید." #: src/testing/other.md msgid "Integration Tests" @@ -10820,6 +10866,9 @@ msgid "" "Test the above code on the [Rust Playground](https://play.rust-lang.org/?" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" +"کد بالا را در [Rust Playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " +"تست کنید." #: src/testing/lints.md msgid "" @@ -10840,6 +10889,9 @@ msgid "" "visible here, but those will not be shown once the code compiles. Switch to " "the Playground site to show those lints." msgstr "" +"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل " +"مشاهده هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن " +"lintها به سایت Playground بروید." #: src/testing/lints.md msgid "" @@ -10853,6 +10905,8 @@ msgid "" "Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " "or via your editor." msgstr "" +"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با " +"`cargo fix` یا از طریق ویرایشگر خود برطرف کرد." #: src/testing/exercise.md msgid "Luhn Algorithm" @@ -11007,7 +11061,7 @@ msgstr "صفت‌های بیشتر" #: src/error-handling.md msgid "thiserror and anyhow" -msgstr "" +msgstr "thiserror و anyhow" #: src/error-handling.md src/error-handling/exercise.md msgid "Exercise: Rewriting with Result" @@ -11015,11 +11069,11 @@ msgstr "" #: src/error-handling/panics.md msgid "Rust handles fatal errors with a \"panic\"." -msgstr "" +msgstr "Rust خطاهای مهلک را با \"panic\" کنترل می‌کند." #: src/error-handling/panics.md msgid "Rust will trigger a panic if a fatal error happens at runtime:" -msgstr "" +msgstr "اگر یک خطای مرگبار در زمان اجرا رخ دهد، Rust باعث panic می‌شود:" #: src/error-handling/panics.md msgid "\"v[100]: {}\"" @@ -11027,15 +11081,15 @@ msgstr "\"v[100]: {}\"" #: src/error-handling/panics.md msgid "Panics are for unrecoverable and unexpected errors." -msgstr "" +msgstr "استفاده از Panicها برای خطاهای غیر قابل جبران و غیرمنتظره است." #: src/error-handling/panics.md msgid "Panics are symptoms of bugs in the program." -msgstr "" +msgstr "پانیک‌ها علائم باگ در برنامه هستند." #: src/error-handling/panics.md msgid "Runtime failures like failed bounds checks can panic" -msgstr "" +msgstr "خرابی‌های زمان اجرا مانند failed bounds checkها می‌تواند باعث panic شود" #: src/error-handling/panics.md msgid "Assertions (such as `assert!`) panic on failure" @@ -11043,7 +11097,7 @@ msgstr "" #: src/error-handling/panics.md msgid "Purpose-specific panics can use the `panic!` macro." -msgstr "" +msgstr "پنیک‌های خاص می‌توانند از ماکرو `panic!` استفاده کنند." #: src/error-handling/panics.md msgid "" @@ -11096,6 +11150,9 @@ msgid "" "doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " "saw when discussing standard library types." msgstr "" +"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-" +"lang.org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث " +"در مورد تایپ‌های کتابخانه استاندارد مشاهده کردیم." #: src/error-handling/result.md msgid "" @@ -11170,6 +11227,10 @@ msgid "" "The try-operator `?` is used to return errors to the caller. It lets you " "turn the common" msgstr "" +"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» " +"مدیریت می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` " +"برای برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا " +"موارد مشترک را بازگردانید." #: src/error-handling/try.md msgid "into the much simpler" @@ -11195,11 +11256,11 @@ msgstr "\"نام‌کاربری یا خطا: {username:?}\"" #: src/error-handling/try.md msgid "Simplify the `read_username` function to use `?`." -msgstr "" +msgstr "تابع `read_username` را برای استفاده از `?` ساده کنید." #: src/error-handling/try.md msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." -msgstr "" +msgstr "متغیر`username` می تواند `Ok(string)` یا `Err(error)` باشد." #: src/error-handling/try.md msgid "" @@ -11214,6 +11275,10 @@ msgid "" "The executable will print the `Err` variant and return a nonzero exit status " "on error." msgstr "" +"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را " +"پیاده‌سازی کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است " +"که `E` پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند " +"و در صورت خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." #: src/error-handling/try-conversions.md msgid "" @@ -11223,7 +11288,7 @@ msgstr "" #: src/error-handling/try-conversions.md msgid "works the same as" -msgstr "" +msgstr "به طو مشابه کار می‌کند" #: src/error-handling/try-conversions.md msgid "" @@ -11231,6 +11296,9 @@ msgid "" "type returned by the function. This makes it easy to encapsulate errors into " "higher-level errors." msgstr "" +"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را " +"به نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح " +"بالاتر کپسوله شوند." #: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" @@ -11253,6 +11321,11 @@ msgid "" "of type `Result` if `ErrorOuter` and `ErrorInner` are the " "same type or if `ErrorOuter` implements `From`." msgstr "" +"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به " +"این معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` " +"را برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا " +"اگر `ErrorOuter` از` را پیاده‌سازی کند." #: src/error-handling/try-conversions.md msgid "" @@ -11285,6 +11358,9 @@ msgid "" "Error` trait makes it easy to create a trait object that can contain any " "error." msgstr "" +"گاهی اوقات می‌خواهیم اجازه دهیم هر نوع خطای بدون نوشتن enum خودمان که تمام " +"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد " +"یک object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." #: src/error-handling/error.md msgid "\"count.dat\"" @@ -11307,6 +11383,8 @@ msgid "" "The `read_count` function can return `std::io::Error` (from file operations) " "or `std::num::ParseIntError` (from `String::parse`)." msgstr "" +"تابع `read_count`می‌تواند `std::io::Error` (از عملیات فایل) یا `std::num::" +"ParseIntError` (از `String::parse`) را برگرداند." #: src/error-handling/error.md msgid "" @@ -11331,6 +11409,9 @@ msgid "" "The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" "anyhow/) crates are widely used to simplify error handling." msgstr "" +"این [`thiserror`](https://docs.rs/thiserror/) و [`anyhow`](https://docs.rs/" +"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده " +"می‌شوند." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11380,10 +11461,12 @@ msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" +"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید " +"زیادی برای کمک به تعریف انواع خطا به روشی فشرده است." #: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." -msgstr "" +msgstr "ویژگی `std::error::Error` به طور خودکار مشتق می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "The message from `#[error]` is used to derive the `Display` trait." @@ -11703,6 +11786,10 @@ msgid "" "has the `'static` lifetime, so `r3` has type `&'static String`, and thus " "outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" +"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` " +"دارای طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است " +"و بنابراین عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت " +"بسیار دارد." #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" @@ -11854,6 +11941,8 @@ msgid "" "You can mark your own functions as `unsafe` if they require particular " "conditions to avoid undefined behaviour." msgstr "" +"اگر عملکردهای خود را برای جلوگیری از رفتار نامشخص به شرایط خاصی نیاز دارند، " +"می‌توانید به‌عنوان`unsafe` علامت‌گذاری کنید." #: src/unsafe-rust/unsafe-functions.md #, fuzzy @@ -11900,6 +11989,8 @@ msgid "" "The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" +"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس " +"هستند](https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe-rust/unsafe-functions.md msgid "" @@ -11914,6 +12005,10 @@ msgid "" "Try adding it and see what happens. This will likely change in a future Rust " "edition." msgstr "" +"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. " +"ما می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. " +"سعی کنید آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه " +"بعدی Rust تغییر خواهد کرد." #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" @@ -11957,7 +12052,7 @@ msgstr "" msgid "" "The actual safety section for `AsBytes` is rather longer and more " "complicated." -msgstr "" +msgstr "بخش ایمنی واقعی برای `AsBytes` نسبتا طولانی‌تر و پیچیده‌تر است." #: src/unsafe-rust/unsafe-traits.md msgid "The built-in `Send` and `Sync` traits are unsafe." @@ -11976,7 +12071,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "You will want to consult the manual pages:" -msgstr "" +msgstr "شما می‌خواهید به صفحات راهنما مراجعه کنید:" #: src/unsafe-rust/exercise.md msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" @@ -11995,7 +12090,7 @@ msgid "" "You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" "ffi/) module. There you find a number of string types which you need for the " "exercise:" -msgstr "" +msgstr "همچنین می‌خواهید [`std::ffi`](https://doc.rust-lang.or) را مرور کنید" #: src/unsafe-rust/exercise.md msgid "Encoding" @@ -12003,7 +12098,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "Use" -msgstr "" +msgstr "استفاده" #: src/unsafe-rust/exercise.md msgid "" @@ -12019,7 +12114,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "Text processing in Rust" -msgstr "" +msgstr "پردازش متن در Rust" #: src/unsafe-rust/exercise.md msgid "" @@ -12031,7 +12126,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "NUL-terminated" -msgstr "" +msgstr "NUL-terminated" #: src/unsafe-rust/exercise.md msgid "Communicating with C functions" @@ -12047,7 +12142,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "OS-specific" -msgstr "" +msgstr "مخصوص سیستم‌عامل" #: src/unsafe-rust/exercise.md msgid "Communicating with the OS" @@ -12055,7 +12150,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "You will convert between all these types:" -msgstr "" +msgstr "شما بین تمام این typeها تبدیل خواهید کرد:" #: src/unsafe-rust/exercise.md msgid "" @@ -12101,6 +12196,8 @@ msgid "" "The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " "useful chapter about FFI." msgstr "" +"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل " +"بسیار مفید در مورد FFI دارد." #: src/unsafe-rust/exercise.md msgid "" @@ -16603,7 +16700,9 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" -msgstr "برخی از سؤالاتی که ممکن است با آن مواجه شوید:" +msgstr "" +"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با " +"آن مواجه شوید:" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -17535,6 +17634,8 @@ msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" +"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون " +"سیستم‌عامل در ادامه به چند بخش تقسیم خواهد شد:" #: src/bare-metal.md msgid "What is `no_std` Rust?" @@ -17542,15 +17643,15 @@ msgstr "" #: src/bare-metal.md msgid "Writing firmware for microcontrollers." -msgstr "" +msgstr "نوشتنfirmware برای میکروکنترلرها." #: src/bare-metal.md msgid "Writing bootloader / kernel code for application processors." -msgstr "" +msgstr "نوشتن کد bootloader / kernel برای پردازنده‌های برنامه." #: src/bare-metal.md msgid "Some useful crates for bare-metal Rust development." -msgstr "" +msgstr "برخی از crateهای مفید برای توسعه bare-metal Rust." #: src/bare-metal.md msgid "" @@ -17565,6 +17666,8 @@ msgstr "" msgid "" "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" +"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس " +"یا دبیان:" #: src/bare-metal.md msgid "" @@ -17573,7 +17676,7 @@ msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" -msgstr "" +msgstr "در MacOS:" #: src/bare-metal/no_std.md msgid "`core`" @@ -17585,7 +17688,7 @@ msgstr "`std`" #: src/bare-metal/no_std.md msgid "Slices, `&str`, `CStr`" -msgstr "" +msgstr "Slices, `&str`, `CStr`" #: src/bare-metal/no_std.md msgid "`NonZeroU8`..." @@ -17682,7 +17785,7 @@ msgstr "" #: src/bare-metal/minimal.md msgid "This will compile to an empty binary." -msgstr "" +msgstr "این به یک باینری خالی کامپایل می‌شود." #: src/bare-metal/minimal.md msgid "`std` provides a panic handler; without it we must provide our own." @@ -17704,12 +17807,17 @@ msgid "" "define your own entry point. This will typically involve a linker script and " "some assembly code to set things up ready for Rust code to run." msgstr "" +"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما " +"بستگی دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker " +"و مقداری کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." #: src/bare-metal/alloc.md msgid "" "To use `alloc` you must implement a [global (heap) allocator](https://doc." "rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" +"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-" +"lang.org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." #: src/bare-metal/alloc.md #, fuzzy @@ -17771,22 +17879,28 @@ msgid "" "The `cortex_m_rt` crate provides (among other things) a reset handler for " "Cortex M microcontrollers." msgstr "" +"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای " +"میکروکنترلرهای Cortex M فراهم می‌کند." #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" +"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع " +"بررسی خواهیم کرد." #: src/bare-metal/microcontrollers.md msgid "" "The `cortex_m_rt::entry` macro requires that the function have type `fn() -" "> !`, because returning to the reset handler doesn't make sense." msgstr "" +"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::" +"entry` باشد، زیرا بازگشت به reset handler منطقی نیست." #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" -msgstr "" +msgstr "مثال را با `cargo embed --bin minimal` اجرا کنید" #: src/bare-metal/microcontrollers/mmio.md msgid "" @@ -17843,11 +17957,11 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" -msgstr "" +msgstr "مثال را با:" #: src/bare-metal/microcontrollers/pacs.md msgid "Peripheral Access Crates" -msgstr "" +msgstr "Crateهای دسترسی جانبی" #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -17864,6 +17978,9 @@ msgid "" "SVD (System View Description) files are XML files typically provided by " "silicon vendors which describe the memory map of the device." msgstr "" +"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً " +"توسط فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را " +"توصیف می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -17877,6 +17994,9 @@ msgid "" "which patch the mistakes, add missing details, and publish the generated " "crates." msgstr "" +"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد " +"که اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید " +"شده را منتشر می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." @@ -17964,6 +18084,9 @@ msgid "" "Pins don't implement `Copy` or `Clone`, so only one instance of each can " "exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" +"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام " +"می‌تواند وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس " +"دیگری نمی تواند آن را بگیرد." #: src/bare-metal/microcontrollers/type-state.md msgid "" @@ -17985,6 +18108,8 @@ msgid "" "You can call `is_high` on an input pin and `set_high` on an output pin, but " "not vice-versa." msgstr "" +"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی " +"فراخوانی کنید، اما برعکس امکان پذیر نیست." #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." @@ -17995,6 +18120,8 @@ msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" +"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی " +"ویژگی را ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" @@ -18002,7 +18129,7 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "PWM" -msgstr "" +msgstr "PWM" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "Delay timers" @@ -18019,6 +18146,10 @@ msgid "" "can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" "crates.io/crates/rand_core) respectively." msgstr "" +"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم " +"شدن به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-" +"can`](https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates." +"io/crates/rand_core) به ترتیب." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" @@ -18026,6 +18157,10 @@ msgid "" "awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " "accelerometer driver might need an I2C or SPI device instance." msgstr "" +"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-" +"embedded-rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به " +"عنوان مثال. یک درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز " +"داشته باشد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" @@ -18070,6 +18205,7 @@ msgstr "" msgid "" "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" +"SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" @@ -18107,6 +18243,8 @@ msgid "" "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " "is a range from SEGGER." msgstr "" +"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link " +"محدوده ای از SEGGER است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18119,6 +18257,8 @@ msgid "" "probe-rs is a library which you can integrate into your own tools if you " "want to." msgstr "" +"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود " +"ادغام کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18126,6 +18266,9 @@ msgid "" "adapter-protocol/) lets VSCode and other IDEs debug code running on any " "supported microcontroller." msgstr "" +"[پروتکل آداپتور Debug مایکروسافت](https://microsoft.github.io/debug-adapter-" +"protocol/) به VSCode و سایر IDE‌ها اجازه می‌دهد کدهای موجود در هر میکروکنترلر " +"پشتیبانی‌شده را Debug کنند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." @@ -18136,6 +18279,8 @@ msgid "" "RTT (Real Time Transfers) is a mechanism to transfer data between the debug " "host and the target through a number of ringbuffers." msgstr "" +"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و " +"target از طریق تعدادی بافر حلقه‌ای (ringbuffers) است." #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" @@ -18151,7 +18296,7 @@ msgstr "" #: src/bare-metal/microcontrollers/debugging.md msgid "On gLinux or Debian:" -msgstr "" +msgstr "در gLinux یا Debian:" #: src/bare-metal/microcontrollers/debugging.md msgid "In GDB, try running:" @@ -18160,7 +18305,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md #: src/bare-metal/aps/other-projects.md msgid "Other projects" -msgstr "" +msgstr "پروژه‌های دیگر" #: src/bare-metal/microcontrollers/other-projects.md msgid "[RTIC](https://rtic.rs/)" @@ -18174,6 +18319,8 @@ msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" msgid "" "Shared resource management, message passing, task scheduling, timer queue" msgstr "" +"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر " +"(timer queue)" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" @@ -18192,6 +18339,8 @@ msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" +"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از " +"حافظه" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" @@ -18212,10 +18361,14 @@ msgid "" "Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." "github.io/book/overview/using-the-standard-library.html)." msgstr "" +"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-" +"rs.github.io/book/overview/using-the-standard-library.html)." #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" +"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر " +"گرفت." #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." @@ -18284,6 +18437,7 @@ msgstr "" msgid "" "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" +"TWI نام دیگری برای I2C است، بنابراین دستگاه جانبی اصلی I2C TWIM نامیده می‌شود." #: src/exercises/bare-metal/compass.md msgid "" @@ -18297,6 +18451,9 @@ msgid "" "You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" "struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" +"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/" +"microbit/struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف " +"دارید." #: src/exercises/bare-metal/compass.md msgid "" @@ -18313,7 +18470,7 @@ msgstr "" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_src/main.rs_:" -msgstr "" +msgstr "_src/main.rs_:" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_Cargo.toml_ (you shouldn't need to change this):" @@ -18329,12 +18486,13 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "See the serial output on Linux with:" -msgstr "" +msgstr "مشاهده خروجی سریال در لینوکس با:" #: src/exercises/bare-metal/compass.md msgid "" "Or on Mac OS something like (the device name may be slightly different):" msgstr "" +"یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." @@ -18406,6 +18564,10 @@ msgid "" "with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" "virt.html) board." msgstr "" +"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا " +"بیایید سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's " +"aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " +"کار می‌کنیم." #: src/bare-metal/aps.md msgid "" @@ -18420,6 +18582,9 @@ msgid "" "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" +"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی " +"می کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای " +"ماشین‌های مجازی طراحی شده است." #: src/bare-metal/aps/entry-point.md msgid "" @@ -20249,6 +20414,8 @@ msgid "" "Spawning new threads does not automatically delay program termination at the " "end of `main`." msgstr "" +"ایجاد threadهای جدید به طور خودکار خاتمه برنامه را تا پایان `main` به تاخیر " +"نمی‌اندازد." #: src/concurrency/threads/plain.md msgid "Thread panics are independent of each other." @@ -20444,13 +20611,16 @@ msgstr "" #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" -msgstr "" +msgstr "این بخش باید حدود ۲۰ دقیقه طول بکشد. این شامل:" #: src/concurrency/channels/senders-receivers.md msgid "" "Rust channels have two parts: a `Sender` and a `Receiver`. The two " "parts are connected via the channel, but you only see the end-points." msgstr "" +"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از " +"طریق channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را " +"می‌بینید." #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" @@ -20471,7 +20641,7 @@ msgstr "" #: src/concurrency/channels/unbounded.md msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" -msgstr "" +msgstr "شما یک کانال نامحدود و ناهمزمان با `mpsc::channel()` دریافت می کنید:" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Message {i}\"" @@ -20519,7 +20689,7 @@ msgstr "ارسال" #: src/concurrency/send-sync.md msgid "Sync" -msgstr "همگام سازی" +msgstr "همگام‌سازی" #: src/concurrency/send-sync/marker-traits.md msgid "" @@ -21873,6 +22043,9 @@ msgid "" "or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " "does the `send` also fail in this situation?" msgstr "" +"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async " +"یا به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر " +"دهید تا شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" #: src/concurrency/async-control-flow/select.md msgid "" From bcb90f29c6e29cbd2c1a6b01fe89b1a770c423d9 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 21 Sep 2024 20:14:11 +0330 Subject: [PATCH 81/92] Try to complete Farsi Part1 --- po/fa.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index 792e70a27b7..b124444ed1a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-21 20:09+0330\n" +"PO-Revision-Date: 2024-09-21 20:11+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -4606,8 +4606,7 @@ msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" -"\n" -"‏Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " +"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " "اولیه (primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md From 845d2d4dfa2ae8e91c195ddfc80938628c241be3 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 24 Sep 2024 00:15:27 +0330 Subject: [PATCH 82/92] fa: Try to complete Farsi part2 --- po/fa.po | 179 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 121 insertions(+), 58 deletions(-) diff --git a/po/fa.po b/po/fa.po index b124444ed1a..730cb9758c8 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-21 20:11+0330\n" +"PO-Revision-Date: 2024-09-24 00:14+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -570,7 +570,7 @@ msgstr "`FromIterator`" #: src/SUMMARY.md src/iterators.md src/iterators/exercise.md msgid "Exercise: Iterator Method Chaining" -msgstr "" +msgstr "تمرین: روش Iterator Chaining" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4.md src/modules.md src/modules/modules.md @@ -591,7 +591,7 @@ msgstr "" #: src/SUMMARY.md src/modules.md src/modules/exercise.md msgid "Exercise: Modules for a GUI Library" -msgstr "" +msgstr "تمرین: ماژولهایی برای کتابخانه رابط کاربری گرافیکی" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4.md src/testing.md src/chromium/testing.md @@ -645,7 +645,7 @@ msgstr "" #: src/SUMMARY.md msgid "Exercise: Rewriting with `Result`" -msgstr "" +msgstr "تمرین: بازنویسی با «نتیجه»." #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4-afternoon.md src/unsafe-rust.md src/unsafe-rust/unsafe.md @@ -658,7 +658,7 @@ msgstr "ناایمن" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/dereferencing.md msgid "Dereferencing Raw Pointers" -msgstr "" +msgstr "عدم ارجاع به اشاره‌گرهای خام" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/mutable-static.md msgid "Mutable Static Variables" @@ -678,7 +678,7 @@ msgstr "صفات (Traits) ناامن" #: src/SUMMARY.md src/unsafe-rust.md msgid "Exercise: FFI Wrapper" -msgstr "" +msgstr "تمرین: FFI Wrapper" #: src/SUMMARY.md src/bare-metal/android.md msgid "Android" @@ -706,7 +706,7 @@ msgstr "AIDL" #: src/SUMMARY.md src/android/aidl/birthday-service.md msgid "Birthday Service Tutorial" -msgstr "" +msgstr "آموزش سرویس Birthday" #: src/SUMMARY.md msgid "Interface" @@ -727,7 +727,7 @@ msgstr "سرور" #: src/SUMMARY.md src/android/aidl/example-service/deploy.md msgid "Deploy" -msgstr "دیپلوی" +msgstr "استقرار" #: src/SUMMARY.md msgid "Client" @@ -772,7 +772,7 @@ msgstr "ارسال فایل‌ها" #: src/SUMMARY.md src/android/testing/googletest.md msgid "GoogleTest" -msgstr "" +msgstr "GoogleTest" #: src/SUMMARY.md src/android/testing/mocking.md msgid "Mocking" @@ -816,7 +816,7 @@ msgstr "" #: src/SUMMARY.md msgid "C++ Bridge" -msgstr "" +msgstr "پل ++C " #: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md msgid "Shared Types" @@ -832,7 +832,7 @@ msgstr "مدیریت خطا Rust" #: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md msgid "C++ Error Handling" -msgstr "مدیریت خطا C++" +msgstr "مدیریت خطا ++C " #: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" @@ -840,15 +840,15 @@ msgstr "" #: src/SUMMARY.md msgid "Building for Android: C++" -msgstr "" +msgstr "روش Build برای اندروید: ++C" #: src/SUMMARY.md msgid "Building for Android: Genrules" -msgstr "" +msgstr "روش Build برای اندروید: ژانرها" #: src/SUMMARY.md msgid "Building for Android: Rust" -msgstr "" +msgstr "روش Build برای اندروید: Rust" #: src/SUMMARY.md msgid "With Java" @@ -864,11 +864,11 @@ msgstr "تمرین‌ها" #: src/SUMMARY.md msgid "Chromium" -msgstr "" +msgstr "Chromium" #: src/SUMMARY.md src/chromium/cargo.md msgid "Comparing Chromium and Cargo Ecosystems" -msgstr "" +msgstr "مقایسه Chromium و اکوسیستم Cargo" #: src/SUMMARY.md msgid "Policy" @@ -881,7 +881,7 @@ msgstr "Rust ناایمن" #: src/SUMMARY.md src/chromium/build-rules/depending.md msgid "Depending on Rust Code from Chromium C++" -msgstr "" +msgstr "بسته به Rust Code از ++Chromium C" #: src/SUMMARY.md src/chromium/build-rules/vscode.md msgid "Visual Studio Code" @@ -897,7 +897,7 @@ msgstr "`rust_gtest_interop` Library" #: src/SUMMARY.md src/chromium/testing/build-gn.md msgid "GN Rules for Rust Tests" -msgstr "" +msgstr "قواعد GN برای تست‌های Rust" #: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md msgid "`chromium::import!` Macro" @@ -939,21 +939,21 @@ msgstr "" #: src/SUMMARY.md msgid "Configuring Cargo.toml" -msgstr "" +msgstr "پیکربندی Cargo.toml" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "Configuring `gnrt_config.toml`" -msgstr "" +msgstr "تنظیمات `gnrt_config.toml`" #: src/SUMMARY.md src/chromium/adding-third-party-crates/downloading-crates.md msgid "Downloading Crates" -msgstr "" +msgstr "دانلود کردن Crateها" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Generating `gn` Build Rules" -msgstr "" +msgstr "ایجاد قواعد `gn` Build." #: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md msgid "Resolving Problems" @@ -962,17 +962,17 @@ msgstr "حل مشکلات" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "Build Scripts Which Generate Code" -msgstr "" +msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کنند." #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" -msgstr "" +msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" -msgstr "" +msgstr "وابسته به یک Crate" #: src/SUMMARY.md msgid "Reviews and Audits" @@ -980,7 +980,7 @@ msgstr "بررسی‌ها و ممیزی‌ها" #: src/SUMMARY.md msgid "Checking into Chromium Source Code" -msgstr "" +msgstr "کد‌های Chromium را بررسی کنید." #: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "Keeping Crates Up to Date" @@ -988,7 +988,7 @@ msgstr "" #: src/SUMMARY.md msgid "Bringing It Together - Exercise" -msgstr "" +msgstr "دور همی تمرین کنید" #: src/SUMMARY.md src/exercises/chromium/solutions.md #, fuzzy @@ -1334,7 +1334,7 @@ msgstr "سپاس!" #. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md msgid "Glossary" -msgstr "واژه نامه" +msgstr "واژه‌نامه" #: src/SUMMARY.md msgid "Other Resources" @@ -1553,7 +1553,7 @@ msgstr "" #: src/running-the-course.md msgid "Before you run the course, you will want to:" -msgstr "قبل از اجرای دوره، شما می خواهید:" +msgstr "قبل از اجرای دوره، شما می‌خواهید:" #: src/running-the-course.md msgid "" @@ -4912,7 +4912,7 @@ msgstr "// Aliases are more useful with long, complex types:\n" #: src/user-defined-types/aliases.md msgid "C programmers will recognize this as similar to a `typedef`." -msgstr "" +msgstr "برنامه‌نویسان C این را شبیه به `typedef` تشخیص می‌دهند." #: src/user-defined-types/exercise.md msgid "" @@ -7222,7 +7222,7 @@ msgstr "Read and Write" #: src/std-traits.md msgid "Default, struct update syntax" -msgstr "" +msgstr "به طور پیش‌فرض، ساختار به‌روزرسانی syntax" #: src/std-traits.md msgid "" @@ -7730,6 +7730,10 @@ msgid "" "then exclusive reference, then by move). The `move` keyword forces capture " "by value." msgstr "" +"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با " +"کمترین سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس " +"با انتقال) capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت " +"value اجباری می‌کند." #: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" @@ -8250,7 +8254,7 @@ msgstr "" #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" -msgstr "کپی‌های تدافعی در C++ مدرن" +msgstr "نسخههای دفاعی در ++C مدرن" #: src/memory-management/move.md msgid "Modern C++ solves this differently:" @@ -9441,6 +9445,8 @@ msgid "" "By implementing `Deref` (and `DerefMut` for `RefMut`), these types allow " "calling methods on the inner value without allowing references to escape." msgstr "" +"با پیاده‌سازی `Deref` (و `DerefMut` برای `RefMut`)، این تایپ‌ها امکان فراخوانی " +"متدها روی مقدار داخلی را بدون اجازه خروج ارجاع‌ها فراهم می‌کنند." #: src/borrowing/interior-mutability.md #, fuzzy @@ -10086,7 +10092,7 @@ msgstr "تست‌کردن" #: src/welcome-day-4.md msgid "Error handling: panics, `Result`, and the try operator `?`." -msgstr "" +msgstr "رسیدگی به خطا: panics در `Result` و اپراتور تلاش مجدد `?`." #: src/welcome-day-4.md msgid "" @@ -10177,6 +10183,8 @@ msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" +"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع " +"را اعلام کند:" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," @@ -10278,6 +10286,9 @@ msgid "" "pass. Use an iterator expression and `collect` the result to construct the " "return value." msgstr "" +"کد زیر را در کپی کنید و تست ها را قبول کنید. از " +"یک عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) " +"کنید تا مقدار بازگشتی را بسازید." #: src/iterators/exercise.md src/iterators/solution.md #, fuzzy @@ -10329,6 +10340,8 @@ msgid "" "Crates are a tree of modules, where a binary crate creates an executable and " "a library crate compiles to a library." msgstr "" +"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل " +"اجرایی ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." @@ -10396,6 +10409,8 @@ msgid "" "Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " "`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" +"قبل از Rust 2018، ماژول‌ها باید به جای `module.rs` در `module/mod.rs` قرار " +"می‌گرفتند و این هنوز یک جایگزین کارآمد برای نسخه‌های بعد از 2018 است." #: src/modules/filesystem.md msgid "" @@ -10406,6 +10421,8 @@ msgstr "" #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" +"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول " +"اصلی یک فایل باشد:" #: src/modules/filesystem.md msgid "" @@ -10440,6 +10457,8 @@ msgid "" "In other words, if an item is visible in module `foo`, it's visible in all " "the descendants of `foo`." msgstr "" +"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه " +"فرزندان`foo` قابل مشاهده است." #: src/modules/visibility.md msgid "\"outer::private\"" @@ -10477,7 +10496,7 @@ msgstr "" #: src/modules/visibility.md msgid "Configuring `pub(crate)` visibility is a common pattern." -msgstr "" +msgstr "پیکربندی قابل نمایش بودن `pub(crate)` یک الگوی رایج است." #: src/modules/visibility.md msgid "Less commonly, you can give visibility to a specific path." @@ -10488,6 +10507,7 @@ msgid "" "In any case, visibility must be granted to an ancestor module (and all of " "its descendants)." msgstr "" +"در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." #: src/modules/paths.md msgid "" @@ -10594,7 +10614,7 @@ msgstr "منبع" #: src/modules/exercise.md msgid "Here's the single-module implementation of the GUI library:" -msgstr "" +msgstr "در اینجا اجرای تک ماژول کتابخانه GUI آمده است:" #: src/modules/exercise.md src/modules/solution.md #, fuzzy @@ -10808,7 +10828,7 @@ msgstr "" #: src/testing/other.md msgid "Create a `.rs` file under `tests/`:" -msgstr "" +msgstr "یک فایل `.rs` در زیر `tests/` بسازید:" #: src/testing/other.md #, fuzzy @@ -10849,6 +10869,7 @@ msgstr "" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." msgstr "" +"بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." @@ -11064,7 +11085,7 @@ msgstr "thiserror و anyhow" #: src/error-handling.md src/error-handling/exercise.md msgid "Exercise: Rewriting with Result" -msgstr "" +msgstr "تمرین: بازنویسی با نتیجه" #: src/error-handling/panics.md msgid "Rust handles fatal errors with a \"panic\"." @@ -11114,6 +11135,8 @@ msgid "" "By default, a panic will cause the stack to unwind. The unwinding can be " "caught:" msgstr "" +"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان " +"گرفت( در واقع منظور این است که می‌توان آن را caught کرد):" #: src/error-handling/panics.md msgid "\"No problem here!\"" @@ -11132,6 +11155,8 @@ msgid "" "Catching is unusual; do not attempt to implement exceptions with " "`catch_unwind`!" msgstr "" +"گرفتن (Catching) غیر معمول است. سعی نکنید exceptionها را با `catch_unwind` " +"پیاده‌سازی کنید!" #: src/error-handling/panics.md msgid "" @@ -11193,6 +11218,10 @@ msgid "" "that you can't tell when calling a function if it may throw an exception or " "not." msgstr "" +"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند " +"یا نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور " +"کلی به این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن " +"است یک exception ایجاد کند یا خیر." #: src/error-handling/result.md msgid "" @@ -11203,7 +11232,7 @@ msgstr "" #: src/error-handling/result.md msgid "Error Numbers" -msgstr "" +msgstr "شماره‌های خطا" #: src/error-handling/result.md msgid "" @@ -11233,7 +11262,7 @@ msgstr "" #: src/error-handling/try.md msgid "into the much simpler" -msgstr "" +msgstr "بسیار ساده‌تر" #: src/error-handling/try.md msgid "We can use this to simplify our error handling code:" @@ -11393,6 +11422,10 @@ msgid "" "can be a good option in a program where you just want to display the error " "message somewhere." msgstr "" +"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای " +"مختلف را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از " +"`Box` در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه " +"خوبی در برنامه‌ای باشد که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." #: src/error-handling/error.md msgid "" @@ -11652,7 +11685,7 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "Dereference raw pointers." -msgstr "" +msgstr "اشاره‌گرهای خام." #: src/unsafe-rust/unsafe.md msgid "Access or modify mutable static variables." @@ -11687,7 +11720,7 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" -msgstr "" +msgstr "ایجاد اشاره‌گر ایمن است، اما عدم ارجاع به آنها «ناامن» یا `unsafe` است:" #: src/unsafe-rust/dereferencing.md msgid "\"careful!\"" @@ -11777,7 +11810,7 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "In most cases the pointer must also be properly aligned." -msgstr "" +msgstr "در بیشتر موارد، اشاره‌گر نیز باید به درستی تراز شود." #: src/unsafe-rust/dereferencing.md msgid "" @@ -12129,7 +12162,7 @@ msgstr "NUL-terminated" #: src/unsafe-rust/exercise.md msgid "Communicating with C functions" -msgstr "" +msgstr "ارتباط با توابع C" #: src/unsafe-rust/exercise.md msgid "" @@ -12145,7 +12178,7 @@ msgstr "مخصوص سیستم‌عامل" #: src/unsafe-rust/exercise.md msgid "Communicating with the OS" -msgstr "" +msgstr "برقراری ارتباط با سیستم‌عامل" #: src/unsafe-rust/exercise.md msgid "You will convert between all these types:" @@ -12203,6 +12236,8 @@ msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" +"کد زیر را در کپی کنید و توابع و متدهای از " +"مفقود شده را پر کنید:" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" @@ -15112,6 +15147,7 @@ msgstr "" msgid "" "Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" +"نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" #: src/chromium/cargo.md msgid "" @@ -17799,6 +17835,8 @@ msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" +"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را " +"`panic = \"abort\"` کامپایل کنید." #: src/bare-metal/minimal.md msgid "" @@ -17950,6 +17988,7 @@ msgid "" "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " "to the first row." msgstr "" +"در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md @@ -18009,7 +18048,7 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "HAL crates" -msgstr "" +msgstr "HAL crates" #: src/bare-metal/microcontrollers/hals.md msgid "" @@ -18037,16 +18076,21 @@ msgid "" "HAL crates exist for many Cortex-M and RISC-V devices, including various " "STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" +"بسیاری از HAL crateها برای انواعی از دستگاه های Cortex-M و RISC-V از جمله " +"میکروکنترلرهای STM32، GD32، nRF، NXP، MSP430، AVR و PIC مختلف وجود دارد." #: src/bare-metal/microcontrollers/board-support.md msgid "Board support crates" -msgstr "" +msgstr "Board support crates" #: src/bare-metal/microcontrollers/board-support.md +#, fuzzy msgid "" "Board support crates provide a further level of wrapping for a specific " "board for convenience." msgstr "" +"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک " +"board خاص فراهم می‌کنند." #: src/bare-metal/microcontrollers/board-support.md msgid "" @@ -18092,6 +18136,8 @@ msgid "" "Changing the configuration of a pin consumes the old pin instance, so you " "can’t keep use the old instance afterwards." msgstr "" +"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از " +"آن از pin قدیمی استفاده کنید." #: src/bare-metal/microcontrollers/type-state.md msgid "" @@ -18124,7 +18170,7 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" -msgstr "" +msgstr "GPIO" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "PWM" @@ -18132,11 +18178,11 @@ msgstr "PWM" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "Delay timers" -msgstr "" +msgstr "تایمرهای تاخیری" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "I2C and SPI buses and devices" -msgstr "" +msgstr "گذرگاه‌ها و دستگاه‌های I2C و SPI" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" @@ -18212,7 +18258,7 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "Cargo integration" -msgstr "" +msgstr "ادغام Cargo" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18272,6 +18318,8 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" +"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده " +"است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" @@ -18287,11 +18335,11 @@ msgstr "" #: src/bare-metal/microcontrollers/debugging.md msgid "In one terminal under `src/bare-metal/microcontrollers/examples/`:" -msgstr "" +msgstr "در یک ترمینال تحت `src/bare-metal/microcontrollers/examples/`:" #: src/bare-metal/microcontrollers/debugging.md msgid "In another terminal in the same directory:" -msgstr "" +msgstr "در ترمینال دیگری در همان دایرکتوری:" #: src/bare-metal/microcontrollers/debugging.md msgid "On gLinux or Debian:" @@ -18299,7 +18347,7 @@ msgstr "در gLinux یا Debian:" #: src/bare-metal/microcontrollers/debugging.md msgid "In GDB, try running:" -msgstr "" +msgstr "در GDB، اجرا کنید:" #: src/bare-metal/microcontrollers/other-projects.md #: src/bare-metal/aps/other-projects.md @@ -18371,7 +18419,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." -msgstr "" +msgstr "این شامل هیچ HAL نیست." #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -18381,12 +18429,13 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "Cortex-M only." -msgstr "" +msgstr "Cortex-M فقط." #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" +"گوگل از TockOS در میکروکنترلر Haven برای کلیدهای امنیتی Titan استفاده می‌کند." #: src/bare-metal/microcontrollers/other-projects.md msgid "" @@ -18417,7 +18466,7 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "Hints:" -msgstr "" +msgstr "نکته‌ها:" #: src/exercises/bare-metal/compass.md msgid "" @@ -18426,6 +18475,10 @@ msgid "" "microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." "org/hardware/)." msgstr "" +"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و " +"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه " +"crateهای آن را بررسی کنید همانطور که [micro:bit hardware](https://tech." +"microbit.org/hardware/) را بررسی می‌کنید." #: src/exercises/bare-metal/compass.md msgid "" @@ -18466,6 +18519,8 @@ msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `compass` directory for the following files." msgstr "" +"این [الگوی تمرین](../../comprehensive-rust-exercises.zip) را دانلود کنید و " +"فایل‌های زیر را در دایرکتوری `compass` جستجو کنید." #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_src/main.rs_:" @@ -18473,7 +18528,7 @@ msgstr "_src/main.rs_:" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_Cargo.toml_ (you shouldn't need to change this):" -msgstr "" +msgstr "_Cargo.toml_ (نیاز به تغییر ندارد):" #: src/exercises/bare-metal/compass.md msgid "_Embed.toml_ (you shouldn't need to change this):" @@ -18499,7 +18554,7 @@ msgstr "" #: src/exercises/bare-metal/solutions-morning.md msgid "Bare Metal Rust Morning Exercise" -msgstr "" +msgstr "تمرین صبحگاهی Bare Metal Rust" #: src/exercises/bare-metal/solutions-morning.md msgid "([back to exercise](compass.md))" @@ -18574,6 +18629,9 @@ msgid "" "privilege (exception levels on Arm CPUs, rings on x86), while application " "processors do." msgstr "" +"به طور کلی، میکروکنترلرها دارای MMU یا چندین سطح دسترسی (سطوح استثنا در " +"پردازنده‌های Arm، حلقه‌ها در x86) نیستند، در حالی که پردازنده‌های برنامه دارای " +"دسترسی هستند." #: src/bare-metal/aps.md msgid "" @@ -18589,6 +18647,8 @@ msgstr "" msgid "" "Before we can start running Rust code, we need to do some initialisation." msgstr "" +"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه " +"را انجام دهیم." #: src/bare-metal/aps/entry-point.md msgid "" @@ -20669,6 +20729,9 @@ msgid "" "channel for the new message. The thread can be blocked indefinitely if there " "is nobody who reads from the channel." msgstr "" +"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته " +"باشد، thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread " +"را می‌توان به طور نامحدود مسدود کرد." #: src/concurrency/channels/bounded.md msgid "" From 56f280a5adfd12cef08bb7a2745d0beb155d4bb0 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 4 Oct 2024 22:38:08 +0330 Subject: [PATCH 83/92] fa: try to complete Farsi part 3 --- po/fa.po | 14025 +++++++++++++++++++++++++---------------------------- 1 file changed, 6673 insertions(+), 7352 deletions(-) diff --git a/po/fa.po b/po/fa.po index 730cb9758c8..70a4a12ef6b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-09-24 00:14+0330\n" +"PO-Revision-Date: 2024-10-04 21:48+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -52,15 +52,14 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md +#: src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md -#: src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -76,8 +75,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -105,17 +104,16 @@ msgstr "تمرین: دنباله فیبوناچی" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md -#: src/std-traits/solution.md src/memory-management/solution.md -#: src/smart-pointers/solution.md src/borrowing/solution.md -#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md -#: src/testing/solution.md src/error-handling/solution.md +#: src/generics/solution.md src/std-types/solution.md src/std-traits/solution.md +#: src/memory-management/solution.md src/smart-pointers/solution.md +#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md +#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -152,8 +150,7 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -161,8 +158,7 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -187,8 +183,7 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -226,13 +221,11 @@ msgstr "تمرین: هندسه" msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -261,8 +254,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -279,8 +272,7 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md -#: src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -288,8 +280,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -438,8 +430,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -475,8 +467,8 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" @@ -551,8 +543,8 @@ msgstr "تمرین: تجزیه Protobuf" msgid "Day 4: Morning" msgstr "روز چهارم: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/iterators.md msgid "Iterators" msgstr "" @@ -572,8 +564,8 @@ msgstr "`FromIterator`" msgid "Exercise: Iterator Method Chaining" msgstr "تمرین: روش Iterator Chaining" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/modules.md src/modules/modules.md msgid "Modules" msgstr "ماژول‌ها" @@ -593,8 +585,8 @@ msgstr "" msgid "Exercise: Modules for a GUI Library" msgstr "تمرین: ماژولهایی برای کتابخانه رابط کاربری گرافیکی" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/testing.md src/chromium/testing.md msgid "Testing" msgstr "تست‌کردن" @@ -633,7 +625,7 @@ msgstr "عملگرد Try" #: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md msgid "Try Conversions" -msgstr "" +msgstr "این تبدیل‌ها (Conversions) را امتحان کنید" #: src/SUMMARY.md msgid "`Error` Trait" @@ -885,7 +877,7 @@ msgstr "بسته به Rust Code از ++Chromium C" #: src/SUMMARY.md src/chromium/build-rules/vscode.md msgid "Visual Studio Code" -msgstr "" +msgstr "Visual Studio Code" #: src/SUMMARY.md src/exercises/chromium/third-party.md msgid "Exercise" @@ -931,7 +923,7 @@ msgstr "مدیریت خطا: مثال PNG" #: src/SUMMARY.md msgid "Using CXX in Chromium" -msgstr "" +msgstr "استفاده از CXX در Chromium" #: src/SUMMARY.md src/chromium/adding-third-party-crates.md msgid "Adding Third Party Crates" @@ -969,8 +961,7 @@ msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کن msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." -#: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/SUMMARY.md src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "وابسته به یک Crate" @@ -1058,8 +1049,7 @@ msgid "Compass" msgstr "قطب‌نما" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/solutions.md -#: src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md #: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "راه حل‌ها" @@ -1178,13 +1168,11 @@ msgstr "کانال‌ها" msgid "Senders and Receivers" msgstr "متد دریافتی" -#: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" -#: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1206,8 +1194,7 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync.md -#: src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md src/concurrency/send-sync/examples.md msgid "Examples" msgstr "مثال‌ها" @@ -1232,8 +1219,7 @@ msgstr "مثال" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/dining-philosophers.md -#: src/concurrency/sync-exercises/solutions.md -#: src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" @@ -1346,53 +1332,53 @@ msgstr "اعتبارها" #: src/index.md msgid "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" -"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" -"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" -"[GitHub contributors](https://img.shields.io/github/contributors/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." -"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." -"com/google/comprehensive-rust/stargazers)" -msgstr "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" -"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" -"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" -"[GitHub contributors](https://img.shields.io/github/contributors/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." -"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." -"com/google/comprehensive-rust/stargazers)" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" +"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" +"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " +"contributors](https://img.shields.io/github/contributors/google/comprehensive-" +"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" +"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" +"rust/stargazers)" +msgstr "" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" +"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" +"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " +"contributors](https://img.shields.io/github/contributors/google/comprehensive-" +"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" +"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" +"rust/stargazers)" #: src/index.md msgid "" -"This is a free Rust course developed by the Android team at Google. The " -"course covers the full spectrum of Rust, from basic syntax to advanced " -"topics like generics and error handling." +"This is a free Rust course developed by the Android team at Google. The course " +"covers the full spectrum of Rust, from basic syntax to advanced topics like " +"generics and error handling." msgstr "" -"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این " -"این دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته " -"مانند جنریک و مدیریت خطاها." +"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این این " +"دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته مانند " +"جنریک و مدیریت خطاها." #: src/index.md msgid "" "The latest version of the course can be found at . If you are reading somewhere else, please check there " -"for updates." +"comprehensive-rust/>. If you are reading somewhere else, please check there for " +"updates." msgstr "" -"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " -"نیز بررسی کنید." +"آخرین نسخه از دوره را میتوان در " +"پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز " +"بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language " -"in the top right corner of the page or check the [Translations](running-the-" -"course/translations.md) page for a list of all available translations." +"The course is available in other languages. Select your preferred language in the " +"top right corner of the page or check the [Translations](running-the-course/" +"translations.md) page for a list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " -"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " -"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای " +"صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای " +"فهرستی از تمام ترجمه‌های موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1400,11 +1386,11 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know " -"anything about Rust and hope to:" +"The goal of the course is to teach you Rust. We assume you don't know anything " +"about Rust and hope to:" msgstr "" -"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " -"نمی دانید :" +"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی " +"دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1413,8 +1399,8 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " -"در Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در " +"Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1427,8 +1413,7 @@ msgstr "ما چهار روز اول دوره را اصول Rust می نامیم #: src/index.md msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "" -"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" @@ -1440,13 +1425,13 @@ msgstr "" #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium " -"based browsers. This includes interoperability with C++ and how to include " -"third-party crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium based " +"browsers. This includes interoperability with C++ and how to include third-party " +"crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " -"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " -"جعبه های(crates) شخص ثالث در کروم است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای " +"مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه " +"های(crates) شخص ثالث در کروم است." #: src/index.md msgid "" @@ -1455,21 +1440,20 @@ msgid "" "covered." msgstr "" "[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " -"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " -"داده شده اند." +"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده " +"شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " -"Rust. We cover both classical concurrency (preemptively scheduling using " -"threads and mutexes) and async/await concurrency (cooperative multitasking " -"using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. " +"We cover both classical concurrency (preemptively scheduling using threads and " +"mutexes) and async/await concurrency (cooperative multitasking using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " -"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " -"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " -"استفاده از futures را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " +"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و " +"mutexها ) و async/await concurrency (multitasking مشارکتی) با استفاده از futures " +"را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1477,8 +1461,8 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few " -"days. Some non-goals of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few days. " +"Some non-goals of this course are:" msgstr "" "زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." "چندتا از اهداف خارج از این دوره عبارتند از:" @@ -1489,9 +1473,9 @@ msgid "" "(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" "(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://" +"doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-" +"lang.org/rust-by-example/macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1499,14 +1483,14 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"The course assumes that you already know how to program. Rust is a statically-" +"typed language and we will sometimes make comparisons with C and C++ to better " +"explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " -"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا " +"رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" @@ -1519,12 +1503,12 @@ msgstr "" #: src/index.md msgid "" "This is an example of a _speaker note_. We will use these to add additional " -"information to the slides. This could be key points which the instructor " -"should cover as well as answers to typical questions which come up in class." +"information to the slides. This could be key points which the instructor should " +"cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " -"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " -"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات " +"بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و " +"همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1532,24 +1516,22 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the " -"course internally at Google." -msgstr "" -"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the course " +"internally at Google." +msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " -"in the middle. This leaves 3 hours for the morning class and 3 hours for the " -"afternoon class. Both sessions contain multiple breaks and time for students " -"to work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in " +"the middle. This leaves 3 hours for the morning class and 3 hours for the " +"afternoon class. Both sessions contain multiple breaks and time for students to " +"work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " -"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " -"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " -"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " -"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " -"ظهر خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت " +"ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس " +"بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: شما می‌توانید ۳ " +"ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته منفی این کار این است که " +"با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1557,103 +1539,100 @@ msgstr "قبل از اجرای دوره، شما می‌خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker " -"notes to help highlight the key points (please help us by contributing more " -"speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"Make yourself familiar with the course material. We've included speaker notes to " +"help highlight the key points (please help us by contributing more speaker " +"notes!). When presenting, you should make sure to open the speaker notes in a " +"popup (click the link with a little arrow next to \"Speaker Notes\"). This way " +"you have a clean screen to present to the class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " -"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " -"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " -"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " -"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات " +"کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). " +"هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید " +"(روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک " +"صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." #: src/running-the-course.md msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " -"schedule the days over two weeks. Course participants have said that they " -"find it helpful to have a gap in the course since it helps them process all " -"the information we give them." +"schedule the days over two weeks. Course participants have said that they find it " +"helpful to have a gap in the course since it helps them process all the " +"information we give them." msgstr "" "در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " -"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " -"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " -"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره " +"گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا تمام " +"اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a " -"class size of 15-25 people. That's small enough that people are comfortable " -"asking questions --- it's also small enough that one instructor will have " -"time to answer the questions. Make sure the room has _desks_ for yourself " -"and for the students: you will all need to be able to sit and work with your " -"laptops. In particular, you will be doing a lot of live-coding as an " -"instructor, so a lectern won't be very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " -"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " -"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " -"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " -"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" -"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " -"نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a class " +"size of 15-25 people. That's small enough that people are comfortable asking " +"questions --- it's also small enough that one instructor will have time to answer " +"the questions. Make sure the room has _desks_ for yourself and for the students: " +"you will all need to be able to sit and work with your laptops. In particular, " +"you will be doing a lot of live-coding as an instructor, so a lectern won't be " +"very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر " +"را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین " +"مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر " +"_میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که بتونید بشنید و با لپتاپ " +"های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-coding انجام خواهید داد پس " +"صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things " -"up. We recommend presenting directly using `mdbook serve` running on your " -"laptop (see the [installation instructions](https://github.com/google/" -"comprehensive-rust#building)). This ensures optimal performance with no lag " -"as you change pages. Using your laptop will also allow you to fix typos as " -"you or the course participants spot them." +"On the day of your course, show up to the room a little early to set things up. " +"We recommend presenting directly using `mdbook serve` running on your laptop (see " +"the [installation instructions](https://github.com/google/comprehensive-" +"rust#building)). This ensures optimal performance with no lag as you change " +"pages. Using your laptop will also allow you to fix typos as you or the course " +"participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " -"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " -"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " -"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " -"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " -"شما یا شرکت کنندگان در دوره اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه " +"می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای " +"نصب](https://github.com/google/comprehensive-rust#building) را ببنیید). با این " +"کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین " +"به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده شما یا شرکت کنندگان در دوره " +"اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We " -"typically spend 30-45 minutes on exercises in the morning and in the " -"afternoon (including time to review the solutions). Make sure to ask people " -"if they're stuck or if there is anything you can help with. When you see " -"that several people have the same problem, call it out to the class and " -"offer a solution, e.g., by showing people where to find the relevant " -"information in the standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " -"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " -"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " -"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " -"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " -"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " -"کنند." +"Let people solve the exercises by themselves or in small groups. We typically " +"spend 30-45 minutes on exercises in the morning and in the afternoon (including " +"time to review the solutions). Make sure to ask people if they're stuck or if " +"there is anything you can help with. When you see that several people have the " +"same problem, call it out to the class and offer a solution, e.g., by showing " +"people where to find the relevant information in the standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ " +"الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) " +"صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که " +"می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, خطاب به " +"کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که می‌توانند اطلاعات " +"مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun " -"for you as it has been for us!" +"That is all, good luck running the course! We hope it will be as much fun for you " +"as it has been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " -"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه " +"که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We " -"would love to hear what worked well for you and what can be made better. " -"Your students are also very welcome to [send us feedback](https://github.com/" -"google/comprehensive-rust/discussions/100)!" +"discussions/86) afterwards so that we can keep improving the course. We would " +"love to hear what worked well for you and what can be made better. Your students " +"are also very welcome to [send us feedback](https://github.com/google/" +"comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" -"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " -"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " -"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" -"github.com/google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/" +"discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم " +"بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور شما " +"دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://github.com/" +"google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1661,11 +1640,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " -"days are fast paced and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days " +"are fast paced and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " -"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز " +"با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1689,12 +1668,11 @@ msgstr "بخش" #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md #: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md -#: src/std-types.md src/std-traits.md src/welcome-day-3.md -#: src/memory-management.md src/smart-pointers.md -#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md -#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md -#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md src/memory-management.md +#: src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md +#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md +#: src/testing.md src/welcome-day-4-afternoon.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/threads.md #: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md @@ -1706,10 +1684,10 @@ msgstr "مدت زمان" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/lifetimes.md -#: src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/shared-state.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/shared-state.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" @@ -1806,8 +1784,7 @@ msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" msgstr "" -"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " -"دهیم:" +"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1815,38 +1792,38 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using " -"Rust for Android platform development. This includes interoperability with " -"C, C++, and Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust " +"for Android platform development. This includes interoperability with C, C++, and " +"Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " -"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " -"با C، C++ و جاوا می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده " +"از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/" -"download/downloading). Make a checkout of the [course repository](https://" -"github.com/google/comprehensive-rust) on the same machine and move the `src/" -"android/` directory into the root of your AOSP checkout. This will ensure " -"that the Android build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/" +"downloading). Make a checkout of the [course repository](https://github.com/" +"google/comprehensive-rust) on the same machine and move the `src/android/` " +"directory into the root of your AOSP checkout. This will ensure that the Android " +"build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" -"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" -"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" -"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " -"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/" +"download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/" +"google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن " +"ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build اندروید فایل های " +"`Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build " -"all Android examples using `src/android/build_all.sh`. Read the script to " -"see the commands it runs and make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build all " +"Android examples using `src/android/build_all.sh`. Read the script to see the " +"commands it runs and make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " -"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " -"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " -"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه " +"نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. " +"اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها " +"را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1854,25 +1831,24 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " -"using Rust as part of the Chromium browser. It includes using Rust in " -"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " -"and C++ interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using " +"Rust as part of the Chromium browser. It includes using Rust in Chromium's `gn` " +"build system, bringing in third-party libraries (\"crates\") and C++ " +"interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " -"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " -"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" -"+C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به " +"عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` " +"Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری ++C است." #: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. " -"Ensure that you can run the Chromium browser that you've built." +"[recommended](../chromium/setup.md) for speed but any build will work. Ensure " +"that you can run the Chromium browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " -"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " -"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت " +"[توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که " +"می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1880,25 +1856,24 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " -"using Rust for bare-metal (embedded) development. Both microcontrollers and " -"application processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using " +"Rust for bare-metal (embedded) development. Both microcontrollers and application " +"processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " -"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " -"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " -"کارایی خاص را پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک " +"روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل " +"(embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را " +"پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit]" -"(https://microbit.org/) v2 development board ahead of time. Everybody will " -"need to install a number of packages as described on the [welcome page](../" -"bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit](https://" +"microbit.org/) v2 development board ahead of time. Everybody will need to install " +"a number of packages as described on the [welcome page](../bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " -"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" -"(../bare-metal.md) توضیح داده شده نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 " +"را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-" +"metal.md) توضیح داده شده نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1910,18 +1885,17 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " -"شامل همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل " +"همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready " -"to go. You can then copy/paste the examples into `src/main.rs` to experiment " -"with them:" +"You will need a fresh crate set up and the dependencies downloaded and ready to " +"go. You can then copy/paste the examples into `src/main.rs` to experiment with " +"them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " -"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " -"آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. " +"سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" @@ -1957,11 +1931,11 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the " -"questions drive the exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the questions " +"drive the exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " -"Rust را هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را " +"هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1992,69 +1966,65 @@ msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" msgstr "" -"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " -"است:" +"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " -"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " -"[@henrif75](https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by " +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" +"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and [@henrif75]" +"(https://github.com/henrif75)." msgstr "" "[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " -"[@henrif75](https://github.com/henrif75)." +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" +"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و [@henrif75]" +"(https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " -"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" -"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" -"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by " +"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " +"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " +"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" +"superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " "[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " "[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " "[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." -"com/nodmp)." +"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github.com/" +"nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " -"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" "github.com/kuanhungchen), and [@johnathan79717](https://github.com/" "johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" +"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " +"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" +"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" -"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " -"and [@kantasv](https://github.com/kantasv)." +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), " +"[@HidenoriKobayashi](https://github.com/HidenoriKobayashi) and [@kantasv](https://" +"github.com/kantasv)." msgstr "" "[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" -"momotaro1105)." +"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " -"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." -"com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://" +"github.com/keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan]" +"(https://github.com/jooyunghan), and [@namhyung](https://github.com/namhyung)." msgstr "" "[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " @@ -2062,8 +2032,8 @@ msgstr "" #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" -"(https://github.com/deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://" +"github.com/deavid)." msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2071,16 +2041,15 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" -"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" -"yaremam) and [@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp]" +"(https://github.com/git-user-cpp), [@yaremam](https://github.com/yaremam) and " +"[@reta](https://github.com/reta)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "" -"Use the language picker in the top-right corner to switch between languages." +msgid "Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." @@ -2090,17 +2059,17 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most " -"recently updated translations:" +"There is a large number of in-progress translations. We link to the most recently " +"updated translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " -"پیوند می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند " +"می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" -"(https://github.com/younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://" +"github.com/younies)" msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2116,77 +2085,73 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" -"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " -"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" -"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" -"moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://" +"github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp]" +"(https://github.com/hamidrezakp), [@javad-jafari](https://github.com/javad-" +"jafari) and [@moaminsharifi](https://github.com/moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" +"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " +"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" +"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " -"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://" +"github.com/KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont]" +"(https://github.com/AdrienBaudemont)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" -"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://" +"github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" -"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://" +"github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by " -"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" -"github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder]" +"(https://github.com/henrythebuilder) and [@detro](https://github.com/detro)." msgstr "" "[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available " -"either [as of their last update](https://google.github.io/comprehensive-rust/" -"translation-report.html) or [synced to the latest version of the course]" -"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." +"The full list of translations with their current status is also available either " +"[as of their last update](https://google.github.io/comprehensive-rust/translation-" +"report.html) or [synced to the latest version of the course](https://google." +"github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " -"get going. Translations are coordinated on the [issue tracker](https://" -"github.com/google/comprehensive-rust/issues/282)." +"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get " +"going. Translations are coordinated on the [issue tracker](https://github.com/" +"google/comprehensive-rust/issues/282)." msgstr "" "اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" -"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " -"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" -"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." +"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار " +"ببینید. ترجمه ها در [issue tracker](https://github.com/google/comprehensive-rust/" +"issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc." -"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " -"and run Rust applications. Here we want to give a brief overview of what " -"Cargo is and how it fits into the wider ecosystem and how it fits into this " -"training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-" +"lang.org/cargo/), the standard tool used in the Rust ecosystem to build and run " +"Rust applications. Here we want to give a brief overview of what Cargo is and how " +"it fits into the wider ecosystem and how it fits into this training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." -"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " -"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " -"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " -"را در این آموزش ارائه دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-" +"lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه " +"های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در " +"مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه " +"دهیم." #: src/cargo.md msgid "Installation" @@ -2199,8 +2164,8 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will " -"pass them to `rustc` when building your project. Cargo also comes with a " -"built-in test runner which is used to execute unit tests." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to download " +"dependencies, usually hosted on , and it will pass them to " +"`rustc` when building your project. Cargo also comes with a built-in test runner " +"which is used to execute unit tests." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " -"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " -"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " -"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها " +"را که معمولاً در میزبانی می شوند دانلود کند و هنگام ساخت پروژه " +"آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که " +"برای اجرای unit test استفاده می شود." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to " -"install and update `rustc` and `cargo` when new versions of Rust are " -"released. In addition, `rustup` can also download documentation for the " -"standard library. You can have multiple versions of Rust installed at once " -"and `rustup` will let you switch between them as needed." +"`rustup`: the Rust toolchain installer and updater. This tool is used to install " +"and update `rustc` and `cargo` when new versions of Rust are released. In " +"addition, `rustup` can also download documentation for the standard library. You " +"can have multiple versions of Rust installed at once and `rustup` will let you " +"switch between them as needed." msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " -"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " -"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " -"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " -"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز " +"رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. " +"علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود " +"کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما " +"اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md #: src/references/exclusive.md src/memory-management/move.md @@ -2299,81 +2263,79 @@ msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six " -"weeks. New releases maintain backwards compatibility with old releases --- " -"plus they enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six weeks. " +"New releases maintain backwards compatibility with old releases --- plus they " +"enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " -"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " -"علاوه قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر " +"می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه " +"قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "" -"There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes " -"\"stable\" every six weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" " +"every six weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " -"هفته \"stable\" می شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته " +"\"stable\" می شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc." -"rust-lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc.rust-" +"lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current " +"edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " -"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه " +"فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md msgid "" -"The editions are allowed to make backwards incompatible changes to the " -"language." +"The editions are allowed to make backwards incompatible changes to the language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for " -"your crate via the `Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for your " +"crate via the `Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " -"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد " +"نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " -"برای نسخه های مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای " +"نسخه های مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " -"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` " +"بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " -"comprehensive tool. It is capable of many advanced features including but " -"not limited to:" +"comprehensive tool. It is capable of many advanced features including but not " +"limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " -"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است " +"که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2381,8 +2343,7 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "" -"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" @@ -2390,33 +2351,27 @@ msgstr "وابستگی های Dev و وابستگی‌های Runtime Manageme #: src/cargo/rust-ecosystem.md msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" #: src/cargo/rust-ecosystem.md msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo " -"clippy](https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo clippy]" +"(https://github.com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" -"lang/rust-clippy)) قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/" +"rust-clippy)) قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "" -"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "" -"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2425,22 +2380,22 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " -"which can be executed through your browser. This makes the setup much easier " -"and ensures a consistent experience for everyone." +"which can be executed through your browser. This makes the setup much easier and " +"ensures a consistent experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " -"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " -"کند و تجربه ای ثابت را برای همه تضمین می کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر " +"شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه " +"ای ثابت را برای همه تضمین می کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do " -"the exercises. On the last day, we will do a larger exercise which shows you " -"how to work with dependencies and for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do the " +"exercises. On the last day, we will do a larger exercise which shows you how to " +"work with dependencies and for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " -"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " -"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. " +"در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با " +"وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2453,8 +2408,8 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy msgid "" -"You can use Ctrl + Enter to execute the code when focus is in the " -"text box." +"You can use Ctrl + Enter to execute the code when focus is in the text " +"box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md @@ -2462,26 +2417,26 @@ msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " -"کد به دلایل مختلف قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به " +"دلایل مختلف قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " -"open it in the real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open " +"it in the real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " -"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و " +"آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from " -"the page! This is the reason that the students should solve the exercises " -"using a local Rust installation or via the Playground." +"The embedded playgrounds lose their state the moment you navigate away from the " +"page! This is the reason that the students should solve the exercises using a " +"local Rust installation or via the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " -"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " -"استفاده از local Rust installation یا از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را " +"از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از " +"local Rust installation یا از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2489,60 +2444,56 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will " -"need to first install Rust. Do this by following the [instructions in the " -"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " -"should give you a working `rustc` and `cargo`. At the time of writing, the " -"latest stable Rust release has these version numbers:" +"If you want to experiment with the code on your own system, then you will need to " +"first install Rust. Do this by following the [instructions in the Rust Book]" +"(https://doc.rust-lang.org/book/ch01-01-installation.html). This should give you " +"a working `rustc` and `cargo`. At the time of writing, the latest stable Rust " +"release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " -"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" -"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " -"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " -"این version numberها است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این " +"کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/" +"book/ch01-01-installation.html) انجام دهید. این باید به شما یک `rustc` و `cargo` " +"کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای این version numberها " +"است:" #: src/cargo/running-locally.md msgid "" -"You can use any later version too since Rust maintains backwards " -"compatibility." +"You can use any later version too since Rust maintains backwards compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " -"های قبلی را حفظ می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های " +"قبلی را حفظ می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of " -"the examples in this training:" +"With this in place, follow these steps to build a Rust binary from one of the " +"examples in this training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " -"باینری Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری " +"Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "" -"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" -"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " -"استفاده کنید:" +"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده " +"کنید:" #: src/cargo/running-locally.md -msgid "" -"Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" -"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " -"کنید:" +"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For " -"example, using the example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For example, " +"using the example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " -"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از " +"مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2550,35 +2501,35 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo " -"build` to compile it without running it. You will find the output in `target/" -"debug/` for a normal debug build. Use `cargo build --release` to produce an " -"optimized release build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo build` to " +"compile it without running it. You will find the output in `target/debug/` for a " +"normal debug build. Use `cargo build --release` to produce an optimized release " +"build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " -"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" -"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " -"شده در `target/release/` از `cargo build --release` استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo " +"build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای " +"ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/" +"release/` از `cargo build --release` استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you " -"run `cargo` commands, it will automatically download and compile missing " -"dependencies for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you run " +"`cargo` commands, it will automatically download and compile missing dependencies " +"for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " -"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " -"نیاز را برای شما دانلود و کامپایل می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که " +"دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما " +"دانلود و کامپایل می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local " -"editor. It will make their life easier since they will have a normal " -"development environment." +"Try to encourage the class participants to install Cargo and use a local editor. " +"It will make their life easier since they will have a normal development " +"environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " -"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " -"محیط توسعه عادی خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر " +"محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی " +"خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" @@ -2586,19 +2537,17 @@ msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md msgid "" -"This is the first day of Rust Fundamentals. We will cover a lot of ground " -"today:" +"This is the first day of Rust Fundamentals. We will cover a lot of ground today:" msgstr "" -"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " -"داد:" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" #: src/welcome-day-1.md 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 msgid "Types and type inference." @@ -2617,87 +2566,79 @@ msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/welcome-day-4.md src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 " -"minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. " +"It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "" -"They should ask questions when they get them, don't save them to the end." -msgstr "" -"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "They should ask questions when they get them, don't save them to the end." +msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md msgid "" -"The class is meant to be interactive and discussions are very much " -"encouraged!" +"The class is meant to be interactive and discussions are very much encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., " -"keep the discussions related to how Rust does things vs some other language. " -"It can be hard to find the right balance, but err on the side of allowing " -"discussions since they engage people much more than one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., keep the " +"discussions related to how Rust does things vs some other language. It can be " +"hard to find the right balance, but err on the side of allowing discussions since " +"they engage people much more than one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " -"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " -"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " -"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های " +"مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا " +"کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، " +"زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." #: src/welcome-day-1.md msgid "" "The questions will likely mean that we talk about things ahead of the slides." msgstr "" -"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " -"کنیم." +"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. " -"Remember that the slides are just a support and you are free to skip them as " -"you like." +"This is perfectly okay! Repetition is an important part of learning. Remember " +"that the slides are just a support and you are free to skip them as you like." msgstr "" "این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " -"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " -"صرف نظر کنید." +"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف " +"نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that " -"should have immediate parallels in other languages. The more advanced parts " -"of Rust come on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that should " +"have immediate parallels in other languages. The more advanced parts of Rust come " +"on the subsequent days." msgstr "" "ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " -"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " -"شوند." +"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." #: src/welcome-day-1.md msgid "" "If you're teaching this in a classroom, this is a good place to go over the " -"schedule. Note that there is an exercise at the end of each segment, " -"followed by a break. Plan to cover the exercise solution after the break. " -"The times listed here are a suggestion in order to keep the course on " -"schedule. Feel free to be flexible and adjust as necessary!" +"schedule. Note that there is an exercise at the end of each segment, followed by " +"a break. Plan to cover the exercise solution after the break. The times listed " +"here are a suggestion in order to keep the course on schedule. Feel free to be " +"flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " -"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " -"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " -"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " -"باشید و در صورت لزوم تنظیم کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه " +"داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن " +"محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد " +"برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم " +"کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" @@ -2706,46 +2647,44 @@ msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شام #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md -#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/threads.md src/concurrency/channels.md -#: src/concurrency/send-sync.md src/concurrency/shared-state.md -#: src/concurrency/sync-exercises.md src/concurrency/async.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-exercises.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md +#: src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md src/testing.md +#: src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/async.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" #: src/hello-world.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md -#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md +#: src/borrowing.md src/lifetimes.md src/modules.md src/unsafe-rust.md +#: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md -#: src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015](https://" +"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://" +"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" -"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ " +"دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2756,8 +2695,8 @@ msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" -"rustc/platform-support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/" +"platform-support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2804,8 +2743,7 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "" -"Can be scaled down to very constrained devices such as microcontrollers." +msgid "Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2825,8 +2763,7 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " -"می شود" +"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2861,8 +2798,8 @@ msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " -"نامشخص باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص " +"باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2874,10 +2811,8 @@ msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wr #: src/hello-world/benefits.md msgid "" -"_Modern language features_ - as expressive and ergonomic as higher-level " -"languages" -msgstr "" -"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +"_Modern language features_ - as expressive and ergonomic as higher-level languages" +msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2913,98 +2848,93 @@ msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md msgid "" -"Do not spend much time here. All of these points will be covered in more " -"depth later." +"Do not spend much time here. All of these points will be covered in more depth " +"later." msgstr "" -"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " -"خواهد شد." +"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. " -"Depending on the answer you can highlight different features of Rust:" +"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/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " -"via the borrow checker. You get performance like in C and C++, but you don't " -"have the memory unsafety issues. In addition, you get a modern language with " -"constructs like pattern matching and built-in dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via " +"the borrow checker. You get performance like in C and C++, but you don't 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++ را " -"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " -"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را دارید اما " +"مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن با ساختارهایی " +"مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory " -"safety as in those languages, plus a similar high-level language feeling. In " -"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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory safety " +"as in those languages, plus a similar high-level language feeling. In 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++ (بدون " -"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " -"می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن زبان‌ها " +"دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، شما عملکرد " +"سریع و قابل پیش‌بینی مانند C و C++ (بدون جمع‌آوری زباله) و " +"همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " -"run short Rust programs, and is the basis for the examples and exercises in " -"this course. Try running the \"hello-world\" program it starts with. It " -"comes with a few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run " +"short Rust programs, and is the basis for the examples and exercises in this " +"course. Try running the \"hello-world\" program it starts with. It comes with a " +"few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " -"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " -"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " -"مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های " +"Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه " +"\"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" #: src/hello-world/playground.md msgid "" -"Under \"Tools\", use the `rustfmt` option to format your code in the " -"\"standard\" way." +"Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" " +"way." msgstr "" "در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " "\"استاندارد\" استفاده کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime " -"checks, less optimization) and Release (fewer runtime checks, lots of " -"optimization). These are accessible under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, " +"less optimization) and Release (fewer runtime checks, lots of optimization). " +"These are accessible under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " -"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " -"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، " +"بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در " +"قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." #: src/hello-world/playground.md msgid "" -"If you're interested, use \"ASM\" under \"...\" to see the generated " -"assembly code." +"If you're interested, use \"ASM\" under \"...\" to see the generated assembly " +"code." msgstr "" "اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " "استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground " -"and experiment a little. Encourage them to keep the tab open and try things " -"out during the rest of the course. This is particularly helpful for advanced " -"students who want to know more about Rust's optimizations or generated " -"assembly." +"As students head into the break, encourage them to open up the playground and " +"experiment a little. Encourage them to keep the tab open and try things out " +"during the rest of the course. This is particularly helpful for advanced students " +"who want to know more about Rust's optimizations or generated assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " -"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " -"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " -"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " -"بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground " +"را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در " +"بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند " +"درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" @@ -3015,8 +2945,7 @@ msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " -"بپردازیم:" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -3033,8 +2962,7 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " -"می‌شوند." +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -3043,32 +2971,30 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک " -"نمونه از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه " +"از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " -"باشند." +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will " -"see a ton of it over the next four days so we start small with something " -"familiar." +"This slide tries to make the students comfortable with Rust code. They will see a " +"ton of it over the next four days so we start small with something familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " -"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده " +"خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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) و سعی نمی‌کند چیزی را مگر اینکه " -"کاملاً ضروری باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/" +"Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری " +"باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -3086,36 +3012,34 @@ msgstr "" #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers " -"from the scope they are used in. Rust macros are actually only [partially " -"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." -"html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers from " +"the scope they are used in. Rust macros are actually only [partially hygienic]" +"(https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " -"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " -"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" -"minutiae/hygiene.html هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را " +"از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا " +"حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html " +"هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented " -"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " -"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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented programming " +"features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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) " -"است." +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و در " +"حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم فانکشنال]" +"(https://doc.rust-lang.org/book/ch13-00-functional-features.html) است." #: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " -"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض " +"تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -3132,29 +3056,27 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by " -"default. Add the `mut` keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by default. " +"Add the `mut` keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " -"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را " +"حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile " -"time, but type inference (covered later) allows the programmer to omit it in " -"many cases." +"The `i32` here is the type of the variable. This must be known at compile time, " +"but type inference (covered later) allows the programmer to omit it in many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " -"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " -"بسیاری از موارد آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج " +"نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد " +"آن را حذف کند." #: src/types-and-values/values.md msgid "" -"Here are some basic built-in types, and the syntax for literal values of " -"each type." +"Here are some basic built-in types, and the syntax for literal values of each " +"type." msgstr "" -"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " -"است." +"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3203,8 +3125,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, 2_f32" +"3.14, -10.0e20, " +"2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3257,13 +3179,13 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " -"`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " -"as `123i64`." +"`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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3271,13 +3193,13 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the " -"meaning should be clear: it takes three integers, and returns an integer. " -"Functions will be covered in more detail later." +"This is the first time we've seen a function other than `main`, but the meaning " +"should be clear: it takes three integers, and returns an integer. Functions will " +"be covered in more detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " -"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " -"بیشتر پوشش داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: " +"سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش " +"داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3287,33 +3209,31 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do unknown things at runtime. In Rust, it's " -"defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " -"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " -"مختلف انجام دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف " +"نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام " +"دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics " -"(checked) in a debug build and wraps in a release build. There are other " -"options, such as overflowing, saturating, and carrying. These are accessed " -"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " -"a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in " +"a debug build and wraps in a release build. There are other options, such as " +"overflowing, saturating, and carrying. These are accessed with method syntax, e." +"g., `(a * b).saturating_add(b * c).saturating_add(c * a)`." msgstr "" "«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " -"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " -"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " -"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." +"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری " +"مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان " +"مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is " -"why the example requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is why " +"the example requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " -"مثال به یک تابع جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به " +"یک تابع جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3321,35 +3241,34 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on " -"constraints given by variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on constraints " +"given by variable declarations and usages." msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not " -"of some sort of dynamic \"any type\" that can hold any data. The machine " -"code generated by such declaration is identical to the explicit declaration " -"of a type. The compiler does the job for us and helps us write more concise " -"code." +"It is very important to emphasize that variables declared like this are not of " +"some sort of dynamic \"any type\" that can hold any data. The machine code " +"generated by such declaration is identical to the explicit declaration of a type. " +"The compiler does the job for us and helps us write more concise code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " -"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " -"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " -"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " -"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده " +"پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** " +"استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و " +"کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین تایپ ضمنی میتوانید " +"کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to " -"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " -"floating-point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to `i32`. " +"This sometimes appears as `{integer}` in error messages. Similarly, floating-" +"point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " -"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " -"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» " +"قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به " +"طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3357,20 +3276,19 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " -"number is calculated recursively as the sum of the n-1'th and n-2'th " -"Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is " +"calculated recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " -"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی " +"به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " -"will this function panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will " +"this function panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " -"panic می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic " +"می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3407,11 +3325,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" -"if-expr.html#if-expressions) exactly like `if` statements in other languages:" +"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) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-" +"expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3427,11 +3345,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each " -"block becomes the value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار هم " +"استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3447,30 +3365,28 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its " -"branch blocks must have the same type. Show what happens if you add `;` " -"after `\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its branch " +"blocks must have the same type. Show what happens if you add `;` after " +"`\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " -"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " -"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و " +"`else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` " +"در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. " -"For example, when it is used in a `let` statement, the statement must be " -"terminated with a `;` as well. Remove the `;` before `println!` to see the " -"compiler error." +"An `if` expression should be used in the same way as the other expressions. For " +"example, when it is used in a `let` statement, the statement must be terminated " +"with a `;` as well. Remove the `;` before `println!` to see the compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " -"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " -"کامپایلر را ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از " +"عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را " +"ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "" -"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3478,12 +3394,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) works much like in other languages, executing the " -"loop body as long as the condition is true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr." +"html#predicate-loops) works much like in other languages, executing the loop body " +"as long as the condition is true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr." +"html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3491,8 +3407,8 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " -"over ranges of values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over " +"ranges of values or the items in a collection:" msgstr "" "حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " "مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" @@ -3503,30 +3419,30 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle " -"iterating over different kinds of ranges/collections. Iterators will be " -"discussed in more detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle iterating " +"over different kinds of ranges/collections. Iterators will be discussed in more " +"detail later." msgstr "" "حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " -"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " -"قرار خواهند گرفت." +"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار " +"خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " -"for an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for " +"an inclusive range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " -"یک محدوده فراگیر نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک " +"محدوده فراگیر نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " -"زمانی که یک «break» ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که " +"یک «break» ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3534,23 +3450,21 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://" -"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +"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) " -"استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#continue-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). With " -"`loop`, this can take an optional expression that becomes the value of the " -"`loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions). With `loop`, this " +"can take an optional expression that becomes the value of the `loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/" +"reference/expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md @@ -3564,22 +3478,21 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-" -"trivial value. This is because it's guaranteed to only return at a `break` " -"statement (unlike `while` and `for` loops, which can also return when the " -"condition fails)." +"Note that `loop` is the only looping construct which can return a non-trivial " +"value. This is because it's guaranteed to only return at a `break` statement " +"(unlike `while` and `for` loops, which can also return when the condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " -"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " -"(برخلاف حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را " +"برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف " +"حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is " -"used to break out of nested loops:" +"Both `continue` and `break` can optionally take a label argument which is used to " +"break out of nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " -"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب " +"(label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3591,12 +3504,11 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " -"Each block has a value and a type, which are those of the last expression of " -"the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each " +"block has a value and a type, which are those of the last expression of the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " -"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. " +"هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" @@ -3604,18 +3516,17 @@ msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"If the last expression ends with `;`, then the resulting value and type is " -"`()`." +"If the last expression ends with `;`, then the resulting value and type is `()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر می‌کند. " +"به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید واژه " +"`return` تغییرات را اعمال کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." @@ -3623,11 +3534,11 @@ msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محا #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"You can shadow variables, both those from outer scopes and variables from " -"the same scope:" +"You can shadow variables, both those from outer scopes and variables from the " +"same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " -"هم متغیرهایی که از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم " +"متغیرهایی که از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3652,22 +3563,22 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block " -"in the last example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block in the " +"last example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " -"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در " +"خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both " -"variables' memory locations exist at the same time. Both are available under " -"the same name, depending where you use it in the code." +"Shadowing is different from mutation, because after shadowing both variables' " +"memory locations exist at the same time. Both are available under the same name, " +"depending where you use it in the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " -"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " -"کد استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور " +"همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد " +"استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3683,22 +3594,21 @@ msgstr "" #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some " -"programming languages), then a return type." +"Declaration parameters are followed by a type (the reverse of some programming " +"languages), then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " -"برخی از زبان‌های برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی " +"از زبان‌های برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return " -"value. Simply omit the `;` at the end of the expression. The `return` " -"keyword can be used for early return, but the \"bare value\" form is " -"idiomatic at the end of a function (refactor `gcd` to use a `return`)." +"The last expression in a function body (or any block) becomes the return value. " +"Simply omit the `;` at the end of the expression. The `return` keyword can be " +"used for early return, but the \"bare value\" form is idiomatic at the end of a " +"function (refactor `gcd` to use a `return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " -"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " -"عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته " +"می‌شود. به همین سادگی `;` را میتوان در انتهای عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy @@ -3706,56 +3616,55 @@ 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/control-flow-basics/functions.md -msgid "" -"Overloading is not supported -- each function has a single implementation." +msgid "Overloading is not supported -- each function has a single implementation." msgstr "" "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not " -"supported. Macros can be used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not supported. " +"Macros can be used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " -"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. " +"ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, " -"which will be covered later." +"Always takes a single set of parameter types. These types can be generic, which " +"will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a " -"variable number of arguments. They are distinguished by a `!` at the end. " -"The Rust standard library includes an assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a variable " +"number of arguments. They are distinguished by a `!` at the end. The Rust " +"standard library includes an assortment of useful macros." msgstr "" "ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " -"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " -"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." +"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد " +"Rust شامل مجموعه ای از ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " -"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " -"را اعمال می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح " +"داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال " +"می کند. ." #: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " -"یک رشته برمی گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک " +"رشته برمی گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." @@ -3763,19 +3672,17 @@ msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن ر #: src/control-flow-basics/macros.md msgid "" -"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " -"panic." +"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." msgstr "" -"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " -"panic می کند." +"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می " +"کند." #: src/control-flow-basics/macros.md msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will " -"panic." +"`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " -"اعدام شود وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود " +"وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3783,21 +3690,21 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and " -"how to use them. Why they are defined as macros, and what they expand to, is " -"not especially critical." +"The takeaway from this section is that these common conveniences exist, and how " +"to use them. Why they are defined as macros, and what they expand to, is not " +"especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " -"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " -"یابند، بسیار مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. " +"اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار " +"مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe " -"use of derive macros." +"The course does not cover defining macros, but a later section will describe use " +"of derive macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " -"مشتق شده توضیح داده خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده " +"توضیح داده خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy @@ -3805,27 +3712,22 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " -"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر " +"تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is 1, then the sequence terminates at _ni_." +msgid "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " -"می‌یابد." +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "" -"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " -"+ ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3888,8 +3790,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 35 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " -"آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن " +"شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3897,27 +3799,26 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) " -"elements of the same type `T`. Note that the length of the array is _part of " -"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " -"different types. Slices, which have a size determined at runtime, are " -"covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements " +"of the same type `T`. Note that the length of the array is _part of its type_, " +"which means that `[u8; 3]` and `[u8; 4]` are considered two different types. " +"Slices, which have a size determined at runtime, are covered later." msgstr "" "یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " -"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " -"نظر گرفته می‌شوند." +"span> (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` است. " +"توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر " +"گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be " -"avoided using unsafe Rust." +"runtime. Rust can usually optimize these checks away, and they can be avoided " +"using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " -"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " -"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در " +"زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با " +"استفاده از Rust ناایمن از آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3926,25 +3827,23 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. " -"Types such as integers and strings implement the default output, but arrays " -"only implement the debug output. This means that we must use debug output " -"here." -msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " -"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " -"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " -"خروجی دیباگ استفاده کنیم." +"parameter: `{}` gives the default output, `{:?}` gives the debug output. Types " +"such as integers and strings implement the default output, but arrays only " +"implement the debug output. This means that we must use debug output here." +msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` " +"نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، " +"`{:?}` خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و " +"رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها فقط خروجی دیباگ را پیاده " +"سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک " -"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت " +"«چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3956,16 +3855,16 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, " -"e.g. `t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند `t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies " -"absence of a return value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of " +"a return value, akin to `void` in other languages." msgstr "" "تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " "بازگشتی است، مشابه `void` در زبان‌های دیگر." @@ -3976,22 +3875,20 @@ msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه ت #: src/tuples-and-arrays/iteration.md msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered " -"that yet." +"This functionality uses the `IntoIterator` trait, but we haven't covered that yet." msgstr "" -"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " -"پرداخته‌ایم." +"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked, while debug-only variants like " -"`debug_assert!` compile to nothing in release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` " +"macros. These are always checked, while debug-only variants like `debug_assert!` " +"compile to nothing in release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" -"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " -"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` " +"وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند " +"`debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -3999,9 +3896,9 @@ msgid "" "extract the inner values into local variables. This can be done manually by " "directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " -"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " -"دسترسی مستقیم به مقادیر داخلی انجام داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی " +"را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به " +"مقادیر داخلی انجام داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -4009,47 +3906,46 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger " -"value into its constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger value " +"into its constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " -"در بخش های تشکیل دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در " +"بخش های تشکیل دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " -"statically verify that the value on the right of `=` has the same structure " -"as the pattern." +"statically verify that the value on the right of `=` has the same structure as " +"the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " -"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " -"دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می " +"تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, " -"hence why we can also use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, hence " +"why we can also use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " -"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو " +"می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " -"comparison and destructuring to happen at the same time. This form of " -"pattern matching will be discussed in more detail later." +"comparison and destructuring to happen at the same time. This form of pattern " +"matching will be discussed in more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " -"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " -"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و " +"تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات " +"بیشتری مورد بحث قرار خواهد گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't " -"match the value being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't match " +"the value being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " -"مطابقت‌شده مطابقت ندارد نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده " +"مطابقت ندارد نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -4069,11 +3965,11 @@ msgstr "" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the " -"function. This function only operates on 3x3 matrices." +"Copy the code below to and implement the function. " +"This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و توابع " +"را پیاده‌سازی کنید:" #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md @@ -4104,23 +4000,22 @@ msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن ش #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership " -"of the value, and is also called \"borrowing\". Shared references are read-" -"only, and the referenced data cannot change." +"A reference provides a way to access another value without taking ownership of " +"the value, and is also called \"borrowing\". Shared references are read-only, and " +"the referenced data cannot change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " -"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " -"نمی توانند تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن " +"«قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند " +"تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made " -"with the `&` operator. The `*` operator \"dereferences\" a reference, " -"yielding its value." +"A shared reference to a type `T` has type `&T`. A reference value is made with " +"the `&` operator. The `*` operator \"dereferences\" a reference, yielding its " +"value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " -"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " -"دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته " +"می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -4130,114 +4025,107 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The " -"course will get into more detail on ownership in day 3." +"access the value, but is still \"owned\" by the original variable. The course " +"will get into more detail on ownership in day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " -"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " -"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " -"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و " +"این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع " +"برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در " +"روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can " -"be much smaller than the thing they point to. Students familiar with C or C+" -"+ will recognize references as pointers. Later parts of the course will " -"cover how Rust prevents the memory-safety bugs that come from using raw " -"pointers." +"References are implemented as pointers, and a key advantage is that they can be " +"much smaller than the thing they point to. Students familiar with C or C++ will " +"recognize references as pointers. Later parts of the course will cover how Rust " +"prevents the memory-safety bugs that come from using raw pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " -"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " -"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " -"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " -"استفاده از نشانگرهای خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند " +"بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ " +"آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این " +"موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از استفاده از نشانگرهای " +"خام جلوگیری می‌کند." #: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." -msgstr "" -"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"Rust will auto-dereference in some cases, in particular when invoking methods " +"(try `r.is_ascii()`). There is no need for an `->` operator like in C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " -"متدها (`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها " +"(`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " -"Note that this re-binds `r`, so that it refers to something else. This is " -"different from C++, where assignment to a reference changes the referenced " -"value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note " +"that this re-binds `r`, so that it refers to something else. This is different " +"from C++, where assignment to a reference changes the referenced value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " -"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " -"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " -"تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه " +"داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می " +"کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if " -"that value was mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if that " +"value was mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " -"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن " +"مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long enough. " +"Dangling references cannot occur in safe Rust. `x_axis` would return a reference " +"to `point`, but `point` will be deallocated when the function returns, so this " +"will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " -"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " -"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " -"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه " +"کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک " +"ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، " +"بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " -"خواهیم کرد." +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the " -"value they refer to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the value " +"they refer to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " -"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند " +"مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the " -"value. No other references (shared or exclusive) can exist at the same time, " -"and the referenced value cannot be accessed while the exclusive reference " -"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " -"alive." +"\"Exclusive\" means that only this reference can be used to access the value. No " +"other references (shared or exclusive) can exist at the same time, and the " +"referenced value cannot be accessed while the exclusive reference exists. Try " +"making an `&point.0` or changing `point.0` while `x_coord` is alive." msgstr "" "\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " -"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " -"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " -"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " -"`point.0` را تغییر دهید." +"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود " +"داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده " +"دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا `point.0` را تغییر " +"دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let " -"x_coord: &mut i32`. The first one represents a shared reference which can be " -"bound to different values, while the second represents an exclusive " -"reference to a mutable value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: " +"&mut i32`. The first one represents a shared reference which can be bound to " +"different values, while the second represents an exclusive reference to a mutable " +"value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " -"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " -"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. " +"مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در " +"حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -4250,13 +4138,13 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` " +"تغییر دهید چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending " -"indexes in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending indexes " +"in brackets." msgstr "" "ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " "براکت‌ها، برش (slice) ایجاد می‌کنیم." @@ -4264,62 +4152,59 @@ msgstr "" #: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " -"identical." +"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/references/slices.md 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/references/slices.md -msgid "" -"To easily create a slice of the full array, we can therefore use `&a[..]`." +msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " "استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " -"(`&[i32]`) no longer mentions the array length. This allows us to perform " -"computation on slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) " +"no longer mentions the array length. This allows us to perform computation on " +"slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " -"`s` (`&[i32]`) دیگر طول آرایه را " -"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " -"انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. " +"این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." #: src/references/slices.md 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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but the " +"answer is that for memory safety reasons you cannot do it through `a` at this " +"point in the execution, but you can read the data from both `a` and `s` safely. " +"It works before you created the slice, and again after the `println`, when the " +"slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " -"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " -"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " -"داده‌ها را از هر دو `a` و `s` به " -"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، " +"اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر " +"دو `a` و `s` به طور ایمن بخوانید. این " +"کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، " +"زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow " +"checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -4331,8 +4216,7 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "" -"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4358,31 +4242,31 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a " -"`Vec`, it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, " +"it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " -"بایت‌هاست. مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. " +"مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string " -"literal; `String::new()` creates a new empty string, to which string data " -"can be added using the `push()` and `push_str()` methods." +"As with many other types `String::from()` creates a string from a string 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()` که رشته " -"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `String::from()` یک رشته از یک " +"لیترال رشته ایجاد می‌کند. `String::new()` که رشته خالی جدید " +"ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md @@ -4390,9 +4274,9 @@ 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!()` یک راه راحت برای ایجاد یک رشته Owned " -"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" -"()` است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned از " +"مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` " +"است." #: src/references/strings.md msgid "" @@ -4401,63 +4285,60 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " -"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " -"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " -"درست کردن مرزهای کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. " +"اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. " +"تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای " +"کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " -"one that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain " -"UTF-8 encoded bytes and will never use a small-string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one " +"that always points to a valid string in memory. Rust `String` is a rough " +"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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` " +"ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `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\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " -"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" == \"\\\\n\"`.شما " +"می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را " +"جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, " -"representing a point as `[f64;3]`. It is up to you to determine the function " -"signatures." +"We will create a few utility functions for 3-dimensional geometry, representing a " +"point as `[f64;3]`. It is up to you to determine the function signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " -"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان " +"`[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" +"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " -"`v.sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v." +"sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4489,8 +4370,7 @@ msgstr "/// اندازه‌ی بردار داده شده را محاسبه کن #: src/references/solution.md msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its " -"direction.\n" +"/// Change the magnitude of the vector to 1.0 without changing its direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4537,46 +4417,43 @@ msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری #: src/user-defined-types/named-structs.md msgid "" -"This may be a good time to let people know there are different types of " -"structs." +"This may be a good time to let people know there are different types of structs." msgstr "" -"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " -"دارد." +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " -"trait on some type but don’t have any data that you want to store in the " -"value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait " +"on some type but don’t have any data that you want to store in the value itself." msgstr "" "ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " -"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " -"که بخواهید در خود مقدار ذخیره کنید." +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که " +"بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md msgid "" -"The next slide will introduce Tuple structs, used when the field names are " -"not important." +"The next slide will introduce Tuple structs, used when the field names are not " +"important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " -"استفاده می‌شوند که نام فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده " +"می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " -"یک روش میانبر ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک " +"روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the " -"old struct without having to explicitly type it all out. It must always be " -"the last element." +"The syntax `..avery` allows us to copy the majority of the fields from the old " +"struct without having to explicitly type it all out. It must always be the last " +"element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " -"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم " +"بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" @@ -4589,6 +4466,7 @@ msgstr "\"({}, {})\"" #: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" +"این اغلب برایsingle-field wrapper (که newtypes نامیده می‌شوند) استفاده می‌شود:" #: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" @@ -4603,11 +4481,11 @@ msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in " -"a primitive type, for example:" +"Newtypes are a great way to encode additional information about the value in a " +"primitive type, for example:" msgstr "" -"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " -"اولیه (primitive type) است، به عنوان مثال:" +"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع اولیه " +"(primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." @@ -4615,20 +4493,20 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have " -"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have to " +"validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " -"single field in the newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single " +"field in the newtype." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " -"for instance using booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for " +"instance using booleans as integers." msgstr "" "Rust معمولاً چیزهای غیر واضح را دوست ندارد، مانند automatic unwrapping یا " "به‌عنوان‌مثال استفاده از booleanها به عنوان اعداد صحیح." @@ -4648,8 +4526,7 @@ msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" -"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " -"است:" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" #: src/user-defined-types/enums.md #, fuzzy @@ -4673,8 +4550,8 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " -"تحت یک نوع جمع آوری کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک " +"نوع جمع آوری کنید." #: src/user-defined-types/enums.md msgid "" @@ -4686,9 +4563,9 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, " -"Rust will store a discriminant so that it knows at runtime which variant is " -"in a `PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, Rust " +"will store a discriminant so that it knows at runtime which variant is in a " +"`PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4697,26 +4574,24 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one " -"with different types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع مختلف " +"فیلد (variant payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate " -"structs but then they wouldn’t be the same type as they would if they were " -"all defined in an enum." +"You could even implement the different variants of an enum with separate structs " +"but then they wouldn’t be the same type as they would if they were all defined in " +"an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " -"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " -"نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، " +"اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "" -"Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." +msgstr "Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" @@ -4724,26 +4599,24 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"If the allowed variant values do not cover all bit patterns, it will use invalid " +"bit patterns to encode the discriminant (the \"niche optimization\"). For " +"example, `Option<&u8>` stores either a pointer to an integer or `NULL` for the " +"`None` variant." msgstr "" #: src/user-defined-types/enums.md -msgid "" -"You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " -"را کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را " +"کنترل کنید:" #: src/user-defined-types/enums.md msgid "" -"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " -"bytes." +"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." msgstr "" -"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " -"بایت جا می‌شود." +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا " +"می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md @@ -4754,31 +4627,30 @@ msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md msgid "" -"Rust has several optimizations it can employ to make enums take up less " -"space." +"Rust has several optimizations it can employ to make enums take up less space." msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" -"option/#representation), Rust guarantees that `size_of::()` equals " -"`size_of::>()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" +"#representation), Rust guarantees that `size_of::()` equals `size_of::" +">()`." msgstr "" "بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" -">()` است." +"dir=ltr>`size_of::()` برابر با `size_of::>()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look " -"like in practice. It's important to note that the compiler provides no " -"guarantees regarding this representation, therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look like " +"in practice. It's important to note that the compiler provides no guarantees " +"regarding this representation, therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " -"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " -"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر " +"برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، " +"بنابراین این کاملاً ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4787,44 +4659,43 @@ msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined " -"wherever they are used:" +"Constants are evaluated at compile time and their values are inlined wherever " +"they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " -"استفاده می شوند، درج می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده " +"می شوند، درج می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." +"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)، این موارد هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static.html)، " +"این موارد هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate " -"`const` values. `const` functions can however be called at runtime." +"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` را می توان در " -"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای تولید " +"مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در زمان اجرا " +"فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` " +"عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but " -"it is helpful and safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا ارزیابی " +"می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده `static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4835,8 +4706,7 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " -"نمی‌شوند:" +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4849,30 +4719,29 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html), these are not inlined upon use and have an actual " -"associated memory location. This is useful for unsafe and embedded code, and " -"the variable lives through the entirety of the program execution. When a " -"globally-scoped value does not have a reason to need object identity, " -"`const` is generally preferred." +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" +"static.html), these are not inlined upon use and have an actual associated memory " +"location. This is useful for unsafe and embedded code, and the variable lives " +"through the entirety of the program execution. When a 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` ترجیح داده می‌شود." +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان حافظه " +"واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل اجرای " +"برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, استفاده از " +"`const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " -"`C++` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C++` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as " -"required by types with interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as required by " +"types with interior mutability such as `Mutex`." msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." @@ -4880,17 +4749,17 @@ msgstr "" #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be " -"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be `Sync`. " +"Interior mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/" +"sync/struct.Mutex.html), atomic or similar." 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) نگاه خواهیم کرد." +"`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang.org/std/" +"sync/struct.Mutex.html)، اتمی یا مشابه امکان پذیر است. البته که داشتن متغییر های " +"استاتیک قابل تغییر هم امکان پذیر هست اما برای این کار نیاز به همگام سازی دستی " +"دارند. بنابراین هر دسترسی به آنها نیاز به کد `unsafe` دارد. ما در فصل Unsafe " +"Rust به استاتیک های قابل تغییر [mutable statics](../unsafe/mutable-static-" +"variables.md) نگاه خواهیم کرد." #: src/user-defined-types/static.md #, fuzzy @@ -4917,24 +4786,27 @@ msgstr "برنامه‌نویسان C این را شبیه به `typedef` تشخ #: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " -"system. It is up to you to define the types and functions to construct " -"various events. Use `#[derive(Debug)]` to allow the types to be formatted " -"with `{:?}`." +"system. It is up to you to define the types and functions to construct various " +"events. Use `#[derive(Debug)]` to allow the types to be formatted with `{:?}`." msgstr "" +"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد خواهیم " +"کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای مختلف تعریف " +"کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با `{:?}` قالببندی " +"شوند." #: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " -"`main` runs without errors. The next part of the course will cover getting " -"data out of these structures." +"`main` runs without errors. The next part of the course will cover getting data " +"out of these structures." msgstr "" +"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا اجرا " +"شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy -msgid "" -"/// An event in the elevator system that the controller must react to.\n" -msgstr "" -"/// An event in the elevator system that the controller must react to.\n" +msgid "/// An event in the elevator system that the controller must react to.\n" +msgstr "/// An event in the elevator system that the controller must react to.\n" #: src/user-defined-types/exercise.md #, fuzzy @@ -4964,11 +4836,9 @@ msgstr "/// The car doors have closed.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy msgid "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +"/// A directional button was pressed in an elevator lobby on the given floor.\n" msgstr "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +"/// A directional button was pressed in an elevator lobby on the given floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy @@ -5069,18 +4939,16 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "" -"Standard library types and traits: a tour of Rust's rich standard library." -msgstr "" -"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "Standard library types and traits: a tour of Rust's rich standard library." +msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " -"این شامل:" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این " +"شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md @@ -5089,8 +4957,8 @@ msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شا #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " "دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." @@ -5111,9 +4979,9 @@ msgstr "'q'" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md -#: src/generics/solution.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md +#: src/std-traits/solution.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'a'" msgstr "'a'" @@ -5157,44 +5025,42 @@ msgstr "\"یک چیز دیگر\"" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be exhaustive, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." +"The `_` pattern is a wildcard pattern which matches any value. The expressions " +"_must_ be exhaustive, meaning that it covers every possibility, so `_` is often " +"used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " -"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " -"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید " +"جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان " +"آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " -"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " -"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match " +"باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته " +"باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that can " +"be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " -"بخش مطابقت استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش " +"مطابقت استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " -"باشد که شرط برقرار باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد " +"که شرط برقرار باشد." #: src/pattern-matching/match.md msgid "" -"You might point out how some specific characters are being used when in a " -"pattern" -msgstr "" -"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +"You might point out how some specific characters are being used when in a pattern" +msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -5215,29 +5081,28 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when " -"we wish to concisely express more complex ideas than patterns alone would " -"allow." +"Match guards as a separate syntax feature are important and necessary when we " +"wish to concisely express more complex ideas than patterns alone would allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " -"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و " +"ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"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." +"They are not the same as separate `if` expression inside of the match arm. An " +"`if` expression inside of the branch block (after `=>`) happens after the 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` اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک عبارت " +"`if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به اون شاخه " +"خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های عبارت `match` " +"اصلی ندارد." #: src/pattern-matching/match.md msgid "" -"The condition defined in the guard applies to every expression in a pattern " -"with an `|`." +"The condition defined in the guard applies to every expression in a pattern with " +"an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -5270,13 +5135,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to " -"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." +"The distinction between a capture and a constant expression can be hard to 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` تغییر دهید و خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍`2` " +"را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را به یک " +"`const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -5284,13 +5149,12 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is " -"how you inspect the structure of your types. Let us start with a simple " -"`enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is how " +"you inspect the structure of your types. Let us start with a simple `enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " -"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " -"بیایید با یک نوع ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده " +"شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع " +"ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -5306,21 +5170,21 @@ msgstr "\"با عرض‌پوزش، خطایی رخ داده است: {msg}\"" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first " -"arm, `half` is bound to the value inside the `Ok` variant. In the second " -"arm, `msg` is bound to the error message." +"Here we have used the arms to _destructure_ the `Result` value. In the first arm, " +"`half` is bound to the value inside the `Ok` variant. In the second arm, `msg` is " +"bound to the error message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " -"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " -"`msg` به پیام خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` " +"به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام " +"خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md msgid "" -"The `if`/`else` expression is returning an enum that is later unpacked with " -"a `match`." +"The `if`/`else` expression is returning an enum that is later unpacked with a " +"`match`." msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " -"هم باز می‌شود." +"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از هم باز " +"می‌شود." #: src/pattern-matching/destructuring-enums.md msgid "" @@ -5328,50 +5192,47 @@ 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` اضافه کنید و نمایش " -"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " -"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش خطاها " +"هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش " +"کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md msgid "" -"The values in the enum variants can only be accessed after being pattern " -"matched." +"The values in the enum variants can only be accessed after being pattern matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage " -"the Rust compiler provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage the " +"Rust compiler provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " -"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " -"شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر " +"Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it " -"in a loop. That won't compile because `msg` is consumed when matched. To fix " -"it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " -"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " -"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " -"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " -"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" -"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " -"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " -"msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it in a " +"loop. That won't compile because `msg` is consumed when matched. To fix it, match " +"`&result` instead of `result`. That will make `msg` a reference so it won't be " +"consumed. This [\"match ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-" +"ergonomics.html) appeared in Rust 2018. If you want to support older Rust, " +"replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با " +"استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف " +"می‌شود. برای رفع این مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث " +"می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. این ویژگی که به نام [\"match " +"ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) شناخته " +"می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی " +"کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. " -"They are used for pattern matching:" +"Rust has a few control flow constructs which differ from other languages. They " +"are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " -"ساختارها برای مطابقت الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها " +"برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5387,13 +5248,13 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-let-expressions) lets you execute different code depending on " -"whether a value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " -"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-" +"let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت " +"دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md #, fuzzy @@ -5402,15 +5263,15 @@ msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " -"- anything but falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, use " +"[`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else." +"html). The \"else\" case must diverge (`return`, `break`, or panic - anything but " +"falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" -"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " -"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " -"- به غیر از اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc." +"rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، " +"حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` - به غیر از " +"اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -5429,32 +5290,31 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md -#: src/android/testing.md src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md +#: src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " -"repeatedly tests a value against a pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/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) وجود دارد که مقادیر " -"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر مقابل " +"الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) returns `Some(c)` until the string is empty, after " -"which it will return `None`. The `while let` lets us keep iterating through " -"all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String." +"html#method.pop) returns `Some(c)` until the string is empty, after which it will " +"return `None`. The `while let` lets us keep iterating through all items." msgstr "" "در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " -"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " -"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و " +"پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد " +"که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -5462,25 +5322,24 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make " -"it more concise than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make it " +"more concise than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " -"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " -"کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی " +"نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" -"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " -"`Option` است:" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` " +"است:" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " -"الگو استفاده نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو " +"استفاده نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5488,14 +5347,13 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports " -"flattening this nested code. Rewrite the awkward version for students, so " -"they can see the transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports flattening " +"this nested code. Rewrite the awkward version for students, so they can see the " +"transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " -"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " -"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " -"مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده " +"شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی " +"پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5507,22 +5365,21 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value " -"matches the pattern." +"Point out that the `while let` loop will keep going as long as the value matches " +"the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " -"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته " +"باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if " -"statement that breaks when there is no value to unwrap for `name.pop()`. The " -"`while let` provides syntactic sugar for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if statement " +"that breaks when there is no value to unwrap for `name.pop()`. The `while let` " +"provides syntactic sugar for the above scenario." msgstr "" "شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." -"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " -"می‌دهد." +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، " +"شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5530,49 +5387,48 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later " -"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " -"tests. To evaluate a boxed expression, use the deref operator (`*`) to " -"\"unbox\" it: `eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later in " +"the course. An expression can be \"boxed\" with `Box::new` as seen in the tests. " +"To evaluate a boxed expression, use the deref operator (`*`) to \"unbox\" it: " +"`eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " -"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " -"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " -"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی " +"قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور " +"که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) " +"برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" "Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " +"type is an enum that represents either a successful value (`Ok(Value)`) or an " +"error (`Err(String)`). We will cover this type in detail later." msgstr "" "برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " +"یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " "(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing " -"`eval`. The final product should pass the tests. It may be helpful to use " -"`todo!()` and get the tests to pass one-by-one. You can also skip a test " -"temporarily with `#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing `eval`. " +"The final product should pass the tests. It may be helpful to use `todo!()` and " +"get the tests to pass one-by-one. You can also skip a test temporarily with " +"`#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " -"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " -"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " -"را با استفاده از `[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. " +"محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها " +"به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از " +"`[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " -"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " -"panic مدیریت کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز " +"عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت " +"کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md #, fuzzy @@ -5604,11 +5460,11 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with " -"an `impl` block:" +"Rust allows you to associate functions with your new types. You do this with an " +"`impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " -"کار را با استفاده از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار " +"را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md #, fuzzy @@ -5652,39 +5508,39 @@ msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts " -"on. There are several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts on. " +"There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " -"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. " +"چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " -"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض " +"می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " -"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " -"به پایان برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر " +"قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان " +"برسد." #: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " -"method becomes the owner of the object. The object will be dropped " -"(deallocated) when the method returns, unless its ownership is explicitly " -"transmitted. Complete ownership does not automatically mean mutability." +"method becomes the owner of the object. The object will be dropped (deallocated) " +"when the method returns, unless its ownership is explicitly transmitted. Complete " +"ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " -"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " -"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک " +"شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور " +"صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5692,8 +5548,8 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to " -"create constructors which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to create " +"constructors which are called `new` by convention." msgstr "" "بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " "سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." @@ -5704,21 +5560,21 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the " -"first parameter represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the first " +"parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " -"پارامتر اول نمونه را به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر " +"اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver " -"syntax and to help keep them more organized. By using methods we can keep " -"all the implementation code in one predictable place." +"Developers may choose to use methods to take advantage of method receiver syntax " +"and to help keep them more organized. By using methods we can keep all the " +"implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " -"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " -"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد " +"بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم " +"تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." @@ -5727,53 +5583,53 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how " -"the struct name could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how the " +"struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " -"دهید که چگونه نام struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که " +"چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and " -"can be used elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and can " +"be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " -"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار " +"دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to " -"refer to individual fields." +"Note how `self` is used like other structs and dot notation can be used to refer " +"to individual fields." msgstr "" "توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " "می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` " -"by trying to run `finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` by " +"trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " -"تلاش برای اجرای متد `finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش " +"برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://" -"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " -"receiver types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://doc." +"rust-lang.org/reference/special-types-and-traits.html) allowed to be receiver " +"types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " -"به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " -"redundant?" +"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that redundant?" msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point Point`, but methods in this " -"block will only be available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this block " +"will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type parameters. " +"Here, `Foo::from(\"hello\")` would not compile because there is no `From<&str>` " +"implementation for `Foo`." msgstr "" "پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can be " +"arbitrary, like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " -"باشد، مانند `() -> B` can return any " -"type satisfying `B`, and the caller may need to choose one, such as with " -"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" -">()`." +"Inference is hard in return position. A function returning `impl Foo` picks the " +"concrete type it returns, without writing it out in the source. A function " +"returning a generic type like `collect() -> B` can return any type satisfying " +"`B`, and the caller may need to choose one, such as with `let x: Vec<_> = foo." +"collect()` or with the turbofish, `foo.collect::>()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " -"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " -"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " -"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " -"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " -"یا با استفاده از ()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ " +"مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. " +"تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که " +"`B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از " +"آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` یا با استفاده از " +"()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " -"the error message shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the " +"error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " -"ببینید پیام خطا چه چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید " +"پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also " -"supports using them for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also supports " +"using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " -"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " -"اشیاء trait پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین " +"از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait " +"پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -6379,87 +6225,82 @@ msgstr "// Uses type-erasure and dynamic dispatch.\n" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a " -"specialized instance of the function for each different type that the " -"generic is instantiated with. This means that calling a trait method from " -"within a generic function still uses static dispatch, as the compiler has " -"full type information and can resolve which type's trait implementation to " -"use." +"Generics, including `impl Trait`, use monomorphization to create a specialized " +"instance of the function for each different type that the generic is instantiated " +"with. This means that calling a trait method from within a generic function still " +"uses static dispatch, as the compiler has full type information and can resolve " +"which type's trait implementation to use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " -"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " -"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " -"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " -"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از " +"تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست " +"که فراخوانی یک متد trait از درون یک تابع generic همچنان از فراخوانی استاتیک " +"استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و می‌تواند پیاده‌سازی trait " +"مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " -"This means that there's a single version of `fn dynamic` that is used " -"regardless of what type of `Pet` is passed in." -msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " -"یک [virtual method table](https://en.wikipedia.org/wiki/" -"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " -"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " -"استفاده می‌شود." +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This " +"means that there's a single version of `fn dynamic` that is used regardless of " +"what type of `Pet` is passed in." +msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک " +"[virtual method table](https://en.wikipedia.org/wiki/Virtual_method_table) " +"(vtable) استفاده می‌کند. این بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد " +"که بدون توجه به تایپ `Pet` که وارد می‌شود، استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, the trait object needs to be behind some kind of " -"indirection. In this case it's a reference, though smart pointer types like " -"`Box` can also be used (this will be demonstrated on day 3)." +"indirection. In this case it's a reference, though smart pointer types like `Box` " +"can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " -"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " -"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " -"سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته " +"باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند " +"مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " -"two pointers: One pointer points to the concrete object that implements " -"`Pet`, and the other points to the vtable for the trait implementation for " -"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " -"up the function pointer for `talk` in the vtable and then invokes the " -"function, passing the pointer to the `Dog` or `Cat` into that function. The " -"compiler doesn't need to know the concrete type of the `Pet` in order to do " -"this." -msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " -"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " -"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " -"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " -"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " -"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " -"`Pet` برای انجام این کار ندارد." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two " +"pointers: One pointer points to the concrete object that implements `Pet`, and " +"the other points to the vtable for the trait implementation for that type. When " +"calling the `talk` method on `&dyn Pet` the compiler looks up the function " +"pointer for `talk` in the vtable and then invokes the function, passing the " +"pointer to the `Dog` or `Cat` into that function. The compiler doesn't need to " +"know the concrete type of the `Pet` in order to do this." +msgstr "" +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، " +"یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی " +"می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام " +"فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع `talk` را در vtable " +"جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به `Dog` یا `Cat` را به آن تابع " +"پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " -"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا " +"دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using the [`Ord`](https://doc.rust-" -"lang.org/stable/std/cmp/trait.Ord.html) trait." +"determines the minimum of two values, using the [`Ord`](https://doc.rust-lang.org/" +"stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " -"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." -"rust-lang.org/stable/std/cmp/trait.Ord.html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از " +"دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/" +"stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md #, fuzzy msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "// TODO: implement the `min` function used in `main`.\n" -#: src/generics/exercise.md src/generics/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'z'" msgstr "'z'" @@ -6490,8 +6331,8 @@ msgid "" "Ordering.html) enum." msgstr "" "[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " -"enum را به دانش‌آموزان نشان دهید." +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را " +"به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -6518,35 +6359,33 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " -"از متدهای رایج‌تر را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از " +"متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common " -"types used by Rust libraries and programs. This way, two libraries can work " -"together smoothly because they both use the same `String` type." +"Rust comes with a standard library which helps establish a set of common types " +"used by Rust libraries and programs. This way, two libraries can work together " +"smoothly because they both use the same `String` type." msgstr "" "Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " -"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " -"استفاده می‌کنند." +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه " +"می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." #: src/std-types/std.md msgid "" -"In fact, Rust contains several layers of the Standard Library: `core`, " -"`alloc` and `std`." +"In fact, Rust contains several layers of the Standard Library: `core`, `alloc` " +"and `std`." msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " -"`std`." +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on " -"`libc`, allocator or even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on `libc`, " +"allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " -"حتی وجود یک سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی " +"وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" @@ -6557,8 +6396,7 @@ msgstr "" "`Vec`، `Box` و `Arc`." #: src/std-types/std.md -msgid "" -"Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " "می‌کنند." @@ -6577,21 +6415,21 @@ msgstr "" #: src/std-types/docs.md msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." +"html)." msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." +"html)." #: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" -"std/collections/struct.BinaryHeap.html)." +"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" +"collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" -"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" -"stable/std/collections/struct.BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/" +"option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" +"collections/struct.BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6600,13 +6438,11 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md #, fuzzy msgid "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" +"/// Determine whether the first argument is divisible by the second argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" +"/// Determine whether the first argument is divisible by the second argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" @@ -6614,50 +6450,46 @@ msgstr "" msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " -"idiomatic to document all public items in an API using this pattern." +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is idiomatic to " +"document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " -"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " -"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " -"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " -"رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust " +"به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc]" +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند می‌شوند. مستند کردن " +"تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!" -"` or `/*! .. */`, called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!` or " +"`/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " -"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/" +"* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md #, fuzzy msgid "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers.\n" msgstr "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers.\n" #: src/std-types/docs.md msgid "" -"Show students the generated docs for the `rand` crate at ." +"Show students the generated docs for the `rand` crate at ." msgstr "" -"مستندات تولیدشده برای `rand` crate را در به " -"دانش‌آموزان نشان دهید." +"مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان " +"نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of " -"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" -"stable/std/string/struct.String.html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of type " +"`T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/stable/" +"std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in " -"memory as `T`." +"The niche optimization means that `Option` often has the same size in memory " +"as `T`." msgstr "" -"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، " -"هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str), which means that you can call " -"all `str` methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/string/" +"struct.String.html#deref-methods-str), which means that you can call all `str` " +"methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" -"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " -"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" +"string/struct.String.html#deref-methods-str) است، که به این معناست که می‌توانید " +"تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when " -"you know how much data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when you " +"know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " -"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده " +"کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be " -"different from its length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be different " +"from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " -"طول آن به‌صورت کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول " +"آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " -"`char` can be different from what a human will consider a \"character\" due " -"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" +"`char` can be different from what a human will consider a \"character\" due to " +"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " -"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." -"html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه " +"داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر " +"می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/unicode-" +"segmentation/latest/unicode_segmentation/struct.Graphemes.html)." #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " -"باشد." +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it " -"access to `str`'s methods." +"`String` implements `Deref` which transparently gives it access to " +"`str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " -"methods on a `Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/struct." +"Vec.html#deref-methods-%5BT%5D), which means that you can call slice methods on a " +"`Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" -"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " -"متدهای برش را بر روی یک `Vec` فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/" +"struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را " +"بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data " -"it contains is stored on the heap. This means the amount of data doesn't " -"need to be known at compile time. It can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data it " +"contains is stored on the heap. This means the amount of data doesn't need to be " +"known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " -"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " -"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap " +"ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و " +"می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " -"explicitly. As always with Rust type inference, the `T` was established " -"during the first `push` call." +"explicitly. As always with Rust type inference, the `T` was established during " +"the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://doc." +"rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);" +"+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to easily " +"initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" -"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " -"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K," +"+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی " +"یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md msgid "" -"Alternatively HashMap can be built from any `Iterator` which yields key-" -"value tuples." +"Alternatively HashMap can be built from any `Iterator` which yields key-value " +"tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " -"تولید می‌کند، ساخته شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید " +"می‌کند، ساخته شود." #: src/std-types/hashmap.md msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, " -"but it can lead into complications with the borrow checker." +"examples easier. Using references in collections can, of course, be done, but it " +"can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is used " +"to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" "`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " "ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "" -"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, " -"because it is reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, because " +"it is reflexive:" msgstr "" "`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " "بازتابی است:" #: src/std-traits/comparisons.md msgid "" -"In practice, it's common to derive these traits, but uncommon to implement " -"them." +"In practice, it's common to derive these traits, but uncommon to implement them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " -"آن‌ها به‌طور دستی پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها " +"به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc." -"rust-lang.org/std/ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-" +"lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." -"org/std/ops/index.html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/" +"std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -7317,17 +7135,15 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "" -"You could implement `Add` for `&Point`. In which situations is that useful?" +msgid "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " -"مفید است؟" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " -"the operator is not `Copy`, you should consider overloading the operator for " -"`&T` as well. This avoids unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the " +"operator is not `Copy`, you should consider overloading the operator for `&T` as " +"well. This avoids unnecessary cloning on the call site." msgstr "" "پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " "بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " @@ -7338,22 +7154,21 @@ msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " -"متد تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد " +"تعریف کرد؟" #: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " -"associated types (like `Output`) are controlled by the implementer of a " -"trait." +"associated types (like `Output`) are controlled by the implementer of a trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " -"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های " +"مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, " -"i32)> for Point` would add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for " +"Point` would add a tuple to a `Point`." msgstr "" "شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." @@ -7361,27 +7176,26 @@ msgstr "" #: src/std-traits/operators.md #, fuzzy msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " -"like the same operator in C-family languages; instead, for integer types it " -"negates each bit of the number, which arithmetically is equivalent to " -"subtracting it from -1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like " +"the same operator in C-family languages; instead, for integer types it negates " +"each bit of the number, which arithmetically is equivalent to subtracting it from " +"-1: `!5 == -6`." msgstr "" -"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در " -"زبان‌های خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، " -"هر بیت از عدد را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == " -"-6` است." +"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در زبان‌های " +"خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، هر بیت از عدد " +"را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == -6` است." #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions. Unlike `as`, these traits correspond to " -"lossless, infallible conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " +"and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate " +"type conversions. Unlike `as`, these traits correspond to lossless, infallible " +"conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " -"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای " +"تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -7389,18 +7203,18 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " -"automatically implemented when [`From`](https://doc.rust-lang.org/std/" -"convert/trait.From.html) is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically " +"implemented when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " +"is implemented:" msgstr "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" -"trait.From.html) پیاده‌سازی شده باشد:" +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get " -"`Into` implementation too." +"That's why it is common to only implement `From`, as your type will get `Into` " +"implementation too." msgstr "" "به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " "پیاده‌سازی `Into` را نیز دریافت می‌کند." @@ -7408,19 +7222,19 @@ msgstr "" #: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " -"converted into a `String`\", the rule is opposite, you should use `Into`. " -"Your function will accept types that implement `From` and those that _only_ " -"implement `Into`." +"converted into a `String`\", the rule is opposite, you should use `Into`. Your " +"function will accept types that implement `From` and those that _only_ implement " +"`Into`." msgstr "" "هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " -"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " -"پیاده‌سازی کرده‌اند." +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول " +"می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی " +"کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts " -"with `as`. These generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts with " +"`as`. These generally follow C semantics where those are defined." msgstr "" "Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " "می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." @@ -7439,42 +7253,39 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across " -"platforms. This might not match your intuition for changing sign or casting " -"to a smaller type -- check the docs, and comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across platforms. " +"This might not match your intuition for changing sign or casting to a smaller " +"type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " -"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " -"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. " +"این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته " +"باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use " -"incorrectly, and can be a source of subtle bugs as future maintenance work " -"changes the types that are used or the ranges of values in types. Casts are " -"best used only when the intent is to indicate unconditional truncation (e.g. " -"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " -"was in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and " +"can be a source of subtle bugs as future maintenance work changes the types that " +"are used or the ranges of values in types. Casts are best used only when the " +"intent is to indicate unconditional truncation (e.g. selecting the bottom 32 bits " +"of a `u64` with `as u32`, regardless of what was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " -"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " -"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " -"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " -"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " -"بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان " +"است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث " +"تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها " +"زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط باشد (مثلاً انتخاب 32 " +"بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " -"over `as` to confirm that the cast is in fact infallible. For fallible " -"casts, `TryFrom` and `TryInto` are available when you want to handle casts " -"that fit differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over " +"`as` to confirm that the cast is in fact infallible. For fallible casts, " +"`TryFrom` and `TryInto` are available when you want to handle casts that fit " +"differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " -"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " -"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " -"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " -"کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` " +"بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با " +"احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که " +"به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -7482,29 +7293,26 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might " -"be lost is generally discouraged, or at least deserves an explanatory " -"comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might be " +"lost is generally discouraged, or at least deserves an explanatory comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " -"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " -"دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است " +"داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " -"است." +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " -"abstract over `u8` sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`]" +"(https://doc.rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` " +"sources:" msgstr "" "با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " -"بر روی منابع `u8` انتزاع کنید:" +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی " +"منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -7520,11 +7328,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " -"you abstract over `u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you " +"abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " -"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما " +"امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -7543,8 +7351,8 @@ msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک " +"مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -7563,8 +7371,7 @@ msgstr "\" مقدار Y وارد شده است!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md -#: src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" @@ -7577,25 +7384,25 @@ msgstr "" #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to " -"their default values." +"A derived implementation will produce a value where all fields are set to their " +"default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " -"پیش‌فرض خود تنظیم شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض " +"خود تنظیم شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " -"پیاده‌سازی کنند." +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی " +"کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. " -"`0`, `\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, " +"`\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " -"(مثل `0`، `\"\"` و غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل " +"`0`، `\"\"` و غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -7606,31 +7413,30 @@ msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " -"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی " +"کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" -"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" -"with-struct-update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/" +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" +"update-syntax)." msgstr "" "سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" -"struct-update-syntax) شناخته می‌شود." +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" +"update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, they " +"implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), " +"[`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`]" +"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " -"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" -"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." -"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " -"هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها " +"پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`]" +"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -7653,65 +7459,63 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " -"be called needing only a shared reference to the closure, which means the " -"closure can be executed repeatedly and even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be " +"called needing only a shared reference to the closure, which means the closure " +"can be executed repeatedly and even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " -"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " -"چندین بار فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر " +"می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار " +"فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " -"object is accessed via exclusive reference, so it can be called repeatedly " -"but not concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object " +"is accessed via exclusive reference, so it can be called repeatedly but not " +"concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " -"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما " +"می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " -"Doing so consumes the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing " +"so consumes the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " -"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار " +"فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. " +"you can use an `FnMut` wherever an `FnOnce` is called for, and you can use an " +"`Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " -"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " -"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " -"کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` " +"است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید " +"و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if you " +"can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most " +"flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " -"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " -"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " -"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده " +"کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از " +"`FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای " +"فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then " -"`FnMut`, and lastly `FnOnce`." +"(which can be passed to a consumer of any of the 3 closure traits), then `FnMut`, " +"and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " -"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " -"`FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید " +"`Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." #: src/std-traits/closures.md #, fuzzy @@ -7725,15 +7529,13 @@ msgstr "" #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the " -"least demanding form of access they can (by shared reference if possible, " -"then exclusive reference, then by move). The `move` keyword forces capture " -"by value." +"By default, closures will capture each variable from an outer scope by the least " +"demanding form of access they can (by shared reference if possible, then " +"exclusive reference, then by move). The `move` keyword forces capture by value." msgstr "" -"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با " -"کمترین سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس " -"با انتقال) capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت " -"value اجباری می‌کند." +"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با کمترین " +"سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس با انتقال) " +"capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت value اجباری می‌کند." #: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" @@ -7749,15 +7551,15 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://" -"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " -"implement the missing bits. Only rotate ASCII alphabetic characters, to " -"ensure the result is still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://en." +"wikipedia.org/wiki/ROT13). Copy this code to the playground, and implement the " +"missing bits. Only rotate ASCII alphabetic characters, to ensure the result is " +"still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." -"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " -"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " -"تا نتیجه همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/" +"wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و " +"بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه " +"همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7773,11 +7575,11 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating " -"by 13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating by " +"13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " -"۱۳ کاراکتر را بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ " +"کاراکتر را بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7793,11 +7595,11 @@ msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md msgid "" -"Memory management, lifetimes, and the borrow checker: how Rust ensures " -"memory safety." +"Memory management, lifetimes, and the borrow checker: how Rust ensures memory " +"safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " -"Rust از ایمنی حافظه اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از " +"ایمنی حافظه اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7808,8 +7610,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " -"بکشد. این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. " +"این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7826,8 +7628,7 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "" -"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " -"می‌شود." +"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7863,41 +7664,39 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically " -"sized data, the actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized " +"data, the actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " -"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، " +"یعنی رشته واقعی، را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " -"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " -"کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول " +"است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." #: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" -"struct.System.html) and custom allocators can be implemented using the " -"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" +"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/struct." +"System.html) and custom allocators can be implemented using the [Allocator API]" +"(https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " -"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." -"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " -"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " -"پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده " +"از [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر " +"روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator " +"API](https://doc.rust-lang.org/std/alloc/index.html) پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should " -"point out that this is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should point " +"out that this is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " -"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با " +"این حال، باید اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7910,13 +7709,11 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7936,11 +7733,9 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "" -"Programmer must determine whether a pointer still points to valid memory." +msgid "Programmer must determine whether a pointer still points to valid memory." msgstr "" -"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " -"یا نه." +"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." @@ -7951,22 +7746,20 @@ msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" -"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " -"هسکل، ..." +"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." #: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " -"ارجاع داده شود، آزاد نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع " +"داده شود، آزاد نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "" -"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7984,80 +7777,78 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put " -"Rust in context." +"This slide is intended to help students coming from other languages to put Rust " +"in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " -"را در زمینه مناسب قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را " +"در زمینه مناسب قرار دهند." #: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " -"forgetting to call `free`, calling it multiple times for the same pointer, " -"or dereferencing a pointer after the memory it points to has been freed." +"forgetting to call `free`, calling it multiple times for the same pointer, or " +"dereferencing a pointer after the memory it points to has been freed." msgstr "" "C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " "خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " -"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " -"اشاره می‌کند." +"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره " +"می‌کند." #: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " -"advantage of language guarantees about calling destructors to ensure memory " -"is freed when a function returns. It is still quite easy to mis-use these " -"tools and create similar bugs to C." +"advantage of language guarantees about calling destructors to ensure memory is " +"freed when a function returns. It is still quite easy to mis-use these tools and " +"create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " -"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " -"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " -"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " -"ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از " +"تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن " +"حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که " +"از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that " -"is no longer reachable and discard it. This guarantees that any pointer can " -"be dereferenced, eliminating use-after-free and other classes of bugs. But, " -"GC has a runtime cost and is difficult to tune properly." +"Java, Go, and Python rely on the garbage collector to identify memory that is no " +"longer reachable and discard it. This guarantees that any pointer can be " +"dereferenced, eliminating use-after-free and other classes of bugs. But, GC has a " +"runtime cost and is difficult to tune properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " -"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " -"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " -"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " -"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای " +"که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر " +"اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از آزادسازی (use-" +"after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای در زمان اجرا دارد و " +"تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance " -"of C, with alloc and free operations precisely where they are required -- " -"zero cost. It also provides tools similar to C++'s smart pointers. When " -"required, other options such as reference counting are available, and there " -"are even third-party crates available to support runtime garbage collection " -"(not covered in this class)." +"Rust's ownership and borrowing model can, in many cases, get the performance of " +"C, with alloc and free operations precisely where they are required -- zero cost. " +"It also provides tools similar to C++'s smart pointers. When required, other " +"options such as reference counting are available, and there are even third-party " +"crates available to support runtime garbage collection (not covered in this " +"class)." msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " -"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " -"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" -"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " -"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " -"اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد " +"عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه " +"صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم " +"می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در دسترس هستند و حتی " +"crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان اجرا موجود است (که در این " +"کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error " -"to use a variable outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error to " +"use a variable outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " -"از متغیر خارج از دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از " +"متغیر خارج از دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely " -"one owner at all times." +"We say that the variable _owns_ the value. Every Rust value has precisely one " +"owner at all times." msgstr "" -"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " -"دارد." +"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." #: src/memory-management/ownership.md msgid "" @@ -8070,12 +7861,12 @@ msgstr "" #: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " -"garbage collector starts with a set of \"roots\" to find all reachable " -"memory. Rust's \"single owner\" principle is a similar idea." +"garbage collector starts with a set of \"roots\" to find all reachable memory. " +"Rust's \"single owner\" principle is a similar idea." msgstr "" "دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " -"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " -"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." +"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی " +"شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -8096,8 +7887,7 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" -"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " -"نیست." +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -8160,8 +7950,8 @@ msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " -"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده " +"می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -8178,29 +7968,27 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` " -"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ است که " +"در ان مقدار کپی میشود مگر که از `std::move` استفاده کنیم " +"( تا یک مقدار را جا به جا کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated " -"to manipulate the data itself is a matter of optimization, and such copies " -"are aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated to " +"manipulate the data itself is a matter of optimization, and such copies are " +"aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " -"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " -"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود " +"داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی " +"(aggressively) بهینه‌سازی می‌شوند." #: src/memory-management/move.md -msgid "" -"Simple values (such as integers) can be marked `Copy` (see later slides)." +msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" -"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " -"ببینید)." +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -8215,42 +8003,41 @@ 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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس از " +"آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the " -"`say_hello` function." +"The heap memory allocated for `name` will be freed at the end of the `say_hello` " +"function." msgstr "" -"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " -"خواهد شد." +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and " -"if `say_hello` accepts a reference as a parameter." +"`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` یک مرجع " -"را به عنوان پارامتر باید بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع (`&name`) منتقل کند و صد البته که `say_hello` یک مرجع را به عنوان " +"پارامتر باید بپذیرد." #: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " -"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع " +"ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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++ است که سهوا کپی ایجاد کنیم, " -"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " -"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, زیر به " +"صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که " +"لازم هست به صورت صریح کلون را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -8272,14 +8059,14 @@ msgstr "// Duplicate the data in s1.\n" msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " -"این کپی به صورت مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این " +"کپی به صورت مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " -"جداگانه‌ای حافظه خود را آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای " +"حافظه خود را آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -8291,84 +8078,83 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, " -"the string data has to be cloned. Otherwise we would get a double-free when " -"either string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, the " +"string data has to be cloned. Otherwise we would get a double-free when either " +"string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " -"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " -"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " -"آزادسازی مجدد حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده " +"است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، " +"هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد " +"حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " -"which is used to indicate when a value may be moved from. If the example had " -"been `s2 = std::move(s1)`, no heap allocation would take place. After the " -"move, `s1` would be in a valid but unspecified state. Unlike Rust, the " -"programmer is allowed to keep using `s1`." +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which " +"is used to indicate when a value may be moved from. If the example had been `s2 = " +"std::move(s1)`, no heap allocation would take place. After the 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` استفاده کند." +"البته که زبان C++ دارای [`std::move`]" +"(https://en.cppreference.com/w/cpp/utility/move) است که برای انتقال یک متغییر " +"استفاده میشود. اگر مثال ما `s2 = std::move(s1)` بود هیچ " +"تخصیص انباشتی صورت نمیگرفت بلکه `s1` در یک وضعیت معتبر البته نامشخص قرار میگرفت و " +"برخلاف زبان Rust, توی زبان C++ برنامه‌نویس مجاز است که دوباره " +"از `s1` استفاده کند." #: src/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " -"which is being copied or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is " +"being copied or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " -"انتقال دادن استفاده شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال " +"دادن استفاده شود." #: src/memory-management/clone.md msgid "" -"Sometimes you _want_ to make a copy of a value. The `Clone` trait " -"accomplishes this." +"Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes " +"this." msgstr "" -"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " -"انجام می‌دهد." +"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام " +"می‌دهد." #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " "occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " -"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال " +"`()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, " -"and return later to try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, and " +"return later to try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " -"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن " +"استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e." -"g. clone an array, all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e.g. " +"clone an array, all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " -"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان " +"مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning " -"logic if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning logic " +"if needed." msgstr "" "رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " "کپی‌برداری سفارشی را اجرا کند." #: src/memory-management/copy-types.md -msgid "" -"While move semantics are the default, certain types are copied by default:" +msgid "While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " -"صورت پیش‌فرض کپی می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت " +"پیش‌فرض کپی می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -8394,15 +8180,14 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on " -"arbitrary objects." +"Copying refers to bitwise copies of memory regions and does not work on arbitrary " +"objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " -"تعریف شده توسط شما کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف " +"شده توسط شما کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "" -"Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." @@ -8412,13 +8197,12 @@ msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " -"رفتار سفارشی را فراهم می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار " +"سفارشی را فراهم می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "" -"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -8426,19 +8210,19 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` " -"is not a `Copy` type." +"Add a `String` field to `struct Point`. It will not compile because `String` is " +"not a `Copy` type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " -"یک نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک " +"نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " -"برای `p1` قرار دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای " +"`p1` قرار دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -8446,16 +8230,16 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is " -"because rust requires that mutable references be exclusive, so while it's " -"valid to make a copy of a shared reference, creating a copy of a mutable " -"reference would violate Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is because " +"rust requires that mutable references be exclusive, so while it's valid to make a " +"copy of a shared reference, creating a copy of a mutable reference would violate " +"Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " -"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " -"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " -"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " -"قوانین قرض‌گیری Rust را نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات " +"قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز " +"دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک " +"ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را " +"نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -8466,9 +8250,8 @@ msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " -"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " -"شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را " +"پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -8505,8 +8288,7 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "" -"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -8514,38 +8296,38 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" -"drop` implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " +"implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " -"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی " +"کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " -"کرده باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده " +"باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The " -"significance is that it takes ownership of the value, so at the end of its " -"scope it gets dropped. This makes it a convenient way to explicitly drop " -"values earlier than they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The significance " +"is that it takes ownership of the value, so at the end of its scope it gets " +"dropped. This makes it a convenient way to explicitly drop values earlier than " +"they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " -"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " -"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " -"دامنه خارج می‌شوند، تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که " +"مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن " +"را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، " +"تبدیل می‌کند." #: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " -"کردن قفل‌ها، بستن فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن " +"قفل‌ها، بستن فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -8556,9 +8338,8 @@ msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " -"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " -"می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر " +"به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -8566,13 +8347,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its " -"data. We will use the \"builder pattern\" to support building a new value " -"piece-by-piece, using convenience functions." +"In this example, we will implement a complex data type that owns all of its data. " +"We will use the \"builder pattern\" to support building a new value piece-by-" +"piece, using convenience functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " -"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " -"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های " +"خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت " +"قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -8598,8 +8379,7 @@ msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md #, fuzzy -msgid "" -"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" @@ -8693,11 +8473,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " -"pointer to data on the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer " +"to data on the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " -"به داده‌های روی heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به " +"داده‌های روی heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -8705,22 +8485,22 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call " -"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" -"trait.Deref.html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can [call methods " +"from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref." +"html#more-on-deref-coercion)." msgstr "" "`| Element | 2 | o--+--->| Nil | // " -"| // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " +"| :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " -"- - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " -"- - - - -.\n" +".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - - - - " +"- -.\n" ": : : :\n" ": " "list : : :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " -"| // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " +"| :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " -"- - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" #: src/smart-pointers/box.md msgid "" -"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " -"not null." +"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not " +"null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " -"هیچ‌گاه تهی (null) نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه " +"تهی (null) نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -8790,51 +8570,51 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust " -"compiler wants to know an exact size." +"have a type whose size that can't be known at compile time, but the Rust compiler " +"wants to know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " -"به دانستن اندازه دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به " +"دانستن اندازه دقیق آن دارد." #: src/smart-pointers/box.md msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " -"amounts of data on the stack, instead store the data on the heap in a `Box` " -"so only the pointer is moved." +"amounts of data on the stack, instead store the data on the heap in a `Box` so " +"only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " -"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " -"کنید تا فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم " +"زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا " +"فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not be able to compute a fixed size for the " -"struct in memory (the `List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the struct in " +"memory (the `List` would be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " -"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " -"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` " +"قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا " +"`List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and " -"just points at the next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and just " +"points at the next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " -"به عنصر بعدی `List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به " +"عنصر بعدی `List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get " -"the message \"recursive without indirection\", because for data recursion, " -"we have to use indirection, a `Box` or reference of some kind, instead of " -"storing the value directly." +"Remove the `Box` in the List definition and show the compiler error. We get the " +"message \"recursive without indirection\", because for data recursion, we have to " +"use indirection, a `Box` or reference of some kind, instead of storing the value " +"directly." msgstr "" "`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " -"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " -"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " -"مستقیم مقدار استفاده کنیم." +"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها " +"باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم " +"مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -8842,24 +8622,24 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " -"This makes `Box` one of the types that allow the compiler to optimize " -"storage of some enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This " +"makes `Box` one of the types that allow the compiler to optimize storage of some " +"enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" -"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " -"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null " +"باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه " +"می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" "For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit " -"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"compiler uses NULL-value to discriminate variants instead of using explicit tag " +"([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" "#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn Pet`. " +"However, we can also use trait objects with smart pointers like `Box` to create " +"an owned trait object: `Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده " -"کرد، مثلاً `dyn Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای " -"هوشمند مانند `Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait " -"object) ایجاد کنیم: `\" : : \"data: Cat\" +----+----+----" -"+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" +"+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | o " +"| :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" +"+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -9008,45 +8786,45 @@ msgid "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" +" `- - -| - - |- - - - - - - - - - - - - - - - " +"-'\n" " | |\n" -" | | " -"\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" +" | | \"Program " +"text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - - " +"-.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk\" " +"| :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk\" " +"| :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" '- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----" -"+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" +"+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | o " +"| :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" +"+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -9065,32 +8843,32 @@ msgstr "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" +" `- - -| - - |- - - - - - - - - - - - - - - - " +"-'\n" " | |\n" -" | | " -"\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" +" | | \"Program " +"text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - - " +"-.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk\" " +"| :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk\" " +"| :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" '- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" #: src/smart-pointers/trait-objects.md @@ -9098,45 +8876,44 @@ msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته " -"باشند. این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " "method:" msgstr "" -"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " -"کنید:" +"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" #: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor\"" msgstr "\"به‌روزرسانی آمار یک کاربر بر اساس اندازه‌گیری معبار بازدید از پزشک\"" #: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md -#: src/android/aidl/example-service/client.md +#: src/android/build-rules/library.md src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -9560,23 +9326,23 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers " -"to. This is verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. " +"This is verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " -"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع " +"توسط بررسی‌کننده قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes " -"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " -"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " -"`Point` which is valid for at least the lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes can " +"also be explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and " +"`'a` is a typical default name. Read `&'a Point` as \"a borrowed `Point` which is " +"valid for at least the lifetime `a`\"." msgstr "" "طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " -"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " -"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " -"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." +"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` " +"شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک `Point` " +"قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9584,9 +9350,9 @@ msgid "" "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " -"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " -"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر " +"را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود " +"ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9608,15 +9374,14 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that " -"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " -"requires explicit annotations of lifetimes on function arguments and return " -"values." +"Looking inside the function body shows that it can only safely assume that `p3`'s " +"lifetime is the shorter of `p1` and `p2`. But just like types, Rust requires " +"explicit annotations of lifetimes on function arguments and return values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " -"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " -"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " -"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به " +"بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر " +"از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در " +"آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -9624,18 +9389,17 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for " +"at least `'a`." msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " "می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +msgid "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " -"بعدی توضیح داده شده است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی " +"توضیح داده شده است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -9643,37 +9407,36 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, " -"but Rust allows lifetimes to be elided in most cases with [a few simple " -"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " -"inference -- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, but " +"Rust allows lifetimes to be elided in most cases with [a few simple rules]" +"(https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not inference " +"-- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " -"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." -"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " -"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما " +"Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang." +"org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- " +"بلکه تنها یک اصطلاح نوشتاری کوتاه است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" -"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " -"می‌شود." +"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there is only one argument lifetime, it is given to all un-annotated " -"return values." +"If there is only one argument lifetime, it is given to all un-annotated return " +"values." msgstr "" "اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " "حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, " -"that lifetime is given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, that " +"lifetime is given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " -"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام " +"مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -9684,50 +9447,46 @@ msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " -"نیاز به حاشیه‌نویسی صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به " +"حاشیه‌نویسی صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" -"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " -"داده می‌شوند:" +"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده " +"می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for " -"validity by the compiler. Note that this is not the case for raw pointers " -"(unsafe), and this is a common source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for validity " +"by the compiler. Note that this is not the case for raw pointers (unsafe), and " +"this is a common source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " -"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " -"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " -"ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر " +"برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام " +"(ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have " -"lifetimes. Most of the time, elision and type inference mean these don't " -"need to be written out. In more complicated cases, lifetime annotations can " -"help resolve ambiguity. Often, especially when prototyping, it's easier to " -"just work with owned data by cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. " +"Most of the time, elision and type inference mean these don't need to be written " +"out. In more complicated cases, lifetime annotations can help resolve ambiguity. " +"Often, especially when prototyping, it's easier to just work with owned data by " +"cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " -"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " -"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " -"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " -"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " -"صورت لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، " +"_همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی " +"است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر " +"می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که " +"با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "Lifetimes in Data Structures" #: src/lifetimes/struct-lifetimes.md -msgid "" -"If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "" -"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -9756,27 +9515,27 @@ msgid "" "underlying the contained `&str` lives at least as long as any instance of " "`Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " -"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " -"می‌کند، زنده بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` " +"به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده " +"بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the " +"borrow checker throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " -"(borrow checker) خطا می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow " +"checker) خطا می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This " -"can be useful for creating lightweight views, but it generally makes them " -"somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This can be " +"useful for creating lightweight views, but it generally makes them somewhat " +"harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " -"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " -"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های " +"اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً " +"استفاده از آنها را تا حدی دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -9786,37 +9545,37 @@ msgstr "در صورت امکان، داده‌های ساختارها را به msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime " -"of the struct itself. Those are very advanced use cases." +"relationships between the references themselves, in addition to the lifetime of " +"the struct itself. Those are very advanced use cases." msgstr "" "برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " -"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " -"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " -"بسیار پیشرفته هستند." +"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین " +"ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد بسیار پیشرفته " +"هستند." #: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " -"simpler than it seems! This illustrates a common parsing pattern, passing " -"slices of data. The underlying data itself is never copied." +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's simpler " +"than it seems! This illustrates a common parsing pattern, passing slices of data. " +"The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" -"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " -"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " -"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf." +"dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن " +"است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل " +"عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` " -"file. In this exercise, we'll encode that information into `match` " -"statements in functions that get called for each field." +"indexed by their field numbers. That is typically provided in a `proto` file. In " +"this exercise, we'll encode that information into `match` statements in functions " +"that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " -"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " -"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " -"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس " +"شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. " +"در این تمرین، ما این اطلاعات را به صورت عبارات `match` در توابعی که برای هر فیلد " +"فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -9824,27 +9583,27 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each " -"is implemented as a \"tag\" followed by the value. The tag contains a field " -"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each is " +"implemented as a \"tag\" followed by the value. The tag contains a field number " +"(e.g., `2` for the `id` field of a `Person` message) and a wire type defining how " +"the payload should be determined from the byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " -"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " -"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " -"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر " +"فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد " +"(مانند `2` برای فیلد `id` در پیام `Person`) و wire type است که نحوه تعیین بار را " +"از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +"called VARINT. Luckily, `parse_varint` is defined for you below. The given code " +"also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse " +"a message into a series of calls to those callbacks." msgstr "" "اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " -"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " -"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " -"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." +"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین " +"بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به " +"مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" @@ -9868,32 +9627,26 @@ msgstr "/// The Varint WireType indicates the value is a single VARINT.\n" #, fuzzy msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double " -"type.\n" +" /// little-endian order containing a 64-bit signed integer or double type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double " -"type.\n" +" /// little-endian order containing a 64-bit signed integer or double type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float " -"type.\n" +" // little-endian order containing a 32-bit signed integer or float type.\n" " //I32, -- not needed for this exercise\n" msgstr "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float " -"type.\n" +" // little-endian order containing a 32-bit signed integer or float type.\n" " //I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -9948,10 +9701,8 @@ msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy -msgid "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" -msgstr "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgstr "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" @@ -9987,10 +9738,8 @@ msgstr "/// Parse a field, returning the remaining bytes\n" #: src/lifetimes/exercise.md msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as " -"necessary.\"" -msgstr "" -"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +"\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" +msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -9999,14 +9748,12 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" msgstr "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -10018,18 +9765,18 @@ msgstr "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, " -"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " -"the data buffer. In normal Rust code we'd handle this with the `Result` " -"enum, but for simplicity in this exercise we panic if any errors are " -"encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, e.g. " +"if you try to parse an `i32` when there are fewer than 4 bytes left in the data " +"buffer. In normal Rust code we'd handle this with the `Result` enum, but for " +"simplicity in this exercise we panic if any errors are encountered. On day 4 " +"we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " -"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " -"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " -"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " -"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " -"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، " +"مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، " +"تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما " +"برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به جای آن که با `Result` " +"برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، به بررسی دقیق‌تر مدیریت خطا " +"در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" @@ -10075,8 +9822,7 @@ msgstr "به روز ۱ خوش آمدید" msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" -"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش " -"خواهیم داد:" +"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش خواهیم داد:" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." @@ -10095,8 +9841,7 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "رسیدگی به خطا: panics در `Result` و اپراتور تلاش مجدد `?`." #: src/welcome-day-4.md -msgid "" -"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md @@ -10121,16 +9866,15 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait " +"supports iterating over values in a collection. It requires a `next` method and " +"provides lots of methods. Many standard library types implement `Iterator`, and " +"you can implement it yourself, too:" msgstr "" -"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"از تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` " -"نیاز دارد و متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد " -"`Iterator` را پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی " -"کنید:" +"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) از " +"تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` نیاز دارد و " +"متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد `Iterator` را " +"پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی کنید:" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" @@ -10138,41 +9882,40 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming " -"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"The `Iterator` trait implements many common functional programming operations " +"over collections (e.g. `map`, `filter`, `reduce`, etc). This is the trait where " +"you can find all the documentation about them. In Rust these functions should " +"produce the code as efficient as equivalent imperative implementations." msgstr "" "ویژگی `Iterator` بسیاری از عملیات برنامه‌نویسی تابعی رایج را روی collectionها " -"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که " -"در آن می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع " -"باید کد را به اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." +"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که در آن " +"می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع باید کد را به " +"اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." #: src/iterators/iterator.md msgid "" "`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"collection types such as `Vec` and references to them such as `&Vec` and " +"`&[T]`. Ranges also implement it. This is why you can iterate over a vector with " +"`for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه " -"(collection) توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند " -"`&Vec` و `&[T]` پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین " -"دلیل است که می‌توانید روی یک بردار با `برای i در some_vec { .. }` تکرار کنید، " -"اما درنهایت `some_vec.next()`وجود ندارد." +"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه (collection) " +"توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند `&Vec` و `&[T]` " +"پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین دلیل است که می‌توانید روی " +"یک بردار با `برای i در some_vec { .. }` تکرار کنید، اما درنهایت `some_vec." +"next()`وجود ندارد." #: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " -"It is used automatically by the `for` loop." +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/" +"trait.IntoIterator.html) defines how to create an iterator for a type. It is used " +"automatically by the `for` loop." msgstr "" -"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، " -"_iterate_ کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص " -"می‌کند. به طور خودکار توسط حلقه `for` استفاده می‌شود." +"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، _iterate_ " +"کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait." +"IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص می‌کند. به طور " +"خودکار توسط حلقه `for` استفاده می‌شود." #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" @@ -10183,8 +9926,8 @@ msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" -"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع " -"را اعلام کند:" +"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع را " +"اعلام کند:" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," @@ -10200,9 +9943,8 @@ msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" -"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده " -"(iterator) باید همان `Item` type را داشته باشد، به این معنی که " -"`Option` را برمی‌گرداند." +"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده (iterator) " +"باید همان `Item` type را داشته باشد، به این معنی که `Option` را برمی‌گرداند." #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." @@ -10213,32 +9955,32 @@ msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ " -"توجه داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." +"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ توجه " +"داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference " +"to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in " -"some_vector` will take ownership of `some_vector` and iterate over owned " -"elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in some_vector` " +"will take ownership of `some_vector` and iterate over owned elements from that " +"vector. Use `for e in &some_vector` instead, to iterate over references to " +"elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets " +"you build a collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/" +"trait.Iterator.html)." msgstr "" "گزینه [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator." -"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/" -"iter/trait.Iterator.html) یک مجموعه یا collection بسازید." +"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/iter/" +"trait.Iterator.html) یک مجموعه یا collection بسازید." #: src/iterators/fromiterator.md #, fuzzy @@ -10251,13 +9993,12 @@ msgstr "پیاده‌سازی `Iterator`" #: src/iterators/fromiterator.md msgid "There are two ways to specify `B` for this method:" -msgstr "" +msgstr "دو راه برای تعیین`B` برای این روش وجود دارد:" #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." +"With the \"turbofish\": `some_iterator.collect::()`, as shown. " +"The `_` shorthand used here lets Rust infer the type of the `Vec` elements." msgstr "" #: src/iterators/fromiterator.md @@ -10265,59 +10006,60 @@ msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" +"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. این " +"مثال را برای استفاده از این فرم بازنویسی کنید." #: src/iterators/fromiterator.md msgid "" "There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +"There are also more specialized implementations which let you do cool things like " +"convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods " -"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait to implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods in " +"the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to " +"implement a complex calculation." msgstr "" #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests " -"pass. Use an iterator expression and `collect` the result to construct the " -"return value." +"Copy the following code to and make the tests pass. " +"Use an iterator expression and `collect` the result to construct the return value." msgstr "" -"کد زیر را در کپی کنید و تست ها را قبول کنید. از " -"یک عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) " -"کنید تا مقدار بازگشتی را بسازید." +"کد زیر را در کپی کنید و تست ها را قبول کنید. از یک " +"عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) کنید تا " +"مقدار بازگشتی را بسازید." #: src/iterators/exercise.md src/iterators/solution.md #, fuzzy msgid "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" #: src/modules.md src/modules/paths.md msgid "use, super, self" -msgstr "" +msgstr "use, super, self" #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" +"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را به " +"یک type تبدیل کنیم." #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت " -"داشته باشیم:" +"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت داشته " +"باشیم:" #: src/modules/modules.md msgid "\"In the foo module\"" @@ -10329,35 +10071,36 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that " -"describes how to build a bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that describes how " +"to build a bundle of 1+ crates." msgstr "" -"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` " -"می‌شوند که نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." +"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` می‌شوند که " +"نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and " -"a library crate compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and a " +"library crate compiles to a library." msgstr "" -"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل " -"اجرایی ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." +"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل اجرایی " +"ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md -msgid "" -"Omitting the module content will tell Rust to look for it in another file:" +msgid "Omitting the module content will tell Rust to look for it in another file:" msgstr "حذف محتوای ماژول به Rust می‌گوید که آن را در فایل دیگری جستجو کند:" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden." -"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" -"vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden.rs`. " +"Similarly, a `garden::vegetables` module can be found at `src/garden/vegetables." +"rs`." msgstr "" +"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به طور " +"مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables.rs` یافت." #: src/modules/filesystem.md msgid "The `crate` root is in:" @@ -10373,20 +10116,17 @@ msgstr "`src/main.rs` (for a binary crate)" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments\". " +"These document the item that contains them -- in this case, a module." msgstr "" #: src/modules/filesystem.md #, fuzzy msgid "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" msgstr "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" #: src/modules/filesystem.md @@ -10414,20 +10154,19 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod." -"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` " +"was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول " -"اصلی یک فایل باشد:" +"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول اصلی یک " +"فایل باشد:" #: src/modules/filesystem.md msgid "" -"The place rust will look for modules can be changed with a compiler " -"directive:" +"The place rust will look for modules can be changed with a compiler directive:" msgstr "" #: src/modules/filesystem.md @@ -10436,9 +10175,11 @@ msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module " -"in a file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module in a " +"file named `some_module_test.rs`, similar to the convention in Go." msgstr "" +"برای مثال، اگر می‌خواهید تست‌هایی را برای یک ماژول در فایلی به نام " +"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در Go." #: src/modules/visibility.md msgid "Modules are a privacy boundary:" @@ -10454,11 +10195,11 @@ msgstr "کزینه‌های sibling و sibling همیشه قابل مشاهده #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all " -"the descendants of `foo`." +"In other words, if an item is visible in module `foo`, it's visible in all the " +"descendants of `foo`." msgstr "" -"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه " -"فرزندان`foo` قابل مشاهده است." +"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه فرزندان`foo` " +"قابل مشاهده است." #: src/modules/visibility.md msgid "\"outer::private\"" @@ -10478,12 +10219,12 @@ msgstr "\"outer::inner::public\"" #: src/modules/visibility.md msgid "Use the `pub` keyword to make modules public." -msgstr "" +msgstr "از کلمه کلیدی `pub` برای public کردن ماژول‌ها استفاده کنید." #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " -"of public visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of " +"public visibility." msgstr "" #: src/modules/visibility.md @@ -10504,15 +10245,14 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of " -"its descendants)." -msgstr "" -"در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." +"In any case, visibility must be granted to an ancestor module (and all of its " +"descendants)." +msgstr "در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You " -"will typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You will " +"typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -10549,8 +10289,8 @@ msgstr "یک `bar::foo` به `foo` در `bar` crate اشاره دارد." #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the " -"top-level `lib.rs` in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the top-" +"level `lib.rs` in a crate might have" msgstr "" #: src/modules/paths.md @@ -10562,27 +10302,26 @@ msgstr "" #: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if " -"a type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to " -"`use std::io::Read`." +"However, a trait must be in scope to call any methods on that trait, even if a " +"type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to `use " +"std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is " -"discouraged because it is not clear which items are imported, and those " -"might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged " +"because it is not clear which items are imported, and those might change over " +"time." msgstr "" -"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع " -"شده است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر " -"کنند." +"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع شده " +"است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر کنند." #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. " -"This library defines a `Widget` trait and a few implementations of that " -"trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. This " +"library defines a `Widget` trait and a few implementations of that trait, as well " +"as a `main` function." msgstr "" #: src/modules/exercise.md @@ -10643,12 +10382,10 @@ msgstr "// Add 4 paddings for borders\n" #: src/modules/exercise.md #, fuzzy msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" #: src/modules/exercise.md src/modules/solution.md @@ -10694,9 +10431,9 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, " -"and get accustomed to the required `mod`, `use`, and `pub` declarations. " -"Afterward, discuss what organizations are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, and " +"get accustomed to the required `mod`, `use`, and `pub` declarations. Afterward, " +"discuss what organizations are most idiomatic." msgstr "" #: src/modules/solution.md @@ -10793,13 +10530,13 @@ msgstr "" #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested " -"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " -"building tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` " +"module, using `#[cfg(test)]` to conditionally compile them only when building " +"tests." msgstr "" -"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` " -"تودرتو قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت " -"مشروط تنها در هنگام build تست‌ها کامپایل کنند." +"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` تودرتو " +"قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت مشروط تنها در " +"هنگام build تست‌ها کامپایل کنند." #: src/testing/unit-tests.md msgid "\"Hello World\"" @@ -10807,12 +10544,11 @@ msgstr "\"سلام دنیا!\"" #: src/testing/unit-tests.md msgid "This lets you unit test private helpers." -msgstr "" +msgstr "این به شما امکان می‌دهد تا private helper را آزمایش کنید." #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." -msgstr "" -"ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." +msgstr "ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." @@ -10837,7 +10573,7 @@ msgstr "// tests/my_library.rs\n" #: src/testing/other.md msgid "These tests only have access to the public API of your crate." -msgstr "" +msgstr "این آزمایش‌ها فقط به public API مربوط به crate شما دسترسی دارند." #: src/testing/other.md msgid "Documentation Tests" @@ -10868,8 +10604,7 @@ msgstr "" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." -msgstr "" -"بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." +msgstr "بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." @@ -10877,8 +10612,7 @@ msgstr "" #: src/testing/other.md msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/" -"run it." +"Adding `#` in the code will hide it from the docs, but will still compile/run it." msgstr "" #: src/testing/other.md @@ -10887,46 +10621,46 @@ msgid "" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" "کد بالا را در [Rust Playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " -"تست کنید." +"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) تست " +"کنید." #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful " -"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " -"more lints, organized into groups that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful built-in " +"lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, " +"organized into groups that can be enabled per-project." msgstr "" #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب " -"است، درست است؟ {}\"" +"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب است، " +"درست است؟ {}\"" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints " -"visible here, but those will not be shown once the code compiles. Switch to " -"the Playground site to show those lints." +"Run the code sample and examine the error message. There are also lints visible " +"here, but those will not be shown once the code compiles. Switch to the " +"Playground site to show those lints." msgstr "" -"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل " -"مشاهده هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن " -"lintها به سایت Playground بروید." +"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل مشاهده " +"هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن lintها به " +"سایت Playground بروید." #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show " -"clippy warnings. Clippy has extensive documentation of its lints, and adds " -"new lints (including default-deny lints) all the time." +"After resolving the lints, run `clippy` on the playground site to show clippy " +"warnings. Clippy has extensive documentation of its lints, and adds new lints " +"(including default-deny lints) all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " -"or via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or " +"via your editor." msgstr "" -"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با " -"`cargo fix` یا از طریق ویرایشگر خود برطرف کرد." +"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با `cargo " +"fix` یا از طریق ویرایشگر خود برطرف کرد." #: src/testing/exercise.md msgid "Luhn Algorithm" @@ -10934,14 +10668,13 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " -"to validate credit card numbers. The algorithm takes a string as input and " -"does the following to validate the credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used 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) برای " -"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " -"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " -"انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای اعتبارسنجی " +"شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی " +"دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -10950,12 +10683,11 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل " -"می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره `1234`، `3` " +"و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل می‌کنیم." #: src/testing/exercise.md msgid "" @@ -10976,20 +10708,19 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, " -"along with two basic unit tests that confirm that most of the algorithm is " -"implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, along " +"with two basic unit tests that confirm that most of the algorithm is implemented " +"correctly." msgstr "" #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional " -"tests to uncover bugs in the provided implementation, fixing any bugs you " -"find." +"Copy the code below to and write additional tests " +"to uncover bugs in the provided implementation, fixing any bugs you find." msgstr "" -"کد زیر را به کپی کنید و " -"تابع را پیاده‌سازی کنید." +"کد زیر را به کپی کنید و تابع " +"را پیاده‌سازی کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -11071,8 +10802,7 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 15 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/error-handling.md #, fuzzy @@ -11121,22 +10851,21 @@ msgstr "پنیک‌های خاص می‌توانند از ماکرو `panic!` ا #: src/error-handling/panics.md msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions " -"had returned." +"A panic will \"unwind\" the stack, dropping values just as if the functions had " +"returned." msgstr "" #: src/error-handling/panics.md -msgid "" -"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" +"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده کنید." #: src/error-handling/panics.md msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be " -"caught:" +"By default, a panic will cause the stack to unwind. The unwinding can be caught:" msgstr "" -"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان " -"گرفت( در واقع منظور این است که می‌توان آن را caught کرد):" +"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان گرفت( در " +"واقع منظور این است که می‌توان آن را caught کرد):" #: src/error-handling/panics.md msgid "\"No problem here!\"" @@ -11152,59 +10881,62 @@ msgstr "\"oh no!\"" #: src/error-handling/panics.md msgid "" -"Catching is unusual; do not attempt to implement exceptions with " -"`catch_unwind`!" +"Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" msgstr "" "گرفتن (Catching) غیر معمول است. سعی نکنید exceptionها را با `catch_unwind` " "پیاده‌سازی کنید!" #: src/error-handling/panics.md msgid "" -"This can be useful in servers which should keep running even if a single " -"request crashes." +"This can be useful in servers which should keep running even if a single request " +"crashes." msgstr "" +"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، باید به " +"کار خود ادامه دهند." #: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" +"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار نمی‌کند." #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://" -"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " -"saw when discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://doc." +"rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly saw when " +"discussing standard library types." msgstr "" -"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-" -"lang.org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث " -"در مورد تایپ‌های کتابخانه استاندارد مشاهده کردیم." +"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-lang." +"org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث در مورد " +"تایپ‌های کتابخانه استاندارد مشاهده کردیم." #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` " -"which contains an error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` which " +"contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's " -"type signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's type " +"signature by having the function return a `Result` value." msgstr "" +"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با برگرداندن " +"تابع مقدار `Result` کدگذاری می‌شود." #: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern " -"matching on the `Result` to check which variant you have. Methods like " -"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " -"error handling, but means that you can always see in your source code where " -"proper error handling is being skipped." +"access either the success value or the error value without first pattern matching " +"on the `Result` to check which variant you have. Methods like `unwrap` make it " +"easier to write quick-and-dirty code that doesn't do robust error handling, but " +"means that you can always see in your source code where proper error handling is " +"being skipped." msgstr "" #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling " -"conventions that students may be familiar with from other programming " -"languages." +"It may be helpful to compare error handling in Rust to error handling conventions " +"that students may be familiar with from other programming languages." msgstr "" #: src/error-handling/result.md @@ -11214,14 +10946,13 @@ msgstr "" #: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means " -"that you can't tell when calling a function if it may throw an exception or " -"not." +"exception is not visible as part of its type signature. This generally means that " +"you can't tell when calling a function if it may throw an exception or not." msgstr "" -"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند " -"یا نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور " -"کلی به این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن " -"است یک exception ایجاد کند یا خیر." +"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند یا " +"نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور کلی به " +"این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن است یک " +"exception ایجاد کند یا خیر." #: src/error-handling/result.md msgid "" @@ -11236,29 +10967,28 @@ msgstr "شماره‌های خطا" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error " -"value) separately from the successful return value of the function. Examples " -"include C and Go." +"Some languages have functions return an error number (or some other error value) " +"separately from the successful return value of the function. Examples include C " +"and Go." msgstr "" #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error " -"value, in which case you may be accessing an uninitialized or otherwise " -"invalid success value." +"Depending on the language it may be possible to forget to check the error value, " +"in which case you may be accessing an uninitialized or otherwise invalid success " +"value." msgstr "" #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with " -"the `Result` type, but matching this type on every call can be cumbersome. " -"The try-operator `?` is used to return errors to the caller. It lets you " -"turn the common" +"Runtime errors like connection-refused or file-not-found are handled with the " +"`Result` type, but matching this type on every call can be cumbersome. The try-" +"operator `?` is used to return errors to the caller. It lets you turn the common" msgstr "" -"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» " -"مدیریت می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` " -"برای برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا " -"موارد مشترک را بازگردانید." +"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» مدیریت " +"می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` برای " +"برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا موارد " +"مشترک را بازگردانید." #: src/error-handling/try.md msgid "into the much simpler" @@ -11266,7 +10996,7 @@ msgstr "بسیار ساده‌تر" #: src/error-handling/try.md msgid "We can use this to simplify our error handling code:" -msgstr "" +msgstr "می‌توانیم از این برای ساده‌سازی کد رسیدگی به خطا استفاده کنیم:" #: src/error-handling/try.md #, fuzzy @@ -11295,18 +11025,19 @@ msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" +"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، فایل " +"خالی، فایل با نام کاربری." #: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. " -"The executable will print the `Err` variant and return a nonzero exit status " -"on error." +"process::Termination`. In practice, this means that `E` implements `Debug`. The " +"executable will print the `Err` variant and return a nonzero exit status on error." msgstr "" -"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را " -"پیاده‌سازی کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است " -"که `E` پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند " -"و در صورت خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." +"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را پیاده‌سازی " +"کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است که `E` " +"پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند و در صورت " +"خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." #: src/error-handling/try-conversions.md msgid "" @@ -11320,13 +11051,13 @@ msgstr "به طو مشابه کار می‌کند" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function. This makes it easy to encapsulate errors into " -"higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the type " +"returned by the function. This makes it easy to encapsulate errors into higher-" +"level errors." msgstr "" -"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را " -"به نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح " -"بالاتر کپسوله شوند." +"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را به " +"نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح بالاتر " +"کپسوله شوند." #: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" @@ -11344,35 +11075,37 @@ msgstr "//std::fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. " -"A function that returns `Result` can only use `?` on a value " -"of type `Result` if `ErrorOuter` and `ErrorInner` are the " -"same type or if `ErrorOuter` implements `From`." +"function. For `Result`, it means that the error types have to be compatible. A " +"function that returns `Result` can only use `?` on a value of type " +"`Result` if `ErrorOuter` and `ErrorInner` are the same type or if " +"`ErrorOuter` implements `From`." msgstr "" -"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به " -"این معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` " -"را برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا " -"اگر `ErrorOuter` از` را پیاده‌سازی کند." +"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به این " +"معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` را " +"برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` " +"استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا اگر `ErrorOuter` " +"از` را پیاده‌سازی کند." #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, " -"especially when the conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, especially " +"when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and " -"`U` types." +"`Option` can use the `?` operator on `Option` for arbitrary `T` and `U` " +"types." msgstr "" +"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی گرداند " +"می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` استفاده کند." #: src/error-handling/try-conversions.md msgid "" "A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " -"turns `Result` into `Option`." +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` turns " +"`Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -11381,14 +11114,13 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing " -"our own enum covering all the different possibilities. The `std::error::" -"Error` trait makes it easy to create a trait object that can contain any " -"error." +"Sometimes we want to allow any type of error to be returned without writing our " +"own enum covering all the different possibilities. The `std::error::Error` trait " +"makes it easy to create a trait object that can contain any error." msgstr "" "گاهی اوقات می‌خواهیم اجازه دهیم هر نوع خطای بدون نوشتن enum خودمان که تمام " -"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد " -"یک object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." +"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد یک " +"object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." #: src/error-handling/error.md msgid "\"count.dat\"" @@ -11408,32 +11140,30 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) " -"or `std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) or " +"`std::num::ParseIntError` (from `String::parse`)." msgstr "" "تابع `read_count`می‌تواند `std::io::Error` (از عملیات فایل) یا `std::num::" "ParseIntError` (از `String::parse`) را برگرداند." #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle " -"different error cases differently in the program. As such it's generally not " -"a good idea to use `Box` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle different " +"error cases differently in the program. As such it's generally not a good idea to " +"use `Box` in the public API of a library, but it can be a good option " +"in a program where you just want to display the error message somewhere." msgstr "" -"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای " -"مختلف را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از " -"`Box` در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه " -"خوبی در برنامه‌ای باشد که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." +"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای مختلف " +"را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از `Box` " +"در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه خوبی در برنامه‌ای باشد " +"که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom error " +"type so it can be boxed. But if you need to support the `no_std` attribute, keep " +"in mind that the `std::error::Error` trait is currently compatible with `no_std` " +"in [nightly](https://github.com/rust-lang/rust/issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -11442,8 +11172,7 @@ msgid "" "anyhow/) crates are widely used to simplify error handling." msgstr "" "این [`thiserror`](https://docs.rs/thiserror/) و [`anyhow`](https://docs.rs/" -"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده " -"می‌شوند." +"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده می‌شوند." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11453,8 +11182,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in functions, " +"including adding contextual information to your errors." msgstr "" " اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " "اطلاعات متنی به خطاهای شما، استفاده می‌شود." @@ -11493,8 +11222,8 @@ msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید " -"زیادی برای کمک به تعریف انواع خطا به روشی فشرده است." +"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید زیادی " +"برای کمک به تعریف انواع خطا به روشی فشرده است." #: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." @@ -11510,13 +11239,13 @@ msgstr "`anyhow`" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such it's " +"again generally not a good choice for the public API of a library, but is widely " +"used in applications." msgstr "" -" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " -"ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " -"در برنامه‌های مختلف استفاده می‌شود." +" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این ترتیب " +"معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده در " +"برنامه‌های مختلف استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." @@ -11529,34 +11258,33 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go developers, " +"as it provides similar usage patterns and ergonomics to `(T, error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` " +"types. `use anyhow::Context` is necessary to enable `.context()` and `." +"with_context()` on those types." msgstr "" -"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و " -"`Option` پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `." -"context()` و `.with_context()` در آن typeها ضروری است." +"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و `Option` " +"پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `.context()` و `." +"with_context()` در آن typeها ضروری است." #: src/error-handling/exercise.md msgid "" "The following implements a very simple parser for an expression language. " "However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"error handling and propagate errors to a return from `main`. Feel free to use " +"`thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md msgid "" "HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." +"working correctly, update `Tokenizer` to implement `Iterator>` and handle that in the parser." msgstr "" #: src/error-handling/exercise.md src/error-handling/solution.md @@ -11648,7 +11376,7 @@ msgstr "\"شماره نامعتبر\"" #: src/unsafe-rust.md msgid "This segment should take about 1 hour and 5 minutes. It contains:" -msgstr "" +msgstr "این بخش باید حدود ۱ ساعت و ۵ دقیقه طول بکشد.و شامل موارد زیر است:" #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" @@ -11657,27 +11385,28 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان " -"پذیر نیست." +"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان پذیر " +"نیست." #: src/unsafe-rust/unsafe.md msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are " -"violated." -msgstr "" -"در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." +"**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." +msgstr "در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." #: src/unsafe-rust/unsafe.md msgid "" -"We saw mostly safe Rust in this course, but it's important to know what " -"Unsafe Rust is." +"We saw mostly safe Rust in this course, but it's important to know what Unsafe " +"Rust is." msgstr "" +"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust چیست." #: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" +"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در یک " +"لایه انتزاعی ایمن پیچیده می‌شود." #: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" @@ -11706,16 +11435,18 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" +"rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" +"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً به " +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" +"rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers " -"have turned off some compiler safety features and have to write correct code " -"by themselves. It means the compiler no longer enforces Rust's memory-safety " -"rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers have " +"turned off some compiler safety features and have to write correct code by " +"themselves. It means the compiler no longer enforces Rust's memory-safety rules." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11730,15 +11461,13 @@ msgstr "\"مراقب باش!\"" #, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11773,9 +11502,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write " -"a comment for each `unsafe` block explaining how the code inside it " -"satisfies the safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write a " +"comment for each `unsafe` block explaining how the code inside it satisfies the " +"safety requirements of the unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11790,8 +11519,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single " -"allocated object)." +"The pointer must be _dereferenceable_ (within the bounds of a single allocated " +"object)." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11800,12 +11529,12 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "There must not be concurrent accesses to the same location." -msgstr "" +msgstr "دسترسی همزمان به یک مکان نباید وجود داشته باشد." #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object " -"must be live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object must be " +"live and no reference may be used to access the memory." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11814,14 +11543,13 @@ msgstr "در بیشتر موارد، اشاره‌گر نیز باید به در #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has " +"the `'static` lifetime, so `r3` has type `&'static String`, and thus outlives " +"`s`. Creating a reference from a pointer requires _great care_." msgstr "" -"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` " -"دارای طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است " -"و بنابراین عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت " -"بسیار دارد." +"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` دارای " +"طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است و بنابراین " +"عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت بسیار دارد." #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" @@ -11843,10 +11571,8 @@ msgstr "" #: src/unsafe-rust/mutable-static.md #, fuzzy -msgid "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" -msgstr "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" #: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" @@ -11855,17 +11581,20 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" "The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"compiler is conservative and will assume the worst. Try removing the `unsafe` and " +"see how the compiler explains that it is undefined behavior to mutate a static " +"from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases where it " +"might make sense in low-level `no_std` code, such as implementing a heap " +"allocator or working with some C APIs." msgstr "" +"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما مواردی " +"وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند اجرای یک heap " +"allocator یا کار با برخی از APIهای مربوط به زبان C." #: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" @@ -11886,16 +11615,16 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They " -"are occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They are " +"occasionally needed for interacting with C library APIs." msgstr "" #: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." -"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" -"crates/zerocopy) crate." +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute." +"html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/" +"zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -11904,8 +11633,8 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions you " +"must uphold to avoid undefined behaviour:" msgstr "" #: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md @@ -11970,8 +11699,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular conditions " +"to avoid undefined behaviour." msgstr "" "اگر عملکردهای خود را برای جلوگیری از رفتار نامشخص به شرایط خاصی نیاز دارند، " "می‌توانید به‌عنوان`unsafe` علامت‌گذاری کنید." @@ -12003,44 +11732,43 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"create UB if the range is incorrect. `abs` is incorrect for a different reason: " +"it is an external function (FFI). Calling external functions is usually only a " +"problem when those functions do things with pointers which might violate Rust's " +"memory model, but in general any C function might have undefined behaviour under " +"any arbitrary circumstances." msgstr "" "تابع `get_unchecked`، مانند اکثر توابع `_unchecked`، ناامن است، زیرا اگر در " -"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: " -"این یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است " -"که آن توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه " -"Rust را نقض کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه " -"رفتار نامشخصی داشته باشد." +"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: این " +"یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است که آن " +"توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه Rust را نقض " +"کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه رفتار نامشخصی داشته " +"باشد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too]" -"(https://doc.rust-lang.org/reference/items/external-blocks.html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://" +"doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" -"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس " -"هستند](https://doc.rust-lang.org/reference/items/external-blocks.html)." +"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس هستند]" +"(https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +"We wouldn't actually use pointers for a `swap` function - it can be done safely " +"with references." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"Note that unsafe code is allowed within an unsafe function without an `unsafe` " +"block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " +"and see what happens. This will likely change in a future Rust edition." msgstr "" -"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. " -"ما می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. " -"سعی کنید آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه " -"بعدی Rust تغییر خواهد کرد." +"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. ما " +"می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. سعی کنید " +"آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه بعدی Rust تغییر " +"خواهد کرد." #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" @@ -12048,14 +11776,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation " -"must guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation must " +"guarantee particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something like " +"this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -12076,14 +11804,15 @@ msgstr "// SAFETY: `u32` has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining " -"the requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining the " +"requirements for the trait to be safely implemented." msgstr "" +"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که شرایط " +"لازم برای اجرای ایمن این trait را توضیح دهد." #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more " -"complicated." +"The actual safety section for `AsBytes` is rather longer and more complicated." msgstr "بخش ایمنی واقعی برای `AsBytes` نسبتا طولانی‌تر و پیچیده‌تر است." #: src/unsafe-rust/unsafe-traits.md @@ -12119,9 +11848,8 @@ msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" -"ffi/) module. There you find a number of string types which you need for the " -"exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) " +"module. There you find a number of string types which you need for the exercise:" msgstr "همچنین می‌خواهید [`std::ffi`](https://doc.rust-lang.or) را مرور کنید" #: src/unsafe-rust/exercise.md @@ -12134,15 +11862,15 @@ msgstr "استفاده" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://" +"doc.rust-lang.org/std/string/struct.String.html)" msgstr "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`](https://" +"doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" -msgstr "" +msgstr "UTF-8" #: src/unsafe-rust/exercise.md msgid "Text processing in Rust" @@ -12166,8 +11894,8 @@ msgstr "ارتباط با توابع C" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " -"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`]" +"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) و [`OsString`]" "(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" @@ -12186,8 +11914,7 @@ msgstr "شما بین تمام این typeها تبدیل خواهید کرد:" #: src/unsafe-rust/exercise.md msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` " -"character," +"`&str` to `CString`: you need to allocate space for a trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md @@ -12199,8 +11926,7 @@ msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" -"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " -"پیدا کند." +"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را پیدا کند." #: src/unsafe-rust/exercise.md msgid "" @@ -12214,8 +11940,8 @@ msgid "" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" "از `&[u8]` به `&OsStr`: `&OsStr` گامی به سوی `OsString` است، از [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد " -"آن استفاده کنید،" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد آن " +"استفاده کنید،" #: src/unsafe-rust/exercise.md msgid "" @@ -12225,19 +11951,19 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " -"useful chapter about FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful " +"chapter about FFI." msgstr "" -"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل " -"بسیار مفید در مورد FFI دارد." +"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل بسیار " +"مفید در مورد FFI دارد." #: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" -"کد زیر را در کپی کنید و توابع و متدهای از " -"مفقود شده را پر کنید:" +"کد زیر را در کپی کنید و توابع و متدهای از مفقود شده " +"را پر کنید:" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" @@ -12273,18 +11999,14 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" msgstr "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" @@ -12404,102 +12126,101 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can " -"write new services, libraries, drivers or even firmware in Rust (or improve " -"existing code as needed)." +"Rust is supported for system software on Android. This means that you can write " +"new services, libraries, drivers or even firmware in Rust (or improve existing " +"code as needed)." msgstr "" "‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " -"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " -"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا " +"در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to find " +"a little corner of your code base where we can move some lines of code to Rust. " +"The fewer dependencies and \"exotic\" types the better. Something that parses " +"some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " -"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " -"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " -"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین " +"سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به " +"Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. " +"چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md msgid "" -"The speaker may mention any of the following given the increased use of Rust " -"in Android:" +"The speaker may mention any of the following given the increased use of Rust in " +"Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " -"زیر اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر " +"اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" +"http3-in-android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" +"http3-in-android.html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/" +"rutabaga_gfx.html)" msgstr "" "کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" +"binder-v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" +"binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" +"in-android.html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" +"in-android.html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make " -"sure you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure " +"you have access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " -"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. " +"مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/" -"setup/start) for details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/" +"start) for details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" -"docs/setup/start) مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/" +"setup/start) مراجعه کنید." #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " "desktops. MacOS support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " -"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی " +"طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is " -"the ideal emulator to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is the " +"ideal emulator to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " -"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل " +"برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "" -"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -12523,8 +12244,7 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "" -"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -12532,11 +12252,11 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static and " +"shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " -"متغیرهای static و share را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای " +"static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" @@ -12544,10 +12264,8 @@ msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins." -msgstr "" -"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +"Produces a `proc-macro` Rust library. These are analogous to compiler plugins." +msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -12556,8 +12274,7 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" -"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " -"می‌کند." +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -12573,8 +12290,8 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for " -"a particular protobuf." +"Generates source and produces a Rust library that provides an interface for a " +"particular protobuf." msgstr "" "یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " "protobuf خاص فراهم می‌کند." @@ -12601,28 +12318,28 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages " -"from the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages from " +"the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " -"اینترنت دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت " +"دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must " -"also interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must also " +"interop with C/C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " -"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/" +"C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the " -"open-source variant of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-" +"source variant of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " -"استفاده در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده " +"در google3)." #: src/android/build-rules.md #, fuzzy @@ -12635,11 +12352,11 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, " -"create the following files:" +"Let us start with a simple application. At the root of an AOSP checkout, create " +"the following files:" msgstr "" -"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " -"ایجاد کنید:" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد " +"کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -12714,9 +12431,9 @@ msgid "" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/) عرضه شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://" +"cs.android.com/android/platform/superproject/+/master:external/rust/crates/) عرضه " +"شده است." #: src/android/build-rules/library.md msgid "\"hello_rust_with_dep\"" @@ -12739,9 +12456,8 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md -#: src/android/aidl/example-service/service.md src/android/testing.md -#: src/android/interoperability/java.md +#: src/android/build-rules/library.md src/android/aidl/example-service/service.md +#: src/android/testing.md src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -12770,22 +12486,20 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android." -"com/guide/components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android.com/" +"guide/components/aidl) is supported in Rust:" msgstr "" "‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" "guide/components/aidl) در Rust پشتیبانی می‌شود:" @@ -12801,12 +12515,12 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement " -"the described service and write client code that talks to that service." +"process of creating a Binder interface. We're then going to both implement the " +"described service and write client code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " -"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " -"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder " +"را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را " +"می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -12818,10 +12532,8 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -12854,14 +12566,13 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match " -"the package name used in the AIDL file, i.e. the package is `com.example." +"Note that the directory structure under the `aidl/` directory needs to match the " +"package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " -"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." -"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." -"aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package " +"استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example." +"birthdayservice` و این فایل در `aidl/com/example/IBirthdayService.aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -12869,11 +12580,11 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to " -"talk to the service." +"Binder generates a trait corresponding to the interface definition. trait to talk " +"to the service." msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " -"با سرویس" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با " +"سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -12881,24 +12592,24 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use " -"this trait to talk to the service." +"Your service will need to implement this trait, and your client will use this " +"trait to talk to the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " -"صحبت با سرویس‌ها استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با " +"سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md msgid "" -"The generated bindings can be found at `out/soong/.intermediates//`." +"The generated bindings can be found at `out/soong/.intermediates//" +"`." msgstr "" -"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" -"` یافت." +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//` " +"یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument " -"and return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument and " +"return types, correspond the interface definition." msgstr "" "اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " "بازگشتی، با تعریف interface مطابقت دارد." @@ -12908,8 +12619,8 @@ msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " -"type برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type " +"برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -12967,19 +12678,19 @@ msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain " -"why each of the segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain why " +"each of the segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " -"از بخش‌ها ضروری است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از " +"بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to " -"override? Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to override? " +"Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " -"برای override وجود دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای " +"override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -13023,17 +12734,17 @@ msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case " -"the `BirthdayService` type, which implements the `IBirthdayService`) and " -"starting it as a Binder service has multiple steps, and may appear more " -"complicated than students are used to if they've used Binder from C++ or " -"another language. Explain to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case the " +"`BirthdayService` type, which implements the `IBirthdayService`) and starting it " +"as a Binder service has multiple steps, and may appear more complicated than " +"students are used to if they've used Binder from C++ or another language. Explain " +"to students why each step is necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " -"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " -"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " -"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " -"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " +"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند " +"مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. " +"اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید " +"که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -13041,33 +12752,33 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " -"this case). This type is generated by Binder and provides the common Binder " +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this " +"case). This type is generated by Binder and provides the common Binder " "functionality that would be provided by the `BnBinder` base class in C++. We " "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" "این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" -"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " -"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " -"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را " +"ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust ارث‌بری یا " +"inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " "`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object " -"(the `BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object (the " +"`BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " -"(شی‏ «BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " +"«BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool " -"and start listening for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool and " +"start listening for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " -"اضافه کنید و شروع به گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه " +"کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -13077,16 +12788,14 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -13117,8 +12826,7 @@ msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md +#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -13153,67 +12861,63 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service " -"that the client has connected to." +"`Strong` is the trait object representing the service that " +"the client has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " -"که کلاینت به آن متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که " +"کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-" -"process ref count for the service trait object, and the global Binder ref " -"count that tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-process " +"ref count for the service trait object, and the global Binder ref count that " +"tracks how many processes have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " -"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " -"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " -"ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون " +"فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global " +"Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses " -"the exact same trait that the server implements. For a given Binder " -"interface, there is a single Rust trait generated that both client and " -"server use." +"Note that the trait object that the client uses to talk to the service uses the " +"exact same trait that the server implements. For a given Binder interface, there " +"is a single Rust trait generated that both client and server use." msgstr "" "توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " "دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " -"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " -"از آن استفاده می کنند." +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور از آن " +"استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This " -"should ideally be defined in a common crate that both the client and server " -"can depend on." +"Use the same service identifier used when registering the service. This should " +"ideally be defined in a common crate that both the client and server can depend " +"on." msgstr "" "از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " -"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " -"آن وابسته باشند." +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن " +"وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +"Let us extend the API with more functionality: we want to let clients specify a " +"list of lines for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " -"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم " +"لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -13221,13 +12925,13 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a " -"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " -"generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in " +"Rust, i.e. that idiomatic Rust types are used in the generated bindings wherever " +"possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " -"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " -"شده تا جایی که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust " +"ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی " +"که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -13265,10 +12969,8 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "" -"TODO: Move code snippets into project files where they'll actually be built?" -msgstr "" -"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "TODO: Move code snippets into project files where they'll actually be built?" +msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -13280,21 +12982,18 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "" -"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "" -"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" -"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " -"کرد." +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -13303,8 +13002,7 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "" -"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -13411,22 +13109,20 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " -"array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes " +"`[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. `int[3][4]`). In " +"the Java backend, fixed-size arrays are represented as array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " -"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " -"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " -"type نمایش داده می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به " +"`[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3]" +"[4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array type نمایش داده " +"می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -13434,24 +13130,21 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-" -"erased `IBinder` interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-erased " +"`IBinder` interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " -"interface پاک‌شده ارسال کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface " +"پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" @@ -13483,10 +13176,8 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" @@ -13502,10 +13193,8 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -13514,11 +13203,11 @@ msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md msgid "" -"Files can be sent between Binder clients/servers using the " -"`ParcelFileDescriptor` type:" +"Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` " +"type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" -"سرورهای Binder ارسال کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای " +"Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -13555,13 +13244,11 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -13570,21 +13257,21 @@ msgstr "\"کنترل فایل نامعتبر\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " -"`File` (or any other type that wraps an `OwnedFd`), and can be used to " -"create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` " +"(or any other type that wraps an `OwnedFd`), and can be used to create a new " +"`File` handle on the other side." msgstr "" "‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " -"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " -"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای " +"ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " -"UNIX sockets." +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX " +"sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " -"سوکت های TCP، UDP و UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های " +"TCP، UDP و UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -13592,11 +13279,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests " -"work in AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests work in " +"AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " -"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم " +"پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -13662,8 +13349,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " +"2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13673,8 +13360,8 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " +"2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13685,16 +13372,16 @@ msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " -"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی " +"در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " -"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه " +"می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13706,55 +13393,52 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured error " +"message pin-pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " -"که خطا را pin-pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که " +"خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this example in " +"a local environment. Use `cargo add googletest` to quickly add it to an existing " +"Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " -"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " -"add googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add " +"googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used macros " +"and types](https://docs.rs/googletest/latest/googletest/prelude/index.html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" -"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " -"می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://" +"docs.rs/googletest/latest/googletest/prelude/index.html) را وارد می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " -"Rust course: it provides a guided introduction to the library, with " -"exercises to help you get comfortable with `googletest` macros, its matchers " -"and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider going " +"through the first chapter of [\"Advanced testing for Rust applications\"](https://" +"rust-exercises.com/advanced-testing/), a self-guided Rust course: it provides a " +"guided introduction to the library, with exercises to help you get comfortable " +"with `googletest` macros, its matchers and its overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " -"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" -"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " -"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " -"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-" +"workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه راهنمایی برای " +"کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای `googletest` و مطابقت‌های آن " +"و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md msgid "" -"A particularly nice feature is that mismatches in multi-line strings are " -"shown as a diff:" +"A particularly nice feature is that mismatches in multi-line strings are shown as " +"a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " -"نشان داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان " +"داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -13785,109 +13469,103 @@ msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " -"در Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در " +"Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You " +"need to refactor your code to use traits, which you can then quickly mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " -"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " -"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده " +"استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس " +"می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are " -"other [mocking libraries available on crates.io](https://crates.io/keywords/" -"mock), in particular in the area of mocking HTTP services. The other mocking " -"libraries work in a similar fashion as Mockall, meaning that they make it " -"easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are other " +"[mocking libraries available on crates.io](https://crates.io/keywords/mock), in " +"particular in the area of mocking HTTP services. The other mocking libraries work " +"in a similar fashion as Mockall, meaning that they make it easy to get a mock " +"implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " -"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " -"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " -"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " -"را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking " +"دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در " +"زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار " +"می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." +"isolate a test from its dependencies. The immediate result is faster and more " +"stable test execution. On the other hand, the mocks can be configured wrongly and " +"return output different from what the real dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " -"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " -"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " -"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " -"برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان " +"را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای " +"سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد " +"و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As an " +"example, many databases allow you to configure an in-memory backend. This means " +"that you get the correct behavior in your tests, plus they are fast and will " +"automatically clean up after themselves." msgstr "" "در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " -"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " -"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " -"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " -"مخصوص به خود پاک می شوند." +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی " +"کنید. این به این معنی است که شما در تست های خود رفتار صحیح را دریافت می کنید، به " +"علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." +"binds to a random port on `localhost`. Always prefer this over mocking away the " +"framework since it helps you test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " -"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " -"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " -"را در محیط واقعی آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process " +"دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را " +"به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی " +"آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example in a " +"local environment. Use `cargo add mockall` to quickly add Mockall to an existing " +"Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " -"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " -"پروژه Cargo موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local " +"اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo " +"موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up expectations " +"which depend on the arguments passed. Here we use this to mock a cat which " +"becomes hungry 3 hours after the last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " -"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " -"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " -"گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که " +"به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat " +"استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be called " +"to `n` --- the mock will automatically panic when dropped if this isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " -"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " -"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند " +"به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف " +"کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) " -"or `stdout` (on-host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) or " +"`stdout` (on-host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " -"(روی host) استفاده کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی " +"host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -13945,15 +13623,13 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -13963,11 +13639,11 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This " -"means that you can:" +"Rust has excellent support for interoperability with other languages. This means " +"that you can:" msgstr "" -"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " -"شما می‌توانید:" +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما " +"می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -13979,8 +13655,8 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a " -"_foreign function interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a _foreign " +"function interface_, also known as FFI." msgstr "" "وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " "خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " @@ -13995,9 +13671,8 @@ msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " -"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " -"کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به " +"طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -14014,18 +13689,16 @@ msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" -"exercise.md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise." +"md)." msgstr "" -"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " -"دیدیم." +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." #: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." -msgstr "" -"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -14037,8 +13710,8 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool " +"can auto-generate bindings from a C header file." msgstr "" "ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." @@ -14096,8 +13769,7 @@ msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" -"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " -"نیست):" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -14146,40 +13818,34 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " -"اتصالات (bindings) اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات " +"(bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -14274,35 +13940,32 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will " +"just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " -"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " -"برای تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط " +"نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای " +"تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe " -"interoperability between Rust and C++." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability " +"between Rust and C++." msgstr "" -"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " -"می‌کند." +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -14310,14 +13973,13 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed " -"from each language to the other. You provide this description using extern " -"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed from " +"each language to the other. You provide this description using extern blocks in a " +"Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " -"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " -"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " -"شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض " +"دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust " +"ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -14366,25 +14028,24 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching " -"Rust and C++ type/function definitions in order to expose those items to " -"both languages." +"From the declarations made in the bridge module, CXX will generate matching Rust " +"and C++ type/function definitions in order to expose those items to both " +"languages." msgstr "" "از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" -"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " -"دهد." +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/" -"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " -"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " -"(though this doesn't apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) to view the expanded proc macro. For most of the examples you would " +"use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't " +"apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" -"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " -"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " -"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-" +"expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از " +"`cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای " +"پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -14409,23 +14070,22 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in " -"the parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in the " +"parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " -"والد قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد " +"قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" -"+ header file containing the corresponding C++ declarations. The generated " -"header has the same path as the Rust source file containing the bridge, " -"except with a .rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ " +"header file containing the corresponding C++ declarations. The generated header " +"has the same path as the Rust source file containing the bridge, except with a ." +"rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" -"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " -"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." -"h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C " +"حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که " +"فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs.h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -14450,8 +14110,8 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed " -"in are accurate. CXX performs static assertions that the signatures exactly " +"The programmer does not need to promise that the signatures they have typed in " +"are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" "برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " @@ -14460,11 +14120,11 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to " -"call from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to call " +"from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " -"Rust امن هستند را اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust " +"امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -14481,9 +14141,9 @@ msgid "" "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " -"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " -"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد " +"مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، " +"پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -14497,14 +14157,14 @@ msgstr "Generated C++:" #, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum " -"class to hold a value different from all of the listed variants, and our " -"Rust representation needs to have the same behavior." +"wrapping a numeric value. This is because it is not UB in C++ for an enum class " +"to hold a value different from all of the listed variants, and our Rust " +"representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " -"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " -"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " -"رفتار مشابهی داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی " +"را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از " +"همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی " +"داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -14516,25 +14176,23 @@ msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ " -"side." +"Rust functions that return `Result` are translated to exceptions on the C++ side." msgstr "" "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come " -"from the error type's `Display` impl." +"exposes a way to get the error message string. The error message will come from " +"the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " -"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " -"خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول " +"راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to " -"immediately terminate." +"A panic unwinding from Rust to C++ will always cause the process to immediately " +"terminate." msgstr "" "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." @@ -14549,24 +14207,23 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception " -"on the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception on " +"the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " -"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " -"برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت +" +"+C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not " -"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" -"terminate`. The behavior is equivalent to the same exception being thrown " -"through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not declared by " +"the CXX bridge to return `Result`, the program calls C++'s `std::terminate`. The " +"behavior is equivalent to the same exception being thrown through a `noexcept` C+" +"+ function." msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " -"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " -"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " -"C++ function فعال می‌شود." +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی " +"می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C++ function " +"فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -14626,42 +14283,41 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments " -"and returns of extern functions." +"These types can be used in the fields of shared structs and the arguments and " +"returns of extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " -"functionها استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها " +"استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are " -"a few reasons for this:" +"Note that Rust's `String` does not map directly to `std::string`. There are a few " +"reasons for this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " -"چند دلیل برای این وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند " +"دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "" -"`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed " -"directly between languages." +"The two types have different layouts in memory and so can't be passed directly " +"between languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " -"مستقیماً بین زبان‌ها منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً " +"بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move " -"semantics, so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move semantics, " +"so a `std::string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " -"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، " +"بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14674,8 +14330,8 @@ msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " -"شده CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده " +"CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -14702,43 +14358,43 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the " +"dependencies for the CXX-generated C++ bindings. We'll show how these are setup " +"on the next slide." msgstr "" "به این نکته اشاره کنید که `libcxx_test_bridge_header` و " -"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" -"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​هستند. " +"نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in order to " +"pull in common CXX definitions." msgstr "" "توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" "header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs](https://" +"source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" +"patterns#rust-cpp-interop-using-cxx). You may want to share that link with the " +"class so that students know where they can find these instructions again in the " +"future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " -"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" -"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " -"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " -"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید " +"[the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" +"modules/android-rust-patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن " +"پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند که در آینده می‌توانند این " +"دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the " -"CXX source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the CXX " +"source file. These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " -"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. " +"سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -14793,16 +14449,14 @@ msgid "" "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." -"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " -"اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و " +"فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" -"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " -"دارد." +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -14822,10 +14476,9 @@ msgid "" "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " -"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " -"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " -"کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface " +"(JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` " +"crate](https://docs.rs/jni/) به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -14895,11 +14548,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with and " +"try to integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " -"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و " +"سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -14911,11 +14564,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone in " +"the class having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " -"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی " +"است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -14923,51 +14576,51 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party " -"glue code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party glue " +"code to connect between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " -"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص " +"برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've " -"got a corner of the code where you're displaying a UTF8 string to the user, " -"feel free to follow this recipe in your part of the codebase instead of the " -"exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've got a " +"corner of the code where you're displaying a UTF8 string to the user, feel free " +"to follow this recipe in your part of the codebase instead of the exact part we " +"talk about." msgstr "" "امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " -"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " -"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " -"پایگاه کد دنبال کنید." +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت " +"دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد " +"دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build " -"flags is OK, so long as your code is relatively recent (commit position " -"1223636 onwards, corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build flags is " +"OK, so long as your code is relatively recent (commit position 1223636 onwards, " +"corresponding to November 2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " -"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " -"commit 1223636 به بعد، مربوط به نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از " +"build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit " +"1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md msgid "" -"(A component, debug build is recommended for quickest iteration time. This " -"is the default!)" +"(A component, debug build is recommended for quickest iteration time. This is the " +"default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " -"یک حالت پیش‌فرض است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک " +"حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" -"the-code/) if you aren't already at that point. Be warned: setting up to " -"build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-" +"code/) if you aren't already at that point. Be warned: setting up to build " +"Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." -"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " -"برای build Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium." +"org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build " +"Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -14980,20 +14633,19 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" "This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. " -"If you don't have time to complete a certain part, don't worry: you can " -"catch up in the next slot." +"We'll be doing them spread throughout the course instead of just at the end. If " +"you don't have time to complete a certain part, don't worry: you can catch up in " +"the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " -"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " -"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " -"به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها " +"را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای " +"تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io]" -"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " -"set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io](https://" +"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " +"dependencies." msgstr "" "جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " "استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " @@ -15005,41 +14657,41 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." -"gni` (e.g. `rust_static_library` that we'll meet later). This uses " -"Chromium's audited toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e." +"g. `rust_static_library` that we'll meet later). This uses Chromium's audited " +"toolchain and crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " -"crateهای بررسی‌شده Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای " +"بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " -"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates]" +"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " -"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" -"heads/main/docs/rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium " +"محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/" +"rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " -"downloaded from the internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded " +"from the internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " -"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای " +"دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " -"code can be built into the Chromium browser. At the same time, Cargo is an " -"important part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code " +"can be built into the Chromium browser. At the same time, Cargo is an important " +"part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " -"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " -"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان " +"کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم " +"Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -15051,11 +14703,11 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the " -"risk profile of these scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk " +"profile of these scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " -"ریسک‌های این سناریوها را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های " +"این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" @@ -15068,111 +14720,105 @@ msgstr "" #: src/chromium/cargo.md msgid "" "Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them " -"to discuss in small groups of 3-4 people." +"exercise. Assuming folks taking the course are physically together, ask them to " +"discuss in small groups of 3-4 people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " -"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " -"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران " +"خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، " +"از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where " -"Cargo may offer an advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where Cargo " +"may offer an advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " -"را ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را " +"ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, " -"one has access to the rich ecosystem of crates.io libraries. There is a " -"crate for almost anything and they are usually quite pleasant to use. " -"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" -"from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, one " +"has access to the rich ecosystem of crates.io libraries. There is a crate for " +"almost anything and they are usually quite pleasant to use. (`clap` for command-" +"line parsing, `serde` for serializing/deserializing to/from various formats, " +"`itertools` for working with iterators, etc.)." msgstr "" "این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " -"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " -"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " -"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " -"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک " +"crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط " +"فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای " +"کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo." -"toml` and start writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` " +"and start writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " -"اضافه کنید و شروع به نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه " +"کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " -"مقایسه با `python` + `pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با " +"`python` + `pip`." #: src/chromium/cargo.md #, fuzzy msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate " -"that needs to work on nightly, current stable, and older stable) but also by " -"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a " -"streamlined way to run benchmarks)." -msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " -"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " -"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " -"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " -"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " -"راهی ساده برای اجرای benchmark‌ها می‌دهد)." +"using `rustup` to switch to a different `rustc` version when testing a crate that " +"needs to work on nightly, current stable, and older stable) but also by an " +"ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a streamlined " +"way to run benchmarks)." +msgstr "" +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای " +"تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی " +"پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز " +"انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را برای ساده‌سازی و " +"اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate راهی ساده برای اجرای " +"benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "" -"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" -"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " -"می‌کند." +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" -"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " -"باشد." +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." #: src/chromium/cargo.md -msgid "" -"Broad, generic examples of projects where `cargo` may be the right choice:" -msgstr "" -"نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" +msgid "Broad, generic examples of projects where `cargo` may be the right choice:" +msgstr "نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " -"for writing command line tools. The breadth and ergonomics of libraries is " -"comparable to Python, while being more robust (thanks to the rich " -"typesystem) and running faster (as a compiled, rather than interpreted " -"language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for " +"writing command line tools. The breadth and ergonomics of libraries is comparable " +"to Python, while being more robust (thanks to the rich typesystem) and running " +"faster (as a compiled, rather than interpreted language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " -"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " -"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " -"زبان کامپایل شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان " +"محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که " +"قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل " +"شده و نه مفسری)." #: src/chromium/cargo.md msgid "" "Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be " -"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " -"should probably use Cargo." +"Cargo. Libraries that want to get external contributions, and want to be used " +"outside of Chromium (e.g. in Bazel or Android/Soong build environments) should " +"probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " -"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " -"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " -"باید از Cargo استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. " +"کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium " +"استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo " +"استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -15180,11 +14826,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which " -"resulted in PRs with performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which resulted " +"in PRs with performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " -"با بهبود در عملکرد می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با " +"بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -15192,22 +14838,20 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` " -"for command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` for " +"command-line parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " -"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به " +"`clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " -"when building and bootstrapping Rust standard library when building Rust " -"toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when " +"building and bootstrapping Rust standard library when building Rust toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " -"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " -"toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در " +"هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." #: src/chromium/cargo.md msgid "" @@ -15216,16 +14860,14 @@ msgid "" "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" "‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " -"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." -"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " -"است.)" +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` " +"از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" -msgstr "" -"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" @@ -15234,16 +14876,16 @@ msgid "" "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" "‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " -"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر " +"Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" -"rust-lang/ - همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-" +"lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -15251,11 +14893,11 @@ msgstr "`cargo`, `rustfmt`,سایر موارد." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for " -"distributing the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for distributing " +"the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " -"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain " +"از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." @@ -15263,8 +14905,8 @@ msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by " -"security@chromium.org)" +"Rust libraries vendored into `//third_party/rust` (audited by security@chromium." +"org)" msgstr "" "کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " "security@chromium.org)" @@ -15279,94 +14921,76 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as approved by " +"Chromium's [Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/" +"main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " -"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" -"ATL_OWNERS) تأیید شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech " +"Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید " +"شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"Chromium's policy on third party libraries is outlined [here](https://chromium." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust " +"is allowed for third party libraries under various circumstances, including if " +"they're the best option for performance or for security." msgstr "" "رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " -"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " -"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده " +"است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا " +"آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"Very few Rust libraries directly expose a C/C++ API, so that means that nearly " +"all such libraries will require a small amount of first-party glue code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " -"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " -"glue code اول شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) " +"قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول " +"شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should normally be " +"kept in `third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" -"rust///wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust/" +"//wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -15379,14 +15003,13 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "" -"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " -"کنید." +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " -"مسیر مناسب ادامه یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر " +"مناسب ادامه یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -15394,23 +15017,21 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and " -"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " -"is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` " +"for efficiency --- its static rules allow maximum parallelism. Rust is no " +"exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " -"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " -"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت " +"کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر " +"می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "" -"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "" -"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -15434,8 +15055,8 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to " -"depend upon third party code." +"You can also add `deps` on other Rust targets. Later we'll use this to depend " +"upon third party code." msgstr "" "همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " "وابستگی به کد شخص ثالث استفاده خواهیم کرد." @@ -15443,38 +15064,37 @@ msgstr "" #: src/chromium/build-rules.md msgid "" "You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root " -"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " -"list of all source files which `ninja` needs in order to determine when " -"rebuilds are necessary." -msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " -"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " -"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " -"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " -"دارد." +"`crate_root` is the file given to the Rust compiler representing the root file of " +"the compilation unit --- typically `lib.rs`. `sources` is a complete list of all " +"source files which `ninja` needs in order to determine when rebuilds are " +"necessary." +msgstr "" +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی " +"است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- " +"معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی " +"است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire " -"crate is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate " +"is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" "(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " "جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using " -"[gn's built-in support for Rust static libraries](https://gn.googlesource." -"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " -"this template provides support for CXX interop, Rust features, and unit " -"tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using [gn's " +"built-in support for Rust static libraries](https://gn.googlesource.com/gn/+/main/" +"docs/reference.md#func_static_library). The answer is that this template provides " +"support for CXX interop, Rust features, and unit tests, some of which we'll use " +"later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " -"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" -"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " -"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " -"از برخی از آنها استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای " +"کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference." +"md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که این الگو از " +"CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً از برخی از آنها " +"استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -15482,15 +15102,13 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " -"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " -"the gn target. (Later in the course we'll see circumstances where this is " -"necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't " +"compile. If you need unsafe Rust code, add `allow_unsafe = true` to the gn " +"target. (Later in the course we'll see circumstances where this is necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " -"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " -"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " -"است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل " +"نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn " +"اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -15556,29 +15174,26 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than " -"for C++. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than for C+" +"+. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " -"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " -"استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد " +"ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " -"Rust support" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust " +"support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " -"قبلی پشتیبانی از Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی " +"پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output " -"directory)" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" msgstr "" -"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " -"شما)" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -15586,24 +15201,23 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-" -"analyzer might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-analyzer " +"might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " -"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های " +"code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a " -"piece of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a piece " +"of Chromium-related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " -"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به " +"Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "" -"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" @@ -15615,48 +15229,46 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " -"K)." +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." msgstr "" -"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" -"CoC = K)." +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = " +"K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " -"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This " +"will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " -"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." -"rs` می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/" +"CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` " +"می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " -"164; the outline is in the file explorer pane in vscode; typical vim/CoC " -"bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; " +"the outline is in the file explorer pane in vscode; typical vim/CoC bindings = " +"space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " -"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " -"bindings = space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط " +"164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC bindings = " +"space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the " -"`QrCode::with_bits` method)" +"Demo **type annotations** (there are quite a few nice examples in the `QrCode::" +"with_bits` method)" msgstr "" "نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" "with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will " -"need to be rerun after editing `BUILD.gn` files (which we will do a few " -"times throughout the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will need to " +"be rerun after editing `BUILD.gn` files (which we will do a few times throughout " +"the exercises in this session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " -"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " -"اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های " +"`BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" @@ -15664,53 +15276,50 @@ msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " -"containing:" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" msgstr "" -"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " -"که حاوی:" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که " +"حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " -"target." +"**Important**: note that `no_mangle` here is considered a type of unsafety by the " +"Rust compiler, so you'll need to allow unsafe code in your `gn` target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " -"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " -"`gn` target خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی " +"(type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target " +"خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " -"see how this can be automated by bindings generation tools):" +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll see " +"how this can be automated by bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " -"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " -"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را " +"در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که " +"چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " -"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " -"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " -"times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we " +"suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run " +"Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " -"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " -"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " -"بارها چاپ می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما " +"قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. " +"Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" بارها چاپ " +"می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " -"in subsequent exercises. If you've succeeded, you will be able to use right-" -"click \"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in " +"subsequent exercises. If you've succeeded, you will be able to use right-click " +"\"Go to definition\" on `println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " -"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " -"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار " +"کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک " +"راست روی\"Go to definition\" در`println!` استفاده کنید." #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md @@ -15719,38 +15328,35 @@ msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://" -"source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." -"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" -"l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." +"html#the-no_mangle-attribute)" msgstr "" "اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." "html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." -"extern.html)" -msgstr "" -"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." "html)" +msgstr "" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/" +"main/docs/reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/" +"main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy @@ -15763,152 +15369,145 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-" -"denominator interop language, C. Both C++ and Rust can natively declare and " -"call C ABI functions. Later in the course, we'll connect C++ directly to " -"Rust." +"This example is unusual because it boils down to the lowest-common-denominator " +"interop language, C. Both C++ and Rust can natively declare and call C ABI " +"functions. Later in the course, we'll connect C++ directly to Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " -"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. " +"بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to " +"generate two functions with the same name, and Rust can no longer guarantee that " +"the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " -"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " -"کند که تابع مورد نظر فراخوانی شده است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به " +"Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که " +"تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " -"از الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " +"الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same " -"source file as the code being tested. This was covered [earlier](../testing." -"md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same source " +"file as the code being tested. This was covered [earlier](../testing.md) in the " +"course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " -"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " -"پوشش داده شده بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد " +"مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده " +"بود و به این صورت است:" #: src/chromium/testing.md msgid "" "In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable " -"and helps to avoid rebuilding `.rs` files a second time (in the `test` " -"configuration)." +"follow this practice for Rust --- this makes tests consistently discoverable and " +"helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " -"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " -"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " -"`test`) جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این " +"روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف " +"باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) " +"جلوگیری شود." #: src/chromium/testing.md -msgid "" -"This results in the following options for testing Rust code in Chromium:" +msgid "This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" -"rust`." +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." msgstr "" "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " -"when Rust code is just a thin FFI layer and the existing unit tests provide " -"sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when " +"Rust code is just a thin FFI layer and the existing unit tests provide sufficient " +"coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " -"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " -"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. " +"زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای " +"ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its " -"public API (using `pub mod for_testing { ... }` if needed). This is the " -"subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its public " +"API (using `pub mod for_testing { ... }` if needed). This is the subject of the " +"next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " -"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " -"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی " +"آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده " +"می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" "Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after " -"adding or updating third-party crates.)" +"exercised by Chromium bots. (Such testing is needed rarely --- only after adding " +"or updating third-party crates.)" msgstr "" "ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " -"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " -"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از " +"افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " -"used:" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " -"مقابل Rust `gtest` استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل " +"Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a " -"thin FFI glue) and therefore uses the existing C++ unit tests for testing " -"both the C++ and the Rust implementation (parameterizing the tests so they " -"enable or disable Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a thin " +"FFI glue) and therefore uses the existing C++ unit tests for testing both the C++ " +"and the Rust implementation (parameterizing the tests so they enable or disable " +"Rust using a `ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " -"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " -"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " -"`ScopedFeatureList` آن را فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و " +"بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند " +"(تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک `ScopedFeatureList` آن را " +"فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe " -"implementation of pixel transformations that are provided by `libpng` but " -"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " -"functionality may benefit from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe implementation " +"of pixel transformations that are provided by `libpng` but missing in the `png` " +"crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit " +"from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " -"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " -"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " -"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " -"بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی " +"داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به " +"عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن " +"است از آزمایش های جداگانه‌ای که در Rust نوشته شده است بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" +"testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" -"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " -"attribute)" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" msgstr "" "از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " "`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " -"panicking and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking " +"and not terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " -"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی " +"assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -15916,11 +15515,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing " -"test binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing test " +"binary that already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " -"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که " +"از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -15945,8 +15544,8 @@ msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " -"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام " +"دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -15988,19 +15587,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " -"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " -"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " -"computed based on the full target path and name. Fortunately we can avoid " -"working with such an unwieldy name by using the `chromium::import!` macro " -"from the automatically-imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import " +"and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an " +"explicit `crate_name` for `my_rust_lib` so its crate name is computed based on " +"the full target path and name. Fortunately we can avoid working with such an " +"unwieldy name by using the `chromium::import!` macro from the automatically-" +"imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " -"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " -"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " -"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " -"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " -"درنتیجه از کار با چنین نامی پرهیز کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " +"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح " +"برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل " +"هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` " +"از `chromium` crate که به‌طور خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز " +"کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -16012,30 +15611,30 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" -"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" +"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" -"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" +"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" "import`." #: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the " -"crate name has to be globally unique. crates.io guarantees uniqueness of its " -"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " -"covered in a later section) use short crate names." +"property, but doing this is discouraged. And it is discouraged because the crate " +"name has to be globally unique. crates.io guarantees uniqueness of its crate " +"names so `cargo_crate` GN targets (generated by the `gnrt` tool covered in a " +"later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " -"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " -"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " -"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " -"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، " +"اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح " +"سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین " +"می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که در بخش " +"بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -16051,13 +15650,13 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding " -"two integers received as arguments, computing the nth Fibonacci number, " -"summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding two " +"integers received as arguments, computing the nth Fibonacci number, summing " +"integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " -"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " -"اعداد صحیح در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن " +"دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح " +"در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -16069,122 +15668,114 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "" -"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new " -"tools being developed all the time. At the moment, Chromium uses a tool " -"called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new tools " +"being developed all the time. At the moment, Chromium uses a tool called CXX." msgstr "" "جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " -"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " -"CXX استفاده می‌کند." +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX " +"استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition " -"language (which looks a lot like Rust) and then CXX tools generate " -"declarations for functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition language " +"(which looks a lot like Rust) and then CXX tools generate declarations for " +"functions and types in both Rust and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " -"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " -"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار " +"شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع " +"و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " -"using this." +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using " +"this." msgstr "" -"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " -"ببینید." +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just " -"the same as you previously did. Point out that automating the process has " -"the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just the " +"same as you previously did. Point out that automating the process has the " +"following benefits:" msgstr "" "از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " -"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " -"فرآیند دارای مزایای زیر است:" +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند " +"دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " -"definitions, but with out-of-sync manual bindings you'd get Undefined " -"Behavior)" +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, " +"but with out-of-sync manual bindings you'd get Undefined Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " -"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " -"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " -"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::" +"bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای " +"کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual " +"bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " -"methods; manual bindings would require authoring such top-level, free " -"functions manually)" +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ methods; " +"manual bindings would require authoring such top-level, free functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " -"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " -"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " -"بالا و رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای " +"ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور " +"خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح بالا و " +"رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " -"کنند - به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - " +"به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't " -"guarantee any particular ABI or memory layout. With manual bindings `std::" -"span` / `&[T]` have to be manually destructured and rebuilt out of a " -"pointer and length - this is error-prone given that each language represents " -"empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee " +"any particular ABI or memory layout. With manual bindings `std::span` / `&[T]` " +"have to be manually destructured and rebuilt out of a pointer and length - this " +"is error-prone given that each language represents empty slices slightly " +"differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " -"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " -"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " -"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " -"خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی " +"را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت " +"دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با توجه به اینکه " +"هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " -"are natively supported. With manual bindings, one would have to pass C-ABI-" -"compatible raw pointers, which would increase lifetime and memory-safety " -"risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are " +"natively supported. With manual bindings, one would have to pass C-ABI-compatible " +"raw pointers, which would increase lifetime and memory-safety risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " -"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " -"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " -"طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` " +"به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-" +"ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" "`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can " -"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" -"terminate a string)." +"string representation across the languages (e.g. `rust::String::lossy` can build " +"a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a " +"string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " -"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " -"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " -"string را با NUL خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها " +"درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را " +"از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک string را با NUL " +"خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." -"rs` اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` " +"اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -16200,14 +15791,14 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " -"procedural macro does complex things to it. The generated code is quite a " -"bit more sophisticated - though this does still result in a `mod` called " -"`ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural " +"macro does complex things to it. The generated code is quite a bit more " +"sophisticated - though this does still result in a `mod` called `ffi` in your " +"code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" -"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " -"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` " +"کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این " +"کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -16227,22 +15818,21 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by " -"Rust, but this is misleading. This header is never interpreted by Rust, but " -"simply `#include`d in the generated C++ code for the benefit of C++ " -"compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, " +"but this is misleading. This header is never interpreted by Rust, but simply " +"`#include`d in the generated C++ code for the benefit of C++ compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " -"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " -"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه " +"کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد +" +"+C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://" -"cxx.rs/bindings.html)." +"By far the most useful page when using CXX is the [type reference](https://cxx.rs/" +"bindings.html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" -"(https://cxx.rs/bindings.html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx." +"rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" @@ -16250,51 +15840,45 @@ msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of " -"it." +"Your Rust-C++ interface is sufficiently simple that you can declare all of it." msgstr "" "اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " "declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example " -"`std::unique_ptr`, `std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example `std::" +"unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" "شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " "مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` " -"type." +"It has many limitations --- for example lack of support for Rust's `Option` type." msgstr "" -"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " -"Rust." +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well " -"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " -"considering a use-case for Rust in Chromium, a good starting point is to " -"draft the CXX bindings for the language boundary to see if it appears simple " -"enough." +"These limitations constrain us to using Rust in Chromium only for well isolated " +"\"leaf nodes\" rather than for arbitrary Rust-C++ interop. When considering a use-" +"case for Rust in Chromium, a good starting point is to draft the CXX bindings for " +"the language boundary to see if it appears simple enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " -"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " -"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " -"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " -"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" " +"به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن " +"یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که پیش نویس " +"پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا ببینید آیا به " +"اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You should also discuss some of the other sticky points with CXX, for " -"example:" +"You should also discuss some of the other sticky points with CXX, for example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"Its error handling is based around C++ exceptions (given on the next slide)" +msgid "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -16303,12 +15887,12 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " -"on C++ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C+" +"+ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" -"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " -"جایگزین‌های آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ " +"exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های " +"آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -16317,12 +15901,11 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " -"be passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be " +"passed across the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " -"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " -"باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این " +"مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -16333,19 +15916,18 @@ msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " -"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " -"`Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای " +"یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed " -"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " -"cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed when `T` " +"is a Rust type, which cannot be passed across the FFI boundary, and cannot be " +"stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " -"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " -"کند و نمی تواند در `UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است " +"زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و " +"نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -16353,19 +15935,18 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` " -"representing failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` representing " +"failure)" msgstr "" "به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " "نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been " -"needed in practice." +"Preserving error details is in theory possible, but so far hasn't been needed in " +"practice." msgstr "" -"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " -"است." +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -16374,15 +15955,15 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." -"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " -"used to communicate success vs failure, and where the successful result can " -"be passed across the FFI boundary:" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;" +"l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to " +"communicate success vs failure, and where the successful result can be passed " +"across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" -"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " -"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:" +"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و جایی " +"که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -16390,37 +15971,36 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. " -"This is not the size of the vector, but the size of the QR code (and " -"admittedly it is a bit redundant - this is the square root of the size of " -"the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. This is " +"not the size of the vector, but the size of the QR code (and admittedly it is a " +"bit redundant - this is the square root of the size of the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " -"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " -"جذر اندازه بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه " +"بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه " +"بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` " -"before calling into the Rust function. Creation of a Rust reference that " -"points to uninitialized memory results in Undefined Behavior (unlike in C++, " -"when only the act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` before " +"calling into the Rust function. Creation of a Rust reference that points to " +"uninitialized memory results in Undefined Behavior (unlike in C++, when only the " +"act of dereferencing such memory results in UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " -"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " -"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " -"حافظه‌ای منجر به UB می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` " +"اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار " +"نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB " +"می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable " -"references to C++ data: the answer is that C++ data can’t be moved around " -"like Rust data, because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable references " +"to C++ data: the answer is that C++ data can’t be moved around like Rust data, " +"because it may contain self-referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " -"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " -"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " -"خودارجاعی (self-referential pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل " +"تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند " +"داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential " +"pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -16428,11 +16008,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the " -"successful result cannot be passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the successful " +"result cannot be passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " -"FFI عبور کند و چه کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI " +"عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -16457,31 +16037,29 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " -"types cannot cross the FFI boundary without indirection of a `Box`. We " -"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " -"to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types " +"cannot cross the FFI boundary without indirection of a `Box`. We can't have an " +"`out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust " +"objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " -"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " -"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " -"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این " +"نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم " +"`out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust " +"object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary " -"generics nor templates, we can still pass them across the FFI boundary by " -"manually specializing / monomorphizing them into a non-generic type. In the " -"example `ResultOfPngReader` is a non-generic type that forwards into " -"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " -"`as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary generics " +"nor templates, we can still pass them across the FFI boundary by manually " +"specializing / monomorphizing them into a non-generic type. In the example " +"`ResultOfPngReader` is a non-generic type that forwards into appropriate methods " +"of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " -"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " -"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " -"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " -"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " -"ارسال می‌شود." +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی " +"نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی " +"تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در " +"مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای مناسب `Result` " +"(به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -16489,13 +16067,13 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" -"node where we want to use Rust. You'd typically have one for each " +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node " +"where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " -"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " -"یکی دارید. پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust " +"استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. " +"پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -16527,15 +16105,13 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium " -"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" -"l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium C++ " +"types to CXX Rust types --- for example [`SpanToRustSlice`](https://source." +"chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " -"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." -"h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به " +"انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source." +"chromium.org/chromium/chromium/src /+/main:base/containers/span_rust.h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" @@ -16544,32 +16120,31 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " -"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " -"to memory, and compromise the safety of Rust's own data layouts. Presence of " -"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " -"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " -"binary can cause unexpected behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. " +"Calling back and forth to C/C++ from Rust may do arbitrary things to memory, and " +"compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` " +"keywords in C/C++ interop can harm the signal-to-noise ratio of such a keyword, " +"and is [controversial](https://steveklabnik.com/writing/the-cxx-debate), but " +"strictly, bringing any foreign code into a Rust binary can cause unexpected " +"behavior from Rust's perspective." msgstr "" "پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " -"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " -"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " -"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " -"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" -"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " -"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام " +"دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار " +"زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین کلمه کلیدی آسیب " +"برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/the-cxx-debate) است، " +"اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث رفتار غیرمنتظره " +"از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " -"`unsafe` and `extern \"C\"` functions just like we did manually in the " -"previous section." +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust `unsafe` " +"and `extern \"C\"` functions just like we did manually in the previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " -"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " -"در بخش قبل به صورت دستی انجام دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است " +"--- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل " +"به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -16581,13 +16156,13 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which " -"specifies a single function, to be called from C++, called " -"`hello_from_rust`, taking no parameters and returning no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a " +"single function, to be called from C++, called `hello_from_rust`, taking no " +"parameters and returning no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " -"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " -"بدون اینکه پارامتر و هیچ مقداری برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را " +"مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه " +"پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -16603,11 +16178,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. " -"Instead, include the generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, " +"include the generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " -"عوض، فایل هِدِر تولید شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، " +"فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -16619,11 +16194,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how " -"flexible Rust in Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how flexible " +"Rust in Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " -"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید " +"که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -16638,26 +16213,25 @@ msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " -"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما " +"باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the " -"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" -"extern-c++.html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the `unsafe` " +"keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++." +"html#functions-and-member-functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " -"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" -"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` " +"را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx." +"rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" -"cxx.h\"` را وارد کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -16672,32 +16246,32 @@ msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " -"و به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " +"خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " -"به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " +"خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " -"own some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own " +"some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " -"بتواند دارای یک C++ object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند " +"دارای یک C++ object باشد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " -"need a `Box`)." +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a " +"`Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " -"(نکته: شما به یک `Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: " +"شما به یک `Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -16717,9 +16291,9 @@ msgid "" "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " -"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " -"تعریف این رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای " +"Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این " +"رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -16736,40 +16310,39 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "" -"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با " -"آن مواجه شوید:" +"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با آن " +"مواجه شوید:" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X " -"and Y are both function types. This is because your C++ function doesn't " -"quite match the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X and Y " +"are both function types. This is because your C++ function doesn't quite match " +"the declaration in your `cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " -"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " -"`cxx::bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر " +"دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::" +"bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. " -"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" -"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " -"CXX's design makes it quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. Doesn't " +"that risk UB? For CXX's _opaque_ types, no, because they are zero-sized. For CXX " +"trivial types yes, it's _possible_ to cause UB, although CXX's design makes it " +"quite difficult to craft such an example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " -"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " -"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " -"نمونه‌ای را بسیار دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB " +"را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع " +"بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار " +"دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://crates." +"io). It's _very easy_ for Rust crates to depend upon one another. So they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." -"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " -"آنها این کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) " +"یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این " +"کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -16824,16 +16397,16 @@ msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " -"آن‌ها در Chromium را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها " +"در Chromium را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely " -"have to bring in multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely have " +"to bring in multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " -"بود چندین کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود " +"چندین کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -16857,15 +16430,13 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. These " +"are managed through a single [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " -"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" -"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " -"می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. " +"اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/" +"+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16888,14 +16459,13 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies." +"html) --- most commonly, you'll want to specify the `features` that you wish to " +"enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" -"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " -"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " -"کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://" +"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- " +"معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16913,15 +16483,13 @@ msgid "" msgstr "" "در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " -"crate است." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت crate " +"است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"If you add a new crate, you should specify at least the `group`. This is one " -"of:" -msgstr "" -"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +"If you add a new crate, you should specify at least the `group`. This is one of:" +msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -16930,27 +16498,27 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this " -"file to specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this file to " +"specify where its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " -"یافتن فایل (های) مجوز آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن " +"فایل (های) مجوز آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file " -"to resolve problems." +"Later, we'll see some other things you will need to configure in this file to " +"resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " -"مشاهده خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده " +"خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD." -"gn` rules." +"A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` " +"rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " -"`BUILD.gn` را ایجاد کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD." +"gn` را ایجاد کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -16958,14 +16526,13 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running " -"this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." +"Although the `gnrt` tool is part of the Chromium source code, by running this " +"command you will be downloading and running its dependencies from `crates.io`. " +"See [the earlier section](../cargo.md) discussing this security decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " -"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." -"md) را در مورد این تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن " +"را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این " +"تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -16981,11 +16548,11 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete " -"set of crates required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete set " +"of crates required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " -"جعبه‌های مورد نیاز Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های " +"مورد نیاز Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -16993,13 +16560,12 @@ msgid "" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" -"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " -"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" +"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال " +"می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" @@ -17009,10 +16575,8 @@ msgstr "اکنون `git status` را اجرا کنید. شما باید این #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/" -"vendor`" -msgstr "" -"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +"At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" +msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" @@ -17028,46 +16592,44 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." +"The \"major semver version\" is a [Rust \"semver\" version number](https://doc." +"rust-lang.org/cargo/reference/semver.html)." msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " -"مراجعه کنید." +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه " +"کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Take a close look, especially at the things generated in `third_party/rust`." +msgid "Take a close look, especially at the things generated in `third_party/rust`." msgstr "" "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium " -"it's to allow multiple incompatible versions of a crate, which is " -"discouraged but sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium it's to " +"allow multiple incompatible versions of a crate, which is discouraged but " +"sometimes necessary in the Cargo ecosystem." msgstr "" "کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " -"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " -"منع می‌شود ولی گاهی اوقات ضروری است." +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع " +"می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the " -"design of `gn` and `ninja` which aim for static, deterministic, build rules " -"to maximize parallelism and repeatability of builds." +"arbitrary things at build time. This is fundamentally at odds with the design of " +"`gn` and `ninja` which aim for static, deterministic, build rules to maximize " +"parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " -"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " -"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " -"رساندن موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که " +"کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی " +"`gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر رساندن " +"موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "" -"Some `build.rs` actions are automatically supported; others require action:" +msgid "Some `build.rs` actions are automatically supported; others require action:" msgstr "" -"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " -"اقدام دارند:" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام " +"دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -17126,30 +16688,28 @@ msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " -"scriptها تنها دو عمل اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها " +"تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " -"ببینید که آیا کدهای منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که " +"آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " -"add `build-script-outputs` to the crate. If this is a transitive dependency, " -"that is, one on which Chromium code should not directly depend, also add " -"`allow-first-party-usage=false`. There are several examples already in that " -"file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add " +"`build-script-outputs` to the crate. If this is a transitive dependency, that is, " +"one on which Chromium code should not directly depend, also add `allow-first-" +"party-usage=false`. There are several examples already in that file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " -"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " -"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " -"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " -"فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر " +"دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، " +"یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس `allow-first-" +"party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -17168,27 +16728,26 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input " -"to subsequent build steps." +"`BUILD.gn` files to inform ninja that this particular output file is input to " +"subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " -"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " -"فایل خروجی خاص ورودی مراحل build بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا " +"فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی " +"خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " -"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" -"crates.io/crates/bindgen) within their build scripts. These actions can't be " -"supported in a Chromium context --- our gn, ninja and LLVM build system is " -"very specific in expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " -"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " -"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " -"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " -"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " -"است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/" +"C++ libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/" +"crates/bindgen) within their build scripts. These actions can't be supported in a " +"Chromium context --- our gn, ninja and LLVM build system is very specific in " +"expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build " +"و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از " +"[`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه " +"می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، " +"ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -17205,27 +16764,25 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" -"` - see for example the [patches against the `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - and will be applied automatically by " -"`gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - " +"see for example the [patches against the `cxx` crate](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - " +"and will be applied automatically by `gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" -"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " -"خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` " +"نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" +"cxx/) - و هر بار که crate را upgrade می‌کند به‌طور خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending " -"on a crate is simple. Find your `rust_static_library` target, and add a " -"`dep` on the `:lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending on a " +"crate is simple. Find your `rust_static_library` target, and add a `dep` on the `:" +"lib` target within your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " -"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " -"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه " +"به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا " +"کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -17235,15 +16792,13 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" @@ -17272,43 +16827,41 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Third_party-review), but of course also subject to security review. As " -"you may be bringing in not just a single crate but also transitive " -"dependencies, there may be a lot of code to review. On the other hand, safe " -"Rust code can have limited negative side effects. How should you review it?" -msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" -"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " -"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " -"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " -"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " -"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-" +"review), but of course also subject to security review. As you may be bringing in " +"not just a single crate but also transitive dependencies, there may be a lot of " +"code to review. On the other hand, safe Rust code can have limited negative side " +"effects. How should you review it?" +msgstr "" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/" +"src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما " +"البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، " +"بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای زیادی برای بررسی وجود داشته " +"باشد. از سوی دیگر، safe Rust code می‌تواند عوارض جانبی محدودی داشته باشد. پس " +"چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet]" -"(https://mozilla.github.io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet](https://" +"mozilla.github.io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" -"mozilla.github.io/cargo-vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla." +"github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "" -"Meanwhile, for each new crate addition, we are checking for the following:" +msgid "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? " -"If the build system for each crate contains a `build.rs` or procedural " -"macros, work out what they're for. Are they compatible with the way Chromium " -"is normally built?" +"Understand why each crate is used. What's the relationship between crates? If the " +"build system for each crate contains a `build.rs` or procedural macros, work out " +"what they're for. Are they compatible with the way Chromium is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " -"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " -"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " -"ساخته و built می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر " +"جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که " +"آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول ساخته و built " +"می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -17323,19 +16876,18 @@ msgid "" "cargo.md))" msgstr "" "از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " -"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" -"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." -"md))" +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` " +"که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." -"md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium." +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" +"safe-languages)" msgstr "" "مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" -"in-safe-languages) خوب است" +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" +"safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -17343,21 +16895,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place " -"that might have been maliciously inserted. (You can't realistically aim for " -"100% perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place that " +"might have been maliciously inserted. (You can't realistically aim for 100% " +"perfection here: there's often just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " -"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " -"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد " +"شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ " +"درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium." -"org` to work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium.org` to " +"work out the right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " -"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار " +"کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -17376,8 +16928,7 @@ msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" -"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" -"`" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -17385,16 +16936,16 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config." -"toml` changes, into the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` " +"changes, into the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " -"مخزن Chromium قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن " +"Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` " -"files may result in some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` files " +"may result in some files being skipped." msgstr "" "**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." "gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." @@ -17403,49 +16954,48 @@ msgstr "" #, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git " -"branches, and many projects still use non-inclusive terminology there. So " -"you may need to run:" +"language. This is because Rust crate data tends to include names of git branches, " +"and many projects still use non-inclusive terminology there. So you may need to " +"run:" msgstr "" "در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " -"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " -"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " -"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام " +"شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده " +"می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to " -"keep it up to date with any security fixes](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " -"hoped that we will soon automate this for Rust crates, but for now, it's " -"still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to keep it " +"up to date with any security fixes](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will " +"soon automate this for Rust crates, but for now, it's still your responsibility " +"just as it is for any other third party dependency." msgstr "" "شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " -"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" -"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " -"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " -"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/" +"main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی این را " +"برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که " +"برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/" -"features.html#the-default-feature). Assume that the crate will be used in " -"shipping Chromium, but won't be used to handle untrustworthy input." -msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " -"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." -"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " -"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " -"نمی‌شود." +"crate's [default features](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). Assume that the crate will be used in shipping " +"Chromium, but won't be used to handle untrustworthy input." +msgstr "" +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های " +"پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features.html#the-default-" +"feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، " +"اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " -"ahead and do that now if you like. Or, you could create a new " -"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead " +"and do that now if you like. Or, you could create a new [`rust_executable` target]" +"(https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"rust_executable.gni) which uses `uwuify`)." msgstr "" "(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " "می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" @@ -17494,18 +17044,17 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to " -"turn off the default features." +"If students are downloading even more than that, they probably forgot to turn off " +"the default features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " -"ویژگی‌های پیش‌فرض را خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های " +"پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" -"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " -"crate!" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -17516,8 +17065,8 @@ msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " -"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی " +"را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -17525,46 +17074,43 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. " -"It's important that we get Chromium for Pixies delivered to them as soon as " -"possible." +"A community of pixies has been discovered living in a remote rainforest. It's " +"important that we get Chromium for Pixies delivered to them as soon as possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " -"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم " +"است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie " -"language." +"The requirement is to translate all Chromium's UI strings into Pixie language." msgstr "" -"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " -"شوند." +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie " -"language is very close to English, and it turns out there's a Rust crate " -"which does the translation." +"There's not time to wait for proper translations, but fortunately pixie language " +"is very close to English, and it turns out there's a Rust crate which does the " +"translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " -"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " -"که ترجمه را انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie " +"بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را " +"انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" -"crates/uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/" +"uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and " -"diligence. Don't ship this!)" +"(Obviously, real translations of Chrome require incredible care and diligence. " +"Don't ship this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " -"این مورد را ارسال نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این " +"مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -17573,84 +17119,83 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" "Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always " -"do this irrespective of the setting of `mangle_localized_strings_`." +"strings before display. In this special build of Chromium, it should always do " +"this irrespective of the setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " -"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " -"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را " +"قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات " +"`mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, " -"you should have created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, you " +"should have created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " -"را برای pixies ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را " +"برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " -"and will probably decide that it's better to do the conversion on the C++ " -"side using `base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and " +"will probably decide that it's better to do the conversion on the C++ side using " +"`base::UTF16ToUTF8` and back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " -"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " -"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و " +"احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::" +"UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " "consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which " -"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" -"slice.html)." +"String.html#method.from_utf16), consider error handling, and consider which [CXX " +"supported types can transfer a lot of u16s](https://cxx.rs/binding/slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. " -"taking and returning strings by value, or taking a mutable reference to a " -"string. If a mutable reference is used, CXX will likely tell the student " -"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " -"need to explain what `Pin` does, and then explain why CXX needs it for " -"mutable references to C++ data: the answer is that C++ data can't be moved " -"around like Rust data, because it may contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " -"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " -"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " -"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " -"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " -"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " -"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " -"نشانگرهای خودارجاعی (self-referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. taking " +"and returning strings by value, or taking a mutable reference to a string. If a " +"mutable reference is used, CXX will likely tell the student that they need to use " +"[`Pin`](https://doc.rust-lang.org/std/pin/). You may need to explain what `Pin` " +"does, and then explain why CXX needs it for mutable references to C++ data: the " +"answer is that C++ data can't be moved around like Rust data, because it may " +"contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. " +"گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک " +"string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که " +"باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. ممکن است لازم " +"باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به آن برای ارجاع‌های " +"قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های C++ را نمی‌توان " +"مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" +"referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " -"need to depend on a `rust_static_library` target. The student probably " -"already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need " +"to depend on a `rust_static_library` target. The student probably already did " +"this." msgstr "" "هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " -"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " -"داده است." +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده " +"است." #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" -"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " -"وابسته باشد." +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته " +"باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs]" -"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs](https://" +"chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" -"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review." +"googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -17658,23 +17203,26 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people " -"who are familiar with the basics of Rust (perhaps from completing the " -"Comprehensive Rust course), and ideally also have some experience with bare-" -"metal programming in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people who " +"are familiar with the basics of Rust (perhaps from completing the Comprehensive " +"Rust course), and ideally also have some experience with bare-metal programming " +"in some other language such as C." msgstr "" +"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با اصول " +"Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز تجربه " +"برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." #: src/bare-metal.md msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" -"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون " -"سیستم‌عامل در ادامه به چند بخش تقسیم خواهد شد:" +"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون سیستم‌عامل " +"در ادامه به چند بخش تقسیم خواهد شد:" #: src/bare-metal.md msgid "What is `no_std` Rust?" -msgstr "" +msgstr "این `no_std` Rust چیست؟" #: src/bare-metal.md msgid "Writing firmware for microcontrollers." @@ -17691,22 +17239,20 @@ msgstr "برخی از crateهای مفید برای توسعه bare-metal Rust." #: src/bare-metal.md msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " -"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " -"an on-board SWD debugger." +"(https://microbit.org/) v2 as an example. It's a [development board](https://tech." +"microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some " +"LEDs and buttons, an I2C-connected accelerometer and compass, and an on-board SWD " +"debugger." msgstr "" #: src/bare-metal.md -msgid "" -"To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" -"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس " -"یا دبیان:" +"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس یا " +"دبیان:" #: src/bare-metal.md -msgid "" -"And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md @@ -17727,7 +17273,7 @@ msgstr "Slices, `&str`, `CStr`" #: src/bare-metal/no_std.md msgid "`NonZeroU8`..." -msgstr "`net`" +msgstr "`NonZeroU8`..." #: src/bare-metal/no_std.md msgid "`Option`, `Result`" @@ -17835,26 +17381,26 @@ msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را " -"`panic = \"abort\"` کامپایل کنید." +"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را `panic = " +"\"abort\"` کامپایل کنید." #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to " -"define your own entry point. This will typically involve a linker script and " -"some assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to define " +"your own entry point. This will typically involve a linker script and some " +"assembly code to set things up ready for Rust code to run." msgstr "" -"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما " -"بستگی دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker " -"و مقداری کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." +"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما بستگی " +"دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker و مقداری " +"کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc." -"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-" +"lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" -"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-" -"lang.org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." +"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-lang." +"org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." #: src/bare-metal/alloc.md #, fuzzy @@ -17878,62 +17424,62 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy system " +"allocator. Other crates are available, or you can write your own or hook into " +"your existing allocator." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " -"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " -"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " +"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " +"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " -"in this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in " +"this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" #: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in " -"the top-level binary crate." +"exactly one global allocator defined in your binary. Usually this is done in the " +"top-level binary crate." msgstr "" #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " -"crate is linked in so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate " +"is linked in so we get its panic handler." msgstr "" "برای اطمینان از اینکه `panic_halt` crate لینک شده است، استفاده `extern crate " "panic_halt as _` ضروری است، بنابراین panic handler آن را دریافت می‌کنیم." #: src/bare-metal/alloc.md msgid "This example will build but not run, as it doesn't have an entry point." -msgstr "" +msgstr "این مثال ساخته می شود اما اجرا نمی‌شود، زیرا entry point ندارد." #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for " -"Cortex M microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex " +"M microcontrollers." msgstr "" -"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای " -"میکروکنترلرهای Cortex M فراهم می‌کند." +"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای میکروکنترلرهای " +"Cortex M فراهم می‌کند." #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" -"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع " -"بررسی خواهیم کرد." +"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع بررسی " +"خواهیم کرد." #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" -"> !`, because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, " +"because returning to the reset handler doesn't make sense." msgstr "" -"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::" -"entry` باشد، زیرا بازگشت به reset handler منطقی نیست." +"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::entry` " +"باشد، زیرا بازگشت به reset handler منطقی نیست." #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" @@ -17941,8 +17487,8 @@ msgstr "مثال را با `cargo embed --bin minimal` اجرا کنید" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try " -"turning on an LED on our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning " +"on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -17960,8 +17506,7 @@ msgstr "// GPIO peripheral offsets\n" msgid "// PIN_CNF fields\n" msgstr "// PIN_CNF fields\n" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" @@ -17976,8 +17521,7 @@ msgstr "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" @@ -17985,13 +17529,11 @@ msgstr "// Set pin 28 low and pin 21 high to turn the LED on.\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " -"to the first row." -msgstr "" -"در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to " +"the first row." +msgstr "در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" @@ -18004,21 +17546,20 @@ msgstr "Crateهای دسترسی جانبی" #: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" -"pack/doc/CMSIS/SVD/html/index.html) files." +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/" +"doc/CMSIS/SVD/html/index.html) files." msgstr "" -"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust " -"عمدتاً ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD]" -"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." +"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust عمدتاً " +"ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD](https://www." +"keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by " -"silicon vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by silicon " +"vendors which describe the memory map of the device." msgstr "" -"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً " -"توسط فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را " -"توصیف می‌کنند." +"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً توسط " +"فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را توصیف می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -18028,13 +17569,12 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects " -"which patch the mistakes, add missing details, and publish the generated " -"crates." +"SVD files are often buggy and incomplete, so there are various projects which " +"patch the mistakes, add missing details, and publish the generated crates." msgstr "" -"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد " -"که اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید " -"شده را منتشر می‌کنند." +"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد که " +"اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید شده را " +"منتشر می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." @@ -18042,8 +17582,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " -"pac -- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac " +"-- -d --no-show-raw-insn` to see the resulting binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -18053,14 +17593,14 @@ msgstr "HAL crates" #: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around " -"various peripherals. These generally implement traits from [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal)." +"implementation-crates) for many microcontrollers provide wrappers around various " +"peripherals. These generally implement traits from [`embedded-hal`](https://" +"crates.io/crates/embedded-hal)." msgstr "" "این [crateهای HAL]‌(https://github.com/rust-embedded/wesome-embedded-rust#hal-" "implementation-crates) برای بسیاری از میکروکنترلرها بسته‌بندی‌هایی را در اطراف " -"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." +"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`](https://" +"crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" @@ -18073,8 +17613,8 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various " -"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, " +"GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" "بسیاری از HAL crateها برای انواعی از دستگاه های Cortex-M و RISC-V از جمله " "میکروکنترلرهای STM32، GD32، nRF، NXP، MSP430، AVR و PIC مختلف وجود دارد." @@ -18086,16 +17626,16 @@ msgstr "Board support crates" #: src/bare-metal/microcontrollers/board-support.md #, fuzzy msgid "" -"Board support crates provide a further level of wrapping for a specific " -"board for convenience." +"Board support crates provide a further level of wrapping for a specific board for " +"convenience." msgstr "" -"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک " -"board خاص فراهم می‌کنند." +"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک board " +"خاص فراهم می‌کنند." #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, " -"and a bit of initialisation." +"In this case the board support crate is just providing more useful names, and a " +"bit of initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -18124,37 +17664,37 @@ msgstr "// pin_input.is_high(); // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can " -"exist. Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. " +"Once a pin is moved out of the port struct nobody else can take it." msgstr "" -"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام " -"می‌تواند وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس " -"دیگری نمی تواند آن را بگیرد." +"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام می‌تواند " +"وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس دیگری نمی " +"تواند آن را بگیرد." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you " -"can’t keep use the old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you can’t " +"keep use the old instance afterwards." msgstr "" -"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از " -"آن از pin قدیمی استفاده کنید." +"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از آن از " +"pin قدیمی استفاده کنید." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, " -"the configuration state of a GPIO pin. This encodes the state machine into " -"the type system, and ensures that you don't try to use a pin in a certain " -"way without properly configuring it first. Illegal state transitions are " -"caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, the " +"configuration state of a GPIO pin. This encodes the state machine into the type " +"system, and ensures that you don't try to use a pin in a certain way without " +"properly configuring it first. Illegal state transitions are caught at compile " +"time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but " -"not vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but not " +"vice-versa." msgstr "" -"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی " -"فراخوانی کنید، اما برعکس امکان پذیر نیست." +"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی فراخوانی " +"کنید، اما برعکس امکان پذیر نیست." #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." @@ -18165,8 +17705,8 @@ msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" -"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی " -"ویژگی را ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" +"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی ویژگی را " +"ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" @@ -18186,38 +17726,36 @@ msgstr "گذرگاه‌ها و دستگاه‌های I2C و SPI" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " -"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" -"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" -"crates.io/crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out " +"into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`]" +"(https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/" +"crates/rand_core) respectively." msgstr "" -"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم " -"شدن به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-" -"can`](https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates." -"io/crates/rand_core) به ترتیب." +"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم شدن " +"به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-can`]" +"(https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates.io/crates/" +"rand_core) به ترتیب." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-" +"embedded-rust#driver-crates) in terms of these traits, e.g. an accelerometer " +"driver might need an I2C or SPI device instance." msgstr "" -"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-" -"embedded-rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به " -"عنوان مثال. یک درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز " -"داشته باشد." +"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-embedded-" +"rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به عنوان مثال. یک " +"درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز داشته باشد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring " -"them, as initialisation and configuration is usually highly platform-" -"specific." +"The traits cover using the peripherals but not initialising or configuring them, " +"as initialisation and configuration is usually highly platform-specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other " -"platforms such as Linux on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other platforms " +"such as Linux on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -18225,32 +17763,30 @@ msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " -"نسخه‌های async از traitها را ارائه می دهد." +" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) نسخه‌های " +"async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " -"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" -"crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another " +"approach to non-blocking I/O, based on the [`nb`](https://crates.io/crates/nb) " +"crate." msgstr "" -"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد " -"دیگری را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// " -"crates.io/crates/nb) crate است." +"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد دیگری " +"را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// crates.io/" +"crates/nb) crate است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " -"like OpenOCD but better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like " +"OpenOCD but better integrated." msgstr "" -"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی " -"جاسازی شده است، مانند OpenOCD است، اما بهتر یکپارچه شده است." +"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی جاسازی شده " +"است، مانند OpenOCD است، اما بهتر یکپارچه شده است." #: src/bare-metal/microcontrollers/probe-rs.md -msgid "" -"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" -msgstr "" -"SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" +msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgstr "SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" @@ -18262,54 +17798,52 @@ msgstr "ادغام Cargo" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " -"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." -"toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real " +"Time Transfers) output and connect GDB. It's configured by an `Embed.toml` file " +"in your project directory." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " -"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " -"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " +"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " +"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " -"an Arm standard protocol over USB for an in-circuit debugger to access the " -"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " -"on-board debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm " +"standard protocol over USB for an in-circuit debugger to access the CoreSight " +"Debug Access Port of various Arm Cortex processors. It's what the on-board " +"debugger on the BBC micro:bit uses." msgstr "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک " -"پروتکل استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی " -"به پورت CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد " -"استفاده قرار گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از " -"آن استفاده می‌کند." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک پروتکل " +"استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی به پورت " +"CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد استفاده قرار " +"گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از آن استفاده می‌کند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " -"is a range from SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a " +"range from SEGGER." msgstr "" -"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link " -"محدوده ای از SEGGER است." +"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link محدوده ای " +"از SEGGER است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " -"Serial Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial " +"Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"probe-rs is a library which you can integrate into your own tools if you " -"want to." +"probe-rs is a library which you can integrate into your own tools if you want to." msgstr "" -"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود " -"ادغام کنید." +"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود ادغام " +"کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" -"adapter-protocol/) lets VSCode and other IDEs debug code running on any " -"supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-" +"protocol/) lets VSCode and other IDEs debug code running on any supported " +"microcontroller." msgstr "" "[پروتکل آداپتور Debug مایکروسافت](https://microsoft.github.io/debug-adapter-" "protocol/) به VSCode و سایر IDE‌ها اجازه می‌دهد کدهای موجود در هر میکروکنترلر " @@ -18318,16 +17852,15 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده " -"است." +"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " -"host and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host " +"and the target through a number of ringbuffers." msgstr "" -"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و " -"target از طریق تعدادی بافر حلقه‌ای (ringbuffers) است." +"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و target از " +"طریق تعدادی بافر حلقه‌ای (ringbuffers) است." #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" @@ -18363,11 +17896,10 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +msgid "Shared resource management, message passing, task scheduling, timer queue" msgstr "" -"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر " -"(timer queue)" +"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر (timer " +"queue)" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" @@ -18386,8 +17918,7 @@ msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از " -"حافظه" +"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از حافظه" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" @@ -18395,8 +17926,8 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged " +"drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -18405,17 +17936,16 @@ msgstr "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." -"github.io/book/overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github." +"io/book/overview/using-the-standard-library.html)." msgstr "" -"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-" -"rs.github.io/book/overview/using-the-standard-library.html)." +"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-rs." +"github.io/book/overview/using-the-standard-library.html)." #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر " -"گرفت." +"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر گرفت." #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." @@ -18423,8 +17953,8 @@ msgstr "این شامل هیچ HAL نیست." #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " -"scheduling rather than a proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling " +"rather than a proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -18432,8 +17962,7 @@ msgid "Cortex-M only." msgstr "Cortex-M فقط." #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" "گوگل از TockOS در میکروکنترلر Haven برای کلیدهای امنیتی Titan استفاده می‌کند." @@ -18445,24 +17974,27 @@ msgstr "" #: src/exercises/bare-metal/morning.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port." -msgstr "" +"We will read the direction from an I2C compass, and log the readings to a serial " +"port." +msgstr "ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"morning.md) provided." +"After looking at the exercises, you can look at the [solutions](solutions-morning." +"md) provided." msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " -"نگاه کنید." +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه " +"کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port. If you have time, try displaying it on the LEDs somehow too, or " -"use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a serial " +"port. If you have time, try displaying it on the LEDs somehow too, or use the " +"buttons somehow." msgstr "" +"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. اگر " +"وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از دکمه‌ها " +"استفاده کنید." #: src/exercises/bare-metal/compass.md msgid "Hints:" @@ -18470,15 +18002,14 @@ msgstr "نکته‌ها:" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" -"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" -"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." -"org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/" +"lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) " +"crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." msgstr "" -"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و " -"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه " -"crateهای آن را بررسی کنید همانطور که [micro:bit hardware](https://tech." -"microbit.org/hardware/) را بررسی می‌کنید." +"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و [`microbit-" +"v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه crateهای آن را بررسی " +"کنید همانطور که [micro:bit hardware](https://tech.microbit.org/hardware/) را " +"بررسی می‌کنید." #: src/exercises/bare-metal/compass.md msgid "" @@ -18486,38 +18017,38 @@ msgid "" msgstr "" #: src/exercises/bare-metal/compass.md -msgid "" -"TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" "TWI نام دیگری برای I2C است، بنابراین دستگاه جانبی اصلی I2C TWIM نامیده می‌شود." #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" -"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" -"microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` " +"trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/" +"hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct." +"Board.html) struct with fields for the various pins and peripherals." msgstr "" -"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/" -"microbit/struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف " -"دارید." +"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف دارید." #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " -"this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/" +"pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this " +"exercise." msgstr "" +"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi.com/" +"pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " +"in the `compass` directory for the following files." msgstr "" "این [الگوی تمرین](../../comprehensive-rust-exercises.zip) را دانلود کنید و " "فایل‌های زیر را در دایرکتوری `compass` جستجو کنید." @@ -18543,14 +18074,12 @@ msgid "See the serial output on Linux with:" msgstr "مشاهده خروجی سریال در لینوکس با:" #: src/exercises/bare-metal/compass.md -msgid "" -"Or on Mac OS something like (the device name may be slightly different):" -msgstr "" -"یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" +msgid "Or on Mac OS something like (the device name may be slightly different):" +msgstr "یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." -msgstr "" +msgstr "برای خروج از picocom از Ctrl+A و Ctrl+Q استفاده کنید." #: src/exercises/bare-metal/solutions-morning.md msgid "Bare Metal Rust Morning Exercise" @@ -18599,12 +18128,10 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md #, fuzzy msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" msgstr "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" #: src/bare-metal/aps.md @@ -18613,15 +18140,14 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now " +"let's try writing something for Cortex-A. For simplicity we'll just work with " +"QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " +"board." msgstr "" -"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا " -"بیایید سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's " -"aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " -"کار می‌کنیم." +"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا بیایید " +"سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's aarch64 " +"['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) کار می‌کنیم." #: src/bare-metal/aps.md msgid "" @@ -18639,16 +18165,15 @@ msgid "" "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" -"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی " -"می کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای " -"ماشین‌های مجازی طراحی شده است." +"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی می " +"کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای ماشین‌های " +"مجازی طراحی شده است." #: src/bare-metal/aps/entry-point.md -msgid "" -"Before we can start running Rust code, we need to do some initialisation." +msgid "Before we can start running Rust code, we need to do some initialisation." msgstr "" -"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه " -"را انجام دهیم." +"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه را " +"انجام دهیم." #: src/bare-metal/aps/entry-point.md msgid "" @@ -18657,8 +18182,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU " +"and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18677,8 +18202,7 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18688,8 +18212,7 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18730,8 +18253,8 @@ msgstr "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU " +"and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18750,8 +18273,7 @@ msgstr "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18761,8 +18283,7 @@ msgstr "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18800,56 +18321,58 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, " -"zeroing the BSS, and setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, zeroing " +"the BSS, and setting up the stack pointer." msgstr "" +"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر کردن " +"BSS و تنظیم stack pointer." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the " -"object file which containing statically allocated variables which are " -"initialised to zero. They are omitted from the image, to avoid wasting space " -"on zeroes. The compiler assumes that the loader will take care of zeroing " -"them." +"The BSS (block starting symbol, for historical reasons) is the part of the object " +"file which containing statically allocated variables which are initialised to " +"zero. They are omitted from the image, to avoid wasting space on zeroes. The " +"compiler assumes that the loader will take care of zeroing them." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and " -"the image is loaded, but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and the " +"image is loaded, but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If " -"we don't:" +"We need to enable the MMU and cache before reading or writing any memory. If we " +"don't:" msgstr "" +"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار را " +"نکنیم:" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-" -"unknown-none` target which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses, so it should be fine in this case, but this " -"is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-" +"none` target which sets `+strict-align` to prevent the compiler generating " +"unaligned accesses, so it should be fine in this case, but this is not " +"necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost when the cache " -"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " -"not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The problem " +"is that the VM is accessing memory directly with the cache disabled, while the " +"host has cacheable aliases to the same memory. Even if the host doesn't " +"explicitly access the memory, speculative accesses can lead to cache fills, and " +"then changes from one or the other will get lost when the cache is cleaned or the " +"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " -"identity maps the first 1 GiB of address space for devices, the next 1 GiB " -"for DRAM, and another 1 GiB higher up for more devices. This matches the " -"memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity " +"maps the first 1 GiB of address space for devices, the next 1 GiB for DRAM, and " +"another 1 GiB higher up for more devices. This matches the memory layout that " +"QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -18857,12 +18380,14 @@ msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" +"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در مورد " +"آن خواهیم دید." #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 " -"(EL1). If you need to run at a different exception level you'll need to " -"modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 (EL1). " +"If you need to run at a different exception level you'll need to modify `entry.S` " +"accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -18871,13 +18396,13 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with " -"Rust code. For example, to make an HVC (hypervisor call) to tell the " -"firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with Rust " +"code. For example, to make an HVC (hypervisor call) to tell the firmware to power " +"off the system:" msgstr "" "گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " -"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " -"که به firmware بگویید سیستم را خاموش کند:" +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به " +"firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -18935,58 +18460,56 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of " -"functions to manage system and CPU power states, among other things. It is " -"implemented by EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of functions " +"to manage system and CPU power states, among other things. It is implemented by " +"EL3 firmware and hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " -"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " -"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای " +"مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط " +"میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the " -"inline assembly code, and ignore its contents afterwards. We need to use " -"`inout` rather than `in` because the call could potentially clobber the " -"contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the inline " +"assembly code, and ignore its contents afterwards. We need to use `inout` rather " +"than `in` because the call could potentially clobber the contents of the " +"registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " -"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " -"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " -"محتویات رجیسترها را مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی " +"به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به " +"جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را " +"مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is " +"called from our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " -"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه " +"ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " -"used by the bootloader to pass things like a pointer to the device tree. " -"According to the standard aarch64 calling convention (which is what `extern " -"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " -"arguments passed to a function, so `entry.S` doesn't need to do anything " -"special except make sure it doesn't change these registers." -msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " -"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " -"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " -"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " -"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " -"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " -"نمی‌دهد." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used " +"by the bootloader to pass things like a pointer to the device tree. According to " +"the standard aarch64 calling convention (which is what `extern \"C\"` specifies " +"to use), registers `x0`–`x7` are used for the first 8 arguments passed to a " +"function, so `entry.S` doesn't need to do anything special except make sure it " +"doesn't change these registers." +msgstr "" +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader " +"برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد " +"فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` برای استفاده مشخص " +"می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده به یک تابع استفاده " +"می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست کار خاصی انجام " +"دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" -"examples`." +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -19005,45 +18528,44 @@ msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " -"ساختارها را دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را " +"دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent " -"the compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent the " +"compiler or hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " -"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " -"حذف آنها جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته " +"باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها " +"جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the " -"compiler may assume that the value read is the same as the value just " -"written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the compiler " +"may assume that the value read is the same as the value just written, and not " +"bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " -"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " -"است و در واقع خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر " +"ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع " +"خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but " -"this is unsound. Whenever a reference exist, the compiler may choose to " -"dereference it." +"Some existing crates for volatile access to hardware do hold references, but this " +"is unsound. Whenever a reference exist, the compiler may choose to dereference it." msgstr "" "برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " -"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " -"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته " +"باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " -"ساختار استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار " +"استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -19051,11 +18573,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" -"documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) UART, so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" -"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/" +"g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -19070,10 +18592,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -19081,10 +18601,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -19118,40 +18636,37 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is " -"because as long as the caller of `Uart::new` guarantees that its safety " -"requirements are met (i.e. that there is only ever one instance of the " -"driver for a given UART, and nothing else aliasing its address space), then " -"it is always safe to call `write_byte` later because we can assume the " -"necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is because " +"as long as the caller of `Uart::new` guarantees that its safety requirements are " +"met (i.e. that there is only ever one instance of the driver for a given UART, " +"and nothing else aliasing its address space), then it is always safe to call " +"`write_byte` later because we can assume the necessary preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " -"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " -"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " -"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " -"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " -"را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن " +"هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که " +"الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص " +"وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس همیشه می‌توان " +"`write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but " -"`write_byte` unsafe), but that would be much less convenient to use as every " -"place that calls `write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but `write_byte` " +"unsafe), but that would be much less convenient to use as every place that calls " +"`write_byte` would need to reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " -"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " -"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " -"استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما " +"`write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر " +"مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving " -"the burden of proof for soundness from a large number of places to a smaller " -"number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving the " +"burden of proof for soundness from a large number of places to a smaller number " +"of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " -"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت " +"عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" @@ -19159,10 +18674,9 @@ msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more " -"traits too." -msgstr "" -"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +"We derived the `Debug` trait. It would be useful to implement a few more traits " +"too." +msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -19186,8 +18700,8 @@ msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -19198,15 +18712,15 @@ msgstr "یک درایور UART بهتر" msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to " -"read. Plus, some of them are bit fields which would be nice to access in a " -"structured way." +"offsets to construct pointers to access them is error-prone and hard to read. " +"Plus, some of them are bit fields which would be nice to access in a structured " +"way." msgstr "" "‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " -"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " -"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " -"به آنها به روشی ساختاریافته خوب است." +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند خواندن " +"را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی به آنها به " +"روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -19370,8 +18884,8 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " -"working with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working " +"with bitflags." msgstr "" "این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " "bitflags مفید است." @@ -19428,37 +18942,34 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a " +"bunch of method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " -"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی " +"متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "" -"We can use a struct to represent the memory layout of the UART's registers." +msgid "We can use a struct to represent the memory layout of the UART's registers." msgstr "" -"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " -"کنیم." +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to " -"(among other things) reorder fields however it sees fit." +"predictable layout, as default Rust representation allows the compiler to (among " +"other things) reorder fields however it sees fit." msgstr "" "‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " -"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " -"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " -"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " -"کند." +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این " +"پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای داشتن یک طرح " +"قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر اجازه می دهد تا (از " +"جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب کند." #: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." @@ -19504,8 +19015,8 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " -"fields without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields " +"without creating an intermediate reference, which would be unsound." msgstr "" "به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " "جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." @@ -19516,11 +19027,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, " -"and echo incoming bytes." +"Let's write a small program using our driver to write to the serial console, and " +"echo incoming bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " -"بنویسیم و بایت‌های ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم " +"و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -19561,30 +19072,27 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` function " +"is called from our entry point code in `entry.S`. See the speaker notes there for " +"details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " -"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " -"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از " +"کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های " +"سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`]" -"(https://crates.io/crates/log) crate. We can do this by implementing the " -"`Log` trait." +"It would be nice to be able to use the logging macros from the [`log`](https://" +"crates.io/crates/log) crate. We can do this by implementing the `Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" -"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " -"دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/" +"log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -19600,8 +19108,8 @@ msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " -"مقداردهی اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی " +"اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." @@ -19622,40 +19130,39 @@ msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " -"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " -"We implement this in assembly to save volatile registers to the stack before " -"calling into Rust code:" +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, " +"current EL with SPx, lower EL using AArch64, lower EL using AArch32). We " +"implement this in assembly to save volatile registers to the stack before calling " +"into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " -"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " -"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " -"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " -"فراخوانی Rust در stack ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، " +"IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL " +"using AArch64, lower EL using AArch32) تعریف می‌کند. ما این کار را در اسمبلی " +"پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از فراخوانی Rust در stack " +"ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "" -"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current " -"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current EL " +"exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " -"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 " +"برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't " -"expect any of them to actually happen." +"For this example we just log the exception and power down, as we don't expect any " +"of them to actually happen." msgstr "" "برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " "نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." @@ -19663,20 +19170,19 @@ msgstr "" #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or " -"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." -"md) will control what we can share between them, just like with threads. For " -"example, if we want to share some value between exception handlers and the " -"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " -"it in something like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or less " +"like different threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will " +"control what we can share between them, just like with threads. For example, if " +"we want to share some value between exception handlers and the rest of the " +"program, and it's `Send` but not `Sync`, then we'll need to wrap it in something " +"like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " -"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." -"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " -"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " -"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " -"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " -"قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای " +"مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که " +"می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای " +"مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و بقیه برنامه به اشتراک " +"بگذاریم که بیشتر در مورد `Send` است اما مربوط به `Sync` نیست، باید آن را در چیزی " +"مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -19697,27 +19203,27 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" +"OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" +"OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception " +"handling, page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " -"exception و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception " +"و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " -"برای کپی کردن برای کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای " +"کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -19729,44 +19235,43 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. " +"This will read and write memory (e.g. the stack). However:" msgstr "" "آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " -"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " -"بااین‌حال:" +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-" +"unknown-none` which sets `+strict-align` to prevent the compiler generating " +"unaligned accesses so it should be alright, but this is not necessarily the case " +"in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " -"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " -"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " -"صحیح باشد، اما لزوماً اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-" +"unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های " +"غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً " +"اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." -msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " -"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " -"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " -"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " -"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " -"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " -"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." +"If it were running in a VM, this can lead to cache coherency issues. The problem " +"is that the VM is accessing memory directly with the cache disabled, while the " +"host has cacheable aliases to the same memory. Even if the host doesn't " +"explicitly access the memory, speculative accesses can lead to cache fills, and " +"then changes from one or the other will get lost. Again this is alright in this " +"particular case (running directly on the hardware with no hypervisor), but isn't " +"a good pattern in general." +msgstr "" +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. " +"مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا " +"می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. حتی اگر host به طور " +"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش " +"شود و سپس تغییرات از یکی پس از دیگری از بین می‌رود. باز هم در این مورد خاص درست " +"است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما به‌طورکلی الگوی خوبی " +"نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" @@ -19777,42 +19282,41 @@ msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" -"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " -"را حل می‌کند." +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل " +"می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " -"traits and macros for safely converting between byte sequences and other " -"types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits " +"and macros for safely converting between byte sequences and other types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " -"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی " +"را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " -"but can be useful for working with structures shared with hardware e.g. by " -"DMA, or sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but " +"can be useful for working with structures shared with hardware e.g. by DMA, or " +"sent over some external interface." msgstr "" "این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " -"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " -"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط " +"DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is " -"valid, and so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is valid, and " +"so can safely be converted from an untrusted sequence of bytes." msgstr "" "‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " -"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " -"تبدیل کرد." +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل " +"کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not " -"all byte patterns are valid." +"`RequestType` doesn't use all possible u32 values as discriminants, so not all " +"byte patterns are valid." msgstr "" "تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " "`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " @@ -19820,29 +19324,25 @@ msgstr "" #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "" -"`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"zerocopy-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-" +"example/`. (It won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" -"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا " +"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " -"you create page tables according to the AArch64 Virtual Memory System " -"Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you " +"create page tables according to the AArch64 Virtual Memory System Architecture." msgstr "" "این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " -"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " -"کنید." +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -19861,50 +19361,47 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." +"For now it only supports EL1, but support for other exception levels should be " +"straightforward to add." msgstr "" -"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " -"ساده باشد." +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده " +"باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" -"android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/) استفاده می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/" +"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده " +"می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware or " +"under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " -"یا تحت QEMU اجرا شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت " +"QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a " +"third-party crate implementing a basic buddy system allocator. It can be used " +"both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" "buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " -"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " -"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" -"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " -"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." -"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " -"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " -"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " -"اختصاص دهیم:" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " +"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other " +"address space. For example, we might want to allocate MMIO space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک " +"third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن " +"را هم برای ['LockedHeap'](https://docs.rs/buddy_system_allocator/0.9.0/" +"buddy_system_allocator/struct.LockedHeap.html) در پیاده‌سازی [`GlobalAlloc`]‌" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) استفاده کرد. " +"بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " +"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم " +"فضای MMIO را برای PCI BARها اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -19912,32 +19409,29 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"allocator-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-" +"example/`. (It won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " -"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا " +"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without " -"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " -"this: a vector backed by an array or slice, which could be statically " -"allocated or on the stack, which keeps track of how many elements are used " -"and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without heap " +"allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector " +"backed by an array or slice, which could be statically allocated or on the stack, " +"which keeps track of how many elements are used and panics if you try to use more " +"than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " -"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " -"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " -"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " -"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " -"کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما " +"بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را " +"فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت " +"ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده شده را ردیابی می‌کند و " +"اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"`tinyvec` requires that the element type implement `Default` for " -"initialisation." +"`tinyvec` requires that the element type implement `Default` for initialisation." msgstr "" "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." @@ -19945,14 +19439,14 @@ msgstr "" msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " -"داخلی اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " -"are not available in `core` or `alloc`. How can we manage synchronisation or " -"interior mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are " +"not available in `core` or `alloc`. How can we manage synchronisation or interior " +"mutability, such as for sharing state between different CPUs?" msgstr "" "‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " "`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " @@ -19963,51 +19457,48 @@ msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " -"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، " +"بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" -"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " -"کنید." +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." #: src/bare-metal/useful-crates/spin.md msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " -"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و " +"`Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " -"useful types for late initialisation with a slightly different approach to " -"`spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful " +"types for late initialisation with a slightly different approach to `spin::once::" +"Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " -"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" -"once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های " +"مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "" -"The Rust Playground includes `spin`, so this example will run fine inline." +msgid "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" -"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " -"اجرا می‌شود." +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا " +"می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a " -"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " -"with a linker script to produce the binary itself, and then a `raw_binary` " -"to convert the ELF to a raw binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` " +"Soong rule to build your Rust code, then a `cc_binary` with a linker script to " +"produce the binary itself, and then a `raw_binary` to convert the ELF to a raw " +"binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " -"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " -"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " -"ELF به یک raw binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong " +"برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script " +"برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw " +"binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -20017,31 +19508,30 @@ msgstr "vmbase" #, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" -"libs/libvmbase/) library provides a linker script and useful defaults for " -"the build rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/" +"libvmbase/) library provides a linker script and useful defaults for the build " +"rules, along with an entry point, UART console logging and more." msgstr "" "برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" -"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" -"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " -"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " -"موارد دیگر." +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/" +"heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای " +"این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و موارد دیگر." #: src/bare-metal/android/vmbase.md msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` " -"entry point." +"The `main!` macro marks your main function, to be called from the `vmbase` entry " +"point." msgstr "" -"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " -"فراخوانی شود." +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی " +"شود." #: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " -"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main " +"function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -20052,11 +19542,10 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " -"شده نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده " +"نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" @@ -20064,28 +19553,27 @@ msgstr "RTC driver" #, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " -"you should write a driver for it." +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, you " +"should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." -"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " -"برای آن بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/" +"documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن " +"بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the " -"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the [`chrono`]" +"(https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " -"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " -"کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`]" +"(https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given " -"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" -"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given time, " +"e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-" +"lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" "از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " "بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" @@ -20093,14 +19581,13 @@ msgstr "" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by " -"the RTC match. You can use the driver provided in the [`arm-gic`](https://" -"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by the " +"RTC match. You can use the driver provided in the [`arm-gic`](https://docs.rs/arm-" +"gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " -"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" -"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " -"کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را " +"مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/" +"arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -20111,24 +19598,22 @@ msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" -"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " -"به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به " +"حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " +"in the `rtc` directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " -"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های " +"زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " -"the exercise):" -msgstr "" -"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the " +"exercise):" +msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -20303,10 +19788,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -20314,10 +19797,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20346,12 +19827,10 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20372,14 +19851,12 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20402,54 +19879,50 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md msgid "" -"Rust has full support for concurrency using OS threads with mutexes and " -"channels." +"Rust has full support for concurrency using OS threads with mutexes and channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " -"از mutex ها و channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از " +"mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since " -"you can rely on the compiler to ensure correctness at runtime." +"compile time bugs. This is often referred to as _fearless concurrency_ since you " +"can rely on the compiler to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " -"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " -"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " -"زمان اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان " +"کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در زمان " +"اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " -"بکشد. شامل موارد زیر است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. " +"شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "" -"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " -"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: " +"thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." -msgstr "" -"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e." -"g., a called function that might mutate an argument or save references to it " -"to read later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e.g., a " +"called function that might mutate an argument or save references to it to read " +"later) save us from multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " -"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " -"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " -"می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند " +"یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای " +"خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات می‌دهند. " #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -20470,8 +19943,8 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the " -"end of `main`." +"Spawning new threads does not automatically delay program termination at the end " +"of `main`." msgstr "" "ایجاد threadهای جدید به طور خودکار خاتمه برنامه را تا پایان `main` به تاخیر " "نمی‌اندازد." @@ -20483,14 +19956,13 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" -"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " -"کرد." +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" -"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " -"آن‌ها است." +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها " +"است." #: src/concurrency/threads/plain.md msgid "Run the example." @@ -20498,8 +19970,7 @@ msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in " -"lockstep." +"5ms timing is loose enough that main and spawned threads stay mostly in lockstep." msgstr "" "زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " "عمدتاً همگام می‌مانند." @@ -20507,16 +19978,15 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " -"پایان می‌رسد!" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان " +"می‌رسد!" #: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it " -"persist." +"This is because main ends the program and spawned threads do not make it persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " -"تداوم آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم " +"آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -20528,11 +19998,11 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " +"`JoinHandle`. Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " +"`JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" @@ -20544,11 +20014,11 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the " +"thread to finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " -"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا " +"منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -20560,26 +20030,25 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " +"returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " +"returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md msgid "" -"Use the `Result` return value from `handle.join()` to get access to the " -"returned value." -msgstr "" -"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +"Use the `Result` return value from `handle.join()` to get access to the returned " +"value." +msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -20587,21 +20056,19 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "" -"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://" -"doc.rust-lang.org/std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://doc." +"rust-lang.org/std/any/index.html)." msgstr "" "دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" "(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "" -"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -20614,8 +20081,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " -"مشتق شده را برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق " +"شده را برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -20623,17 +20090,17 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just " -"return and leave them running." +"Main kills child threads when it returns, but another function would just return " +"and leave them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " -"return می‌شود و آنها را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return " +"می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " -"نقض می‌کند!" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض " +"می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -20645,28 +20112,27 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" -"fn.scope.html) for this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn." +"scope.html) for this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" -"std/thread/fn.scope.html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/" +"thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all " -"the threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all the " +"threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " -"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین " +"می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one " -"thread, or immutably by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, " +"or immutably by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " -"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " -"بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با " +"یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -20674,12 +20140,11 @@ msgstr "این بخش باید حدود ۲۰ دقیقه طول بکشد. این #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts " +"are connected via the channel, but you only see the end-points." msgstr "" -"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از " -"طریق channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را " -"می‌بینید." +"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از طریق " +"channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را می‌بینید." #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" @@ -20688,8 +20153,7 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"implement `Clone` (so you can make multiple producers) but `Receiver` does not." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -20719,30 +20183,30 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +msgid "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" +"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را مسدود کند:" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the " -"channel for the new message. The thread can be blocked indefinitely if there " -"is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the channel " +"for the new message. The thread can be blocked indefinitely if there is nobody " +"who reads from the channel." msgstr "" -"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته " -"باشد، thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread " -"را می‌توان به طور نامحدود مسدود کرد." +"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته باشد، " +"thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread را می‌توان " +"به طور نامحدود مسدود کرد." #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) if " +"the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". Every " +"send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -20755,48 +20219,48 @@ msgstr "همگام‌سازی" #: src/concurrency/send-sync/marker-traits.md msgid "" -"How does Rust know to forbid shared access across threads? The answer is in " -"two traits:" +"How does Rust know to forbid shared access across threads? The answer is in two " +"traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " -"دو trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو " +"trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " -"is `Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is " +"`Send` if it is safe to move a `T` across a thread boundary." msgstr "" "‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " "جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " -"is `Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is " +"`Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" "‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " -"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " -"`Sync` است." +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` " +"است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " -"The compiler will automatically derive them for your types as long as they " -"only contain `Send` and `Sync` types. You can also implement them manually " -"when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The " +"compiler will automatically derive them for your types as long as they only " +"contain `Send` and `Sync` types. You can also implement them manually when you " +"know it is valid." msgstr "" "‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " -"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " -"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " -"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای " +"انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی پیاده سازی " +"کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-" -"safety properties." +"One can think of these traits as markers that the type has certain thread-safety " +"properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" -"safety خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety " +"خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -20804,39 +20268,37 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " -"if it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if " +"it is safe to move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" -"doc.rust-lang.org/std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc." +"rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will " -"run in that thread. So the question is when you can allocate a value in one " -"thread and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will run " +"in that thread. So the question is when you can allocate a value in one thread " +"and deallocate it in another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " -"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " -"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " -"thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " +"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی " +"می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from " -"a single thread." +"As an example, a connection to the SQLite library must only be accessed from a " +"single thread." msgstr "" -"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " -"باشد." +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " -"if it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if " +"it is safe to access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." -"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " -"همزمان امن باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync." +"html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن " +"باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -20848,27 +20310,26 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is " -"thread-safe for shared use, it is also thread-safe to pass references of it " -"across threads." +"This statement is essentially a shorthand way of saying that if a type is thread-" +"safe for shared use, it is also thread-safe to pass references of it across " +"threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " -"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " -"امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده " +"مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across " -"multiple threads without the risk of data races or other synchronization " -"issues, so it is safe to move it to another thread. A reference to the type " -"is also safe to move to another thread, because the data it references can " -"be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across multiple " +"threads without the risk of data races or other synchronization issues, so it is " +"safe to move it to another thread. A reference to the type is also safe to move " +"to another thread, because the data it references can be accessed from any thread " +"safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " -"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " -"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " -"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " -"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را " +"در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک " +"گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ نیز برای " +"انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع می‌دهد می‌توانند از " +"هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -20896,8 +20357,7 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "" -"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -20905,16 +20365,15 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "" -"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md msgid "" -"The generic types are typically `Send + Sync` when the type parameters are " -"`Send + Sync`." +"The generic types are typically `Send + Sync` when the type parameters are `Send " +"+ Sync`." msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " -"هستند.`Send + Sync`." +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." +"`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -20922,8 +20381,8 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. " -"Typically because of interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. Typically " +"because of interior mutability:" msgstr "" "این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " "معمول به دلیل تغییرپذیری داخلی(interior mutability):" @@ -20947,18 +20406,18 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple " -"threads, but they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple threads, but " +"they cannot be moved to another thread:" msgstr "" -"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " -"منتقل کرد:" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل " +"کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them. However, an already-locked mutex can have its " -"guarded variable read by any thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on the " +"thread which created them. However, an already-locked mutex can have its guarded " +"variable read by any thread with which the guard is shared." msgstr "" "‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " "threadای که آنها را ایجاد کرده است، توزیع شوند." @@ -20970,24 +20429,24 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" -"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " -"منتقل کرد:" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل " +"کرد:" #: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " -"مراجع غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع " +"غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " -"است ملاحظات همزمانی خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است " +"ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -20999,11 +20458,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-" +"only access via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " -"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا " +"دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -21015,33 +20474,32 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " -"that uses atomic operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that " +"uses atomic operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " -"عملیات atomic استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات " +"atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " -"and `Sync` if and only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and " +"`Sync` if and only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " -"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " -"آنها را پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. " +"`Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را " +"پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but " -"after that the use of the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but after " +"that the use of the `T` is free." msgstr "" -"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن " -"استفاده از 'T' آزاد است." +"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن استفاده " +"از 'T' آزاد است." #: src/concurrency/shared-state/arc.md msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect " -"them." +"Beware of reference cycles, `Arc` does not use a garbage collector to detect them." msgstr "" "مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " "استفاده نمی‌کند." @@ -21052,15 +20510,14 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " -"mutual exclusion _and_ allows mutable access to `T` behind a read-only " -"interface (another form of [interior mutability](../../borrowing/interior-" -"mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual " +"exclusion _and_ allows mutable access to `T` behind a read-only interface " +"(another form of [interior mutability](../../borrowing/interior-mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " -"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " -"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" -"borrowing/interior-mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که " +"حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only " +"interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../borrowing/interior-" +"mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -21068,42 +20525,41 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " -"implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " -"کامل آن داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن " +"داریم." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the " -"protected data." +"`Mutex` in Rust looks like a collection with just one element --- the protected " +"data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " -"(protected) به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) " +"به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md msgid "" -"It is not possible to forget to acquire the mutex before accessing the " -"protected data." +"It is not possible to forget to acquire the mutex before accessing the protected " +"data." msgstr "" -"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " -"فراموش کرد." +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش " +"کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The " -"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` " +"ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " -"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین " +"می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements " +"`Send`." msgstr "" "‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " "استفاده‌ می‌کنند." @@ -21118,18 +20574,17 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to " +"signal that the data it protected might be in an inconsistent state. Calling " +"`lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang." +"org/std/sync/struct.PoisonError.html). You can call `into_inner()` on the error " +"to recover the data regardless." msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" -"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " -"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " -"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " -"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " -"فراخوانی کنید." +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» " +"می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. " +"فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang." +"org/std/sync/struct.PoisonError.html) انجام نمی‌شود. می‌توانید `into_inner()` را در " +"مورد خطا برای بازیابی داده‌ها بدون توجه به آن فراخوانی کنید." #: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" @@ -21149,30 +20604,28 @@ msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " -"orthogonal." +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " -"between threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between " +"threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " -"قابل تغییر (mutable) بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل " +"تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " -"منتقل کرد. نکته `move` به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل " +"کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as " -"possible." +"Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -21181,33 +20634,31 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " -"philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " -"down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " -"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " -"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " -"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " -"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " -"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " -"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " -"پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has their own " +"place at the table. There is a fork between each plate. The dish served is a kind " +"of spaghetti which has to be eaten with two forks. Each philosopher can only " +"alternately think and eat. Moreover, a philosopher can only eat their spaghetti " +"when they have both a left and right fork. Thus two forks will only be available " +"when their two nearest neighbors are thinking, not eating. After an individual " +"philosopher finishes eating, they will put down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز " +"دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که " +"باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا " +"بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی بخورد که هم چنگال " +"چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط زمانی در دسترس خواهد بود " +"که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس از اینکه یک " +"فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) " -"for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) for " +"this exercise. Copy the code below to a file called `src/main.rs`, fill out the " +"blanks, and test that `cargo run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " -"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " -"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی " +"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " +"کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -21322,49 +20773,47 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It " -"should start at a webpage and check that links on the page are valid. It " -"should recursively check other pages on the same domain and keep doing this " -"until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It should " +"start at a webpage and check that links on the page are valid. It should " +"recursively check other pages on the same domain and keep doing this until all " +"pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " -"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " -"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " -"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. " +"باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. " +"باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این کار را تا زمانی " +"که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`]" -"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " -"we will use [`thiserror`](https://docs.rs/thiserror/)." -msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " -"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " -"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " -"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`](https://" +"docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use " +"[`thiserror`](https://docs.rs/thiserror/)." +msgstr "" +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز " +"دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی برای " +"رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" "thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " -"اعلام کنید:" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام " +"کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." -"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` " +"را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "" -"The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "" -"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -21376,8 +20825,7 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -21390,16 +20838,15 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://" -"www.google.org/`." +"You can now download the start page. Try with a small site such as `https://www." +"google.org/`." msgstr "" "اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." "google.org/` امتحان کنید." @@ -21457,19 +20904,18 @@ msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " -"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " -"بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند " +"به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google." -"org` domain. Put an upper limit of 100 pages or so so that you don't end up " -"being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google.org` " +"domain. Put an upper limit of 100 pages or so so that you don't end up being " +"blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." -"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " -"نهایت توسط سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google." +"org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط " +"سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -21496,10 +20942,8 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "" -"/// Determine whether links within the given page should be extracted.\n" -msgstr "" -"/// Determine whether links within the given page should be extracted.\n" +msgid "/// Determine whether links within the given page should be extracted.\n" +msgstr "/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -21525,57 +20969,57 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed " -"concurrently by executing each task until it would block, then switching to " -"another task that is ready to make progress. The model allows running a " -"larger number of tasks on a limited number of threads. This is because the " -"per-task overhead is typically very low and operating systems provide " -"primitives for efficiently identifying I/O that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " -"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " -"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " -"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " -"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " -"ادامه هستند فراهم می‌کنند." +"\"Async\" is a concurrency model where multiple tasks are executed concurrently " +"by executing each task until it would block, then switching to another task that " +"is ready to make progress. The model allows running a larger number of tasks on a " +"limited number of threads. This is because the per-task overhead is typically " +"very low and operating systems provide primitives for efficiently identifying I/O " +"that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر " +"کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است " +"سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از " +"رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار کم است و " +"سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به ادامه هستند فراهم " +"می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work " -"that may be completed in the future. Futures are \"polled\" until they " -"signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work that " +"may be completed in the future. Futures are \"polled\" until they signal that " +"they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " -"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " -"ندهند، «polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن " +"است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، " +"«polled» می‌شوند." #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " -"دسترس هستند." +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس " +"هستند." #: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", " -"similar to a runtime in Rust." +"callback-based, and not polled. Async Python programs require a \"loop\", similar " +"to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " -"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " -"runtime در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر " +"callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime " +"در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language " -"runtime implements the event loop, so many of the details of Promise " -"resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language runtime " +"implements the event loop, so many of the details of Promise resolution are " +"hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " -"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " -"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. " +"runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از " +"جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -21584,8 +21028,7 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential " -"code:" +"At a high level, async Rust code looks very much like \"normal\" sequential code:" msgstr "" "در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " "sequential code):" @@ -21600,8 +21043,8 @@ msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " -"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی " +"مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -21610,24 +21053,23 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" -"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " -"کنید." +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return " -"type with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return type " +"with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " -"یک future جایگزین می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک " +"future جایگزین می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the " -"compiler on how to use the returned future." +"You cannot make `main` async, without additional instructions to the compiler on " +"how to use the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " -"future بازگشتی، `main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future " +"بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md msgid "" @@ -21639,8 +21081,8 @@ msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. " -"Unlike `block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. Unlike " +"`block_on`, `.await` doesn't block the current thread." msgstr "" "همیشه `await` به طور ناهمزمان (asyn) منتظر تکمیل یک عملیات دیگر است. برخلاف " "`block_on` یک `await` معمولاً thread فعلی را مسدود نمی‌کند." @@ -21650,102 +21092,101 @@ msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " -"مورد در آینده معرفی می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در " +"آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " -"trait, implemented by objects that represent an operation that may not be " -"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, " +"implemented by objects that represent an operation that may not be complete yet. " +"A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/" +"std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " -"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " -"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، " +"اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده " +"باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/" +"std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but " -"uncommon) to implement `Future` for your own types. For example, the " -"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " -"joining to it." +"An async function returns an `impl Future`. It's also possible (but uncommon) to " +"implement `Future` for your own types. For example, the `JoinHandle` returned " +"from `tokio::spawn` implements `Future` to allow joining to it." msgstr "" "یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " -"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " -"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " -"امکان پیوستن (joining) به آن را فراهم کند." +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` " +"برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا امکان پیوستن " +"(joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function " -"to pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function to " +"pause until that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " -"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا " +"زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the " -"links to show the implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the links " +"to show the implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " -"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای " +"نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async code, " +"rather than building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " -"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر " +"نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md msgid "" -"`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +"`Context` allows a Future to schedule itself to be polled again when an event " +"occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " -"poll مجدد برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll " +"مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into " -"that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into that " +"future remain valid. This is required to allow references to remain valid after " +"an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " -"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " -"ماندن پس از `.await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future " +"معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `." +"await` لازم است." #: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust " -"does not have a \"built-in\" runtime, but several options are available:" +"_reactor_) and is responsible for executing futures (an _executor_). Rust does " +"not have a \"built-in\" runtime, but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " -"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " -"اما چندین گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و " +"مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین " +"گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" -"github.com/hyperium/tonic) for gRPC." +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github." +"com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " -"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " -"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به " +"خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://" +"github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a " +"basic runtime in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " -"شامل یک runtime اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل " +"یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -21754,8 +21195,8 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" -"async/src/lib.rs) already has one." +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/" +"src/lib.rs) already has one." msgstr "" "چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " "[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" @@ -21763,25 +21204,24 @@ msgstr "" #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust " -"playground. The playground also does not permit any I/O, so most interesting " -"async things can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust playground. " +"The playground also does not permit any I/O, so most interesting async things " +"can't run in the playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " -"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " -"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان " +"Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین " +"بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never " -"used." +"Promises, for example, which will run to completion even if they are never used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " -"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " -"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " -"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/" +"O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling " +"کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند " +"تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21790,8 +21230,7 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "" -"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -21829,8 +21268,8 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " -"until it finishes." +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait until " +"it finishes." msgstr "" "چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " "`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." @@ -21849,17 +21288,16 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make " -"progress. That future may have one or more nested futures that its `poll` " -"method polls, corresponding loosely to a call stack. Concurrency within a " -"task is possible by polling multiple child futures, such as racing a timer " -"and an I/O operation." +"A task has a single top-level future which the executor polls to make progress. " +"That future may have one or more nested futures that its `poll` method polls, " +"corresponding loosely to a call stack. Concurrency within a task is possible by " +"polling multiple child futures, such as racing a timer and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " -"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " -"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " -"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " -"یک تایمر و یک عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را " +"poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` " +"آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده مطابقت دارد. " +"همزمانی در یک task با poll از چندین child future، مانند رقابت یک تایمر و یک " +"عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -21889,53 +21327,47 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"از تماس تلفنی متشکریم، {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "" -"Copy this example into your prepared `src/main.rs` and run it from there." +msgid "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " -"کنید." +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix." -"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" -"telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/" +"man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" -"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/" +"nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with " -"a few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with a " +"few connected clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " -"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه " +"taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a " -"closure, but does not take any arguments. Its return value is a Future, " -"similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a closure, " +"but does not take any arguments. Its return value is a Future, similar to an " +"`async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " -"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ " +"استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md msgid "" -"Refactor the async block into a function, and improve the error handling " -"using `?`." +"Refactor the async block into a function, and improve the error handling using `?" +"`." msgstr "" -"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " -"بخشید." +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "" -"Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "" -"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" @@ -21962,13 +21394,12 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "" -"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](../channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the [morning " +"class](../channels.md)." msgstr "" "به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" "channels.md) دیده می‌شود." @@ -21980,31 +21411,30 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient " -"for complex applications with both IO and heavy CPU processing tasks." +"implement both `sync` and `async` `send` and `recv`. This can be convenient for " +"complex applications with both IO and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " -"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " -"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی " +"است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای " +"برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to " -"combine them with other `future`s to combine them and create complex control " -"flow." +"What makes working with `async` channels preferable is the ability to combine " +"them with other `future`s to combine them and create complex control flow." msgstr "" "چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " "`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns " -"a collection of their results. This is similar to `Promise.all` in " -"JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns a " +"collection of their results. This is similar to `Promise.all` in JavaScript or " +"`asyncio.gather` in Python." msgstr "" "عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " -"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " -"در JavaScript یا `asyncio.gather` در پایتون است." +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در " +"JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" @@ -22024,62 +21454,59 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but " -"you must know how many futures you will have at compile time. This is " -"currently in the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but you " +"must know how many futures you will have at compile time. This is currently in " +"the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " -"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " -"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " -"می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، " +"اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در " +"جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would " -"cause your program to stall." +"The risk of `join` is that one of the futures may never resolve, this would cause " +"your program to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " -"باعث می‌شود برنامه شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث " +"می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all " -"requests to an http service as well as a database query. Try adding a " -"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " -"timeout (that requires `select!`, explained in the next chapter), but " -"demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all requests to " +"an http service as well as a database query. Try adding a `tokio::time::sleep` to " +"the future, using `futures::join!`. This is not a timeout (that requires `select!" +"`, explained in the next chapter), but demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " -"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " -"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " -"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " -"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن " +"(`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید " +"`tokio::time::sleep` را با استفاده از `futures::join!` به future اضافه کنید. این " +"یک timeout نیست (که به `select!`نیاز دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه " +"`join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and " -"responds to that future's result. In JavaScript, this is similar to `Promise." -"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"A select operation waits until any of a set of futures is ready, and responds to " +"that future's result. In JavaScript, this is similar to `Promise.race`. In " +"Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " -"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " -"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." -"FIRST_COMPLETED)` قابل مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به " +"نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و " +"در پایتون با `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل " +"مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, " -"each of the form `pattern = future => statement`. When a `future` is ready, " -"its return value is destructured by the `pattern`. The `statement` is then " -"run with the resulting variables. The `statement` result becomes the result " -"of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, each of " +"the form `pattern = future => statement`. When a `future` is ready, its return " +"value is destructured by the `pattern`. The `statement` is then run with the " +"resulting variables. The `statement` result becomes the result of the `select!` " +"macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " -"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " -"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " -"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " -"`select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که " +"هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` " +"آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس `statement` با " +"متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو `select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -22101,32 +21528,30 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, " -"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " -"does the `send` also fail in this situation?" +"The `listener` async block here is a common form: wait for some async event, or " +"for a timeout. Change the `sleep` to sleep longer to see it fail. Why does the " +"`send` also fail in this situation?" msgstr "" -"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async " -"یا به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر " -"دهید تا شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" +"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async یا " +"به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر دهید تا " +"شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a " -"task reacts to events in a loop. That has some pitfalls, which will be " -"discussed in the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a task " +"reacts to events in a loop. That has some pitfalls, which will be discussed in " +"the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes " -"with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter." +"asynchronous programming. However, the async/await model in Rust also comes with " +"its share of pitfalls and footguns. We illustrate some of them in this chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " -"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " -"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " -"می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous " +"فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و " +"pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -22138,15 +21563,14 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that " -"CPU blocking tasks will block the executor and prevent other tasks from " -"being executed. An easy workaround is to use async equivalent methods where " -"possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that CPU " +"blocking tasks will block the executor and prevent other tasks from being " +"executed. An easy workaround is to use async equivalent methods where possible." msgstr "" "اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " -"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " -"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " -"است که در صورت امکان از متدهای معادل async استفاده کنید." +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن " +"executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این است که در صورت " +"امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -22168,73 +21592,69 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This " -"makes the effect more obvious, but the bug is still present in the multi-" -"threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the " +"effect more obvious, but the bug is still present in the multi-threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " -"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " -"دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را " +"آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " -"باشید." +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " -"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و " +"handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, " -"where that library might depend on thread-local storage or map to specific " -"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " -"situations." -msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " -"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " -"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " -"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " -"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " -"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"particularly problematic when interacting with other libraries via FFI, where " +"that library might depend on thread-local storage or map to specific OS threads " +"(e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." +msgstr "" +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ " +"به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک " +"thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از " +"طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به ذخیره‌سازی محلی thread یا " +"نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی داشته باشد. در چنین " +"شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause " -"another task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause another " +"task to block, and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." -"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " -"thread در حال اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` " +"ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال " +"اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The type " +"returned is the result of a compiler transformation which turns local variables " +"into data stored inside the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " -"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " -"ذخیره شده در future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. " +"نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در " +"future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because of " +"that, the future should never be moved to a different memory location, as it " +"would invalidate those pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " -"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " -"این pointerها را باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به " +"همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را " +"باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" @@ -22243,10 +21663,10 @@ msgid "" "operations that would move the instance it points to into a different memory " "location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " -"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " -"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " -"متفاوت منتقل کند را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می " +"توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی " +"را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند " +"را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -22298,154 +21718,147 @@ msgstr "\"نتیجه کار برای تکرار {i}: {resp}\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically " -"call `select!` in a loop." +"You may recognize this as an example of the actor pattern. Actors typically call " +"`select!` in a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " -"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. " +"بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"This serves as a summation of a few of the previous lessons, so take your " -"time with it." +"This serves as a summation of a few of the previous lessons, so take your time " +"with it." msgstr "" -"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " -"آن کنید." +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن " +"کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " -"the `select!`. This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the " +"`select!`. This will never execute. Why?" msgstr "" "به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " "`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "" -"Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::" -"pin`:" +"`timeout_fut` in the `select!` to work around the move, then using `Box::pin`:" msgstr "" "این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " -"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" -"pin` استفاده کنید:" +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` " +"استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires:" +"iteration (a fused future would help with this). Update to reset `timeout_fut` " +"every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " -"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " -"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::" +"Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی " +"`timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, " -"but that is difficult to use for a future that is reassigned." +"stabilized, with older code often using `tokio::pin!`) is also an option, but " +"that is difficult to use for a future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " -"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " -"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " -"دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت " +"شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه " +"است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that " -"will send to a `oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that will " +"send to a `oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " -"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد " +"کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, " -"the Rust borrow checker would prevent self-referential data from being " -"moved, as the references cannot outlive the data they point to. However, the " -"code transformation for async blocks and functions is not verified by the " -"borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, the " +"Rust borrow checker would prevent self-referential data from being moved, as the " +"references cannot outlive the data they point to. However, the code " +"transformation for async blocks and functions is not verified by the borrow " +"checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " -"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " -"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " -"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " -"borrow checker تأیید نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده " +"می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری " +"می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده " +"بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط borrow checker تأیید " +"نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its " -"place using a pinned pointer. However, it can still be moved through an " -"unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its place " +"using a pinned pointer. However, it can still be moved through an unpinned " +"pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " -"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " -"از طریق یک pointer بدون پین جابجا کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از " +"یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق " +"یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " -"`&mut Self` to refer to the instance. That's why it can only be called on a " -"pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut " +"Self` to refer to the instance. That's why it can only be called on a pinned " +"pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " -"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " -"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به " +"نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک " +"اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 " -"release. This required support for using return-position `impl Trait` (RPIT) " -"in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 release. " +"This required support for using return-position `impl Trait` (RPIT) in traits, as " +"the desugaring for `async fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " -"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " -"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " -"Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی " +"برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا " +"شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +"However, even with the native support today there are some pitfalls around `async " +"fn` and RPIT in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " -"RPIT در ویژگی‌ها وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT " +"در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns of " +"borrowing cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " -"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین " +"برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +"Traits whose methods use return-position `impl trait` or `async` are not `dyn` " +"compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " -"می‌کنند با `dyn` سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند " +"با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) provides a workaround through a macro, with some " -"caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/" +"latest/async_trait/) provides a workaround through a macro, with some caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " -"چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/" +"latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -22462,43 +21875,40 @@ msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " -"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " -"عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف " +"از heap allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"The challenges in language support for `async trait` are deep Rust and probably " +"not worth describing in-depth. Niko Matsakis did a good job of explaining them in " +"[this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-" +"traits-are-hard/) if you are interested in digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " -"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" -"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " -"هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش " +"توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) " +"آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of time and " +"adding it to the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " -"را به Vec اضافه کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به " +"Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to " -"ensure the system works correctly even when futures are cancelled. For " -"example, it shouldn't deadlock or lose data." +"_cancellation_ and it can occur at any `await` point. Care is needed to ensure " +"the system works correctly even when futures are cancelled. For example, it " +"shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " -"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " -"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " -"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این " +"حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از " +"عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، " +"نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -22518,16 +21928,16 @@ msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " -"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و " +"در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " -"error-handling)." +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-" +"handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " -"به خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به " +"خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." @@ -22535,15 +21945,12 @@ msgstr "اسن مثال بخش‌هایی از string را از دست می‌د #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " -"dropped." -msgstr "" -"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." +msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the " -"struct:" +"`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -22554,22 +21961,22 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a " -"tick has been 'delivered'." +"html#method.tick) is cancellation-safe because it keeps track of whether a tick " +"has been 'delivered'." msgstr "" "‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " -"tick تحویل داده شده است." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick " +"تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) is cancellation-safe because it either " -"returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." +"html#method.read) is cancellation-safe because it either returns or doesn't read " +"data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " -"برمی‌گرداند یا نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." +"html#method.read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا " +"نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" @@ -22578,8 +21985,8 @@ msgid "" "cancellation-safe. See its documentation for details and alternatives." msgstr "" "‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" -"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-safe " +"نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22592,18 +21999,18 @@ msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" -"philosophers.md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers." +"md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-" -"locally.md) for this exercise. Copy the code below to a file called `src/" -"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-locally." +"md) for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." -"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " -"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) " +"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " +"کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22619,11 +22026,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. " -"You can use the following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. You " +"can use the following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " -"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. " +"می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -22634,8 +22041,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" +"multi-thread\"] }\n" "```" msgstr "" "```toml\n" @@ -22645,14 +22052,14 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" +"multi-thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module " -"from the `tokio` crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module from " +"the `tokio` crate." msgstr "" "همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " "crate استفاده کنید." @@ -22663,28 +22070,26 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast " -"chat application. We have a chat server that the clients connect to and " -"publish their messages. The client reads user messages from the standard " -"input, and sends them to the server. The chat server broadcasts each message " -"that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast chat " +"application. We have a chat server that the clients connect to and publish their " +"messages. The client reads user messages from the standard input, and sends them " +"to the server. The chat server broadcasts each message that it receives to all " +"the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " -"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " -"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " -"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " -"دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast " +"chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود " +"را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به " +"سرور ارسال می‌کند. سرور چت هر پیامی را که دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/) for the communication between the client " -"and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" +"broadcast/fn.channel.html) on the server, and [`tokio_websockets`](https://docs." +"rs/tokio-websockets/) for the communication between the client and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" -"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" +"broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/" +"tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -22707,8 +22112,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", " +"\"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22721,8 +22126,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", " +"\"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22732,31 +22137,31 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " -"to familiarize yourself with the API." +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes to " +"familiarize yourself with the API." msgstr "" "شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" "websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " -"asynchronously reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait." +"StreamExt.html#method.next) implemented by `WebSocketStream`: for asynchronously " +"reading messages from a Websocket Stream." msgstr "" "‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " -"ناهمزمان پیام‌ها از یک جریان وب سوکت." +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان " +"پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " -"asynchronously sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." +"SinkExt.html#method.send) implemented by `WebSocketStream`: for asynchronously " +"sending messages on a Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " -"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." +"SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال " +"ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" @@ -22765,16 +22170,15 @@ msgid "" "standard input." msgstr "" "‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " -"استاندارد." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." +"Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." +"Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -22782,31 +22186,28 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main." -"rs` file. In this project, we need two binaries. One for the client, and one " -"for the server. You could potentially make them two separate Cargo projects, " -"but we are going to put them in a single Cargo project with two binaries. " -"For this to work, the client and the server code should go under `src/bin` " -"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" -"targets.html#binaries))." -msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " -"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " -"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " -"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " -"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " -"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." -"html#binaries) مراجعه کنید )." +"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` " +"file. In this project, we need two binaries. One for the client, and one for the " +"server. You could potentially make them two separate Cargo projects, but we are " +"going to put them in a single Cargo project with two binaries. For this to work, " +"the client and the server code should go under `src/bin` (see the [documentation]" +"(https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." +msgstr "" +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/" +"main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و " +"دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه " +"بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری قرار می‌دهیم. برای این " +"کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند (به[documentation](https://" +"doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/" -"bin/client.rs`, respectively. Your task is to complete these files as " -"described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/bin/" +"client.rs`, respectively. Your task is to complete these files as described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " -"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " -"شده است تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی " +"کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است " +"تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md @@ -22868,14 +22269,13 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a " -"continuous loop. One task receives messages from the client and broadcasts " -"them. The other sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous " +"loop. One task receives messages from the client and broadcasts them. The other " +"sends messages received by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " -"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " -"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " -"می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده " +"کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. " +"دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -22884,21 +22284,21 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and " -"sending them to the server, and (2) receiving messages from the server, and " -"displaying them for the user." +"performing two tasks: (1) reading user messages from standard input and sending " +"them to the server, and (2) receiving messages from the server, and displaying " +"them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " -"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " -"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task " +"استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و " +"(۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " -"جز فرستنده پیام، منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز " +"فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -22964,33 +22364,33 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it " +"was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " -"برده باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " +"باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not " -"perfect, so if you spotted any mistakes or have ideas for improvements, " -"please get in [contact with us on GitHub](https://github.com/google/" -"comprehensive-rust/discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not perfect, so " +"if you spotted any mistakes or have ideas for improvements, please get in " +"[contact with us on GitHub](https://github.com/google/comprehensive-rust/" +"discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " -"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " -"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " -"شوید. ما دوست داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی " +"را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید]" +"(https://github.com/google/comprehensive-rust/discussions) وارد شوید. ما دوست " +"داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many " -"Rust terms. For translations, this also serves to connect the term back to " -"the English original." +"The following is a glossary which aims to give a short definition of many Rust " +"terms. For translations, this also serves to connect the term back to the English " +"original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " -"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " -"انگلیسی است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان " +"Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی " +"است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -23012,8 +22412,8 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the " -"relationship between types." +"A type associated with a specific trait. Useful for defining the relationship " +"between types." msgstr "" #: src/glossary.md @@ -23023,8 +22423,8 @@ msgid "" "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " -"[Bare-metal Rust](bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-" +"metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -23063,8 +22463,7 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable " -"program." +"The process of converting source code into executable code or a usable program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -23083,8 +22482,7 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " -"می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." #: src/glossary.md msgid "" @@ -23106,8 +22504,7 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "" -"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -23120,8 +22517,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in " -"a program." +"The order in which the individual statements or instructions are executed in a " +"program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -23141,8 +22538,8 @@ msgid "" "associated tuple or struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " -"ساختار مرتبط، نگه می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار " +"مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" @@ -23180,22 +22577,22 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are " -"no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are no " +"longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " -"نمی‌شوند را آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را " +"آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling " -"code reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling code " +"reuse with different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " -"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده " +"مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -23217,12 +22614,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and " -"cannot be used as an identifier." +"A reserved word in a programming language that has a specific meaning and cannot " +"be used as an identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " -"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به " +"عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -23236,14 +22633,14 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when " -"normal functions are not enough. A typical example is `format!`, which takes " -"a variable number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when normal " +"functions are not enough. A typical example is `format!`, which takes a variable " +"number of arguments, which isn't supported by Rust functions." msgstr "" "macro: \n" "ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " -"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " -"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از " +"آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -23257,22 +22654,22 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the " -"value of an expression." +"A control flow construct in Rust that allows for pattern matching on the value of " +"an expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " -"فراهم می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم " +"می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer " -"needed, leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer needed, " +"leading to a gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " -"منجر به افزایش تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر " +"به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -23285,12 +22682,12 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, " -"to organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, to " +"organize code in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " -"Rust است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust " +"است." #: src/glossary.md msgid "" @@ -23316,14 +22713,14 @@ msgid "" "managing the memory associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " -"مقدار است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار " +"است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of " -"the program." +"An unrecoverable error condition in Rust that results in the termination of the " +"program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -23339,12 +22736,12 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against " -"an expression in Rust." +"A combination of values, literals, or structures that can be matched against an " +"expression in Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " -"مطابقت داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت " +"داده شوند." #: src/glossary.md msgid "" @@ -23357,40 +22754,39 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task " -"or solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task or " +"solve a particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاصی اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " +"مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاص اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " +"مشکل خاص اجرا کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which " -"the method is called." +"The first parameter in a Rust method that represents the instance on which the " +"method is called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " -"می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object " -"is tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object is " +"tracked, and the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " -"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که " +"شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -23439,8 +22835,8 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, " -"preventing memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, preventing " +"memory-related errors." msgstr "" "safe: \n" "به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " @@ -23475,8 +22871,7 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for " -"more." +"A data type storing textual data. See [Strings](references/strings.html) for more." msgstr "" "string: \n" "نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" @@ -23485,18 +22880,16 @@ msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different " -"types under a single name." +"A composite data type in Rust that groups together variables of different types " +"under a single name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " -"می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other " -"functions." +"A Rust module containing functions that test the correctness of other functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -23521,8 +22914,8 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to " -"achieve polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to achieve " +"polymorphism in Rust." msgstr "" "trait: \n" "مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " @@ -23536,34 +22929,33 @@ msgid "" "interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " -"علاقه‌تان به typeها نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان " +"به typeها نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple " -"fields have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple fields " +"have no names, and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " -"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام " +"هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values " -"of a particular kind in Rust." +"A classification that specifies which operations can be performed on values of a " +"particular kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " -"در Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در " +"Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or " -"expression." +"The ability of the Rust compiler to deduce the type of a variable or expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -23571,12 +22963,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading " -"to unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading to " +"unpredictable program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " -"غیرقابل پیش‌بینی برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل " +"پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" @@ -23584,8 +22976,8 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " -"یکی در یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در " +"یک زمان خاص." #: src/glossary.md msgid "" @@ -23594,8 +22986,8 @@ msgid "" "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " -"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر " +"ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -23603,18 +22995,18 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " -"شده است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده " +"است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe " +"Rust](unsafe-rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " -"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. " +"[Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -23630,10 +23022,8 @@ msgstr "سایر منابع برای Rust" #: src/other-resources.md msgid "" -"The Rust community has created a wealth of high-quality and free resources " -"online." -msgstr "" -"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +"The Rust community has created a wealth of high-quality and free resources online." +msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -23642,46 +23032,45 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" -"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " -"می‌دهند:" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " -"canonical free book about Rust. Covers the language in detail and includes a " -"few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical " +"free book about Rust. Covers the language in detail and includes a few projects " +"for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " -"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " -"پروژه برای ساخت نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف " +"در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت " +"نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " -"Rust syntax via a series of examples which showcase different constructs. " -"Sometimes includes small exercises where you are asked to expand on the code " -"in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust " +"syntax via a series of examples which showcase different constructs. Sometimes " +"includes small exercises where you are asked to expand on the code in the " +"examples." msgstr "" "‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " "syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " -"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " -"در مثال‌ها گسترش دهید." +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را در " +"مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " -"of the standard library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of " +"the standard library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " -"کتابخانه استاندارد برای Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه " +"استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " -"book which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book " +"which describes the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " -"گرامر و مدل حافظه Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر " +"و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -23690,32 +23079,30 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages " -"(FFI)." +"including working with raw pointers and interfacing with other languages (FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " -"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " -"(FFI) را تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش " +"می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را " +"تشریح می‌کند." #: src/other-resources.md msgid "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the " -"Rust Book was written." +"covers the new asynchronous programming model which was introduced after the Rust " +"Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " -"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " -"پس از نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل " +"برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از " +"نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"an introduction to using Rust on embedded devices without an operating " -"system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an " +"introduction to using Rust on embedded devices without an operating system." msgstr "" "‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " -"شامل می‌شود." +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل " +"می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -23727,115 +23114,113 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " -"from the perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from " +"the perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " -"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را " +"از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): covers Rust from the perspective of developers who " -"write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." +"html): covers Rust from the perspective of developers who write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " -"زبان C می‌نویسند پوشش می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." +"html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش " +"می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): " -"covers the syntax of Rust using side-by-side comparisons with other " -"languages such as C, C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers " +"the syntax of Rust using side-by-side comparisons with other languages such as C, " +"C++, Java, JavaScript, and Python." msgstr "" "‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " -"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " -"C++، Java، JavaScript و Python پوشش می‌دهد." +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، " +"Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " -"you learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you " +"learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " -"کمک به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک " +"به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): a series of small presentations covering both basic " -"and advanced part of the Rust language. Other topics such as WebAssembly, " -"and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" +"index.html): a series of small presentations covering both basic and advanced " +"part of the Rust language. Other topics such as WebAssembly, and async/await are " +"also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " -"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " -"پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" +"index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را " +"پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" "[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" "testing/): a self-paced workshop that goes beyond Rust's built-in testing " -"framework. It covers `googletest`, snapshot testing, mocking as well as how " -"to write your own custom test harness." +"framework. It covers `googletest`, snapshot testing, mocking as well as how to " +"write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" -"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " -"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " -"تست‌های سفارشی خود را پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-" +"testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این " +"`googletest`، تست snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را " +"پوشش می‌دهد." #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs." -"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " -"new developers. The first is a set of 35 videos and the second is a set of " -"11 modules which covers Rust syntax and basic constructs." +"series-to-rust/) and [Take your first steps with Rust](https://docs.microsoft.com/" +"en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. " +"The first is a set of 35 videos and the second is a set of 11 modules which " +"covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" -"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" -"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " -"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " -"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" +"series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. " +"com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان " +"جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از ۱۱ ماژول است که دستور " +"Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." -"github.io/too-many-lists/): in-depth exploration of Rust's memory management " -"rules, through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github." +"io/too-many-lists/): in-depth exploration of Rust's memory management rules, " +"through implementing a few different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." -"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " -"نوع مختلف list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/" +"too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف " +"list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " -"for even more Rust books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for " +"even more Rust books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " -"کتاب‌های بیشتر در مورد Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های " +"بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust " -"documentation. See the page on [other resources](other-resources.md) for a " -"full list of useful resources." +"The material here builds on top of the many great sources of Rust documentation. " +"See the page on [other resources](other-resources.md) for a full list of useful " +"resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " -"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست " +"کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache " -"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" -"rust/blob/main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 " +"license, please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/" +"main/LICENSE) for details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " -"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" -"LICENSE) مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر " +"به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/LICENSE) " +"مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -23843,14 +23228,13 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by " -"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " -"`third_party/rust-by-example/` directory for details, including the license " -"terms." +"Some examples and exercises have been copied and adapted from [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-" +"example/` directory for details, including the license terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" -"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " -"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-" +"example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به " +"دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -23862,9 +23246,9 @@ msgid "" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " -"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " -"`third_party/rust-on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس " +"شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-" +"on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -23872,13 +23256,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section " -"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " -"directory for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section uses an " +"image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory " +"for details, including the license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " -"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " -"license، دایرکتوری `third_party/cxx/` را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از " +"[CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، " +"دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -23887,31 +23271,27 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` " -#~ "keyword makes them capture by value." +#~ "By default, closures will capture by reference if they can. The `move` keyword " +#~ "makes them capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " -#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " -#~ "value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. " +#~ "کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction), [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/" +#~ "bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" -#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." -#~ "com/docs/setup/build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" +#~ "bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" +#~ "bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction) به Bazel." -#~ msgid "" -#~ "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "" -#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "" -#~ "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -23936,45 +23316,44 @@ msgstr "" #~ msgid "" #~ "In this example, we have a race between a cat and a dog. " -#~ "`first_animal_to_finish_race` listens to both channels and will pick " -#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " -#~ "cat that take 500ms." +#~ "`first_animal_to_finish_race` listens to both channels and will pick whichever " +#~ "arrives first. Since the dog takes 50ms, it wins against the cat that take " +#~ "500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " -#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." -#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " -#~ "می‌کشد تا پیروز شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر " +#~ "دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین " +#~ "سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز " +#~ "شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are " -#~ "supposed to receive only one `send`." +#~ "You can use `oneshot` channels in this example as the channels are supposed to " +#~ "receive only one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " -#~ "کانال‌ها فقط یک `send` را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها " +#~ "فقط یک `send` را دریافت کنند." #~ msgid "" -#~ "Try adding a deadline to the race, demonstrating selecting different " -#~ "sorts of futures." +#~ "Try adding a deadline to the race, demonstrating selecting different sorts of " +#~ "futures." #~ msgstr "" -#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " -#~ "نشان دهید." +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان " +#~ "دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their " -#~ "futures. It is easiest to use when every execution of `select!` creates " -#~ "new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their futures. It " +#~ "is easiest to use when every execution of `select!` creates new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " -#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " -#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future " +#~ "آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد " +#~ "می‌کند، راحت‌ترین استفاده از آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but " -#~ "this can lead to issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but this " +#~ "can lead to issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " -#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " -#~ "(pinning slide) شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما " +#~ "این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) " +#~ "شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -24010,8 +23389,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " +#~ "اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -24025,11 +23404,11 @@ msgstr "" #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." #~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/" -#~ "* ... */`." +#~ "Line comments are started with `//`, block comments are delimited by `/* ... */" +#~ "`." #~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " -#~ "مشخص می‌شوند." +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " +#~ "می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -24039,21 +23418,20 @@ msgstr "" #~ msgid "" #~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "" -#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; " -#~ "3]" +#~ "[20, 30, 40], [0; 3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), " -#~ "(T1, T2), …" +#~ "(), (T,), (T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" @@ -24074,17 +23452,16 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " -#~ "type, and the only valid value of that type --- that is to say both the " -#~ "type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, " +#~ "and the only valid value of that type --- that is to say both the type and its " +#~ "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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " -#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " -#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " -#~ "که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " +#~ "این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به " +#~ "صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک " +#~ "تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی " +#~ "خواهیم دید. " #, fuzzy #~ msgid "" @@ -24097,8 +23474,7 @@ msgstr "" #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" #~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " -#~ "کنید." +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -24111,11 +23487,9 @@ msgstr "" #~ "Point out that how `..` will expand to account for different number of " #~ "elements." #~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " -#~ "یافت." +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." -#~ msgid "" -#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" #~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " #~ "`[a@..,b]` را نشان دهید." @@ -24125,9 +23499,8 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-" -#~ "scoped values that cannot be moved or reallocated during the execution of " -#~ "the program." +#~ "Static and constant variables are two different ways to create globally-scoped " +#~ "values that cannot be moved or reallocated during the execution of the program." #~ msgstr "" #~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " #~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " @@ -24163,16 +23536,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " +#~ "اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل " -#~ "تغییر به یک برش از رشته‌ است." +#~ "&str یک مرجع غیرقابل تغییر " +#~ "به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -24400,13 +23773,12 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "" -#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." #~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the " -#~ "standard library." +#~ "Day 2: Memory management, ownership, compound data types, and the standard " +#~ "library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -24439,30 +23811,28 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " -#~ "and `continue`." +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " +#~ "`continue`." #~ msgstr "" #~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " #~ "`continue`. " #~ msgid "" #~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a " -#~ "major feature and we should show students this right away." +#~ "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 یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over " -#~ "the schedule. We suggest splitting the day into two parts (following the " -#~ "slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over the " +#~ "schedule. We suggest splitting the day into two parts (following the slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس " +#~ "می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال " +#~ "کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -24474,8 +23844,8 @@ msgstr "" #~ "You can of course adjust this as necessary. Please make sure to include " #~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را " +#~ "نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -24514,56 +23884,54 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop will " +#~ "always end, but this is not yet proved. Edit the code and play with different " +#~ "inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این " +#~ "است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و " +#~ "با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to trigger " +#~ "type inference. Try with `i8` instead and trigger a runtime integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا " +#~ "استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در " +#~ "زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match the " +#~ "format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها " +#~ "با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد " +#~ "است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "fmt` which has the rules of the formatting mini-language. It's important " -#~ "that the students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه `std::" +#~ "fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان " +#~ "با جستجو در کتابخانه استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::" -#~ "fmt documentation" +#~ "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` را توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات محلی " +#~ "‍`std::fmt` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -24575,8 +23943,7 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" @@ -24602,8 +23969,8 @@ msgstr "" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" #~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " +#~ "(line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -24620,12 +23987,12 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning " -#~ "level, even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش فرض " +#~ "کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" @@ -24633,33 +24000,32 @@ msgstr "" #~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند " +#~ "نمونه:" #~ msgid "" #~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-" -#~ "backdoor-attempt-of-2003)" +#~ "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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of 2003]" +#~ "(https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003)" #~ 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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability](https://" +#~ "dwheeler.com/essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-" -#~ "the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke sudo]" +#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-" +#~ "break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -24681,127 +24047,122 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " -#~ "you can't accidentally forget a `break`." +#~ "`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 را " #~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding " +#~ "`Box` leaves the scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` " +#~ "مورد نظر اسکوپ مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of " +#~ "a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get " +#~ "یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped and " +#~ "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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و در " +#~ "نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی تابعی که با " +#~ "`#[must_use]` علامت گذاری شده است را فراموش کنید، " +#~ "کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" #~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get " -#~ "runtime-initialized and runtime-sized static variables" +#~ "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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/" +#~ "struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر استفاده کنید.یک " +#~ "مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی " +#~ "اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.html) to make the compiler \"forget\" about a value (meaning the " -#~ "destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget." +#~ "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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/std/" +#~ "mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را فراموش کند (به " +#~ "این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-" -#~ "lang.org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory leak " +#~ "and Rust does not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر " +#~ "می‌گیرند و Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood as " +#~ "\"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" #~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " #~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "panics in debug mode (`cargo build`) and wrap-around in release mode " -#~ "(`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang." +#~ "org/rustc/codegen-options/index.html#overflow-checks) compile-time flag. If " +#~ "enabled, the program will panic (a controlled crash of the program), otherwise " +#~ "you get wrap-around semantics. By default, you get 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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be " +#~ "disabled directly with the `unsafe` keyword. However, `unsafe` allows you to " +#~ "call functions such as `slice::get_unchecked` which does not do bounds " +#~ "checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور " +#~ "مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان " +#~ "می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را " +#~ "انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." #~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده " +#~ "است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -24810,51 +24171,51 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, writing a loop using `for` should result in roughly the same low " -#~ "level instructions as using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for " +#~ "higher-level programming constructs with memory or CPU. For example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که شما " +#~ "مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU «هزینه»‌ای " +#~ "پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید تقریباً به " +#~ "همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار `iter()." +#~ "fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also " +#~ "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` را " +#~ "بیان کند." #~ msgid "" #~ "Remind people to read the errors --- many developers have gotten used to " #~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ "talkative than other compilers. It will often provide you with _actionable_ " +#~ "feedback, ready to copy-paste into your code." #~ msgstr "" #~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل " +#~ "توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار " +#~ "شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, Python, " +#~ "and Go. Rust does not come with several things you might consider standard and " +#~ "essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " +#~ "است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " +#~ "بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" +#~ "rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" @@ -24863,44 +24224,44 @@ msgstr "" #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/" +#~ "serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "Rust community is still working on finding the best solution --- and " -#~ "perhaps there isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library cannot " +#~ "go away, so it has to be very stable. For the examples above, the 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 هنوز در تلاش " +#~ "است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک «بهترین " +#~ "راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "makes it trivial to download and compile third-party crates. A " -#~ "consequence of this is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this 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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این " +#~ "امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی از " +#~ "پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates to find a " +#~ "good and trusted one." #~ msgstr "" #~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "dir=ltr> با اجازه مقایسه معیارهای سلامت برای crates به " +#~ "شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است که " +#~ "در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -24914,12 +24275,12 @@ msgstr "" #~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " #~ "pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای " +#~ "C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." +#~ "References that are declared as `mut` can be bound to different values over " +#~ "their lifetime." #~ msgstr "" #~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " #~ "مختلفی ارجاع داده شوند." @@ -24931,8 +24292,8 @@ msgstr "" #~ "Rust is tracking the lifetimes of all references to ensure they live long " #~ "enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را " +#~ "رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " @@ -24941,100 +24302,94 @@ msgstr "" #~ "You can borrow `&str` slices from `String` via `&` and optionally range " #~ "selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و " +#~ "انتخاب محدوده به صورت اختیاری، قرض بگیرید." #~ 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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " +#~ "We refer in `main` to a function written below. Neither forward declarations " +#~ "nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " +#~ "می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر " +#~ "نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains " -#~ "`=n`, which causes it to include the upper bound." +#~ "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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است که " +#~ "باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgid "All language items in Rust can be documented using special `///` syntax." #~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." +#~ "This course does not include rustdoc on slides, just to save space, but in " +#~ "real code they should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما " +#~ "در کدهای دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." +#~ "Inner doc comments are discussed later (in the page on modules) and need not " +#~ "be addressed here." #~ msgstr "" #~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " #~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" #~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." +#~ "`cargo test`. We will discuss these tests in the [Testing section](../testing/" +#~ "doc-tests.html)." #~ msgstr "" #~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست " +#~ "نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a " -#~ "method is an instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای از " +#~ "نوعی است که با آن مرتبط است:" #~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." +#~ "We will look much more at methods in today's exercise and in tomorrow's class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را " +#~ "از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual constructor, `Rectangle { width, height }`, could be called " -#~ "directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/" -#~ "constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static methods " +#~ "are commonly used to initialize structs (but don't have to). The actual " +#~ "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) را ببینید." #~ msgid "" #~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " #~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، " +#~ "با ارگمان‌های یک سازنده `Rectangle::square(width: u32)` " +#~ "اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -25058,13 +24413,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." +#~ "When using generics, the standard library's `Into` can provide a kind of " +#~ "limited polymorphism on argument types. We will see more details in a later " +#~ "section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " +#~ "می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات " +#~ "بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -25083,98 +24438,95 @@ msgstr "" #~ msgid "" #~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." +#~ "completion in your editor. See the page about [Using Cargo](../../cargo.md) " +#~ "for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل " +#~ "خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه " +#~ "مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets lose " +#~ "their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج " +#~ "شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." #~ msgid "" #~ "Rust will not automatically apply _implicit conversions_ between types " #~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` trait has a single `into()` method. Implementing these traits " -#~ "is how a type expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/" +#~ "std/convert/trait.From.html) and [`Into`](https://doc.rust-lang.org/std/" +#~ "convert/trait.Into.html) traits to let us convert between them. The `From` " +#~ "trait has a single `from()` method and similarly, the `Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "dir=ltr>`From`](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را پیاده‌سازی می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح را بدهند. " +#~ "با پیاده سازی ویژگی `From` همه انواع به صورت مشترک یک " +#~ "متد `from()` را دارند. با پیاده‌سازی تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان " +#~ "می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which means " +#~ "that we can convert a variable `x` of type `i8` to an `i16` by calling `i16::" +#~ "from(x)`. Or, simpler, with `x.into()`, because `From for i16` " +#~ "implementation automatically create an implementation of `Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد " +#~ "`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " +#~ "`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." +#~ "into()` ، زیرا پیاده‌سازی `From` برای نوع " +#~ "`i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "The same applies for your own `From` implementations for your own types, so it " +#~ "is sufficient to only implement `From` to get a respective `Into` " #~ "implementation automatically." #~ msgstr "" #~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " #~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه " +#~ "را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای " +#~ "انجام تبدیل استفاده شود." #~ msgid "" #~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " #~ "`i128`) to see which types you can convert to which other types. Try " #~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/" -#~ "trait.From.html) to see if `From` is implemented for the pairs you " -#~ "check." +#~ "[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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) تغییر " +#~ "دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل کنید. سعی کنید " +#~ "انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات کتابخانه استاندارد]" +#~ "(https://doc.rust-lang.org/std/convert/trait.From.html) را بررسی کنید تا " +#~ "ببینید آیا `From` برای تبدیل انواع‌ایی که بررسی می‌کنید " +#~ "پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -25183,11 +24535,10 @@ msgstr "" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " #~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" +#~ "You can print such an array by asking for its debug representation with `{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}" +#~ "` چاپ کنید:" #~ msgid "" #~ "Rust lets you iterate over things like arrays and ranges using the `for` " @@ -25200,36 +24551,36 @@ msgstr "" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your " +#~ "argument and return types? Something like `&[&[i32]]` for a two-dimensional " +#~ "slice-of-slices. Why or why not?" #~ msgstr "" #~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "dir=ltr>`&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " +#~ "چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان " +#~ "پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " +#~ "implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-and-for-" +#~ "loops) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for n in " +#~ "&array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به " +#~ "ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." @@ -25239,80 +24590,77 @@ msgstr "" #~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال ۲۰۲۱ " +#~ "معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-" +#~ "for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, " -#~ "then `[i32; 3]` is also a copy type." +#~ "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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally " +#~ "evaluate one of two blocks, but the blocks can have a value which then becomes " +#~ "the value of the `if` expression. Other control flow expressions work " +#~ "similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود " +#~ "که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این " +#~ "بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته " +#~ "باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" +#~ "The same rule is used for functions: the value of the function body is the " +#~ "return value:" #~ msgstr "" #~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " #~ "برگشتی است: " #~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " +#~ "The point of this slide is to show that blocks have a type and value in Rust. " #~ msgstr "" #~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " #~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely related to the [`while let` loop](while-let-expressions.md). It " -#~ "will automatically call `into_iter()` on the expression and then iterate " -#~ "over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely " +#~ "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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور نزدیکی به " +#~ "حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. حلقه `for` به " +#~ "طور خودکار `into_iter()` را روی عبارت فراخوانی می‌کند و " +#~ "سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." #~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که ویژگی " +#~ "`Iterator` را پیاده‌سازی می‌کند." #~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " +#~ "`step_by` is a method that returns another `Iterator` that skips every other " +#~ "element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه " +#~ "عناصر را برمی‌گرداند." #~ 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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را قابل " +#~ "تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v." +#~ "iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" @@ -25321,60 +24669,58 @@ msgstr "" #~ "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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/expressions/" +#~ "loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" #~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the types " +#~ "less and less as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و " +#~ "کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic container " +#~ "without the code ever explicitly specifying the contained type, using `_` as a " +#~ "placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در " +#~ "یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک " +#~ "جایگزین برای اعلام نوع داده: " #~ msgid "" #~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-" -#~ "HashSet%3CT,+S%3E) implements." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/std/" +#~ "iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.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) آن را پیاده‌سازی می‌کند." +#~ "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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse memory " +#~ "locations when shadowing an immutable variable in a scope, even if the type " +#~ "does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که " +#~ "قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل " +#~ "تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" #~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " @@ -25387,19 +24733,18 @@ msgstr "" #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده باشند. سپس " +#~ "می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There " -#~ "is no fall-through like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There is no " +#~ "fall-through like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از " +#~ "بالا به پایین نمی‌باشد." #~ msgid "" #~ "The match expression has a value. The value is the last expression in the " @@ -25409,17 +24754,17 @@ msgstr "" #~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته باشد، سپس " +#~ "کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه توی match " +#~ "اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را " +#~ "بررسی می کند." #~ msgid "" #~ "It is possible to retrieve the discriminant by calling `std::mem::" @@ -25429,102 +24774,98 @@ msgstr "" #~ "تشخیصی پنهان را دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs where " +#~ "comparing field values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت " +#~ "`PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` " +#~ "with a top level `struct Click { ... }`. The inlined version cannot implement " +#~ "traits, for example." #~ msgstr "" #~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." +#~ "dir=ltr>`WebEvent::Click(Click)` با `struct Click { ... }" +#~ "` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را " +#~ "پیاده‌سازی کند." #~ msgid "" #~ "Rust enums are packed tightly, taking constraints due to alignment into " #~ "account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های " +#~ "ناشی از هم ترازی:" #~ msgid "" #~ "Internally Rust is using a field (discriminant) to keep track of the enum " #~ "variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای " +#~ "`enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی حافظه " +#~ "1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, " +#~ "see below)," #~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): اندازه " +#~ "توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، " +#~ "در زیر ببینید)" -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" +#~ "dbg_size!(&i32): اندازه توی حافظه " +#~ "۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" #~ msgid "" #~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " #~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): اندازه " +#~ "توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی " +#~ "اشاره‌گر NULL را در زیر ببینید)" #~ msgid "" #~ "Niche optimization: Rust will merge unused bit patterns for the enum " #~ "discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` " +#~ "ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." +#~ "More complex example if you want to discuss what happens when we chain more " +#~ "than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد " +#~ "`Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring assignment, or if it fails, execute a block which is " -#~ "required to abort normal control flow (with `panic`/`return`/`break`/" -#~ "`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/" +#~ "flow_control/let_else.html) construct allows to do a destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-lang.org/" +#~ "rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک انتساب به صورت " +#~ "destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا کند که برای خاتمه " +#~ "دادن به جریان کنترل عادی (با panic/return/break/continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-" +#~ "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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-expr." +#~ "html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از این نظر، " +#~ "مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." #~ msgstr "" @@ -25532,76 +24873,71 @@ msgstr "" #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." +#~ ".as_deref() را حذف کنید و خطا را " +#~ "توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot match " +#~ "against `String`." #~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان " +#~ "`String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our " -#~ "case, this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "dir=ltr>`Option` را به `Option<&T::Target>` " +#~ "تبدیل می‌کند. در مورد ما، این `Option` را به `Option<&str>` تبدیل می‌کند." #~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." +#~ "We can now use pattern matching to match against the `&str` inside `Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل " +#~ "`Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف `q`، " +#~ "به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable " -#~ "patterns, as the term can show up in error messages." +#~ "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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار (irrefutable " +#~ "patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" #~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." +#~ "Destructuring of slices of unknown length also works with patterns of fixed " +#~ "length." #~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می " +#~ "کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت بولین " +#~ "دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "You can use the variables defined in the pattern in your if expression." +#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -25617,41 +24953,36 @@ msgstr "" #~ 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." +#~ "integers. Then, revisit the solution and try to implement it with iterators." #~ msgstr "" -#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " -#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " -#~ "کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح " +#~ "حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based memory " +#~ "management, and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت " +#~ "حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` " +#~ "and `Arc`." #~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و " +#~ "`Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -25666,84 +24997,76 @@ msgstr "" #~ "If not done with care, this can lead to crashes, bugs, security " #~ "vulnerabilities, and memory leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی " +#~ "و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" #~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and `free`: " +#~ "the pointer is lost and we cannot deallocate the memory. Worse, freeing the " +#~ "pointer twice, or accessing a freed pointer can lead to exploitable security " +#~ "vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه " +#~ "نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، " +#~ "آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر " +#~ "به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgid "Constructors and destructors let you hook into the lifetime of an object." #~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object is " +#~ "destroyed. The compiler guarantees that this happens, even if an exception is " +#~ "raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را " +#~ "آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception " +#~ "ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and gives " +#~ "you smart pointers." #~ msgstr "" #~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " #~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory " +#~ "allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به " +#~ "حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." #~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا " +#~ "می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "Special move constructors are used when passing ownership to a function:" +#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" +#~ "An alternative to manual and scope-based memory management is automatic memory " +#~ "management:" #~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." #~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." +#~ "A garbage collector finds unused memory and deallocates it for the programmer." #~ msgstr "" #~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " #~ "تخصیص‌زدایی (آزاد) می‌کند." @@ -25765,15 +25088,15 @@ msgstr "" #~ msgid "Scope-based like C++, but the compiler enforces full adherence." #~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت " +#~ "می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even have " +#~ "no cost at runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، " +#~ "برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." @@ -25781,26 +25104,25 @@ msgstr "" #~ msgid "" #~ "If asked how at this point, you can mention that in Rust this is usually " #~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "ownership and memory allocation via various means, and prevent the " -#~ "potential errors in C." +#~ "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), or [Arc](https://" +#~ "doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate 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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید به " +#~ "این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی [Drop]" +#~ "(https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -25811,18 +25133,17 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way to generate code in Rust at compile time. In this case the default " +#~ "If students ask about `derive`, it is sufficient to say that this is a way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای تولید " +#~ "کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض صفت‌های " +#~ "`Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From d727f99c18980620c730444fdb1157d827e3300f Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 4 Oct 2024 22:41:31 +0330 Subject: [PATCH 84/92] fa: try to complete Farsi part3 fmt --- po/fa.po | 14048 ++++++++++++++++++++++++++++------------------------- 1 file changed, 7394 insertions(+), 6654 deletions(-) diff --git a/po/fa.po b/po/fa.po index 70a4a12ef6b..a58bfc3ac14 100644 --- a/po/fa.po +++ b/po/fa.po @@ -52,14 +52,15 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md -#: src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -75,8 +76,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -104,16 +105,17 @@ msgstr "تمرین: دنباله فیبوناچی" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md src/std-traits/solution.md -#: src/memory-management/solution.md src/smart-pointers/solution.md -#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md -#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md +#: src/generics/solution.md src/std-types/solution.md +#: src/std-traits/solution.md src/memory-management/solution.md +#: src/smart-pointers/solution.md src/borrowing/solution.md +#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md +#: src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -150,7 +152,8 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -158,7 +161,8 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -183,7 +187,8 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -221,11 +226,13 @@ msgstr "تمرین: هندسه" msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -254,8 +261,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -272,7 +279,8 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -280,8 +288,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -430,8 +438,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -467,8 +475,8 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" @@ -543,8 +551,8 @@ msgstr "تمرین: تجزیه Protobuf" msgid "Day 4: Morning" msgstr "روز چهارم: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/iterators.md msgid "Iterators" msgstr "" @@ -564,8 +572,8 @@ msgstr "`FromIterator`" msgid "Exercise: Iterator Method Chaining" msgstr "تمرین: روش Iterator Chaining" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/modules.md src/modules/modules.md msgid "Modules" msgstr "ماژول‌ها" @@ -585,8 +593,8 @@ msgstr "" msgid "Exercise: Modules for a GUI Library" msgstr "تمرین: ماژولهایی برای کتابخانه رابط کاربری گرافیکی" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/testing.md src/chromium/testing.md msgid "Testing" msgstr "تست‌کردن" @@ -961,7 +969,8 @@ msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کن msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." -#: src/SUMMARY.md src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/SUMMARY.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "وابسته به یک Crate" @@ -1049,7 +1058,8 @@ msgid "Compass" msgstr "قطب‌نما" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md #: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "راه حل‌ها" @@ -1168,11 +1178,13 @@ msgstr "کانال‌ها" msgid "Senders and Receivers" msgstr "متد دریافتی" -#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" -#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1194,7 +1206,8 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync.md src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "مثال‌ها" @@ -1219,7 +1232,8 @@ msgstr "مثال" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/dining-philosophers.md -#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" @@ -1332,53 +1346,53 @@ msgstr "اعتبارها" #: src/index.md msgid "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" -"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" -"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " -"contributors](https://img.shields.io/github/contributors/google/comprehensive-" -"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" -"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" -"rust/stargazers)" -msgstr "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" -"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" -"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " -"contributors](https://img.shields.io/github/contributors/google/comprehensive-" -"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" -"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" -"rust/stargazers)" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" +"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" +"[GitHub contributors](https://img.shields.io/github/contributors/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/" +"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" +msgstr "" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" +"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" +"[GitHub contributors](https://img.shields.io/github/contributors/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/" +"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" #: src/index.md msgid "" -"This is a free Rust course developed by the Android team at Google. The course " -"covers the full spectrum of Rust, from basic syntax to advanced topics like " -"generics and error handling." +"This is a free Rust course developed by the Android team at Google. The " +"course covers the full spectrum of Rust, from basic syntax to advanced " +"topics like generics and error handling." msgstr "" -"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این این " -"دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته مانند " -"جنریک و مدیریت خطاها." +"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این " +"این دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته " +"مانند جنریک و مدیریت خطاها." #: src/index.md msgid "" "The latest version of the course can be found at . If you are reading somewhere else, please check there for " -"updates." +"comprehensive-rust/>. If you are reading somewhere else, please check there " +"for updates." msgstr "" -"آخرین نسخه از دوره را میتوان در " -"پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز " -"بررسی کنید." +"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " +"نیز بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language in the " -"top right corner of the page or check the [Translations](running-the-course/" -"translations.md) page for a list of all available translations." +"The course is available in other languages. Select your preferred language " +"in the top right corner of the page or check the [Translations](running-the-" +"course/translations.md) page for a list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای " -"صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای " -"فهرستی از تمام ترجمه‌های موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " +"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " +"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1386,11 +1400,11 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know anything " -"about Rust and hope to:" +"The goal of the course is to teach you Rust. We assume you don't know " +"anything about Rust and hope to:" msgstr "" -"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی " -"دانید :" +"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " +"نمی دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1399,8 +1413,8 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در " -"Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " +"در Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1413,7 +1427,8 @@ msgstr "ما چهار روز اول دوره را اصول Rust می نامیم #: src/index.md msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgstr "" +"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" @@ -1425,13 +1440,13 @@ msgstr "" #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium based " -"browsers. This includes interoperability with C++ and how to include third-party " -"crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium " +"based browsers. This includes interoperability with C++ and how to include " +"third-party crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای " -"مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه " -"های(crates) شخص ثالث در کروم است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " +"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " +"جعبه های(crates) شخص ثالث در کروم است." #: src/index.md msgid "" @@ -1440,20 +1455,21 @@ msgid "" "covered." msgstr "" "[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " -"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده " -"شده اند." +"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " +"داده شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. " -"We cover both classical concurrency (preemptively scheduling using threads and " -"mutexes) and async/await concurrency (cooperative multitasking using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " +"Rust. We cover both classical concurrency (preemptively scheduling using " +"threads and mutexes) and async/await concurrency (cooperative multitasking " +"using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " -"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و " -"mutexها ) و async/await concurrency (multitasking مشارکتی) با استفاده از futures " -"را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " +"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " +"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " +"استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1461,8 +1477,8 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few days. " -"Some non-goals of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few " +"days. Some non-goals of this course are:" msgstr "" "زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." "چندتا از اهداف خارج از این دوره عبارتند از:" @@ -1473,9 +1489,9 @@ msgid "" "(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" "(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://" -"doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-" -"lang.org/rust-by-example/macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" +"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1483,14 +1499,14 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a statically-" -"typed language and we will sometimes make comparisons with C and C++ to better " -"explain or contrast the Rust approach." +"The course assumes that you already know how to program. Rust is a " +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا " -"رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " +"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" @@ -1503,12 +1519,12 @@ msgstr "" #: src/index.md msgid "" "This is an example of a _speaker note_. We will use these to add additional " -"information to the slides. This could be key points which the instructor should " -"cover as well as answers to typical questions which come up in class." +"information to the slides. This could be key points which the instructor " +"should cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات " -"بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و " -"همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " +"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " +"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1516,22 +1532,24 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the course " -"internally at Google." -msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the " +"course internally at Google." +msgstr "" +"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in " -"the middle. This leaves 3 hours for the morning class and 3 hours for the " -"afternoon class. Both sessions contain multiple breaks and time for students to " -"work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " +"in the middle. This leaves 3 hours for the morning class and 3 hours for the " +"afternoon class. Both sessions contain multiple breaks and time for students " +"to work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت " -"ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس " -"بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: شما می‌توانید ۳ " -"ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته منفی این کار این است که " -"با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " +"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " +"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " +"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " +"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " +"ظهر خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1539,100 +1557,103 @@ msgstr "قبل از اجرای دوره، شما می‌خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker notes to " -"help highlight the key points (please help us by contributing more speaker " -"notes!). When presenting, you should make sure to open the speaker notes in a " -"popup (click the link with a little arrow next to \"Speaker Notes\"). This way " -"you have a clean screen to present to the class." +"Make yourself familiar with the course material. We've included speaker " +"notes to help highlight the key points (please help us by contributing more " +"speaker notes!). When presenting, you should make sure to open the speaker " +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات " -"کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). " -"هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید " -"(روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک " -"صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " +"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " +"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " +"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " +"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." #: src/running-the-course.md msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " -"schedule the days over two weeks. Course participants have said that they find it " -"helpful to have a gap in the course since it helps them process all the " -"information we give them." +"schedule the days over two weeks. Course participants have said that they " +"find it helpful to have a gap in the course since it helps them process all " +"the information we give them." msgstr "" "در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " -"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره " -"گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا تمام " -"اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " +"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " +"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a class " -"size of 15-25 people. That's small enough that people are comfortable asking " -"questions --- it's also small enough that one instructor will have time to answer " -"the questions. Make sure the room has _desks_ for yourself and for the students: " -"you will all need to be able to sit and work with your laptops. In particular, " -"you will be doing a lot of live-coding as an instructor, so a lectern won't be " -"very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر " -"را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین " -"مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر " -"_میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که بتونید بشنید و با لپتاپ " -"های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-coding انجام خواهید داد پس " -"صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a " +"class size of 15-25 people. That's small enough that people are comfortable " +"asking questions --- it's also small enough that one instructor will have " +"time to answer the questions. Make sure the room has _desks_ for yourself " +"and for the students: you will all need to be able to sit and work with your " +"laptops. In particular, you will be doing a lot of live-coding as an " +"instructor, so a lectern won't be very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " +"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " +"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " +"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " +"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" +"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " +"نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things up. " -"We recommend presenting directly using `mdbook serve` running on your laptop (see " -"the [installation instructions](https://github.com/google/comprehensive-" -"rust#building)). This ensures optimal performance with no lag as you change " -"pages. Using your laptop will also allow you to fix typos as you or the course " -"participants spot them." +"On the day of your course, show up to the room a little early to set things " +"up. We recommend presenting directly using `mdbook serve` running on your " +"laptop (see the [installation instructions](https://github.com/google/" +"comprehensive-rust#building)). This ensures optimal performance with no lag " +"as you change pages. Using your laptop will also allow you to fix typos as " +"you or the course participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه " -"می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای " -"نصب](https://github.com/google/comprehensive-rust#building) را ببنیید). با این " -"کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین " -"به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده شما یا شرکت کنندگان در دوره " -"اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " +"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " +"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " +"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " +"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " +"شما یا شرکت کنندگان در دوره اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We typically " -"spend 30-45 minutes on exercises in the morning and in the afternoon (including " -"time to review the solutions). Make sure to ask people if they're stuck or if " -"there is anything you can help with. When you see that several people have the " -"same problem, call it out to the class and offer a solution, e.g., by showing " -"people where to find the relevant information in the standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ " -"الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) " -"صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که " -"می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, خطاب به " -"کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که می‌توانند اطلاعات " -"مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." +"Let people solve the exercises by themselves or in small groups. We " +"typically spend 30-45 minutes on exercises in the morning and in the " +"afternoon (including time to review the solutions). Make sure to ask people " +"if they're stuck or if there is anything you can help with. When you see " +"that several people have the same problem, call it out to the class and " +"offer a solution, e.g., by showing people where to find the relevant " +"information in the standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " +"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " +"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " +"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " +"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " +"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " +"کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun for you " -"as it has been for us!" +"That is all, good luck running the course! We hope it will be as much fun " +"for you as it has been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه " -"که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " +"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We would " -"love to hear what worked well for you and what can be made better. Your students " -"are also very welcome to [send us feedback](https://github.com/google/" -"comprehensive-rust/discussions/100)!" +"discussions/86) afterwards so that we can keep improving the course. We " +"would love to hear what worked well for you and what can be made better. " +"Your students are also very welcome to [send us feedback](https://github.com/" +"google/comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/" -"discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم " -"بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور شما " -"دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://github.com/" -"google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" +"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " +"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " +"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" +"github.com/google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1640,11 +1661,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days " -"are fast paced and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " +"days are fast paced and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز " -"با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " +"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1668,11 +1689,12 @@ msgstr "بخش" #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md #: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md -#: src/std-types.md src/std-traits.md src/welcome-day-3.md src/memory-management.md -#: src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md -#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md -#: src/testing.md src/welcome-day-4-afternoon.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/threads.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/threads.md #: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md @@ -1684,10 +1706,10 @@ msgstr "مدت زمان" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/lifetimes.md src/iterators.md -#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/shared-state.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" @@ -1784,7 +1806,8 @@ msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" msgstr "" -"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" +"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " +"دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1792,38 +1815,38 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust " -"for Android platform development. This includes interoperability with C, C++, and " -"Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using " +"Rust for Android platform development. This includes interoperability with " +"C, C++, and Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده " -"از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " +"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " +"با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/" -"downloading). Make a checkout of the [course repository](https://github.com/" -"google/comprehensive-rust) on the same machine and move the `src/android/` " -"directory into the root of your AOSP checkout. This will ensure that the Android " -"build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/" +"download/downloading). Make a checkout of the [course repository](https://" +"github.com/google/comprehensive-rust) on the same machine and move the `src/" +"android/` directory into the root of your AOSP checkout. This will ensure " +"that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/" -"download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/" -"google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن " -"ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build اندروید فایل های " -"`Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" +"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" +"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" +"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " +"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build all " -"Android examples using `src/android/build_all.sh`. Read the script to see the " -"commands it runs and make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build " +"all Android examples using `src/android/build_all.sh`. Read the script to " +"see the commands it runs and make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه " -"نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. " -"اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها " -"را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " +"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " +"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " +"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1831,24 +1854,25 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using " -"Rust as part of the Chromium browser. It includes using Rust in Chromium's `gn` " -"build system, bringing in third-party libraries (\"crates\") and C++ " -"interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " +"using Rust as part of the Chromium browser. It includes using Rust in " +"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " +"and C++ interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به " -"عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` " -"Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری ++C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " +"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " +"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" +"+C است." #: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. Ensure " -"that you can run the Chromium browser that you've built." +"[recommended](../chromium/setup.md) for speed but any build will work. " +"Ensure that you can run the Chromium browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت " -"[توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که " -"می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " +"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " +"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1856,24 +1880,25 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using " -"Rust for bare-metal (embedded) development. Both microcontrollers and application " -"processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " +"using Rust for bare-metal (embedded) development. Both microcontrollers and " +"application processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک " -"روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل " -"(embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را " -"پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " +"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " +"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " +"کارایی خاص را پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit](https://" -"microbit.org/) v2 development board ahead of time. Everybody will need to install " -"a number of packages as described on the [welcome page](../bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit]" +"(https://microbit.org/) v2 development board ahead of time. Everybody will " +"need to install a number of packages as described on the [welcome page](../" +"bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 " -"را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-" -"metal.md) توضیح داده شده نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " +"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" +"(../bare-metal.md) توضیح داده شده نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1885,17 +1910,18 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل " -"همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " +"شامل همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready to " -"go. You can then copy/paste the examples into `src/main.rs` to experiment with " -"them:" +"You will need a fresh crate set up and the dependencies downloaded and ready " +"to go. You can then copy/paste the examples into `src/main.rs` to experiment " +"with them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. " -"سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " +"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " +"آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" @@ -1931,11 +1957,11 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the questions " -"drive the exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the " +"questions drive the exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را " -"هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " +"Rust را هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1966,65 +1992,69 @@ msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" msgstr "" -"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" +"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " +"است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" -"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and [@henrif75]" -"(https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " +"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " +"[@henrif75](https://github.com/henrif75)." msgstr "" "[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" -"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و [@henrif75]" -"(https://github.com/henrif75)." +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " +"[@henrif75](https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by " -"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " -"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " -"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " +"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" +"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" +"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" +"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " "[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " "[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " "[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github.com/" -"nodmp)." +"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." +"com/nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " +"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" "github.com/kuanhungchen), and [@johnathan79717](https://github.com/" "johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" -"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " -"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" -"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), " -"[@HidenoriKobayashi](https://github.com/HidenoriKobayashi) and [@kantasv](https://" -"github.com/kantasv)." +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " +"and [@kantasv](https://github.com/kantasv)." msgstr "" "[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." +"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" +"momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://" -"github.com/keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan]" -"(https://github.com/jooyunghan), and [@namhyung](https://github.com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " +"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." +"com/namhyung)." msgstr "" "[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " @@ -2032,8 +2062,8 @@ msgstr "" #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://" -"github.com/deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" +"(https://github.com/deavid)." msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2041,15 +2071,16 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp]" -"(https://github.com/git-user-cpp), [@yaremam](https://github.com/yaremam) and " -"[@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" +"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) and [@reta](https://github.com/reta)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "Use the language picker in the top-right corner to switch between languages." +msgid "" +"Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." @@ -2059,17 +2090,17 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most recently " -"updated translations:" +"There is a large number of in-progress translations. We link to the most " +"recently updated translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند " -"می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " +"پیوند می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://" -"github.com/younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" +"(https://github.com/younies)" msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2085,73 +2116,77 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://" -"github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp]" -"(https://github.com/hamidrezakp), [@javad-jafari](https://github.com/javad-" -"jafari) and [@moaminsharifi](https://github.com/moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" +"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " +"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" +"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" +"moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" -"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " -"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" -"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://" -"github.com/KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont]" -"(https://github.com/AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" +"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://" -"github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" +"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://" -"github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" +"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder]" -"(https://github.com/henrythebuilder) and [@detro](https://github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by " +"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" +"github.com/detro)." msgstr "" "[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available either " -"[as of their last update](https://google.github.io/comprehensive-rust/translation-" -"report.html) or [synced to the latest version of the course](https://google." -"github.io/comprehensive-rust/synced-translation-report.html)." +"The full list of translations with their current status is also available " +"either [as of their last update](https://google.github.io/comprehensive-rust/" +"translation-report.html) or [synced to the latest version of the course]" +"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get " -"going. Translations are coordinated on the [issue tracker](https://github.com/" -"google/comprehensive-rust/issues/282)." +"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " +"get going. Translations are coordinated on the [issue tracker](https://" +"github.com/google/comprehensive-rust/issues/282)." msgstr "" "اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" -"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار " -"ببینید. ترجمه ها در [issue tracker](https://github.com/google/comprehensive-rust/" -"issues/282) هماهنگ و کنترل می شوند." +"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " +"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" +"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-" -"lang.org/cargo/), the standard tool used in the Rust ecosystem to build and run " -"Rust applications. Here we want to give a brief overview of what Cargo is and how " -"it fits into the wider ecosystem and how it fits into this training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc." +"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " +"and run Rust applications. Here we want to give a brief overview of what " +"Cargo is and how it fits into the wider ecosystem and how it fits into this " +"training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-" -"lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه " -"های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در " -"مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه " -"دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." +"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " +"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " +"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " +"را در این آموزش ارائه دهیم." #: src/cargo.md msgid "Installation" @@ -2164,8 +2199,8 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will pass them to " -"`rustc` when building your project. Cargo also comes with a built-in test runner " -"which is used to execute unit tests." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to " +"download dependencies, usually hosted on , and it will " +"pass them to `rustc` when building your project. Cargo also comes with a " +"built-in test runner which is used to execute unit tests." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها " -"را که معمولاً در میزبانی می شوند دانلود کند و هنگام ساخت پروژه " -"آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که " -"برای اجرای unit test استفاده می شود." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " +"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " +"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " +"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to install " -"and update `rustc` and `cargo` when new versions of Rust are released. In " -"addition, `rustup` can also download documentation for the standard library. You " -"can have multiple versions of Rust installed at once and `rustup` will let you " -"switch between them as needed." +"`rustup`: the Rust toolchain installer and updater. This tool is used to " +"install and update `rustc` and `cargo` when new versions of Rust are " +"released. In addition, `rustup` can also download documentation for the " +"standard library. You can have multiple versions of Rust installed at once " +"and `rustup` will let you switch between them as needed." msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز " -"رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. " -"علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود " -"کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما " -"اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " +"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " +"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " +"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " +"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md #: src/references/exclusive.md src/memory-management/move.md @@ -2263,79 +2299,81 @@ msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six weeks. " -"New releases maintain backwards compatibility with old releases --- plus they " -"enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six " +"weeks. New releases maintain backwards compatibility with old releases --- " +"plus they enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر " -"می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه " -"قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " +"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " +"علاوه قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "" +"There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" " -"every six weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes " +"\"stable\" every six weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته " -"\"stable\" می شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " +"هفته \"stable\" می شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc.rust-" -"lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc." +"rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current " -"edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " +"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه " -"فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " +"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md msgid "" -"The editions are allowed to make backwards incompatible changes to the language." +"The editions are allowed to make backwards incompatible changes to the " +"language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for your " -"crate via the `Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for " +"your crate via the `Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد " -"نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " +"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای " -"نسخه های مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " +"برای نسخه های مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` " -"بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " +"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " -"comprehensive tool. It is capable of many advanced features including but not " -"limited to:" +"comprehensive tool. It is capable of many advanced features including but " +"not limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است " -"که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " +"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2343,7 +2381,8 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "" +"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" @@ -2351,27 +2390,33 @@ msgstr "وابستگی های Dev و وابستگی‌های Runtime Manageme #: src/cargo/rust-ecosystem.md msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" #: src/cargo/rust-ecosystem.md msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo clippy]" -"(https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo " +"clippy](https://github.com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/" -"rust-clippy)) قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" +"lang/rust-clippy)) قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "" +"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "" +"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2380,22 +2425,22 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " -"which can be executed through your browser. This makes the setup much easier and " -"ensures a consistent experience for everyone." +"which can be executed through your browser. This makes the setup much easier " +"and ensures a consistent experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر " -"شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه " -"ای ثابت را برای همه تضمین می کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " +"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " +"کند و تجربه ای ثابت را برای همه تضمین می کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do the " -"exercises. On the last day, we will do a larger exercise which shows you how to " -"work with dependencies and for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do " +"the exercises. On the last day, we will do a larger exercise which shows you " +"how to work with dependencies and for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. " -"در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با " -"وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " +"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " +"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2408,8 +2453,8 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy msgid "" -"You can use Ctrl + Enter to execute the code when focus is in the text " -"box." +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md @@ -2417,26 +2462,26 @@ msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به " -"دلایل مختلف قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " +"کد به دلایل مختلف قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open " -"it in the real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " +"open it in the real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و " -"آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " +"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from the " -"page! This is the reason that the students should solve the exercises using a " -"local Rust installation or via the Playground." +"The embedded playgrounds lose their state the moment you navigate away from " +"the page! This is the reason that the students should solve the exercises " +"using a local Rust installation or via the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را " -"از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از " -"local Rust installation یا از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " +"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " +"استفاده از local Rust installation یا از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2444,56 +2489,60 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will need to " -"first install Rust. Do this by following the [instructions in the Rust Book]" -"(https://doc.rust-lang.org/book/ch01-01-installation.html). This should give you " -"a working `rustc` and `cargo`. At the time of writing, the latest stable Rust " -"release has these version numbers:" +"If you want to experiment with the code on your own system, then you will " +"need to first install Rust. Do this by following the [instructions in the " +"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " +"should give you a working `rustc` and `cargo`. At the time of writing, the " +"latest stable Rust release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این " -"کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/" -"book/ch01-01-installation.html) انجام دهید. این باید به شما یک `rustc` و `cargo` " -"کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای این version numberها " -"است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " +"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" +"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " +"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " +"این version numberها است:" #: src/cargo/running-locally.md msgid "" -"You can use any later version too since Rust maintains backwards compatibility." +"You can use any later version too since Rust maintains backwards " +"compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های " -"قبلی را حفظ می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " +"های قبلی را حفظ می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of the " -"examples in this training:" +"With this in place, follow these steps to build a Rust binary from one of " +"the examples in this training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری " -"Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " +"باینری Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "" +"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" -"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده " -"کنید:" +"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " +"استفاده کنید:" #: src/cargo/running-locally.md -msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgid "" +"Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" -"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" +"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " +"کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For example, " -"using the example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For " +"example, using the example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از " -"مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " +"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2501,35 +2550,35 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo build` to " -"compile it without running it. You will find the output in `target/debug/` for a " -"normal debug build. Use `cargo build --release` to produce an optimized release " -"build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo " +"build` to compile it without running it. You will find the output in `target/" +"debug/` for a normal debug build. Use `cargo build --release` to produce an " +"optimized release build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo " -"build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای " -"ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/" -"release/` از `cargo build --release` استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " +"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" +"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " +"شده در `target/release/` از `cargo build --release` استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you run " -"`cargo` commands, it will automatically download and compile missing dependencies " -"for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you " +"run `cargo` commands, it will automatically download and compile missing " +"dependencies for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که " -"دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما " -"دانلود و کامپایل می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " +"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " +"نیاز را برای شما دانلود و کامپایل می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local editor. " -"It will make their life easier since they will have a normal development " -"environment." +"Try to encourage the class participants to install Cargo and use a local " +"editor. It will make their life easier since they will have a normal " +"development environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر " -"محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی " -"خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " +"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " +"محیط توسعه عادی خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" @@ -2537,17 +2586,19 @@ msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md msgid "" -"This is the first day of Rust Fundamentals. We will cover a lot of ground today:" +"This is the first day of Rust Fundamentals. We will cover a lot of ground " +"today:" msgstr "" -"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " +"داد:" #: src/welcome-day-1.md 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 msgid "Types and type inference." @@ -2566,79 +2617,87 @@ msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome.md src/concurrency/welcome-async.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. " -"It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 5 " +"minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "They should ask questions when they get them, don't save them to the end." -msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "" +"They should ask questions when they get them, don't save them to the end." +msgstr "" +"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md msgid "" -"The class is meant to be interactive and discussions are very much encouraged!" +"The class is meant to be interactive and discussions are very much " +"encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., keep the " -"discussions related to how Rust does things vs some other language. It can be " -"hard to find the right balance, but err on the side of allowing discussions since " -"they engage people much more than one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., " +"keep the discussions related to how Rust does things vs some other language. " +"It can be hard to find the right balance, but err on the side of allowing " +"discussions since they engage people much more than one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های " -"مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا " -"کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، " -"زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " +"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " +"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " +"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." #: src/welcome-day-1.md msgid "" "The questions will likely mean that we talk about things ahead of the slides." msgstr "" -"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." +"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " +"کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. Remember " -"that the slides are just a support and you are free to skip them as you like." +"This is perfectly okay! Repetition is an important part of learning. " +"Remember that the slides are just a support and you are free to skip them as " +"you like." msgstr "" "این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " -"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف " -"نظر کنید." +"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " +"صرف نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that should " -"have immediate parallels in other languages. The more advanced parts of Rust come " -"on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that " +"should have immediate parallels in other languages. The more advanced parts " +"of Rust come on the subsequent days." msgstr "" "ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " -"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." +"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " +"شوند." #: src/welcome-day-1.md msgid "" "If you're teaching this in a classroom, this is a good place to go over the " -"schedule. Note that there is an exercise at the end of each segment, followed by " -"a break. Plan to cover the exercise solution after the break. The times listed " -"here are a suggestion in order to keep the course on schedule. Feel free to be " -"flexible and adjust as necessary!" +"schedule. Note that there is an exercise at the end of each segment, " +"followed by a break. Plan to cover the exercise solution after the break. " +"The times listed here are a suggestion in order to keep the course on " +"schedule. Feel free to be flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه " -"داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن " -"محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد " -"برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم " -"کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " +"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " +"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " +"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " +"باشید و در صورت لزوم تنظیم کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" @@ -2647,44 +2706,46 @@ msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شام #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md -#: src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md src/testing.md -#: src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md -#: src/concurrency/channels.md src/concurrency/send-sync.md -#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md -#: src/concurrency/async.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/concurrency/sync-exercises.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" #: src/hello-world.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md -#: src/borrowing.md src/lifetimes.md src/modules.md src/unsafe-rust.md -#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015](https://" -"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://" -"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" -"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ " -"دارد." +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2695,8 +2756,8 @@ msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/" -"platform-support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" +"rustc/platform-support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2743,7 +2804,8 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "Can be scaled down to very constrained devices such as microcontrollers." +msgid "" +"Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2763,7 +2825,8 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" +"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " +"می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2798,8 +2861,8 @@ msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص " -"باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " +"نامشخص باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2811,8 +2874,10 @@ msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wr #: src/hello-world/benefits.md msgid "" -"_Modern language features_ - as expressive and ergonomic as higher-level languages" -msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +"_Modern language features_ - as expressive and ergonomic as higher-level " +"languages" +msgstr "" +"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2848,93 +2913,98 @@ msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md msgid "" -"Do not spend much time here. All of these points will be covered in more depth " -"later." +"Do not spend much time here. All of these points will be covered in more " +"depth later." msgstr "" -"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." +"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " +"خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. Depending " -"on the answer you can highlight different features of Rust:" +"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/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via " -"the borrow checker. You get performance like in C and C++, but you don't have the " -"memory unsafety issues. In addition, you get a modern language with constructs " -"like pattern matching and built-in dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " +"via the borrow checker. You get performance like in C and C++, but you don't " +"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++ را دارید اما " -"مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن با ساختارهایی " -"مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " +"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " +"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory safety " -"as in those languages, plus a similar high-level language feeling. In 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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory " +"safety as in those languages, plus a similar high-level language feeling. In " +"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++ (بدون جمع‌آوری زباله) و " -"همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن " +"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " +"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " +"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " +"می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run " -"short Rust programs, and is the basis for the examples and exercises in this " -"course. Try running the \"hello-world\" program it starts with. It comes with a " -"few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " +"run short Rust programs, and is the basis for the examples and exercises in " +"this course. Try running the \"hello-world\" program it starts with. It " +"comes with a few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های " -"Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه " -"\"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " +"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " +"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " +"مفید است:" #: src/hello-world/playground.md msgid "" -"Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" " -"way." +"Under \"Tools\", use the `rustfmt` option to format your code in the " +"\"standard\" way." msgstr "" "در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " "\"استاندارد\" استفاده کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, " -"less optimization) and Release (fewer runtime checks, lots of optimization). " -"These are accessible under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime " +"checks, less optimization) and Release (fewer runtime checks, lots of " +"optimization). These are accessible under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، " -"بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در " -"قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " +"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " +"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." #: src/hello-world/playground.md msgid "" -"If you're interested, use \"ASM\" under \"...\" to see the generated assembly " -"code." +"If you're interested, use \"ASM\" under \"...\" to see the generated " +"assembly code." msgstr "" "اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " "استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground and " -"experiment a little. Encourage them to keep the tab open and try things out " -"during the rest of the course. This is particularly helpful for advanced students " -"who want to know more about Rust's optimizations or generated assembly." +"As students head into the break, encourage them to open up the playground " +"and experiment a little. Encourage them to keep the tab open and try things " +"out during the rest of the course. This is particularly helpful for advanced " +"students who want to know more about Rust's optimizations or generated " +"assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground " -"را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در " -"بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند " -"درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " +"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " +"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " +"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " +"بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" @@ -2945,7 +3015,8 @@ msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " +"بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -2962,7 +3033,8 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " +"می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -2971,30 +3043,32 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه " -"از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک " +"نمونه از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " +"باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will see a " -"ton of it over the next four days so we start small with something familiar." +"This slide tries to make the students comfortable with Rust code. They will " +"see a ton of it over the next four days so we start small with something " +"familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده " -"خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " +"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری " -"باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه " +"کاملاً ضروری باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -3012,34 +3086,36 @@ msgstr "" #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers from " -"the scope they are used in. Rust macros are actually only [partially hygienic]" -"(https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers " +"from the scope they are used in. Rust macros are actually only [partially " +"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." +"html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را " -"از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا " -"حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html " -"هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " +"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented programming " -"features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented " +"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " +"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) است." +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " +"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم " +"فانکشنال](https://doc.rust-lang.org/book/ch13-00-functional-features.html) " +"است." #: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض " -"تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " +"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -3056,27 +3132,29 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by default. " -"Add the `mut` keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by " +"default. Add the `mut` keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را " -"حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " +"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile time, " -"but type inference (covered later) allows the programmer to omit it in many cases." +"The `i32` here is the type of the variable. This must be known at compile " +"time, but type inference (covered later) allows the programmer to omit it in " +"many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج " -"نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد " -"آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " +"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " +"بسیاری از موارد آن را حذف کند." #: src/types-and-values/values.md msgid "" -"Here are some basic built-in types, and the syntax for literal values of each " -"type." +"Here are some basic built-in types, and the syntax for literal values of " +"each type." msgstr "" -"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." +"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " +"است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3125,8 +3203,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, " -"2_f32" +"3.14, -10.0e20, 2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3179,13 +3257,13 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " -"`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written as " -"`123i64`." +"`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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3193,13 +3271,13 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the meaning " -"should be clear: it takes three integers, and returns an integer. Functions will " -"be covered in more detail later." +"This is the first time we've seen a function other than `main`, but the " +"meaning should be clear: it takes three integers, and returns an integer. " +"Functions will be covered in more detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: " -"سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش " -"داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " +"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " +"بیشتر پوشش داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3209,31 +3287,33 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do unknown things at runtime. In Rust, it's defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's " +"defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف " -"نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام " -"دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " +"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " +"مختلف انجام دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in " -"a debug build and wraps in a release build. There are other options, such as " -"overflowing, saturating, and carrying. These are accessed with method syntax, e." -"g., `(a * b).saturating_add(b * c).saturating_add(c * a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics " +"(checked) in a debug build and wraps in a release build. There are other " +"options, such as overflowing, saturating, and carrying. These are accessed " +"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " +"a)`." msgstr "" "«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " -"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری " -"مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان " -"مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." +"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " +"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " +"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is why " -"the example requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is " +"why the example requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به " -"یک تابع جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " +"مثال به یک تابع جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3241,34 +3321,35 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on constraints " -"given by variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on " +"constraints given by variable declarations and usages." msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not of " -"some sort of dynamic \"any type\" that can hold any data. The machine code " -"generated by such declaration is identical to the explicit declaration of a type. " -"The compiler does the job for us and helps us write more concise code." +"It is very important to emphasize that variables declared like this are not " +"of some sort of dynamic \"any type\" that can hold any data. The machine " +"code generated by such declaration is identical to the explicit declaration " +"of a type. The compiler does the job for us and helps us write more concise " +"code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده " -"پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** " -"استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و " -"کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین تایپ ضمنی میتوانید " -"کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " +"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " +"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " +"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " +"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to `i32`. " -"This sometimes appears as `{integer}` in error messages. Similarly, floating-" -"point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to " +"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " +"floating-point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» " -"قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به " -"طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " +"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " +"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3276,19 +3357,20 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is " -"calculated recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی " -"به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " +"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will " -"this function panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " +"will this function panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic " -"می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " +"panic می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3325,11 +3407,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-expressions) exactly like `if` statements in other languages:" +"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) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3345,11 +3427,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each block " -"becomes the value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " +"هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3365,28 +3447,30 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its branch " -"blocks must have the same type. Show what happens if you add `;` after " -"`\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its " +"branch blocks must have the same type. Show what happens if you add `;` " +"after `\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و " -"`else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` " -"در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " +"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " +"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. For " -"example, when it is used in a `let` statement, the statement must be terminated " -"with a `;` as well. Remove the `;` before `println!` to see the compiler error." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از " -"عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را " -"ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " +"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " +"کامپایلر را ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "" +"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3394,12 +3478,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr." -"html#predicate-loops) works much like in other languages, executing the loop body " -"as long as the condition is true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) works much like in other languages, executing the " +"loop body as long as the condition is true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr." -"html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3407,8 +3491,8 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over " -"ranges of values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " +"over ranges of values or the items in a collection:" msgstr "" "حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " "مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" @@ -3419,30 +3503,30 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle iterating " -"over different kinds of ranges/collections. Iterators will be discussed in more " -"detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle " +"iterating over different kinds of ranges/collections. Iterators will be " +"discussed in more detail later." msgstr "" "حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " -"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار " -"خواهند گرفت." +"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " +"قرار خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک " -"محدوده فراگیر نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " +"یک محدوده فراگیر نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که " -"یک «break» ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " +"زمانی که یک «break» ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3450,21 +3534,23 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://doc." -"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +"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) استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc." +"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " +"استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions). With `loop`, this " -"can take an optional expression that becomes the value of the `loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " +"`loop`, this can take an optional expression that becomes the value of the " +"`loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md @@ -3478,21 +3564,22 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-trivial " -"value. This is because it's guaranteed to only return at a `break` statement " -"(unlike `while` and `for` loops, which can also return when the condition fails)." +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را " -"برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف " -"حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " +"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " +"(برخلاف حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is used to " -"break out of nested loops:" +"Both `continue` and `break` can optionally take a label argument which is " +"used to break out of nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب " -"(label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " +"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3504,11 +3591,12 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each " -"block has a value and a type, which are those of the last expression of the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " +"Each block has a value and a type, which are those of the last expression of " +"the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. " -"هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " +"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" @@ -3516,17 +3604,18 @@ msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"If the last expression ends with `;`, then the resulting value and type is `()`." +"If the last expression ends with `;`, then the resulting value and type is " +"`()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر " +"می‌کند. به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید " +"واژه `return` تغییرات را اعمال کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." @@ -3534,11 +3623,11 @@ msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محا #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"You can shadow variables, both those from outer scopes and variables from the " -"same scope:" +"You can shadow variables, both those from outer scopes and variables from " +"the same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم " -"متغیرهایی که از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " +"هم متغیرهایی که از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3563,22 +3652,22 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block in the " -"last example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block " +"in the last example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در " -"خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " +"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both variables' " -"memory locations exist at the same time. Both are available under the same name, " -"depending where you use it in the code." +"Shadowing is different from mutation, because after shadowing both " +"variables' memory locations exist at the same time. Both are available under " +"the same name, depending where you use it in the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور " -"همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد " -"استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " +"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " +"کد استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3594,21 +3683,22 @@ msgstr "" #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some programming " -"languages), then a return type." +"Declaration parameters are followed by a type (the reverse of some " +"programming languages), then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی " -"از زبان‌های برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " +"برخی از زبان‌های برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return value. " -"Simply omit the `;` at the end of the expression. The `return` keyword can be " -"used for early return, but the \"bare value\" form is idiomatic at the end of a " -"function (refactor `gcd` to use a `return`)." +"The last expression in a function body (or any block) becomes the return " +"value. Simply omit the `;` at the end of the expression. The `return` " +"keyword can be used for early return, but the \"bare value\" form is " +"idiomatic at the end of a function (refactor `gcd` to use a `return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته " -"می‌شود. به همین سادگی `;` را میتوان در انتهای عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " +"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " +"عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy @@ -3616,55 +3706,56 @@ 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/control-flow-basics/functions.md -msgid "Overloading is not supported -- each function has a single implementation." +msgid "" +"Overloading is not supported -- each function has a single implementation." msgstr "" "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not supported. " -"Macros can be used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not " +"supported. Macros can be used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. " -"ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " +"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, which " -"will be covered later." +"Always takes a single set of parameter types. These types can be generic, " +"which will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a variable " -"number of arguments. They are distinguished by a `!` at the end. The Rust " -"standard library includes an assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a " +"variable number of arguments. They are distinguished by a `!` at the end. " +"The Rust standard library includes an assortment of useful macros." msgstr "" "ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " -"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد " -"Rust شامل مجموعه ای از ماکروهای مفید است." +"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " +"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح " -"داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال " -"می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " +"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " +"را اعمال می کند. ." #: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک " -"رشته برمی گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " +"یک رشته برمی گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." @@ -3672,17 +3763,19 @@ msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن ر #: src/control-flow-basics/macros.md msgid "" -"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." +"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " +"panic." msgstr "" -"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می " -"کند." +"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " +"panic می کند." #: src/control-flow-basics/macros.md msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." +"`unreachable!()` marks a bit of code as unreachable. If executed, it will " +"panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود " -"وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " +"اعدام شود وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3690,21 +3783,21 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and how " -"to use them. Why they are defined as macros, and what they expand to, is not " -"especially critical." +"The takeaway from this section is that these common conveniences exist, and " +"how to use them. Why they are defined as macros, and what they expand to, is " +"not especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. " -"اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار " -"مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " +"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " +"یابند، بسیار مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe use " -"of derive macros." +"The course does not cover defining macros, but a later section will describe " +"use of derive macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده " -"توضیح داده خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " +"مشتق شده توضیح داده خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy @@ -3712,22 +3805,27 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر " -"تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " +"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "If _ni_ is 1, then the sequence terminates at _ni_." +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " +"می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "" +"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " +"+ ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3790,8 +3888,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 35 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " +"آن شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3799,26 +3897,27 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements " -"of the same type `T`. Note that the length of the array is _part of its type_, " -"which means that `[u8; 3]` and `[u8; 4]` are considered two different types. " -"Slices, which have a size determined at runtime, are covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) " +"elements of the same type `T`. Note that the length of the array is _part of " +"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " +"different types. Slices, which have a size determined at runtime, are " +"covered later." msgstr "" "یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` است. " -"توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر " -"گرفته می‌شوند." +"span> (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " +"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " +"نظر گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be avoided " -"using unsafe Rust." +"runtime. Rust can usually optimize these checks away, and they can be " +"avoided using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در " -"زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با " -"استفاده از Rust ناایمن از آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " +"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " +"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3827,23 +3926,25 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. Types " -"such as integers and strings implement the default output, but arrays only " -"implement the debug output. This means that we must use debug output here." -msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` " -"نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، " -"`{:?}` خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و " -"رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها فقط خروجی دیباگ را پیاده " -"سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی دیباگ استفاده کنیم." +"parameter: `{}` gives the default output, `{:?}` gives the debug output. " +"Types such as integers and strings implement the default output, but arrays " +"only implement the debug output. This means that we must use debug output " +"here." +msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " +"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " +"خروجی دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت " -"«چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک " +"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3855,16 +3956,16 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, e.g. " -"`t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " +"`t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of " -"a return value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies " +"absence of a return value, akin to `void` in other languages." msgstr "" "تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " "بازگشتی است، مشابه `void` در زبان‌های دیگر." @@ -3875,20 +3976,22 @@ msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه ت #: src/tuples-and-arrays/iteration.md msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered that yet." +"This functionality uses the `IntoIterator` trait, but we haven't covered " +"that yet." msgstr "" -"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." +"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " +"پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` " -"macros. These are always checked, while debug-only variants like `debug_assert!` " -"compile to nothing in release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" +"` macros. These are always checked, while debug-only variants like " +"`debug_assert!` compile to nothing in release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` " -"وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند " -"`debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" +"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " +"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -3896,9 +3999,9 @@ msgid "" "extract the inner values into local variables. This can be done manually by " "directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی " -"را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به " -"مقادیر داخلی انجام داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " +"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " +"دسترسی مستقیم به مقادیر داخلی انجام داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -3906,46 +4009,47 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger value " -"into its constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger " +"value into its constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در " -"بخش های تشکیل دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " +"در بخش های تشکیل دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " -"statically verify that the value on the right of `=` has the same structure as " -"the pattern." +"statically verify that the value on the right of `=` has the same structure " +"as the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می " -"تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " +"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " +"دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, hence " -"why we can also use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, " +"hence why we can also use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو " -"می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " +"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " -"comparison and destructuring to happen at the same time. This form of pattern " -"matching will be discussed in more detail later." +"comparison and destructuring to happen at the same time. This form of " +"pattern matching will be discussed in more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و " -"تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات " -"بیشتری مورد بحث قرار خواهد گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " +"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " +"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't match " -"the value being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't " +"match the value being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده " -"مطابقت ندارد نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " +"مطابقت‌شده مطابقت ندارد نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -3965,11 +4069,11 @@ msgstr "" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the function. " -"This function only operates on 3x3 matrices." +"Copy the code below to and implement the " +"function. This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و توابع " -"را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md @@ -4000,22 +4104,23 @@ msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن ش #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership of " -"the value, and is also called \"borrowing\". Shared references are read-only, and " -"the referenced data cannot change." +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن " -"«قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند " -"تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " +"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " +"نمی توانند تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made with " -"the `&` operator. The `*` operator \"dereferences\" a reference, yielding its " -"value." +"A shared reference to a type `T` has type `&T`. A reference value is made " +"with the `&` operator. The `*` operator \"dereferences\" a reference, " +"yielding its value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته " -"می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " +"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " +"دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -4025,107 +4130,114 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The course " -"will get into more detail on ownership in day 3." +"access the value, but is still \"owned\" by the original variable. The " +"course will get into more detail on ownership in day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و " -"این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع " -"برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در " -"روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " +"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " +"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " +"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can be " -"much smaller than the thing they point to. Students familiar with C or C++ will " -"recognize references as pointers. Later parts of the course will cover how Rust " -"prevents the memory-safety bugs that come from using raw pointers." +"References are implemented as pointers, and a key advantage is that they can " +"be much smaller than the thing they point to. Students familiar with C or C+" +"+ will recognize references as pointers. Later parts of the course will " +"cover how Rust prevents the memory-safety bugs that come from using raw " +"pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند " -"بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ " -"آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این " -"موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از استفاده از نشانگرهای " -"خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " +"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " +"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " +"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " +"استفاده از نشانگرهای خام جلوگیری می‌کند." #: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." -msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgstr "" +"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking methods " -"(try `r.is_ascii()`). There is no need for an `->` operator like in C++." +"Rust will auto-dereference in some cases, in particular when invoking " +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها " -"(`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " +"متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note " -"that this re-binds `r`, so that it refers to something else. This is different " -"from C++, where assignment to a reference changes the referenced value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " +"Note that this re-binds `r`, so that it refers to something else. This is " +"different from C++, where assignment to a reference changes the referenced " +"value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه " -"داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می " -"کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " +"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " +"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " +"تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if that " -"value was mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if " +"that value was mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن " -"مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " +"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long enough. " -"Dangling references cannot occur in safe Rust. `x_axis` would return a reference " -"to `point`, but `point` will be deallocated when the function returns, so this " -"will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long " +"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " +"a reference to `point`, but `point` will be deallocated when the function " +"returns, so this will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه " -"کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک " -"ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، " -"بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " +"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " +"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " +"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " +"خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the value " -"they refer to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the " +"value they refer to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند " -"مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " +"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the value. No " -"other references (shared or exclusive) can exist at the same time, and the " -"referenced value cannot be accessed while the exclusive reference exists. Try " -"making an `&point.0` or changing `point.0` while `x_coord` is alive." +"\"Exclusive\" means that only this reference can be used to access the " +"value. No other references (shared or exclusive) can exist at the same time, " +"and the referenced value cannot be accessed while the exclusive reference " +"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " +"alive." msgstr "" "\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " -"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود " -"داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده " -"دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا `point.0` را تغییر " -"دهید." +"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " +"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " +"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " +"`point.0` را تغییر دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: " -"&mut i32`. The first one represents a shared reference which can be bound to " -"different values, while the second represents an exclusive reference to a mutable " -"value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let " +"x_coord: &mut i32`. The first one represents a shared reference which can be " +"bound to different values, while the second represents an exclusive " +"reference to a mutable value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. " -"مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در " -"حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " +"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " +"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -4138,13 +4250,13 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` " -"تغییر دهید چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending indexes " -"in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending " +"indexes in brackets." msgstr "" "ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " "براکت‌ها، برش (slice) ایجاد می‌کنیم." @@ -4152,59 +4264,62 @@ msgstr "" #: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are identical." +"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/references/slices.md 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/references/slices.md -msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." +msgid "" +"To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " "استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) " -"no longer mentions the array length. This allows us to perform computation on " -"slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " +"(`&[i32]`) no longer mentions the array length. This allows us to perform " +"computation on slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. " -"این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " +"`s` (`&[i32]`) دیگر طول آرایه را " +"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " +"انجام دهیم." #: src/references/slices.md 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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but the " -"answer is that for memory safety reasons you cannot do it through `a` at this " -"point in the execution, but you can read the data from both `a` and `s` safely. " -"It works before you created the slice, and again after the `println`, when the " -"slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but " +"the answer is that for memory safety reasons you cannot do it through `a` at " +"this point in the execution, but you can read the data from both `a` and `s` " +"safely. It works before you created the slice, and again after the " +"`println`, when the slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، " -"اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر " -"دو `a` و `s` به طور ایمن بخوانید. این " -"کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، " -"زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow " -"checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " +"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " +"داده‌ها را از هر دو `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -4216,7 +4331,8 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4242,31 +4358,31 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello\"`), " -"are stored in the program’s binary." +"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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, " -"it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a " +"`Vec`, it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. " -"مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " +"بایت‌هاست. مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string literal; " -"`String::new()` creates a new empty string, to which string data can be added " -"using the `push()` and `push_str()` methods." +"As with many other types `String::from()` creates a string from a string " +"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()` که رشته خالی جدید " -"ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `String::from()` یک رشته از " +"یک لیترال رشته ایجاد می‌کند. `String::new()` که رشته " +"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md @@ -4274,9 +4390,9 @@ 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!()` یک راه راحت برای ایجاد یک رشته Owned از " -"مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` " -"است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned " +"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"()` است." #: src/references/strings.md msgid "" @@ -4285,60 +4401,63 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. " -"اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. " -"تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای " -"کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " +"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " +"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " +"درست کردن مرزهای کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one " -"that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain UTF-8 " -"encoded bytes and will never use a small-string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " +"one that always points to a valid string in memory. Rust `String` is a rough " +"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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` " -"ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n\" " -"== \"\\\\n\"`. You can embed double-quotes by using an equal amount of `#` on " -"either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`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\"`.شما " -"می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را " -"جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " +"== \"\\\\n\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " +"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, representing a " -"point as `[f64;3]`. It is up to you to determine the function signatures." +"We will create a few utility functions for 3-dimensional geometry, " +"representing a point as `[f64;3]`. It is up to you to determine the function " +"signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان " -"`[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " +"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the square\n" +"// Calculate the magnitude of a vector by summing the squares of its " +"coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the " +"square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v." -"sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " +"`v.sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4370,7 +4489,8 @@ msgstr "/// اندازه‌ی بردار داده شده را محاسبه کن #: src/references/solution.md msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its direction.\n" +"/// Change the magnitude of the vector to 1.0 without changing its " +"direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4417,43 +4537,46 @@ msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری #: src/user-defined-types/named-structs.md msgid "" -"This may be a good time to let people know there are different types of structs." +"This may be a good time to let people know there are different types of " +"structs." msgstr "" -"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " +"دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait " -"on some type but don’t have any data that you want to store in the value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " +"trait on some type but don’t have any data that you want to store in the " +"value itself." msgstr "" "ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " -"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که " -"بخواهید در خود مقدار ذخیره کنید." +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " +"که بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md msgid "" -"The next slide will introduce Tuple structs, used when the field names are not " -"important." +"The next slide will introduce Tuple structs, used when the field names are " +"not important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده " -"می‌شوند که نام فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " +"استفاده می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک " -"روش میانبر ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " +"یک روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the old " -"struct without having to explicitly type it all out. It must always be the last " -"element." +"The syntax `..avery` allows us to copy the majority of the fields from the " +"old struct without having to explicitly type it all out. It must always be " +"the last element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم " -"بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " +"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" @@ -4481,11 +4604,11 @@ msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in a " -"primitive type, for example:" +"Newtypes are a great way to encode additional information about the value in " +"a primitive type, for example:" msgstr "" -"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع اولیه " -"(primitive type) است، به عنوان مثال:" +"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " +"اولیه (primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." @@ -4493,20 +4616,20 @@ msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have to " -"validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have " +"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single " -"field in the newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " +"single field in the newtype." msgstr "" #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for " -"instance using booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " +"for instance using booleans as integers." msgstr "" "Rust معمولاً چیزهای غیر واضح را دوست ندارد، مانند automatic unwrapping یا " "به‌عنوان‌مثال استفاده از booleanها به عنوان اعداد صحیح." @@ -4526,7 +4649,8 @@ msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" -"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " +"است:" #: src/user-defined-types/enums.md #, fuzzy @@ -4550,8 +4674,8 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک " -"نوع جمع آوری کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " +"تحت یک نوع جمع آوری کنید." #: src/user-defined-types/enums.md msgid "" @@ -4563,9 +4687,9 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, Rust " -"will store a discriminant so that it knows at runtime which variant is in a " -"`PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, " +"Rust will store a discriminant so that it knows at runtime which variant is " +"in a `PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4574,24 +4698,26 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one with " -"different types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " +"مختلف فیلد (variant payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate structs " -"but then they wouldn’t be the same type as they would if they were all defined in " -"an enum." +"You could even implement the different variants of an enum with separate " +"structs but then they wouldn’t be the same type as they would if they were " +"all defined in an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، " -"اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " +"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " +"نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." +msgstr "" +"Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" @@ -4599,24 +4725,26 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use invalid " -"bit patterns to encode the discriminant (the \"niche optimization\"). For " -"example, `Option<&u8>` stores either a pointer to an integer or `NULL` for the " -"`None` variant." +"If the allowed variant values do not cover all bit patterns, it will use " +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" #: src/user-defined-types/enums.md -msgid "You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "" +"You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را " -"کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " +"را کنترل کنید:" #: src/user-defined-types/enums.md msgid "" -"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." +"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " +"bytes." msgstr "" -"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا " -"می‌شود." +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " +"بایت جا می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md @@ -4627,30 +4755,31 @@ msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md msgid "" -"Rust has several optimizations it can employ to make enums take up less space." +"Rust has several optimizations it can employ to make enums take up less " +"space." msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" -"#representation), Rust guarantees that `size_of::()` equals `size_of::" -">()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" +"option/#representation), Rust guarantees that `size_of::()` equals " +"`size_of::>()`." msgstr "" "بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::>()` است." +"dir=ltr>`size_of::()` برابر با `size_of::" +">()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look like " -"in practice. It's important to note that the compiler provides no guarantees " -"regarding this representation, therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look " +"like in practice. It's important to note that the compiler provides no " +"guarantees regarding this representation, therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر " -"برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، " -"بنابراین این کاملاً ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " +"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " +"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4659,43 +4788,44 @@ msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined wherever " -"they are used:" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده " -"می شوند، درج می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" -"static.html) these are inlined upon use." +"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)، " -"این موارد هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html)، این موارد هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate `const` " -"values. `const` functions can however be called at runtime." +"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` را می توان در زمان اجرا " -"فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای " +"تولید مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در " +"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` " -"عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but it is " -"helpful and safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا " +"ارزیابی می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده " +"`static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4706,7 +4836,8 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " +"نمی‌شوند:" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4719,29 +4850,30 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" -"static.html), these are not inlined upon use and have an actual associated memory " -"location. This is useful for unsafe and embedded code, and the variable lives " -"through the entirety of the program execution. When a globally-scoped value does " -"not have a reason to need object identity, `const` is generally preferred." +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html), these are not inlined upon use and have an actual " +"associated memory location. This is useful for unsafe and embedded code, and " +"the variable lives through the entirety of the program execution. When a " +"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` ترجیح داده می‌شود." +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان " +"حافظه واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل " +"اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " +"استفاده از `const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C++` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " +"`C++` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as required by " -"types with interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as " +"required by types with interior mutability such as `Mutex`." msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." @@ -4749,17 +4881,17 @@ msgstr "" #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be `Sync`. " -"Interior mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/" -"sync/struct.Mutex.html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be " +"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html), atomic or similar." 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) نگاه خواهیم کرد." +"`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html)، اتمی یا مشابه امکان پذیر است. البته که " +"داشتن متغییر های استاتیک قابل تغییر هم امکان پذیر هست اما برای این کار نیاز " +"به همگام سازی دستی دارند. بنابراین هر دسترسی به آنها نیاز به کد `unsafe` " +"دارد. ما در فصل Unsafe Rust به استاتیک های قابل تغییر [mutable statics](../" +"unsafe/mutable-static-variables.md) نگاه خواهیم کرد." #: src/user-defined-types/static.md #, fuzzy @@ -4786,27 +4918,30 @@ msgstr "برنامه‌نویسان C این را شبیه به `typedef` تشخ #: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " -"system. It is up to you to define the types and functions to construct various " -"events. Use `#[derive(Debug)]` to allow the types to be formatted with `{:?}`." +"system. It is up to you to define the types and functions to construct " +"various events. Use `#[derive(Debug)]` to allow the types to be formatted " +"with `{:?}`." msgstr "" -"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد خواهیم " -"کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای مختلف تعریف " -"کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با `{:?}` قالببندی " -"شوند." +"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد " +"خواهیم کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای " +"مختلف تعریف کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با " +"`{:?}` قالببندی شوند." #: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " -"`main` runs without errors. The next part of the course will cover getting data " -"out of these structures." +"`main` runs without errors. The next part of the course will cover getting " +"data out of these structures." msgstr "" -"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا اجرا " -"شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." +"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا " +"اجرا شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy -msgid "/// An event in the elevator system that the controller must react to.\n" -msgstr "/// An event in the elevator system that the controller must react to.\n" +msgid "" +"/// An event in the elevator system that the controller must react to.\n" +msgstr "" +"/// An event in the elevator system that the controller must react to.\n" #: src/user-defined-types/exercise.md #, fuzzy @@ -4836,9 +4971,11 @@ msgstr "/// The car doors have closed.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy msgid "" -"/// A directional button was pressed in an elevator lobby on the given floor.\n" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" msgstr "" -"/// A directional button was pressed in an elevator lobby on the given floor.\n" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy @@ -4939,16 +5076,18 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "Standard library types and traits: a tour of Rust's rich standard library." -msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "" +"Standard library types and traits: a tour of Rust's rich standard library." +msgstr "" +"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این " -"شامل:" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " +"این شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md @@ -4957,8 +5096,8 @@ msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شا #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " "دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." @@ -4979,9 +5118,9 @@ msgstr "'q'" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md -#: src/std-traits/solution.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" msgstr "'a'" @@ -5025,42 +5164,44 @@ msgstr "\"یک چیز دیگر\"" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The expressions " -"_must_ be exhaustive, meaning that it covers every possibility, so `_` is often " -"used as the final catch-all case." +"The `_` pattern is a wildcard pattern which matches any value. The " +"expressions _must_ be exhaustive, meaning that it covers every possibility, " +"so `_` is often used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید " -"جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان " -"آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " +"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " +"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match " -"باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته " -"باشد. در مثال بالا، تایپ بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " +"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " +"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that can " -"be used within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that " +"can be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش " -"مطابقت استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " +"بخش مطابقت استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد " -"که شرط برقرار باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " +"باشد که شرط برقرار باشد." #: src/pattern-matching/match.md msgid "" -"You might point out how some specific characters are being used when in a pattern" -msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +"You might point out how some specific characters are being used when in a " +"pattern" +msgstr "" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -5081,28 +5222,29 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when we " -"wish to concisely express more complex ideas than patterns alone would allow." +"Match guards as a separate syntax feature are important and necessary when " +"we wish to concisely express more complex ideas than patterns alone would " +"allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و " -"ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. An " -"`if` expression inside of the branch block (after `=>`) happens after the 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." +"They are not the same as separate `if` expression inside of the match arm. " +"An `if` expression inside of the branch block (after `=>`) happens after the " +"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` " -"اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " +"عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md msgid "" -"The condition defined in the guard applies to every expression in a pattern with " -"an `|`." +"The condition defined in the guard applies to every expression in a pattern " +"with an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -5135,13 +5277,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to 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." +"The distinction between a capture and a constant expression can be hard to " +"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` تغییر دهید و خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -5149,12 +5291,13 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is how " -"you inspect the structure of your types. Let us start with a simple `enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is " +"how you inspect the structure of your types. Let us start with a simple " +"`enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده " -"شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع " -"ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " +"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " +"بیایید با یک نوع ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -5170,21 +5313,21 @@ msgstr "\"با عرض‌پوزش، خطایی رخ داده است: {msg}\"" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first arm, " -"`half` is bound to the value inside the `Ok` variant. In the second arm, `msg` is " -"bound to the error message." +"Here we have used the arms to _destructure_ the `Result` value. In the first " +"arm, `half` is bound to the value inside the `Ok` variant. In the second " +"arm, `msg` is bound to the error message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` " -"به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام " -"خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " +"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " +"`msg` به پیام خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md msgid "" -"The `if`/`else` expression is returning an enum that is later unpacked with a " -"`match`." +"The `if`/`else` expression is returning an enum that is later unpacked with " +"a `match`." msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از هم باز " -"می‌شود." +"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " +"هم باز می‌شود." #: src/pattern-matching/destructuring-enums.md msgid "" @@ -5192,47 +5335,50 @@ 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` اضافه کنید و نمایش خطاها " -"هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش " -"کامپایلر برای ارائه نکاتی به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش " +"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " +"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md msgid "" -"The values in the enum variants can only be accessed after being pattern matched." +"The values in the enum variants can only be accessed after being pattern " +"matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage the " -"Rust compiler provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage " +"the Rust compiler provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر " -"Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " +"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " +"شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it in a " -"loop. That won't compile because `msg` is consumed when matched. To fix it, match " -"`&result` instead of `result`. That will make `msg` a reference so it won't be " -"consumed. This [\"match ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-" -"ergonomics.html) appeared in Rust 2018. If you want to support older Rust, " -"replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با " -"استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف " -"می‌شود. برای رفع این مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث " -"می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. این ویژگی که به نام [\"match " -"ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) شناخته " -"می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی " -"کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it " +"in a loop. That won't compile because `msg` is consumed when matched. To fix " +"it, match `&result` instead of `result`. That will make `msg` a reference so " +"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." +"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " +"support older Rust, replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " +"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " +"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " +"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " +"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" +"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " +"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " +"msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. They " -"are used for pattern matching:" +"Rust has a few control flow constructs which differ from other languages. " +"They are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها " -"برای مطابقت الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " +"ساختارها برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5248,13 +5394,13 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-expr." -"html#if-let-expressions) lets you execute different code depending on whether a " -"value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" +"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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت " -"دارد، کدهای مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " +"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md #, fuzzy @@ -5263,15 +5409,15 @@ msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, use " -"[`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else." -"html). The \"else\" case must diverge (`return`, `break`, or panic - anything but " -"falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, " +"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" +"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"- anything but falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc." -"rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، " -"حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` - به غیر از " -"اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" +"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " +"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " +"- به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -5290,31 +5436,32 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md -#: src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md +#: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/reference/" -"expressions/loop-expr.html#predicate-pattern-loops) variant which repeatedly " -"tests a value against a pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" +"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) وجود دارد که مقادیر مقابل " -"الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر " +"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String." -"html#method.pop) returns `Some(c)` until the string is empty, after which it will " -"return `None`. The `while let` lets us keep iterating through all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) returns `Some(c)` until the string is empty, after " +"which it will return `None`. The `while let` lets us keep iterating through " +"all items." msgstr "" "در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و " -"پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد " -"که به طور مداوم از میان همه موارد عبور کنیم." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " +"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " +"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -5322,24 +5469,25 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make it " -"more concise than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make " +"it more concise than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی " -"نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " +"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " +"کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" -"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` " -"است:" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " +"`Option` است:" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو " -"استفاده نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " +"الگو استفاده نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5347,13 +5495,14 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports flattening " -"this nested code. Rewrite the awkward version for students, so they can see the " -"transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports " +"flattening this nested code. Rewrite the awkward version for students, so " +"they can see the transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده " -"شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی " -"پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " +"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " +"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " +"مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5365,21 +5514,22 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value matches " -"the pattern." +"Point out that the `while let` loop will keep going as long as the value " +"matches the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته " -"باشد (شرط برقرار باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " +"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if statement " -"that breaks when there is no value to unwrap for `name.pop()`. The `while let` " -"provides syntactic sugar for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if " +"statement that breaks when there is no value to unwrap for `name.pop()`. The " +"`while let` provides syntactic sugar for the above scenario." msgstr "" "شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، " -"شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه می‌دهد." +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." +"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " +"می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5387,48 +5537,49 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later in " -"the course. An expression can be \"boxed\" with `Box::new` as seen in the tests. " -"To evaluate a boxed expression, use the deref operator (`*`) to \"unbox\" it: " -"`eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later " +"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " +"tests. To evaluate a boxed expression, use the deref operator (`*`) to " +"\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی " -"قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور " -"که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) " -"برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " +"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " +"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" "Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " -"type is an enum that represents either a successful value (`Ok(Value)`) or an " -"error (`Err(String)`). We will cover this type in detail later." +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) type is an enum that represents either a successful value " +"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " +"later." msgstr "" "برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " -"یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " "(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing `eval`. " -"The final product should pass the tests. It may be helpful to use `todo!()` and " -"get the tests to pass one-by-one. You can also skip a test temporarily with " -"`#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing " +"`eval`. The final product should pass the tests. It may be helpful to use " +"`todo!()` and get the tests to pass one-by-one. You can also skip a test " +"temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. " -"محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها " -"به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از " -"`[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " +"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " +"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " +"را با استفاده از `[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز " -"عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت " -"کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " +"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " +"panic مدیریت کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md #, fuzzy @@ -5460,11 +5611,11 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with an " -"`impl` block:" +"Rust allows you to associate functions with your new types. You do this with " +"an `impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار " -"را با استفاده از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " +"کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md #, fuzzy @@ -5508,39 +5659,39 @@ msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts on. " -"There are several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts " +"on. There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. " -"چندین گیرنده رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " +"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض " -"می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " +"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر " -"قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان " -"برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " +"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " +"به پایان برسد." #: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " -"method becomes the owner of the object. The object will be dropped (deallocated) " -"when the method returns, unless its ownership is explicitly transmitted. Complete " -"ownership does not automatically mean mutability." +"method becomes the owner of the object. The object will be dropped " +"(deallocated) when the method returns, unless its ownership is explicitly " +"transmitted. Complete ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک " -"شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور " -"صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " +"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " +"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5548,8 +5699,8 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to create " -"constructors which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to " +"create constructors which are called `new` by convention." msgstr "" "بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " "سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." @@ -5560,21 +5711,21 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the first " -"parameter represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the " +"first parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر " -"اول نمونه را به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " +"پارامتر اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver syntax " -"and to help keep them more organized. By using methods we can keep all the " -"implementation code in one predictable place." +"Developers may choose to use methods to take advantage of method receiver " +"syntax and to help keep them more organized. By using methods we can keep " +"all the implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد " -"بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم " -"تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " +"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " +"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." @@ -5583,53 +5734,53 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how the " -"struct name could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how " +"the struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که " -"چگونه نام struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " +"دهید که چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and can " -"be used elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and " +"can be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار " -"دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " +"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to refer " -"to individual fields." +"Note how `self` is used like other structs and dot notation can be used to " +"refer to individual fields." msgstr "" "توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " "می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` by " -"trying to run `finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` " +"by trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش " -"برای اجرای متد `finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " +"تلاش برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) allowed to be receiver " -"types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://" +"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " +"receiver types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc.rust-" -"lang.org/reference/special-types-and-traits.html) نیز وجود دارند که به‌عنوان " -"تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that redundant?" +"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " +"redundant?" msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point Point`, but methods in this block " -"will only be available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this " +"block will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` " -"implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type " +"parameters. Here, `Foo::from(\"hello\")` would not compile because there is " +"no `From<&str>` implementation for `Foo`." msgstr "" "پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can " +"be arbitrary, like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه باشد، " -"مانند `() -> B` can return any type satisfying " -"`B`, and the caller may need to choose one, such as with `let x: Vec<_> = foo." -"collect()` or with the turbofish, `foo.collect::>()`." +"Inference is hard in return position. A function returning `impl Foo` picks " +"the concrete type it returns, without writing it out in the source. A " +"function returning a generic type like `collect() -> B` can return any " +"type satisfying `B`, and the caller may need to choose one, such as with " +"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" +">()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ " -"مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. " -"تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که " -"`B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از " -"آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` یا با استفاده از " -"()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " +"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " +"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " +"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " +"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " +"یا با استفاده از ()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the " -"error message shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " +"the error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید " -"پیام خطا چه چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " +"ببینید پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also supports " -"using them for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین " -"از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait " -"پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " +"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " +"اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -6225,82 +6386,87 @@ msgstr "// Uses type-erasure and dynamic dispatch.\n" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a specialized " -"instance of the function for each different type that the generic is instantiated " -"with. This means that calling a trait method from within a generic function still " -"uses static dispatch, as the compiler has full type information and can resolve " -"which type's trait implementation to use." +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از " -"تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست " -"که فراخوانی یک متد trait از درون یک تابع generic همچنان از فراخوانی استاتیک " -"استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و می‌تواند پیاده‌سازی trait " -"مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " +"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " +"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " +"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " +"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This " -"means that there's a single version of `fn dynamic` that is used regardless of " -"what type of `Pet` is passed in." -msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک " -"[virtual method table](https://en.wikipedia.org/wiki/Virtual_method_table) " -"(vtable) استفاده می‌کند. این بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد " -"که بدون توجه به تایپ `Pet` که وارد می‌شود، استفاده می‌شود." +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " +"This means that there's a single version of `fn dynamic` that is used " +"regardless of what type of `Pet` is passed in." +msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " +"یک [virtual method table](https://en.wikipedia.org/wiki/" +"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " +"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " +"استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, the trait object needs to be behind some kind of " -"indirection. In this case it's a reference, though smart pointer types like `Box` " -"can also be used (this will be demonstrated on day 3)." +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته " -"باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند " -"مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " +"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " +"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " +"سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two " -"pointers: One pointer points to the concrete object that implements `Pet`, and " -"the other points to the vtable for the trait implementation for that type. When " -"calling the `talk` method on `&dyn Pet` the compiler looks up the function " -"pointer for `talk` in the vtable and then invokes the function, passing the " -"pointer to the `Dog` or `Cat` into that function. The compiler doesn't need to " -"know the concrete type of the `Pet` in order to do this." -msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، " -"یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی " -"می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام " -"فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع `talk` را در vtable " -"جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به `Dog` یا `Cat` را به آن تابع " -"پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام این کار ندارد." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." +msgstr "" +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " +"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " +"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " +"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " +"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " +"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " +"`Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا " -"دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " +"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using the [`Ord`](https://doc.rust-lang.org/" -"stable/std/cmp/trait.Ord.html) trait." +"determines the minimum of two values, using the [`Ord`](https://doc.rust-" +"lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از " -"دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/" -"stable/std/cmp/trait.Ord.html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " +"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." +"rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md #, fuzzy msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "// TODO: implement the `min` function used in `main`.\n" -#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "'z'" @@ -6331,8 +6497,8 @@ msgid "" "Ordering.html) enum." msgstr "" "[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را " -"به دانش‌آموزان نشان دهید." +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " +"enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -6359,33 +6525,35 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از " -"متدهای رایج‌تر را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " +"از متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common types " -"used by Rust libraries and programs. This way, two libraries can work together " -"smoothly because they both use the same `String` type." +"Rust comes with a standard library which helps establish a set of common " +"types used by Rust libraries and programs. This way, two libraries can work " +"together smoothly because they both use the same `String` type." msgstr "" "Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه " -"می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " +"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " +"استفاده می‌کنند." #: src/std-types/std.md msgid "" -"In fact, Rust contains several layers of the Standard Library: `core`, `alloc` " -"and `std`." +"In fact, Rust contains several layers of the Standard Library: `core`, " +"`alloc` and `std`." msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " +"`std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on `libc`, " -"allocator or even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on " +"`libc`, allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی " -"وجود یک سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " +"حتی وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" @@ -6396,7 +6564,8 @@ msgstr "" "`Vec`، `Box` و `Arc`." #: src/std-types/std.md -msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgid "" +"Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " "می‌کنند." @@ -6415,21 +6584,21 @@ msgstr "" #: src/std-types/docs.md msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." -"html)." +"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." -"html)." +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." #: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" -"collections/struct.BinaryHeap.html)." +"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" +"std/collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" -"collections/struct.BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" +"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" +"stable/std/collections/struct.BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6438,11 +6607,13 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md #, fuzzy msgid "" -"/// Determine whether the first argument is divisible by the second argument.\n" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" -"/// Determine whether the first argument is divisible by the second argument.\n" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" @@ -6450,46 +6621,50 @@ msgstr "" msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is idiomatic to " -"document all public items in an API using this pattern." +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " +"idiomatic to document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust " -"به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند می‌شوند. مستند کردن " -"تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " +"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " +"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " +"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " +"رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!` or " -"`/*! .. */`, called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!" +"` or `/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/" -"* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " +"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md #, fuzzy msgid "" -"//! This module contains functionality relating to divisibility of integers.\n" +"//! This module contains functionality relating to divisibility of " +"integers.\n" msgstr "" -"//! This module contains functionality relating to divisibility of integers.\n" +"//! This module contains functionality relating to divisibility of " +"integers.\n" #: src/std-types/docs.md msgid "" -"Show students the generated docs for the `rand` crate at ." +"Show students the generated docs for the `rand` crate at ." msgstr "" -"مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان " -"نشان دهید." +"مستندات تولیدشده برای `rand` crate را در به " +"دانش‌آموزان نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of type " -"`T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/stable/" -"std/string/struct.String.html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of " +"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" +"stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in memory " -"as `T`." +"The niche optimization means that `Option` often has the same size in " +"memory as `T`." msgstr "" -"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، هرکدام " -"با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/string/" -"struct.String.html#deref-methods-str), which means that you can call all `str` " -"methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/" +"string/struct.String.html#deref-methods-str), which means that you can call " +"all `str` methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str) است، که به این معناست که می‌توانید " -"تمام متدهای `str` را بر روی `String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" +"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " +"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when you " -"know how much data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when " +"you know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده " -"کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " +"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be different " -"from its length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be " +"different from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول " -"آن به‌صورت کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " +"طول آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " -"`char` can be different from what a human will consider a \"character\" due to " -"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/" +"`char` can be different from what a human will consider a \"character\" due " +"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه " -"داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر " -"می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/unicode-" -"segmentation/latest/unicode_segmentation/struct.Graphemes.html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " +"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." +"html)." #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " +"باشد." #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it access to " -"`str`'s methods." +"`String` implements `Deref` which transparently gives it " +"access to `str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/struct." -"Vec.html#deref-methods-%5BT%5D), which means that you can call slice methods on a " -"`Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/" +"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " +"methods on a `Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را " -"بر روی یک `Vec` فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" +"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " +"متدهای برش را بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data it " -"contains is stored on the heap. This means the amount of data doesn't need to be " -"known at compile time. It can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data " +"it contains is stored on the heap. This means the amount of data doesn't " +"need to be known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap " -"ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و " -"می‌تواند در زمان اجرا رشد یا کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " +"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " +"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " -"explicitly. As always with Rust type inference, the `T` was established during " -"the first `push` call." +"explicitly. As always with Rust type inference, the `T` was established " +"during the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://doc." -"rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);" -"+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to easily " -"initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K," -"+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی " -"یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" +"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " +"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md msgid "" -"Alternatively HashMap can be built from any `Iterator` which yields key-value " -"tuples." +"Alternatively HashMap can be built from any `Iterator` which yields key-" +"value tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید " -"می‌کند، ساخته شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " +"تولید می‌کند، ساخته شود." #: src/std-types/hashmap.md msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, but it " -"can lead into complications with the borrow checker." +"examples easier. Using references in collections can, of course, be done, " +"but it can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " +"used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" "`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " "ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "" +"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, because " -"it is reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, " +"because it is reflexive:" msgstr "" "`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " "بازتابی است:" #: src/std-traits/comparisons.md msgid "" -"In practice, it's common to derive these traits, but uncommon to implement them." +"In practice, it's common to derive these traits, but uncommon to implement " +"them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها " -"به‌طور دستی پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " +"آن‌ها به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-" -"lang.org/std/ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc." +"rust-lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/" -"std/ops/index.html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." +"org/std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -7135,15 +7324,17 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "You could implement `Add` for `&Point`. In which situations is that useful?" +msgid "" +"You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " +"مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the " -"operator is not `Copy`, you should consider overloading the operator for `&T` as " -"well. This avoids unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " +"the operator is not `Copy`, you should consider overloading the operator for " +"`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" "پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " "بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " @@ -7154,21 +7345,22 @@ msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد " -"تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " +"متد تعریف کرد؟" #: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " -"associated types (like `Output`) are controlled by the implementer of a trait." +"associated types (like `Output`) are controlled by the implementer of a " +"trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های " -"مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " +"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for " -"Point` would add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, " +"i32)> for Point` would add a tuple to a `Point`." msgstr "" "شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." @@ -7176,26 +7368,27 @@ msgstr "" #: src/std-traits/operators.md #, fuzzy msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like " -"the same operator in C-family languages; instead, for integer types it negates " -"each bit of the number, which arithmetically is equivalent to subtracting it from " -"-1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." msgstr "" -"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در زبان‌های " -"خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، هر بیت از عدد " -"را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == -6` است." +"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در " +"زبان‌های خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، " +"هر بیت از عدد را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == " +"-6` است." #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " -"and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate " -"type conversions. Unlike `as`, these traits correspond to lossless, infallible " -"conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای " -"تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " +"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -7203,18 +7396,18 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically " -"implemented when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " -"is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " +"automatically implemented when [`From`](https://doc.rust-lang.org/std/" +"convert/trait.From.html) is implemented:" msgstr "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) پیاده‌سازی شده باشد:" +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" +"trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get `Into` " -"implementation too." +"That's why it is common to only implement `From`, as your type will get " +"`Into` implementation too." msgstr "" "به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " "پیاده‌سازی `Into` را نیز دریافت می‌کند." @@ -7222,19 +7415,19 @@ msgstr "" #: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " -"converted into a `String`\", the rule is opposite, you should use `Into`. Your " -"function will accept types that implement `From` and those that _only_ implement " -"`Into`." +"converted into a `String`\", the rule is opposite, you should use `Into`. " +"Your function will accept types that implement `From` and those that _only_ " +"implement `Into`." msgstr "" "هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول " -"می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی " -"کرده‌اند." +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " +"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " +"پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts with " -"`as`. These generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts " +"with `as`. These generally follow C semantics where those are defined." msgstr "" "Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " "می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." @@ -7253,39 +7446,42 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across platforms. " -"This might not match your intuition for changing sign or casting to a smaller " -"type -- check the docs, and comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across " +"platforms. This might not match your intuition for changing sign or casting " +"to a smaller type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. " -"این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته " -"باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " +"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " +"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and " -"can be a source of subtle bugs as future maintenance work changes the types that " -"are used or the ranges of values in types. Casts are best used only when the " -"intent is to indicate unconditional truncation (e.g. selecting the bottom 32 bits " -"of a `u64` with `as u32`, regardless of what was in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use " +"incorrectly, and can be a source of subtle bugs as future maintenance work " +"changes the types that are used or the ranges of values in types. Casts are " +"best used only when the intent is to indicate unconditional truncation (e.g. " +"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " +"was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان " -"است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث " -"تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها " -"زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط باشد (مثلاً انتخاب 32 " -"بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " +"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " +"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " +"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " +"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " +"بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over " -"`as` to confirm that the cast is in fact infallible. For fallible casts, " -"`TryFrom` and `TryInto` are available when you want to handle casts that fit " -"differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " +"over `as` to confirm that the cast is in fact infallible. For fallible " +"casts, `TryFrom` and `TryInto` are available when you want to handle casts " +"that fit differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` " -"بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با " -"احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که " -"به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " +"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " +"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " +"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " +"کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -7293,26 +7489,29 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might be " -"lost is generally discouraged, or at least deserves an explanatory comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might " +"be lost is generally discouraged, or at least deserves an explanatory " +"comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است " -"داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " +"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " +"دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " +"است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`]" -"(https://doc.rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` " -"sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " +"abstract over `u8` sources:" msgstr "" "با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی " -"منابع `u8` انتزاع کنید:" +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " +"بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -7328,11 +7527,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you " -"abstract over `u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " +"you abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما " -"امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " +"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -7351,8 +7550,8 @@ msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک " -"مقدار پیش‌فرض برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -7371,7 +7570,8 @@ msgstr "\" مقدار Y وارد شده است!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md +#: src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" @@ -7384,25 +7584,25 @@ msgstr "" #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to their " -"default values." +"A derived implementation will produce a value where all fields are set to " +"their default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض " -"خود تنظیم شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " +"پیش‌فرض خود تنظیم شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی " -"کنند." +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " +"پیاده‌سازی کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, " -"`\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. " +"`0`, `\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل " -"`0`، `\"\"` و غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " +"(مثل `0`، `\"\"` و غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -7413,30 +7613,31 @@ msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی " -"کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " +"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" -"update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" +"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" +"with-struct-update-syntax)." msgstr "" "سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" -"update-syntax) شناخته می‌شود." +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" +"struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, they " -"implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), " -"[`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`]" -"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها " -"پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`]" -"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " +"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" +"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." +"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " +"هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -7459,63 +7660,65 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be " -"called needing only a shared reference to the closure, which means the closure " -"can be executed repeatedly and even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " +"be called needing only a shared reference to the closure, which means the " +"closure can be executed repeatedly and even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر " -"می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار " -"فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " +"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " +"چندین بار فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object " -"is accessed via exclusive reference, so it can be called repeatedly but not " -"concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما " -"می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " +"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing " -"so consumes the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " +"Doing so consumes the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار " -"فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " +"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. " -"you can use an `FnMut` wherever an `FnOnce` is called for, and you can use an " -"`Fn` wherever an `FnMut` or `FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` " -"است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید " -"و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " +"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " +"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " +"کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if you " -"can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most " -"flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده " -"کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از " -"`FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای " -"فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " +"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " +"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " +"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then `FnMut`, " -"and lastly `FnOnce`." +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید " -"`Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " +"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " +"`FnOnce`." #: src/std-traits/closures.md #, fuzzy @@ -7529,13 +7732,15 @@ msgstr "" #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the least " -"demanding form of access they can (by shared reference if possible, then " -"exclusive reference, then by move). The `move` keyword forces capture by value." +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." msgstr "" -"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با کمترین " -"سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس با انتقال) " -"capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت value اجباری می‌کند." +"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با " +"کمترین سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس " +"با انتقال) capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت " +"value اجباری می‌کند." #: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" @@ -7551,15 +7756,15 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://en." -"wikipedia.org/wiki/ROT13). Copy this code to the playground, and implement the " -"missing bits. Only rotate ASCII alphabetic characters, to ensure the result is " -"still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://" +"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " +"implement the missing bits. Only rotate ASCII alphabetic characters, to " +"ensure the result is still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/" -"wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و " -"بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه " -"همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." +"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " +"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " +"تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7575,11 +7780,11 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating by " -"13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating " +"by 13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ " -"کاراکتر را بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " +"۱۳ کاراکتر را بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7595,11 +7800,11 @@ msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md msgid "" -"Memory management, lifetimes, and the borrow checker: how Rust ensures memory " -"safety." +"Memory management, lifetimes, and the borrow checker: how Rust ensures " +"memory safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از " -"ایمنی حافظه اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " +"Rust از ایمنی حافظه اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7610,8 +7815,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. " -"این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " +"بکشد. این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7628,7 +7833,8 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "" -"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." +"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " +"می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7664,39 +7870,41 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized " -"data, the actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically " +"sized data, the actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، " -"یعنی رشته واقعی، را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " +"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول " -"است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " +"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " +"کند." #: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/struct." -"System.html) and custom allocators can be implemented using the [Allocator API]" -"(https://doc.rust-lang.org/std/alloc/index.html)" +"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" +"struct.System.html) and custom allocators can be implemented using the " +"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده " -"از [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر " -"روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator " -"API](https://doc.rust-lang.org/std/alloc/index.html) پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " +"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." +"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " +"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " +"پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should point " -"out that this is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should " +"point out that this is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با " -"این حال، باید اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " +"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7709,11 +7917,13 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7733,9 +7943,11 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "Programmer must determine whether a pointer still points to valid memory." +msgid "" +"Programmer must determine whether a pointer still points to valid memory." msgstr "" -"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." +"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " +"یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." @@ -7746,20 +7958,22 @@ msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" -"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." +"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " +"هسکل، ..." #: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع " -"داده شود، آزاد نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " +"ارجاع داده شود، آزاد نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "" +"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7777,78 +7991,80 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put Rust " -"in context." +"This slide is intended to help students coming from other languages to put " +"Rust in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را " -"در زمینه مناسب قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " +"را در زمینه مناسب قرار دهند." #: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " -"forgetting to call `free`, calling it multiple times for the same pointer, or " -"dereferencing a pointer after the memory it points to has been freed." +"forgetting to call `free`, calling it multiple times for the same pointer, " +"or dereferencing a pointer after the memory it points to has been freed." msgstr "" "C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " "خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " -"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره " -"می‌کند." +"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " +"اشاره می‌کند." #: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " -"advantage of language guarantees about calling destructors to ensure memory is " -"freed when a function returns. It is still quite easy to mis-use these tools and " -"create similar bugs to C." +"advantage of language guarantees about calling destructors to ensure memory " +"is freed when a function returns. It is still quite easy to mis-use these " +"tools and create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از " -"تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن " -"حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که " -"از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " +"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " +"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " +"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " +"ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that is no " -"longer reachable and discard it. This guarantees that any pointer can be " -"dereferenced, eliminating use-after-free and other classes of bugs. But, GC has a " -"runtime cost and is difficult to tune properly." +"Java, Go, and Python rely on the garbage collector to identify memory that " +"is no longer reachable and discard it. This guarantees that any pointer can " +"be dereferenced, eliminating use-after-free and other classes of bugs. But, " +"GC has a runtime cost and is difficult to tune properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای " -"که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر " -"اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از آزادسازی (use-" -"after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای در زمان اجرا دارد و " -"تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " +"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " +"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " +"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " +"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance of " -"C, with alloc and free operations precisely where they are required -- zero cost. " -"It also provides tools similar to C++'s smart pointers. When required, other " -"options such as reference counting are available, and there are even third-party " -"crates available to support runtime garbage collection (not covered in this " -"class)." +"Rust's ownership and borrowing model can, in many cases, get the performance " +"of C, with alloc and free operations precisely where they are required -- " +"zero cost. It also provides tools similar to C++'s smart pointers. When " +"required, other options such as reference counting are available, and there " +"are even third-party crates available to support runtime garbage collection " +"(not covered in this class)." msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد " -"عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه " -"صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم " -"می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در دسترس هستند و حتی " -"crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان اجرا موجود است (که در این " -"کلاس پوشش داده نمی‌شود)." +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " +"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " +"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" +"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " +"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " +"اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error to " -"use a variable outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error " +"to use a variable outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از " -"متغیر خارج از دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " +"از متغیر خارج از دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely one " -"owner at all times." +"We say that the variable _owns_ the value. Every Rust value has precisely " +"one owner at all times." msgstr "" -"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." +"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " +"دارد." #: src/memory-management/ownership.md msgid "" @@ -7861,12 +8077,12 @@ msgstr "" #: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " -"garbage collector starts with a set of \"roots\" to find all reachable memory. " -"Rust's \"single owner\" principle is a similar idea." +"garbage collector starts with a set of \"roots\" to find all reachable " +"memory. Rust's \"single owner\" principle is a similar idea." msgstr "" "دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " -"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی " -"شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." +"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " +"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -7887,7 +8103,8 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" -"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " +"نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -7950,8 +8167,8 @@ msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده " -"می‌شود. به این شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " +"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -7968,27 +8185,29 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` استفاده کنیم " -"( تا یک مقدار را جا به جا کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ " +"است که در ان مقدار کپی میشود مگر که از `std::move` " +"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated to " -"manipulate the data itself is a matter of optimization, and such copies are " -"aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated " +"to manipulate the data itself is a matter of optimization, and such copies " +"are aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود " -"داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی " -"(aggressively) بهینه‌سازی می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " +"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " +"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." #: src/memory-management/move.md -msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." +msgid "" +"Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" -"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " +"ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -8003,41 +8222,42 @@ 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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " +"از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the `say_hello` " -"function." +"The heap memory allocated for `name` will be freed at the end of the " +"`say_hello` function." msgstr "" -"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " +"خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and if " -"`say_hello` accepts a reference as a parameter." +"`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` یک مرجع را به عنوان " -"پارامتر باید بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع " +"(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " +"را به عنوان پارامتر باید بپذیرد." #: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع " -"ای که در نظر داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " +"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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++ است که سهوا کپی ایجاد کنیم, زیر به " -"صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که " -"لازم هست به صورت صریح کلون را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, " +"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " +"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -8059,14 +8279,14 @@ msgstr "// Duplicate the data in s1.\n" msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این " -"کپی به صورت مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " +"این کپی به صورت مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای " -"حافظه خود را آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " +"جداگانه‌ای حافظه خود را آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -8078,83 +8298,84 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, the " -"string data has to be cloned. Otherwise we would get a double-free when either " -"string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, " +"the string data has to be cloned. Otherwise we would get a double-free when " +"either string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده " -"است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، " -"هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد " -"حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " +"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " +"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " +"آزادسازی مجدد حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which " -"is used to indicate when a value may be moved from. If the example had been `s2 = " -"std::move(s1)`, no heap allocation would take place. After the move, `s1` would " -"be in a valid but unspecified state. Unlike Rust, the programmer is allowed to " -"keep using `s1`." +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " +"which is used to indicate when a value may be moved from. If the example had " +"been `s2 = std::move(s1)`, no heap allocation would take place. After the " +"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` استفاده کند." +"البته که زبان C++ دارای [`std::move`](https://en.cppreference.com/w/cpp/utility/move) است که برای انتقال " +"یک متغییر استفاده میشود. اگر مثال ما `s2 = std::move(s1)` بود هیچ تخصیص انباشتی صورت نمیگرفت بلکه `s1` در یک وضعیت معتبر البته " +"نامشخص قرار میگرفت و برخلاف زبان Rust, توی زبان C++ " +"برنامه‌نویس مجاز است که دوباره از `s1` استفاده کند." #: src/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is " -"being copied or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " +"which is being copied or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال " -"دادن استفاده شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " +"انتقال دادن استفاده شود." #: src/memory-management/clone.md msgid "" -"Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes " -"this." +"Sometimes you _want_ to make a copy of a value. The `Clone` trait " +"accomplishes this." msgstr "" -"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام " -"می‌دهد." +"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " +"انجام می‌دهد." #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " "occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال " -"`()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " +"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, and " -"return later to try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, " +"and return later to try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن " -"استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " +"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e.g. " -"clone an array, all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان " -"مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " +"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning logic " -"if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." msgstr "" "رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " "کپی‌برداری سفارشی را اجرا کند." #: src/memory-management/copy-types.md -msgid "While move semantics are the default, certain types are copied by default:" +msgid "" +"While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت " -"پیش‌فرض کپی می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " +"صورت پیش‌فرض کپی می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -8180,14 +8401,15 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on arbitrary " -"objects." +"Copying refers to bitwise copies of memory regions and does not work on " +"arbitrary objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف " -"شده توسط شما کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " +"تعریف شده توسط شما کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "" +"Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." @@ -8197,12 +8419,13 @@ msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار " -"سفارشی را فراهم می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " +"رفتار سفارشی را فراهم می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "" +"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -8210,19 +8433,19 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` is " -"not a `Copy` type." +"Add a `String` field to `struct Point`. It will not compile because `String` " +"is not a `Copy` type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک " -"نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " +"یک نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای " -"`p1` قرار دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " +"برای `p1` قرار دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -8230,16 +8453,16 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is because " -"rust requires that mutable references be exclusive, so while it's valid to make a " -"copy of a shared reference, creating a copy of a mutable reference would violate " -"Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات " -"قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز " -"دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک " -"ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را " -"نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " +"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " +"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " +"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " +"قوانین قرض‌گیری Rust را نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -8250,8 +8473,9 @@ msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را " -"پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " +"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " +"شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -8288,7 +8512,8 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "" +"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -8296,38 +8521,38 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " -"implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" +"drop` implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی " -"کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " +"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده " -"باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " +"کرده باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The significance " -"is that it takes ownership of the value, so at the end of its scope it gets " -"dropped. This makes it a convenient way to explicitly drop values earlier than " -"they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The " +"significance is that it takes ownership of the value, so at the end of its " +"scope it gets dropped. This makes it a convenient way to explicitly drop " +"values earlier than they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که " -"مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن " -"را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، " -"تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " +"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " +"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " +"دامنه خارج می‌شوند، تبدیل می‌کند." #: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن " -"قفل‌ها، بستن فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " +"کردن قفل‌ها، بستن فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -8338,8 +8563,9 @@ msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر " -"به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " +"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " +"می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -8347,13 +8573,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its data. " -"We will use the \"builder pattern\" to support building a new value piece-by-" -"piece, using convenience functions." +"In this example, we will implement a complex data type that owns all of its " +"data. We will use the \"builder pattern\" to support building a new value " +"piece-by-piece, using convenience functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های " -"خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت " -"قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " +"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " +"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -8379,7 +8605,8 @@ msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md #, fuzzy -msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "" +"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" @@ -8473,11 +8700,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer " -"to data on the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " +"pointer to data on the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به " -"داده‌های روی heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " +"به داده‌های روی heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -8485,22 +8712,22 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call methods " -"from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref." -"html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can [call " +"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" +"trait.Deref.html#more-on-deref-coercion)." msgstr "" "`| Element | 2 | o--+--->| Nil | // | // " -"| :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - - - - " -"- -.\n" +".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " +"- - - - -.\n" ": : : :\n" ": " "list : : :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " -"| :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" "```" #: src/smart-pointers/box.md msgid "" -"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not " -"null." +"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " +"not null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه " -"تهی (null) نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " +"هیچ‌گاه تهی (null) نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -8570,51 +8797,51 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust compiler " -"wants to know an exact size." +"have a type whose size that can't be known at compile time, but the Rust " +"compiler wants to know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به " -"دانستن اندازه دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " +"به دانستن اندازه دقیق آن دارد." #: src/smart-pointers/box.md msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " -"amounts of data on the stack, instead store the data on the heap in a `Box` so " -"only the pointer is moved." +"amounts of data on the stack, instead store the data on the heap in a `Box` " +"so only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم " -"زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا " -"فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " +"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " +"کنید تا فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not be able to compute a fixed size for the struct in " -"memory (the `List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the " +"struct in memory (the `List` would be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` " -"قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا " -"`List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " +"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " +"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and just " -"points at the next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and " +"just points at the next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به " -"عنصر بعدی `List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " +"به عنصر بعدی `List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get the " -"message \"recursive without indirection\", because for data recursion, we have to " -"use indirection, a `Box` or reference of some kind, instead of storing the value " -"directly." +"Remove the `Box` in the List definition and show the compiler error. We get " +"the message \"recursive without indirection\", because for data recursion, " +"we have to use indirection, a `Box` or reference of some kind, instead of " +"storing the value directly." msgstr "" "`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " -"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها " -"باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم " -"مقدار استفاده کنیم." +"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " +"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " +"مستقیم مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -8622,24 +8849,24 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This " -"makes `Box` one of the types that allow the compiler to optimize storage of some " -"enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " +"This makes `Box` one of the types that allow the compiler to optimize " +"storage of some enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null " -"باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه " -"می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" +"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " +"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" "For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit tag " -"([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"compiler uses NULL-value to discriminate variants instead of using explicit " +"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" "#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده کرد، " -"مثلاً `dyn Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای هوشمند مانند " -"`Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait object) ایجاد کنیم: " -"`\" : : \"data: Cat\" +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | o " -"| :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" -"+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -8786,45 +9015,45 @@ msgid "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - - " -"-'\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" " | |\n" -" | | \"Program " -"text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - - " -"-.\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk\" " -"| :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk\" " -"| :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " +"- -.\n" ": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | o " -"| :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" -"+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -8843,32 +9072,32 @@ msgstr "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - - " -"-'\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" " | |\n" -" | | \"Program " -"text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - - " -"-.\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk\" " -"| :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk\" " -"| :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" #: src/smart-pointers/trait-objects.md @@ -8876,44 +9105,45 @@ msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته باشند. " -"این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " "method:" msgstr "" -"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" +"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " +"کنید:" #: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "\"به‌روزرسانی آمار یک کاربر بر اساس اندازه‌گیری معبار بازدید از پزشک\"" #: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md src/android/aidl/example-service/client.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -9326,23 +9569,23 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. " -"This is verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers " +"to. This is verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع " -"توسط بررسی‌کننده قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " +"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes can " -"also be explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and " -"`'a` is a typical default name. Read `&'a Point` as \"a borrowed `Point` which is " -"valid for at least the lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes " +"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " +"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " +"`Point` which is valid for at least the lifetime `a`\"." msgstr "" "طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " -"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` " -"شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک `Point` " -"قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." +"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " +"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " +"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9350,9 +9593,9 @@ msgid "" "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر " -"را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود " -"ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " +"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " +"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9374,14 +9617,15 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that `p3`'s " -"lifetime is the shorter of `p1` and `p2`. But just like types, Rust requires " -"explicit annotations of lifetimes on function arguments and return values." +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به " -"بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر " -"از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در " -"آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " +"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " +"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " +"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -9389,17 +9633,18 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for " -"at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " +"for at least `'a`." msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " "می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "In common cases, lifetimes can be elided, as described on the next slide." +msgid "" +"In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی " -"توضیح داده شده است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " +"بعدی توضیح داده شده است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -9407,36 +9652,37 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, but " -"Rust allows lifetimes to be elided in most cases with [a few simple rules]" -"(https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not inference " -"-- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, " +"but Rust allows lifetimes to be elided in most cases with [a few simple " +"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " +"inference -- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما " -"Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang." -"org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- " -"بلکه تنها یک اصطلاح نوشتاری کوتاه است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " +"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." +"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " +"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" -"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." +"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " +"می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there is only one argument lifetime, it is given to all un-annotated return " -"values." +"If there is only one argument lifetime, it is given to all un-annotated " +"return values." msgstr "" "اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " "حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, that " -"lifetime is given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, " +"that lifetime is given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام " -"مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " +"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -9447,46 +9693,50 @@ msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به " -"حاشیه‌نویسی صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " +"نیاز به حاشیه‌نویسی صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" -"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده " -"می‌شوند:" +"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " +"داده می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for validity " -"by the compiler. Note that this is not the case for raw pointers (unsafe), and " -"this is a common source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for " +"validity by the compiler. Note that this is not the case for raw pointers " +"(unsafe), and this is a common source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر " -"برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام " -"(ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " +"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " +"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " +"ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. " -"Most of the time, elision and type inference mean these don't need to be written " -"out. In more complicated cases, lifetime annotations can help resolve ambiguity. " -"Often, especially when prototyping, it's easier to just work with owned data by " -"cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have " +"lifetimes. Most of the time, elision and type inference mean these don't " +"need to be written out. In more complicated cases, lifetime annotations can " +"help resolve ambiguity. Often, especially when prototyping, it's easier to " +"just work with owned data by cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، " -"_همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی " -"است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر " -"می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که " -"با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " +"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " +"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " +"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " +"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " +"صورت لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "Lifetimes in Data Structures" #: src/lifetimes/struct-lifetimes.md -msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "" +"If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "" +"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -9515,27 +9765,27 @@ msgid "" "underlying the contained `&str` lives at least as long as any instance of " "`Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` " -"به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده " -"بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " +"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " +"می‌کند، زنده بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the " -"borrow checker throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " +"the borrow checker throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow " -"checker) خطا می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " +"(borrow checker) خطا می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This can be " -"useful for creating lightweight views, but it generally makes them somewhat " -"harder to use." +"Types with borrowed data force users to hold on to the original data. This " +"can be useful for creating lightweight views, but it generally makes them " +"somewhat harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های " -"اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً " -"استفاده از آنها را تا حدی دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " +"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " +"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -9545,37 +9795,37 @@ msgstr "در صورت امکان، داده‌های ساختارها را به msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime of " -"the struct itself. Those are very advanced use cases." +"relationships between the references themselves, in addition to the lifetime " +"of the struct itself. Those are very advanced use cases." msgstr "" "برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " -"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین " -"ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد بسیار پیشرفته " -"هستند." +"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " +"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " +"بسیار پیشرفته هستند." #: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's simpler " -"than it seems! This illustrates a common parsing pattern, passing slices of data. " -"The underlying data itself is never copied." +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " +"simpler than it seems! This illustrates a common parsing pattern, passing " +"slices of data. The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf." -"dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن " -"است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل " -"عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" +"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " +"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " +"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` file. In " -"this exercise, we'll encode that information into `match` statements in functions " -"that get called for each field." +"indexed by their field numbers. That is typically provided in a `proto` " +"file. In this exercise, we'll encode that information into `match` " +"statements in functions that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس " -"شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. " -"در این تمرین، ما این اطلاعات را به صورت عبارات `match` در توابعی که برای هر فیلد " -"فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " +"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " +"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " +"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -9583,27 +9833,27 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each is " -"implemented as a \"tag\" followed by the value. The tag contains a field number " -"(e.g., `2` for the `id` field of a `Person` message) and a wire type defining how " -"the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each " +"is implemented as a \"tag\" followed by the value. The tag contains a field " +"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " +"defining how the payload should be determined from the byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر " -"فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد " -"(مانند `2` برای فیلد `id` در پیام `Person`) و wire type است که نحوه تعیین بار را " -"از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " +"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " +"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " +"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given code " -"also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse " -"a message into a series of calls to those callbacks." +"called VARINT. Luckily, `parse_varint` is defined for you below. The given " +"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " +"to parse a message into a series of calls to those callbacks." msgstr "" "اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " -"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین " -"بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به " -"مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." +"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " +"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " +"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" @@ -9627,26 +9877,32 @@ msgstr "/// The Varint WireType indicates the value is a single VARINT.\n" #, fuzzy msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double type.\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double type.\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float type.\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" " //I32, -- not needed for this exercise\n" msgstr "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float type.\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" " //I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -9701,8 +9957,10 @@ msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy -msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" -msgstr "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgstr "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" @@ -9738,8 +9996,10 @@ msgstr "/// Parse a field, returning the remaining bytes\n" #: src/lifetimes/exercise.md msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" -msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +"\"Based on the wire type, build a Field, consuming as many bytes as " +"necessary.\"" +msgstr "" +"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -9748,12 +10008,14 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" msgstr "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -9765,18 +10027,18 @@ msgstr "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, e.g. " -"if you try to parse an `i32` when there are fewer than 4 bytes left in the data " -"buffer. In normal Rust code we'd handle this with the `Result` enum, but for " -"simplicity in this exercise we panic if any errors are encountered. On day 4 " -"we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، " -"مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، " -"تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما " -"برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به جای آن که با `Result` " -"برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، به بررسی دقیق‌تر مدیریت خطا " -"در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " +"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " +"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " +"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " +"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " +"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" @@ -9822,7 +10084,8 @@ msgstr "به روز ۱ خوش آمدید" msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" -"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش خواهیم داد:" +"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش " +"خواهیم داد:" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." @@ -9841,7 +10104,8 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "رسیدگی به خطا: panics در `Result` و اپراتور تلاش مجدد `?`." #: src/welcome-day-4.md -msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "" +"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" #: src/welcome-day-4.md @@ -9866,15 +10130,16 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait " -"supports iterating over values in a collection. It requires a `next` method and " -"provides lots of methods. Many standard library types implement `Iterator`, and " -"you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait supports iterating over values in a collection. It requires a `next` " +"method and provides lots of methods. Many standard library types implement " +"`Iterator`, and you can implement it yourself, too:" msgstr "" -"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) از " -"تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` نیاز دارد و " -"متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد `Iterator` را " -"پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی کنید:" +"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"از تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` " +"نیاز دارد و متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد " +"`Iterator` را پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی " +"کنید:" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" @@ -9882,40 +10147,41 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming operations " -"over collections (e.g. `map`, `filter`, `reduce`, etc). This is the trait where " -"you can find all the documentation about them. In Rust these functions should " -"produce the code as efficient as equivalent imperative implementations." +"The `Iterator` trait implements many common functional programming " +"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " +"the trait where you can find all the documentation about them. In Rust these " +"functions should produce the code as efficient as equivalent imperative " +"implementations." msgstr "" "ویژگی `Iterator` بسیاری از عملیات برنامه‌نویسی تابعی رایج را روی collectionها " -"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که در آن " -"می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع باید کد را به " -"اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." +"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که " +"در آن می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع " +"باید کد را به اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." #: src/iterators/iterator.md msgid "" "`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` and " -"`&[T]`. Ranges also implement it. This is why you can iterate over a vector with " -"`for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه (collection) " -"توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند `&Vec` و `&[T]` " -"پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین دلیل است که می‌توانید روی " -"یک بردار با `برای i در some_vec { .. }` تکرار کنید، اما درنهایت `some_vec." -"next()`وجود ندارد." +"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه " +"(collection) توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند " +"`&Vec` و `&[T]` پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین " +"دلیل است که می‌توانید روی یک بردار با `برای i در some_vec { .. }` تکرار کنید، " +"اما درنهایت `some_vec.next()`وجود ندارد." #: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/" -"trait.IntoIterator.html) defines how to create an iterator for a type. It is used " -"automatically by the `for` loop." +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " +"It is used automatically by the `for` loop." msgstr "" -"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، _iterate_ " -"کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait." -"IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص می‌کند. به طور " -"خودکار توسط حلقه `for` استفاده می‌شود." +"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، " +"_iterate_ کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص " +"می‌کند. به طور خودکار توسط حلقه `for` استفاده می‌شود." #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" @@ -9926,8 +10192,8 @@ msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" -"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع را " -"اعلام کند:" +"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع " +"را اعلام کند:" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," @@ -9943,8 +10209,9 @@ msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" -"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده (iterator) " -"باید همان `Item` type را داشته باشد، به این معنی که `Option` را برمی‌گرداند." +"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده " +"(iterator) باید همان `Item` type را داشته باشد، به این معنی که " +"`Option` را برمی‌گرداند." #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." @@ -9955,32 +10222,32 @@ msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ توجه " -"داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." +"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ " +"توجه داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference " -"to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " +"reference to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in some_vector` " -"will take ownership of `some_vector` and iterate over owned elements from that " -"vector. Use `for e in &some_vector` instead, to iterate over references to " -"elements of `some_vector`." +"The same problem can occur for standard library types: `for e in " +"some_vector` will take ownership of `some_vector` and iterate over owned " +"elements from that vector. Use `for e in &some_vector` instead, to iterate " +"over references to elements of `some_vector`." msgstr "" #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets " -"you build a collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/" -"trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" +"std/iter/trait.Iterator.html)." msgstr "" "گزینه [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator." -"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/iter/" -"trait.Iterator.html) یک مجموعه یا collection بسازید." +"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/" +"iter/trait.Iterator.html) یک مجموعه یا collection بسازید." #: src/iterators/fromiterator.md #, fuzzy @@ -9997,8 +10264,9 @@ msgstr "دو راه برای تعیین`B` برای این روش وجود دا #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as shown. " -"The `_` shorthand used here lets Rust infer the type of the `Vec` elements." +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." msgstr "" #: src/iterators/fromiterator.md @@ -10006,41 +10274,44 @@ msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" -"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. این " -"مثال را برای استفاده از این فرم بازنویسی کنید." +"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"این مثال را برای استفاده از این فرم بازنویسی کنید." #: src/iterators/fromiterator.md msgid "" "There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things like " -"convert an `Iterator>` into a `Result, E>`." +"There are also more specialized implementations which let you do cool things " +"like convert an `Iterator>` into a `Result, E>`." msgstr "" #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods in " -"the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to " -"implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods " +"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait to implement a complex calculation." msgstr "" #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests pass. " -"Use an iterator expression and `collect` the result to construct the return value." +"Copy the following code to and make the tests " +"pass. Use an iterator expression and `collect` the result to construct the " +"return value." msgstr "" -"کد زیر را در کپی کنید و تست ها را قبول کنید. از یک " -"عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) کنید تا " -"مقدار بازگشتی را بسازید." +"کد زیر را در کپی کنید و تست ها را قبول کنید. از " +"یک عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) " +"کنید تا مقدار بازگشتی را بسازید." #: src/iterators/exercise.md src/iterators/solution.md #, fuzzy msgid "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -10052,14 +10323,14 @@ msgstr "use, super, self" #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" -"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را به " -"یک type تبدیل کنیم." +"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را " +"به یک type تبدیل کنیم." #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت داشته " -"باشیم:" +"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت " +"داشته باشیم:" #: src/modules/modules.md msgid "\"In the foo module\"" @@ -10071,36 +10342,38 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that describes how " -"to build a bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that " +"describes how to build a bundle of 1+ crates." msgstr "" -"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` می‌شوند که " -"نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." +"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` " +"می‌شوند که نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and a " -"library crate compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and " +"a library crate compiles to a library." msgstr "" -"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل اجرایی " -"ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." +"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل " +"اجرایی ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." msgstr "" #: src/modules/filesystem.md -msgid "Omitting the module content will tell Rust to look for it in another file:" +msgid "" +"Omitting the module content will tell Rust to look for it in another file:" msgstr "حذف محتوای ماژول به Rust می‌گوید که آن را در فایل دیگری جستجو کند:" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden.rs`. " -"Similarly, a `garden::vegetables` module can be found at `src/garden/vegetables." -"rs`." +"This tells rust that the `garden` module content is found at `src/garden." +"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" +"vegetables.rs`." msgstr "" -"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به طور " -"مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables.rs` یافت." +"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به " +"طور مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables." +"rs` یافت." #: src/modules/filesystem.md msgid "The `crate` root is in:" @@ -10116,17 +10389,20 @@ msgstr "`src/main.rs` (for a binary crate)" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments\". " -"These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" #: src/modules/filesystem.md #, fuzzy msgid "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" msgstr "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" #: src/modules/filesystem.md @@ -10154,19 +10430,20 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` " -"was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod." +"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول اصلی یک " -"فایل باشد:" +"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول " +"اصلی یک فایل باشد:" #: src/modules/filesystem.md msgid "" -"The place rust will look for modules can be changed with a compiler directive:" +"The place rust will look for modules can be changed with a compiler " +"directive:" msgstr "" #: src/modules/filesystem.md @@ -10175,11 +10452,12 @@ msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module in a " -"file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module " +"in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" "برای مثال، اگر می‌خواهید تست‌هایی را برای یک ماژول در فایلی به نام " -"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در Go." +"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در " +"Go." #: src/modules/visibility.md msgid "Modules are a privacy boundary:" @@ -10195,11 +10473,11 @@ msgstr "کزینه‌های sibling و sibling همیشه قابل مشاهده #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all the " -"descendants of `foo`." +"In other words, if an item is visible in module `foo`, it's visible in all " +"the descendants of `foo`." msgstr "" -"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه فرزندان`foo` " -"قابل مشاهده است." +"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه " +"فرزندان`foo` قابل مشاهده است." #: src/modules/visibility.md msgid "\"outer::private\"" @@ -10223,8 +10501,8 @@ msgstr "از کلمه کلیدی `pub` برای public کردن ماژول‌ه #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of " -"public visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " +"of public visibility." msgstr "" #: src/modules/visibility.md @@ -10245,14 +10523,15 @@ msgstr "" #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of its " -"descendants)." -msgstr "در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." +"In any case, visibility must be granted to an ancestor module (and all of " +"its descendants)." +msgstr "" +"در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You will " -"typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You " +"will typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -10289,8 +10568,8 @@ msgstr "یک `bar::foo` به `foo` در `bar` crate اشاره دارد." #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the top-" -"level `lib.rs` in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the " +"top-level `lib.rs` in a crate might have" msgstr "" #: src/modules/paths.md @@ -10302,26 +10581,27 @@ msgstr "" #: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if a " -"type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to `use " -"std::io::Read`." +"However, a trait must be in scope to call any methods on that trait, even if " +"a type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to " +"`use std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged " -"because it is not clear which items are imported, and those might change over " -"time." +"The `use` statement can have a wildcard: `use std::io::*`. This is " +"discouraged because it is not clear which items are imported, and those " +"might change over time." msgstr "" -"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع شده " -"است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر کنند." +"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع " +"شده است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر " +"کنند." #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. This " -"library defines a `Widget` trait and a few implementations of that trait, as well " -"as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. " +"This library defines a `Widget` trait and a few implementations of that " +"trait, as well as a `main` function." msgstr "" #: src/modules/exercise.md @@ -10382,10 +10662,12 @@ msgstr "// Add 4 paddings for borders\n" #: src/modules/exercise.md #, fuzzy msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" #: src/modules/exercise.md src/modules/solution.md @@ -10431,9 +10713,9 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, and " -"get accustomed to the required `mod`, `use`, and `pub` declarations. Afterward, " -"discuss what organizations are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, " +"and get accustomed to the required `mod`, `use`, and `pub` declarations. " +"Afterward, discuss what organizations are most idiomatic." msgstr "" #: src/modules/solution.md @@ -10530,13 +10812,13 @@ msgstr "" #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` " -"module, using `#[cfg(test)]` to conditionally compile them only when building " -"tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested " +"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " +"building tests." msgstr "" -"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` تودرتو " -"قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت مشروط تنها در " -"هنگام build تست‌ها کامپایل کنند." +"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` " +"تودرتو قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت " +"مشروط تنها در هنگام build تست‌ها کامپایل کنند." #: src/testing/unit-tests.md msgid "\"Hello World\"" @@ -10548,7 +10830,8 @@ msgstr "این به شما امکان می‌دهد تا private helper را آ #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." -msgstr "ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." +msgstr "" +"ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." @@ -10604,7 +10887,8 @@ msgstr "" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." -msgstr "بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." +msgstr "" +"بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." @@ -10612,7 +10896,8 @@ msgstr "" #: src/testing/other.md msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/run it." +"Adding `#` in the code will hide it from the docs, but will still compile/" +"run it." msgstr "" #: src/testing/other.md @@ -10621,46 +10906,46 @@ msgid "" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" "کد بالا را در [Rust Playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) تست " -"کنید." +"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " +"تست کنید." #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful built-in " -"lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, " -"organized into groups that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful " +"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " +"more lints, organized into groups that can be enabled per-project." msgstr "" #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب است، " -"درست است؟ {}\"" +"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب " +"است، درست است؟ {}\"" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints visible " -"here, but those will not be shown once the code compiles. Switch to the " -"Playground site to show those lints." +"Run the code sample and examine the error message. There are also lints " +"visible here, but those will not be shown once the code compiles. Switch to " +"the Playground site to show those lints." msgstr "" -"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل مشاهده " -"هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن lintها به " -"سایت Playground بروید." +"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل " +"مشاهده هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن " +"lintها به سایت Playground بروید." #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show clippy " -"warnings. Clippy has extensive documentation of its lints, and adds new lints " -"(including default-deny lints) all the time." +"After resolving the lints, run `clippy` on the playground site to show " +"clippy warnings. Clippy has extensive documentation of its lints, and adds " +"new lints (including default-deny lints) all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or " -"via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " +"or via your editor." msgstr "" -"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با `cargo " -"fix` یا از طریق ویرایشگر خود برطرف کرد." +"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با " +"`cargo fix` یا از طریق ویرایشگر خود برطرف کرد." #: src/testing/exercise.md msgid "Luhn Algorithm" @@ -10668,13 +10953,14 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used to " -"validate credit card numbers. The algorithm takes a string as input and does the " -"following to validate the credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " +"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) برای اعتبارسنجی " -"شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی " -"دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای " +"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " +"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " +"انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -10683,11 +10969,12 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره " +"`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " +"می‌کنیم." #: src/testing/exercise.md msgid "" @@ -10708,19 +10995,20 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, along " -"with two basic unit tests that confirm that most of the algorithm is implemented " -"correctly." +"The provided code provides a buggy implementation of the luhn algorithm, " +"along with two basic unit tests that confirm that most of the algorithm is " +"implemented correctly." msgstr "" #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional tests " -"to uncover bugs in the provided implementation, fixing any bugs you find." +"Copy the code below to and write additional " +"tests to uncover bugs in the provided implementation, fixing any bugs you " +"find." msgstr "" -"کد زیر را به کپی کنید و تابع " -"را پیاده‌سازی کنید." +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -10802,7 +11090,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 15 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/error-handling.md #, fuzzy @@ -10851,21 +11140,24 @@ msgstr "پنیک‌های خاص می‌توانند از ماکرو `panic!` ا #: src/error-handling/panics.md msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions had " -"returned." +"A panic will \"unwind\" the stack, dropping values just as if the functions " +"had returned." msgstr "" #: src/error-handling/panics.md -msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "" +"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" -"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده کنید." +"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده " +"کنید." #: src/error-handling/panics.md msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be caught:" +"By default, a panic will cause the stack to unwind. The unwinding can be " +"caught:" msgstr "" -"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان گرفت( در " -"واقع منظور این است که می‌توان آن را caught کرد):" +"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان " +"گرفت( در واقع منظور این است که می‌توان آن را caught کرد):" #: src/error-handling/panics.md msgid "\"No problem here!\"" @@ -10881,62 +11173,65 @@ msgstr "\"oh no!\"" #: src/error-handling/panics.md msgid "" -"Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" +"Catching is unusual; do not attempt to implement exceptions with " +"`catch_unwind`!" msgstr "" "گرفتن (Catching) غیر معمول است. سعی نکنید exceptionها را با `catch_unwind` " "پیاده‌سازی کنید!" #: src/error-handling/panics.md msgid "" -"This can be useful in servers which should keep running even if a single request " -"crashes." +"This can be useful in servers which should keep running even if a single " +"request crashes." msgstr "" -"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، باید به " -"کار خود ادامه دهند." +"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، " +"باید به کار خود ادامه دهند." #: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" -"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار نمی‌کند." +"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار " +"نمی‌کند." #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://doc." -"rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly saw when " -"discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://" +"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " +"saw when discussing standard library types." msgstr "" -"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-lang." -"org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث در مورد " -"تایپ‌های کتابخانه استاندارد مشاهده کردیم." +"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-" +"lang.org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث " +"در مورد تایپ‌های کتابخانه استاندارد مشاهده کردیم." #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` which " -"contains an error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` " +"which contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's type " -"signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's " +"type signature by having the function return a `Result` value." msgstr "" -"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با برگرداندن " -"تابع مقدار `Result` کدگذاری می‌شود." +"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با " +"برگرداندن تابع مقدار `Result` کدگذاری می‌شود." #: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern matching " -"on the `Result` to check which variant you have. Methods like `unwrap` make it " -"easier to write quick-and-dirty code that doesn't do robust error handling, but " -"means that you can always see in your source code where proper error handling is " -"being skipped." +"access either the success value or the error value without first pattern " +"matching on the `Result` to check which variant you have. Methods like " +"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " +"error handling, but means that you can always see in your source code where " +"proper error handling is being skipped." msgstr "" #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling conventions " -"that students may be familiar with from other programming languages." +"It may be helpful to compare error handling in Rust to error handling " +"conventions that students may be familiar with from other programming " +"languages." msgstr "" #: src/error-handling/result.md @@ -10946,13 +11241,14 @@ msgstr "" #: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means that " -"you can't tell when calling a function if it may throw an exception or not." +"exception is not visible as part of its type signature. This generally means " +"that you can't tell when calling a function if it may throw an exception or " +"not." msgstr "" -"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند یا " -"نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور کلی به " -"این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن است یک " -"exception ایجاد کند یا خیر." +"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند " +"یا نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور " +"کلی به این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن " +"است یک exception ایجاد کند یا خیر." #: src/error-handling/result.md msgid "" @@ -10967,28 +11263,29 @@ msgstr "شماره‌های خطا" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error value) " -"separately from the successful return value of the function. Examples include C " -"and Go." +"Some languages have functions return an error number (or some other error " +"value) separately from the successful return value of the function. Examples " +"include C and Go." msgstr "" #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error value, " -"in which case you may be accessing an uninitialized or otherwise invalid success " -"value." +"Depending on the language it may be possible to forget to check the error " +"value, in which case you may be accessing an uninitialized or otherwise " +"invalid success value." msgstr "" #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with the " -"`Result` type, but matching this type on every call can be cumbersome. The try-" -"operator `?` is used to return errors to the caller. It lets you turn the common" +"Runtime errors like connection-refused or file-not-found are handled with " +"the `Result` type, but matching this type on every call can be cumbersome. " +"The try-operator `?` is used to return errors to the caller. It lets you " +"turn the common" msgstr "" -"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» مدیریت " -"می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` برای " -"برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا موارد " -"مشترک را بازگردانید." +"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» " +"مدیریت می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` " +"برای برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا " +"موارد مشترک را بازگردانید." #: src/error-handling/try.md msgid "into the much simpler" @@ -11025,19 +11322,20 @@ msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" -"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، فایل " -"خالی، فایل با نام کاربری." +"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، " +"فایل خالی، فایل با نام کاربری." #: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. The " -"executable will print the `Err` variant and return a nonzero exit status on error." +"process::Termination`. In practice, this means that `E` implements `Debug`. " +"The executable will print the `Err` variant and return a nonzero exit status " +"on error." msgstr "" -"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را پیاده‌سازی " -"کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است که `E` " -"پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند و در صورت " -"خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." +"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را " +"پیاده‌سازی کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است " +"که `E` پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند " +"و در صورت خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." #: src/error-handling/try-conversions.md msgid "" @@ -11051,13 +11349,13 @@ msgstr "به طو مشابه کار می‌کند" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the type " -"returned by the function. This makes it easy to encapsulate errors into higher-" -"level errors." +"The `From::from` call here means we attempt to convert the error type to the " +"type returned by the function. This makes it easy to encapsulate errors into " +"higher-level errors." msgstr "" -"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را به " -"نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح بالاتر " -"کپسوله شوند." +"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را " +"به نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح " +"بالاتر کپسوله شوند." #: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" @@ -11075,37 +11373,38 @@ msgstr "//std::fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. A " -"function that returns `Result` can only use `?` on a value of type " -"`Result` if `ErrorOuter` and `ErrorInner` are the same type or if " -"`ErrorOuter` implements `From`." +"function. For `Result`, it means that the error types have to be compatible. " +"A function that returns `Result` can only use `?` on a value " +"of type `Result` if `ErrorOuter` and `ErrorInner` are the " +"same type or if `ErrorOuter` implements `From`." msgstr "" -"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به این " -"معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` را " -"برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` " -"استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا اگر `ErrorOuter` " -"از` را پیاده‌سازی کند." +"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به " +"این معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` " +"را برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا " +"اگر `ErrorOuter` از` را پیاده‌سازی کند." #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, especially " -"when the conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, " +"especially when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and `U` " -"types." +"`Option` can use the `?` operator on `Option` for arbitrary `T` and " +"`U` types." msgstr "" -"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی گرداند " -"می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` استفاده کند." +"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی " +"گرداند می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` " +"استفاده کند." #: src/error-handling/try-conversions.md msgid "" "A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` turns " -"`Result` into `Option`." +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -11114,13 +11413,14 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing our " -"own enum covering all the different possibilities. The `std::error::Error` trait " -"makes it easy to create a trait object that can contain any error." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" "گاهی اوقات می‌خواهیم اجازه دهیم هر نوع خطای بدون نوشتن enum خودمان که تمام " -"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد یک " -"object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." +"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد " +"یک object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." #: src/error-handling/error.md msgid "\"count.dat\"" @@ -11140,30 +11440,32 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) or " -"`std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" "تابع `read_count`می‌تواند `std::io::Error` (از عملیات فایل) یا `std::num::" "ParseIntError` (از `String::parse`) را برگرداند." #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle different " -"error cases differently in the program. As such it's generally not a good idea to " -"use `Box` in the public API of a library, but it can be a good option " -"in a program where you just want to display the error message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" -"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای مختلف " -"را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از `Box` " -"در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه خوبی در برنامه‌ای باشد " -"که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." +"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای " +"مختلف را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از " +"`Box` در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه " +"خوبی در برنامه‌ای باشد که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom error " -"type so it can be boxed. But if you need to support the `no_std` attribute, keep " -"in mind that the `std::error::Error` trait is currently compatible with `no_std` " -"in [nightly](https://github.com/rust-lang/rust/issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed. But if you need to support the `no_std` " +"attribute, keep in mind that the `std::error::Error` trait is currently " +"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" +"issues/103765) only." msgstr "" #: src/error-handling/thiserror-and-anyhow.md @@ -11172,7 +11474,8 @@ msgid "" "anyhow/) crates are widely used to simplify error handling." msgstr "" "این [`thiserror`](https://docs.rs/thiserror/) و [`anyhow`](https://docs.rs/" -"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده می‌شوند." +"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده " +"می‌شوند." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11182,8 +11485,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in functions, " -"including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in " +"functions, including adding contextual information to your errors." msgstr "" " اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " "اطلاعات متنی به خطاهای شما، استفاده می‌شود." @@ -11222,8 +11525,8 @@ msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید زیادی " -"برای کمک به تعریف انواع خطا به روشی فشرده است." +"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید " +"زیادی برای کمک به تعریف انواع خطا به روشی فشرده است." #: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." @@ -11239,13 +11542,13 @@ msgstr "`anyhow`" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such it's " -"again generally not a good choice for the public API of a library, but is widely " -"used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" -" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این ترتیب " -"معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده در " -"برنامه‌های مختلف استفاده می‌شود." +" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " +"ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " +"در برنامه‌های مختلف استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." @@ -11258,33 +11561,34 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go developers, " -"as it provides similar usage patterns and ergonomics to `(T, error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go " +"developers, as it provides similar usage patterns and ergonomics to `(T, " +"error)` from Go." msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` " -"types. `use anyhow::Context` is necessary to enable `.context()` and `." -"with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" -"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و `Option` " -"پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `.context()` و `." -"with_context()` در آن typeها ضروری است." +"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و " +"`Option` پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `." +"context()` و `.with_context()` در آن typeها ضروری است." #: src/error-handling/exercise.md msgid "" "The following implements a very simple parser for an expression language. " "However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to use " -"`thiserror` and `anyhow`." +"error handling and propagate errors to a return from `main`. Feel free to " +"use `thiserror` and `anyhow`." msgstr "" #: src/error-handling/exercise.md msgid "" "HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement `Iterator>` and handle that in the parser." +"working correctly, update `Tokenizer` to implement " +"`Iterator>` and handle that in the parser." msgstr "" #: src/error-handling/exercise.md src/error-handling/solution.md @@ -11385,28 +11689,31 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان پذیر " -"نیست." +"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان " +"پذیر نیست." #: src/unsafe-rust/unsafe.md msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." -msgstr "در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." +"**Unsafe Rust:** can trigger undefined behavior if preconditions are " +"violated." +msgstr "" +"در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." #: src/unsafe-rust/unsafe.md msgid "" -"We saw mostly safe Rust in this course, but it's important to know what Unsafe " -"Rust is." +"We saw mostly safe Rust in this course, but it's important to know what " +"Unsafe Rust is." msgstr "" -"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust چیست." +"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust " +"چیست." #: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" -"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در یک " -"لایه انتزاعی ایمن پیچیده می‌شود." +"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در " +"یک لایه انتزاعی ایمن پیچیده می‌شود." #: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" @@ -11435,18 +11742,19 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" -"rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" -"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً به " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" -"rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً " +"به [Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers have " -"turned off some compiler safety features and have to write correct code by " -"themselves. It means the compiler no longer enforces Rust's memory-safety rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers " +"have turned off some compiler safety features and have to write correct code " +"by themselves. It means the compiler no longer enforces Rust's memory-safety " +"rules." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11461,13 +11769,15 @@ msgstr "\"مراقب باش!\"" #, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11502,9 +11812,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write a " -"comment for each `unsafe` block explaining how the code inside it satisfies the " -"safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write " +"a comment for each `unsafe` block explaining how the code inside it " +"satisfies the safety requirements of the unsafe operations it is doing." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11519,8 +11829,8 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single allocated " -"object)." +"The pointer must be _dereferenceable_ (within the bounds of a single " +"allocated object)." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11533,8 +11843,8 @@ msgstr "دسترسی همزمان به یک مکان نباید وجود داش #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object must be " -"live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object " +"must be live and no reference may be used to access the memory." msgstr "" #: src/unsafe-rust/dereferencing.md @@ -11543,13 +11853,14 @@ msgstr "در بیشتر موارد، اشاره‌گر نیز باید به در #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has " -"the `'static` lifetime, so `r3` has type `&'static String`, and thus outlives " -"`s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " +"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " +"outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" -"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` دارای " -"طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است و بنابراین " -"عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت بسیار دارد." +"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` " +"دارای طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است " +"و بنابراین عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت " +"بسیار دارد." #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" @@ -11571,8 +11882,10 @@ msgstr "" #: src/unsafe-rust/mutable-static.md #, fuzzy -msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" -msgstr "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" #: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" @@ -11581,20 +11894,20 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" "The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the `unsafe` and " -"see how the compiler explains that it is undefined behavior to mutate a static " -"from multiple threads." +"compiler is conservative and will assume the worst. Try removing the " +"`unsafe` and see how the compiler explains that it is undefined behavior to " +"mutate a static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases where it " -"might make sense in low-level `no_std` code, such as implementing a heap " -"allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases " +"where it might make sense in low-level `no_std` code, such as implementing a " +"heap allocator or working with some C APIs." msgstr "" -"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما مواردی " -"وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند اجرای یک heap " -"allocator یا کار با برخی از APIهای مربوط به زبان C." +"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما " +"مواردی وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند " +"اجرای یک heap allocator یا کار با برخی از APIهای مربوط به زبان C." #: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" @@ -11615,16 +11928,16 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They are " -"occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They " +"are occasionally needed for interacting with C library APIs." msgstr "" #: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute." -"html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/" -"zerocopy) crate." +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." +"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" +"crates/zerocopy) crate." msgstr "" #: src/unsafe-rust/unsafe-functions.md @@ -11633,8 +11946,8 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions you " -"must uphold to avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions " +"you must uphold to avoid undefined behaviour:" msgstr "" #: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md @@ -11699,8 +12012,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular conditions " -"to avoid undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular " +"conditions to avoid undefined behaviour." msgstr "" "اگر عملکردهای خود را برای جلوگیری از رفتار نامشخص به شرایط خاصی نیاز دارند، " "می‌توانید به‌عنوان`unsafe` علامت‌گذاری کنید." @@ -11732,43 +12045,44 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different reason: " -"it is an external function (FFI). Calling external functions is usually only a " -"problem when those functions do things with pointers which might violate Rust's " -"memory model, but in general any C function might have undefined behaviour under " -"any arbitrary circumstances." +"create UB if the range is incorrect. `abs` is incorrect for a different " +"reason: it is an external function (FFI). Calling external functions is " +"usually only a problem when those functions do things with pointers which " +"might violate Rust's memory model, but in general any C function might have " +"undefined behaviour under any arbitrary circumstances." msgstr "" "تابع `get_unchecked`، مانند اکثر توابع `_unchecked`، ناامن است، زیرا اگر در " -"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: این " -"یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است که آن " -"توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه Rust را نقض " -"کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه رفتار نامشخصی داشته " -"باشد." +"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: " +"این یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است " +"که آن توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه " +"Rust را نقض کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه " +"رفتار نامشخصی داشته باشد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://" -"doc.rust-lang.org/reference/items/external-blocks.html)." -msgstr "" -"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس هستند]" +"The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." +msgstr "" +"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس " +"هستند](https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done safely " -"with references." +"We wouldn't actually use pointers for a `swap` function - it can be done " +"safely with references." msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an `unsafe` " -"block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " -"and see what happens. This will likely change in a future Rust edition." +"Note that unsafe code is allowed within an unsafe function without an " +"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " +"Try adding it and see what happens. This will likely change in a future Rust " +"edition." msgstr "" -"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. ما " -"می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. سعی کنید " -"آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه بعدی Rust تغییر " -"خواهد کرد." +"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. " +"ما می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. " +"سعی کنید آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه " +"بعدی Rust تغییر خواهد کرد." #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" @@ -11776,14 +12090,14 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation must " -"guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation " +"must guarantee particular conditions to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something like " -"this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something " +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -11804,15 +12118,16 @@ msgstr "// SAFETY: `u32` has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining the " -"requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining " +"the requirements for the trait to be safely implemented." msgstr "" -"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که شرایط " -"لازم برای اجرای ایمن این trait را توضیح دهد." +"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که " +"شرایط لازم برای اجرای ایمن این trait را توضیح دهد." #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more complicated." +"The actual safety section for `AsBytes` is rather longer and more " +"complicated." msgstr "بخش ایمنی واقعی برای `AsBytes` نسبتا طولانی‌تر و پیچیده‌تر است." #: src/unsafe-rust/unsafe-traits.md @@ -11848,8 +12163,9 @@ msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) " -"module. There you find a number of string types which you need for the exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" +"ffi/) module. There you find a number of string types which you need for the " +"exercise:" msgstr "همچنین می‌خواهید [`std::ffi`](https://doc.rust-lang.or) را مرور کنید" #: src/unsafe-rust/exercise.md @@ -11862,11 +12178,11 @@ msgstr "استفاده" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://" -"doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`](https://" -"doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" @@ -11894,8 +12210,8 @@ msgstr "ارتباط با توابع C" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`]" -"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " +"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) و [`OsString`]" "(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" @@ -11914,7 +12230,8 @@ msgstr "شما بین تمام این typeها تبدیل خواهید کرد:" #: src/unsafe-rust/exercise.md msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` character," +"`&str` to `CString`: you need to allocate space for a trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md @@ -11926,7 +12243,8 @@ msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" -"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را پیدا کند." +"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " +"پیدا کند." #: src/unsafe-rust/exercise.md msgid "" @@ -11940,8 +12258,8 @@ msgid "" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" "از `&[u8]` به `&OsStr`: `&OsStr` گامی به سوی `OsString` است، از [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد آن " -"استفاده کنید،" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد " +"آن استفاده کنید،" #: src/unsafe-rust/exercise.md msgid "" @@ -11951,19 +12269,19 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful " -"chapter about FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " +"useful chapter about FFI." msgstr "" -"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل بسیار " -"مفید در مورد FFI دارد." +"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل " +"بسیار مفید در مورد FFI دارد." #: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" -"کد زیر را در کپی کنید و توابع و متدهای از مفقود شده " -"را پر کنید:" +"کد زیر را در کپی کنید و توابع و متدهای از " +"مفقود شده را پر کنید:" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" @@ -11999,14 +12317,18 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" msgstr "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" @@ -12126,101 +12448,102 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can write " -"new services, libraries, drivers or even firmware in Rust (or improve existing " -"code as needed)." +"Rust is supported for system software on Android. This means that you can " +"write new services, libraries, drivers or even firmware in Rust (or improve " +"existing code as needed)." msgstr "" "‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " -"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا " -"در صورت نیاز کدهای موجود را بهبود ببخشید)." +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " +"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to find " -"a little corner of your code base where we can move some lines of code to Rust. " -"The fewer dependencies and \"exotic\" types the better. Something that parses " -"some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to " +"find a little corner of your code base where we can move some lines of code " +"to Rust. The fewer dependencies and \"exotic\" types the better. Something " +"that parses some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین " -"سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به " -"Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. " -"چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " +"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " +"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " +"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md msgid "" -"The speaker may mention any of the following given the increased use of Rust in " -"Android:" +"The speaker may mention any of the following given the increased use of Rust " +"in Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر " -"اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " +"زیر اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" -"http3-in-android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" -"http3-in-android.html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/" -"rutabaga_gfx.html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" msgstr "" "کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" -"binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" -"binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" -"in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" -"in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure " -"you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make " +"sure you have access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. " -"مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " +"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/" -"start) for details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/" +"setup/start) for details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/" -"setup/start) مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" +"docs/setup/start) مراجعه کنید." #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " "desktops. MacOS support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی " -"طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " +"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is the " -"ideal emulator to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is " +"the ideal emulator to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل " -"برای اجرای بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " +"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "" +"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -12244,7 +12567,8 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "" +"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -12252,11 +12576,11 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static and " -"shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static " +"and shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای " -"static و share را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " +"متغیرهای static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" @@ -12264,8 +12588,10 @@ msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler plugins." -msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +"Produces a `proc-macro` Rust library. These are analogous to compiler " +"plugins." +msgstr "" +"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -12274,7 +12600,8 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" -"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " +"می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -12290,8 +12617,8 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for a " -"particular protobuf." +"Generates source and produces a Rust library that provides an interface for " +"a particular protobuf." msgstr "" "یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " "protobuf خاص فراهم می‌کند." @@ -12318,28 +12645,28 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages from " -"the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages " +"from the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت " -"دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " +"اینترنت دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must also " -"interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must " +"also interop with C/C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/" -"C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " +"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-" -"source variant of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده " -"در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " +"استفاده در google3)." #: src/android/build-rules.md #, fuzzy @@ -12352,11 +12679,11 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, create " -"the following files:" +"Let us start with a simple application. At the root of an AOSP checkout, " +"create the following files:" msgstr "" -"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد " -"کنید:" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " +"ایجاد کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -12431,9 +12758,9 @@ msgid "" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://" -"cs.android.com/android/platform/superproject/+/master:external/rust/crates/) عرضه " -"شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/) عرضه شده است." #: src/android/build-rules/library.md msgid "\"hello_rust_with_dep\"" @@ -12456,8 +12783,9 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md src/android/aidl/example-service/service.md -#: src/android/testing.md src/android/interoperability/java.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/service.md src/android/testing.md +#: src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -12486,20 +12814,22 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android.com/" -"guide/components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android." +"com/guide/components/aidl) is supported in Rust:" msgstr "" "‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" "guide/components/aidl) در Rust پشتیبانی می‌شود:" @@ -12515,12 +12845,12 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement the " -"described service and write client code that talks to that service." +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder " -"را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را " -"می‌نویسیم که با آن سرویس صحبت می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " +"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " +"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -12532,8 +12862,10 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -12566,13 +12898,14 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match the " -"package name used in the AIDL file, i.e. the package is `com.example." +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package " -"استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example." -"birthdayservice` و این فایل در `aidl/com/example/IBirthdayService.aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " +"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." +"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." +"aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -12580,11 +12913,11 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to talk " -"to the service." +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با " -"سرویس" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"با سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -12592,24 +12925,24 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use this " -"trait to talk to the service." +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با " -"سرویس‌ها استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " +"صحبت با سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md msgid "" -"The generated bindings can be found at `out/soong/.intermediates//" -"`." +"The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" -"پیوندهای تولید شده را می توان در `out/soong/.intermediates//` " -"یافت." +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" +"` یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument and " -"return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." msgstr "" "اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " "بازگشتی، با تعریف interface مطابقت دارد." @@ -12619,8 +12952,8 @@ msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type " -"برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " +"type برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -12678,19 +13011,19 @@ msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain why " -"each of the segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از " -"بخش‌ها ضروری است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " +"از بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to override? " -"Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای " -"override وجود دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " +"برای override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -12734,17 +13067,17 @@ msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case the " -"`BirthdayService` type, which implements the `IBirthdayService`) and starting it " -"as a Binder service has multiple steps, and may appear more complicated than " -"students are used to if they've used Binder from C++ or another language. Explain " -"to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " -"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند " -"مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. " -"اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید " -"که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " +"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " +"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " +"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " +"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -12752,33 +13085,33 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this " -"case). This type is generated by Binder and provides the common Binder " +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " "functionality that would be provided by the `BnBinder` base class in C++. We " "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" "این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" -"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را " -"ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust ارث‌بری یا " -"inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " +"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " +"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " "`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object (the " -"`BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " -"«BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " +"(شی‏ «BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool and " -"start listening for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه " -"کنید و شروع به گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " +"اضافه کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -12788,14 +13121,16 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -12826,7 +13161,8 @@ msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md +#: src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -12861,63 +13197,67 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service that " -"the client has connected to." +"`Strong` is the trait object representing the service " +"that the client has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که " -"کلاینت به آن متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " +"که کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-process " -"ref count for the service trait object, and the global Binder ref count that " -"tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون " -"فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global " -"Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " +"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " +"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " +"ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses the " -"exact same trait that the server implements. For a given Binder interface, there " -"is a single Rust trait generated that both client and server use." +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." msgstr "" "توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " "دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " -"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور از آن " -"استفاده می کنند." +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " +"از آن استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This should " -"ideally be defined in a common crate that both the client and server can depend " -"on." +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." msgstr "" "از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " -"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن " -"وابسته باشند." +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " +"آن وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients specify a " -"list of lines for the birthday card:" +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم " -"لیستی از خطوط را برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " +"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -12925,13 +13265,13 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in " -"Rust, i.e. that idiomatic Rust types are used in the generated bindings wherever " -"possible:" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust " -"ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی " -"که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " +"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " +"شده تا جایی که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -12969,8 +13309,10 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "TODO: Move code snippets into project files where they'll actually be built?" -msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "" +"TODO: Move code snippets into project files where they'll actually be built?" +msgstr "" +"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -12982,18 +13324,21 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "" +"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "" +"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" -"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " +"کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -13002,7 +13347,8 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "" +"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -13109,20 +13455,22 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes " -"`[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. `int[3][4]`). In " -"the Java backend, fixed-size arrays are represented as array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به " -"`[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3]" -"[4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array type نمایش داده " -"می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " +"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " +"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " +"type نمایش داده می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -13130,21 +13478,24 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-erased " -"`IBinder` interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface " -"پاک‌شده ارسال کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " +"interface پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" @@ -13176,8 +13527,10 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" @@ -13193,8 +13546,10 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -13203,11 +13558,11 @@ msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md msgid "" -"Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` " -"type:" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای " -"Binder ارسال کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" +"سرورهای Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -13244,11 +13599,13 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -13257,21 +13614,21 @@ msgstr "\"کنترل فایل نامعتبر\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` " -"(or any other type that wraps an `OwnedFd`), and can be used to create a new " -"`File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." msgstr "" "‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " -"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای " -"ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " +"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX " -"sockets." +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های " -"TCP، UDP و UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " +"سوکت های TCP، UDP و UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -13279,11 +13636,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests work in " -"AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests " +"work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم " -"پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " +"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -13349,8 +13706,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " -"2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13360,8 +13717,8 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " -"2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13372,16 +13729,16 @@ msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی " -"در ماژول‌های تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " +"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه " -"می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " +"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13393,52 +13750,55 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured error " -"message pin-pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که " -"خطا را pin-pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " +"که خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this example in " -"a local environment. Use `cargo add googletest` to quickly add it to an existing " -"Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " -"local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add " -"googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " +"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " +"add googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used macros " -"and types](https://docs.rs/googletest/latest/googletest/prelude/index.html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used " +"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." +"html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://" -"docs.rs/googletest/latest/googletest/prelude/index.html) را وارد می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" +"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " +"می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider going " -"through the first chapter of [\"Advanced testing for Rust applications\"](https://" -"rust-exercises.com/advanced-testing/), a self-guided Rust course: it provides a " -"guided introduction to the library, with exercises to help you get comfortable " -"with `googletest` macros, its matchers and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " -"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-" -"workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه راهنمایی برای " -"کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای `googletest` و مطابقت‌های آن " -"و فلسفه کلی آن راحت باشید." +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" +"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " +"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " +"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md msgid "" -"A particularly nice feature is that mismatches in multi-line strings are shown as " -"a diff:" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان " -"داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " +"نشان داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -13469,103 +13829,109 @@ msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در " -"Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " +"در Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You " -"need to refactor your code to use traits, which you can then quickly mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " +"You need to refactor your code to use traits, which you can then quickly " +"mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده " -"استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس " -"می‌توانید به سرعت آنها را mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " +"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " +"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are other " -"[mocking libraries available on crates.io](https://crates.io/keywords/mock), in " -"particular in the area of mocking HTTP services. The other mocking libraries work " -"in a similar fashion as Mockall, meaning that they make it easy to get a mock " -"implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other [mocking libraries available on crates.io](https://crates.io/keywords/" +"mock), in particular in the area of mocking HTTP services. The other mocking " +"libraries work in a similar fashion as Mockall, meaning that they make it " +"easy to get a mock implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking " -"دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در " -"زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار " -"می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " +"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " +"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " +"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " +"را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and more " -"stable test execution. On the other hand, the mocks can be configured wrongly and " -"return output different from what the real dependencies would do." +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان " -"را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای " -"سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد " -"و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " +"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " +"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " +"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " +"برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As an " -"example, many databases allow you to configure an in-memory backend. This means " -"that you get the correct behavior in your tests, plus they are fast and will " -"automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." msgstr "" "در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " -"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی " -"کنید. این به این معنی است که شما در تست های خود رفتار صحیح را دریافت می کنید، به " -"علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات مخصوص به خود پاک می شوند." +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " +"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " +"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " +"مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away the " -"framework since it helps you test your code in the real environment." +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process " -"دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را " -"به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی " -"آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " +"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " +"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " +"را در محیط واقعی آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example in a " -"local environment. Use `cargo add mockall` to quickly add Mockall to an existing " -"Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local " -"اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo " -"موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " +"پروژه Cargo موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up expectations " -"which depend on the arguments passed. Here we use this to mock a cat which " -"becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که " -"به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat " -"استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " +"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " +"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " +"گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be called " -"to `n` --- the mock will automatically panic when dropped if this isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند " -"به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف " -"کنید به‌طور خودکار دچار panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " +"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " +"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) or " -"`stdout` (on-host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) " +"or `stdout` (on-host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی " -"host) استفاده کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " +"(روی host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -13623,13 +13989,15 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -13639,11 +14007,11 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This means " -"that you can:" +"Rust has excellent support for interoperability with other languages. This " +"means that you can:" msgstr "" -"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما " -"می‌توانید:" +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " +"شما می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -13655,8 +14023,8 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a _foreign " -"function interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a " +"_foreign function interface_, also known as FFI." msgstr "" "وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " "خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " @@ -13671,8 +14039,9 @@ msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به " -"طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " +"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " +"کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -13689,16 +14058,18 @@ msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise." -"md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." msgstr "" -"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " +"دیدیم." #: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." -msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgstr "" +"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -13710,8 +14081,8 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool " -"can auto-generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"tool can auto-generate bindings from a C header file." msgstr "" "ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." @@ -13769,7 +14140,8 @@ msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" -"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " +"نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -13818,34 +14190,40 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات " -"(bindings) اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " +"اتصالات (bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -13940,32 +14318,35 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will " -"just be the name of the function. You can also use `#[export_name = " +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " +"will just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط " -"نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای " -"تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " +"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " +"برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability " -"between Rust and C++." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe " +"interoperability between Rust and C++." msgstr "" -"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " +"می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -13973,13 +14354,14 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed from " -"each language to the other. You provide this description using extern blocks in a " -"Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed " +"from each language to the other. You provide this description using extern " +"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض " -"دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust " -"ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " +"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " +"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " +"شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -14028,24 +14410,25 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching Rust " -"and C++ type/function definitions in order to expose those items to both " -"languages." +"From the declarations made in the bridge module, CXX will generate matching " +"Rust and C++ type/function definitions in order to expose those items to " +"both languages." msgstr "" "از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" -"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " +"دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/" -"cargo-expand) to view the expanded proc macro. For most of the examples you would " -"use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't " -"apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/" +"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " +"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " +"(though this doesn't apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-" -"expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از " -"`cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای " -"پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " +"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " +"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -14070,22 +14453,23 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in the " -"parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in " +"the parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد " -"قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " +"والد قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ " -"header file containing the corresponding C++ declarations. The generated header " -"has the same path as the Rust source file containing the bridge, except with a ." -"rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" +"+ header file containing the corresponding C++ declarations. The generated " +"header has the same path as the Rust source file containing the bridge, " +"except with a .rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C " -"حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که " -"فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs.h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" +"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " +"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." +"h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -14110,8 +14494,8 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed in " -"are accurate. CXX performs static assertions that the signatures exactly " +"The programmer does not need to promise that the signatures they have typed " +"in are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" "برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " @@ -14120,11 +14504,11 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to call " -"from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to " +"call from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust " -"امن هستند را اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " +"Rust امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -14141,9 +14525,9 @@ msgid "" "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد " -"مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، " -"پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " +"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " +"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -14157,14 +14541,14 @@ msgstr "Generated C++:" #, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum class " -"to hold a value different from all of the listed variants, and our Rust " -"representation needs to have the same behavior." +"wrapping a numeric value. This is because it is not UB in C++ for an enum " +"class to hold a value different from all of the listed variants, and our " +"Rust representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی " -"را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از " -"همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی " -"داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " +"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " +"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " +"رفتار مشابهی داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -14176,23 +14560,25 @@ msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ side." +"Rust functions that return `Result` are translated to exceptions on the C++ " +"side." msgstr "" "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come from " -"the error type's `Display` impl." +"exposes a way to get the error message string. The error message will come " +"from the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول " -"راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " +"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " +"خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to immediately " -"terminate." +"A panic unwinding from Rust to C++ will always cause the process to " +"immediately terminate." msgstr "" "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." @@ -14207,23 +14593,24 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception on " -"the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception " +"on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت +" -"+C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " +"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " +"برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not declared by " -"the CXX bridge to return `Result`, the program calls C++'s `std::terminate`. The " -"behavior is equivalent to the same exception being thrown through a `noexcept` C+" -"+ function." +"If an exception is thrown from an extern \"C++\" function that is not " +"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" +"terminate`. The behavior is equivalent to the same exception being thrown " +"through a `noexcept` C++ function." msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " -"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی " -"می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C++ function " -"فعال می‌شود." +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " +"C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -14283,41 +14670,42 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments and " -"returns of extern functions." +"These types can be used in the fields of shared structs and the arguments " +"and returns of extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها " -"استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " +"functionها استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are a few " -"reasons for this:" +"Note that Rust's `String` does not map directly to `std::string`. There are " +"a few reasons for this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند " -"دلیل برای این وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " +"چند دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "" +"`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed directly " -"between languages." +"The two types have different layouts in memory and so can't be passed " +"directly between languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً " -"بین زبان‌ها منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " +"مستقیماً بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move semantics, " -"so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move " +"semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، " -"بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " +"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14330,8 +14718,8 @@ msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده " -"CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " +"شده CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -14358,43 +14746,43 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the " -"dependencies for the CXX-generated C++ bindings. We'll show how these are setup " -"on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." msgstr "" "به این نکته اشاره کنید که `libcxx_test_bridge_header` و " -"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​هستند. " -"نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" +"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in order to " -"pull in common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." msgstr "" "توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" "header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs](https://" -"source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" -"patterns#rust-cpp-interop-using-cxx). You may want to share that link with the " -"class so that students know where they can find these instructions again in the " -"future." +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید " -"[the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" -"modules/android-rust-patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن " -"پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند که در آینده می‌توانند این " -"دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " +"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" +"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " +"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " +"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the CXX " -"source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the " +"CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. " -"سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " +"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -14449,14 +14837,16 @@ msgid "" "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و " -"فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." +"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " +"اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" -"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " +"دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -14476,9 +14866,10 @@ msgid "" "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface " -"(JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` " -"crate](https://docs.rs/jni/) به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " +"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " +"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " +"کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -14548,11 +14939,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with and " -"try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with " +"and try to integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و " -"سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " +"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -14564,11 +14955,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone in " -"the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone " +"in the class having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی " -"است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " +"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -14576,51 +14967,51 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party glue " -"code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party " +"glue code to connect between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص " -"برای اتصال بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " +"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've got a " -"corner of the code where you're displaying a UTF8 string to the user, feel free " -"to follow this recipe in your part of the codebase instead of the exact part we " -"talk about." +"Today, we'll call into Rust to do something silly with strings. If you've " +"got a corner of the code where you're displaying a UTF8 string to the user, " +"feel free to follow this recipe in your part of the codebase instead of the " +"exact part we talk about." msgstr "" "امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " -"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت " -"دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد " -"دنبال کنید." +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " +"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " +"پایگاه کد دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build flags is " -"OK, so long as your code is relatively recent (commit position 1223636 onwards, " -"corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build " +"flags is OK, so long as your code is relatively recent (commit position " +"1223636 onwards, corresponding to November 2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از " -"build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit " -"1223636 به بعد، مربوط به نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " +"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " +"commit 1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md msgid "" -"(A component, debug build is recommended for quickest iteration time. This is the " -"default!)" +"(A component, debug build is recommended for quickest iteration time. This " +"is the default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک " -"حالت پیش‌فرض است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " +"یک حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-" -"code/) if you aren't already at that point. Be warned: setting up to build " -"Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" +"the-code/) if you aren't already at that point. Be warned: setting up to " +"build Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium." -"org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build " -"Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." +"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " +"برای build Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -14633,19 +15024,20 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" "This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. If " -"you don't have time to complete a certain part, don't worry: you can catch up in " -"the next slot." +"We'll be doing them spread throughout the course instead of just at the end. " +"If you don't have time to complete a certain part, don't worry: you can " +"catch up in the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها " -"را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای " -"تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " +"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " +"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " +"به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io](https://" -"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " -"dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io]" +"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " +"set of dependencies." msgstr "" "جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " "استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " @@ -14657,41 +15049,41 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e." -"g. `rust_static_library` that we'll meet later). This uses Chromium's audited " -"toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." +"gni` (e.g. `rust_static_library` that we'll meet later). This uses " +"Chromium's audited toolchain and crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای " -"بررسی‌شده Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " +"crateهای بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates]" -"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " +"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" +"docs/rust.md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium " -"محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/" -"rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " +"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded " -"from the internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " +"downloaded from the internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای " -"دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " +"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code " -"can be built into the Chromium browser. At the same time, Cargo is an important " -"part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " +"code can be built into the Chromium browser. At the same time, Cargo is an " +"important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان " -"کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم " -"Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " +"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " +"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -14703,11 +15095,11 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk " -"profile of these scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the " +"risk profile of these scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های " -"این سناریوها را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " +"ریسک‌های این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" @@ -14720,105 +15112,111 @@ msgstr "" #: src/chromium/cargo.md msgid "" "Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them to " -"discuss in small groups of 3-4 people." +"exercise. Assuming folks taking the course are physically together, ask them " +"to discuss in small groups of 3-4 people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران " -"خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، " -"از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " +"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " +"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where Cargo " -"may offer an advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where " +"Cargo may offer an advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را " -"ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " +"را ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, one " -"has access to the rich ecosystem of crates.io libraries. There is a crate for " -"almost anything and they are usually quite pleasant to use. (`clap` for command-" -"line parsing, `serde` for serializing/deserializing to/from various formats, " -"`itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, " +"one has access to the rich ecosystem of crates.io libraries. There is a " +"crate for almost anything and they are usually quite pleasant to use. " +"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" +"from various formats, `itertools` for working with iterators, etc.)." msgstr "" "این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " -"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک " -"crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط " -"فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای " -"کار با تکرارکننده‌ها (iterators) و غیره)." +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " +"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " +"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " +"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` " -"and start writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo." +"toml` and start writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه " -"کنید و شروع به نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " +"اضافه کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با " -"`python` + `pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " +"مقایسه با `python` + `pip`." #: src/chromium/cargo.md #, fuzzy msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate that " -"needs to work on nightly, current stable, and older stable) but also by an " -"ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a streamlined " -"way to run benchmarks)." -msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای " -"تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی " -"پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز " -"انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را برای ساده‌سازی و " -"اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate راهی ساده برای اجرای " -"benchmark‌ها می‌دهد)." +"using `rustup` to switch to a different `rustc` version when testing a crate " +"that needs to work on nightly, current stable, and older stable) but also by " +"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a " +"streamlined way to run benchmarks)." +msgstr "" +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " +"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " +"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " +"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " +"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " +"راهی ساده برای اجرای benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "" +"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" -"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " +"می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" -"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " +"باشد." #: src/chromium/cargo.md -msgid "Broad, generic examples of projects where `cargo` may be the right choice:" -msgstr "نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" +msgid "" +"Broad, generic examples of projects where `cargo` may be the right choice:" +msgstr "" +"نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for " -"writing command line tools. The breadth and ergonomics of libraries is comparable " -"to Python, while being more robust (thanks to the rich typesystem) and running " -"faster (as a compiled, rather than interpreted language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " +"for writing command line tools. The breadth and ergonomics of libraries is " +"comparable to Python, while being more robust (thanks to the rich " +"typesystem) and running faster (as a compiled, rather than interpreted " +"language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان " -"محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که " -"قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل " -"شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " +"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " +"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " +"زبان کامپایل شده و نه مفسری)." #: src/chromium/cargo.md msgid "" "Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be used " -"outside of Chromium (e.g. in Bazel or Android/Soong build environments) should " -"probably use Cargo." +"Cargo. Libraries that want to get external contributions, and want to be " +"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " +"should probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. " -"کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium " -"استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo " -"استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " +"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " +"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " +"باید از Cargo استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -14826,11 +15224,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which resulted " -"in PRs with performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which " +"resulted in PRs with performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با " -"بهبود در عملکرد می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " +"با بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -14838,20 +15236,22 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` for " -"command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` " +"for command-line parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به " -"`clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " +"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when " -"building and bootstrapping Rust standard library when building Rust toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " +"when building and bootstrapping Rust standard library when building Rust " +"toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در " -"هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " +"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " +"toolchain بود." #: src/chromium/cargo.md msgid "" @@ -14860,14 +15260,16 @@ msgid "" "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" "‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " -"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` " -"از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." +"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " +"است.)" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" -msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgstr "" +"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" @@ -14876,16 +15278,16 @@ msgid "" "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" "‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر " -"Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " +"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-" -"lang/ - همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" +"rust-lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -14893,11 +15295,11 @@ msgstr "`cargo`, `rustfmt`,سایر موارد." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for distributing " -"the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for " +"distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain " -"از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " +"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." @@ -14905,8 +15307,8 @@ msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by security@chromium." -"org)" +"Rust libraries vendored into `//third_party/rust` (audited by " +"security@chromium.org)" msgstr "" "کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " "security@chromium.org)" @@ -14921,76 +15323,94 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as approved by " -"Chromium's [Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/" -"main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as " +"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" +"chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech " -"Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید " -"شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " +"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" +"ATL_OWNERS) تأیید شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust " -"is allowed for third party libraries under various circumstances, including if " -"they're the best option for performance or for security." +"Chromium's policy on third party libraries is outlined [here](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." +"md#rust) - Rust is allowed for third party libraries under various " +"circumstances, including if they're the best option for performance or for " +"security." msgstr "" "رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده " -"است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا " -"آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " +"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " +"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that nearly " -"all such libraries will require a small amount of first-party glue code." +"Very few Rust libraries directly expose a C/C++ API, so that means that " +"nearly all such libraries will require a small amount of first-party glue " +"code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) " -"قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول " -"شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " +"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " +"glue code اول شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should normally be " -"kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should " +"normally be kept in `third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust/" -"//wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" +"rust///wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -15003,13 +15423,14 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "" -"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " +"کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر " -"مناسب ادامه یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " +"مسیر مناسب ادامه یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -15017,21 +15438,23 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` " -"for efficiency --- its static rules allow maximum parallelism. Rust is no " -"exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and " +"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " +"is no exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت " -"کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر " -"می‌سازد. Rust نیز از این قاعده مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " +"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " +"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "" +"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "" +"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -15055,8 +15478,8 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to depend " -"upon third party code." +"You can also add `deps` on other Rust targets. Later we'll use this to " +"depend upon third party code." msgstr "" "همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " "وابستگی به کد شخص ثالث استفاده خواهیم کرد." @@ -15064,37 +15487,38 @@ msgstr "" #: src/chromium/build-rules.md msgid "" "You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root file of " -"the compilation unit --- typically `lib.rs`. `sources` is a complete list of all " -"source files which `ninja` needs in order to determine when rebuilds are " -"necessary." -msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی " -"است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- " -"معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی " -"است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز دارد." +"`crate_root` is the file given to the Rust compiler representing the root " +"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " +"list of all source files which `ninja` needs in order to determine when " +"rebuilds are necessary." +msgstr "" +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " +"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " +"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " +"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " +"دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate " -"is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire " +"crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" "(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " "جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using [gn's " -"built-in support for Rust static libraries](https://gn.googlesource.com/gn/+/main/" -"docs/reference.md#func_static_library). The answer is that this template provides " -"support for CXX interop, Rust features, and unit tests, some of which we'll use " -"later." +"Students might be wondering why we need a gn template, rather than using " +"[gn's built-in support for Rust static libraries](https://gn.googlesource." +"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " +"this template provides support for CXX interop, Rust features, and unit " +"tests, some of which we'll use later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای " -"کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference." -"md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که این الگو از " -"CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً از برخی از آنها " -"استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " +"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " +"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " +"از برخی از آنها استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -15102,13 +15526,15 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't " -"compile. If you need unsafe Rust code, add `allow_unsafe = true` to the gn " -"target. (Later in the course we'll see circumstances where this is necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " +"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " +"the gn target. (Later in the course we'll see circumstances where this is " +"necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل " -"نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn " -"اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " +"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " +"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " +"است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -15174,26 +15600,29 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than for C+" -"+. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than " +"for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد " -"ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " +"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " +"استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust " -"support" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " +"Rust support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی " -"پشتیبانی از Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " +"قبلی پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output " +"directory)" msgstr "" -"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " +"شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -15201,23 +15630,24 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-analyzer " -"might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-" +"analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های " -"code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " +"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a piece " -"of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a " +"piece of Chromium-related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به " -"Chromium که بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " +"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "" +"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" @@ -15229,46 +15659,48 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." -msgstr "" -"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = " +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." +msgstr "" +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" +"CoC = K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This " -"will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " +"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/" -"CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` " -"می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " +"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." +"rs` می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; " -"the outline is in the file explorer pane in vscode; typical vim/CoC bindings = " -"space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " +"164; the outline is in the file explorer pane in vscode; typical vim/CoC " +"bindings = space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط " -"164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC bindings = " -"space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " +"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " +"bindings = space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the `QrCode::" -"with_bits` method)" +"Demo **type annotations** (there are quite a few nice examples in the " +"`QrCode::with_bits` method)" msgstr "" "نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" "with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will need to " -"be rerun after editing `BUILD.gn` files (which we will do a few times throughout " -"the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will " +"need to be rerun after editing `BUILD.gn` files (which we will do a few " +"times throughout the exercises in this session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های " -"`BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " +"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " +"اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" @@ -15276,50 +15708,53 @@ msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " +"containing:" msgstr "" -"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که " -"حاوی:" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " +"که حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety by the " -"Rust compiler, so you'll need to allow unsafe code in your `gn` target." +"**Important**: note that `no_mangle` here is considered a type of unsafety " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " +"target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی " -"(type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target " -"خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " +"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " +"`gn` target خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll see " -"how this can be automated by bindings generation tools):" +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " +"see how this can be automated by bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را " -"در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که " -"چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " +"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " +"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we " -"suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run " -"Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " +"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " +"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " +"times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما " -"قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. " -"Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" بارها چاپ " -"می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " +"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " +"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " +"بارها چاپ می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in " -"subsequent exercises. If you've succeeded, you will be able to use right-click " -"\"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " +"in subsequent exercises. If you've succeeded, you will be able to use right-" +"click \"Go to definition\" on `println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار " -"کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک " -"راست روی\"Go to definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " +"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " +"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md @@ -15328,35 +15763,38 @@ msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://source." -"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://" +"source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" +"l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." -"html#the-no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" +"abi.html#the-no_mangle-attribute)" msgstr "" "اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." "html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." -"html)" +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." +"extern.html)" msgstr "" -"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/" -"main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/" -"main/docs/reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy @@ -15369,145 +15807,152 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-denominator " -"interop language, C. Both C++ and Rust can natively declare and call C ABI " -"functions. Later in the course, we'll connect C++ directly to Rust." +"This example is unusual because it boils down to the lowest-common-" +"denominator interop language, C. Both C++ and Rust can natively declare and " +"call C ABI functions. Later in the course, we'll connect C++ directly to " +"Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. " -"بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " +"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to " -"generate two functions with the same name, and Rust can no longer guarantee that " -"the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " +"Rust to generate two functions with the same name, and Rust can no longer " +"guarantee that the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به " -"Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که " -"تابع مورد نظر فراخوانی شده است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " +"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " +"کند که تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " -"الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " +"از الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same source " -"file as the code being tested. This was covered [earlier](../testing.md) in the " -"course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same " +"source file as the code being tested. This was covered [earlier](../testing." +"md) in the course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد " -"مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده " -"بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " +"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " +"پوشش داده شده بود و به این صورت است:" #: src/chromium/testing.md msgid "" "In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable and " -"helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." +"follow this practice for Rust --- this makes tests consistently discoverable " +"and helps to avoid rebuilding `.rs` files a second time (in the `test` " +"configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این " -"روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف " -"باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) " -"جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " +"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " +"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " +"`test`) جلوگیری شود." #: src/chromium/testing.md -msgid "This results in the following options for testing Rust code in Chromium:" +msgid "" +"This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" +"rust`." msgstr "" "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when " -"Rust code is just a thin FFI layer and the existing unit tests provide sufficient " -"coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " +"when Rust code is just a thin FFI layer and the existing unit tests provide " +"sufficient coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. " -"زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای " -"ویژگی‌هایی که ارائه می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " +"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " +"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its public " -"API (using `pub mod for_testing { ... }` if needed). This is the subject of the " -"next few slides." +"`gtest` tests authored in Rust and using the crate under test through its " +"public API (using `pub mod for_testing { ... }` if needed). This is the " +"subject of the next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی " -"آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده " -"می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " +"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " +"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" "Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after adding " -"or updating third-party crates.)" +"exercised by Chromium bots. (Such testing is needed rarely --- only after " +"adding or updating third-party crates.)" msgstr "" "ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " -"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از " -"افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " +"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " +"used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل " -"Rust `gtest` استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " +"مقابل Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a thin " -"FFI glue) and therefore uses the existing C++ unit tests for testing both the C++ " -"and the Rust implementation (parameterizing the tests so they enable or disable " -"Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a " +"thin FFI glue) and therefore uses the existing C++ unit tests for testing " +"both the C++ and the Rust implementation (parameterizing the tests so they " +"enable or disable Rust using a `ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و " -"بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند " -"(تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک `ScopedFeatureList` آن را " -"فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " +"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " +"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " +"`ScopedFeatureList` آن را فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe implementation " -"of pixel transformations that are provided by `libpng` but missing in the `png` " -"crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit " -"from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe " +"implementation of pixel transformations that are provided by `libpng` but " +"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " +"functionality may benefit from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی " -"داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به " -"عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن " -"است از آزمایش های جداگانه‌ای که در Rust نوشته شده است بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " +"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " +"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " +"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " +"بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" -"testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" +"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " +"attribute)" msgstr "" "از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " "`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking " -"and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " +"panicking and not terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی " -"assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " +"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -15515,11 +15960,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing test " -"binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing " +"test binary that already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که " -"از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " +"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -15544,8 +15989,8 @@ msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام " -"دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " +"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -15587,19 +16032,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import " -"and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an " -"explicit `crate_name` for `my_rust_lib` so its crate name is computed based on " -"the full target path and name. Fortunately we can avoid working with such an " -"unwieldy name by using the `chromium::import!` macro from the automatically-" -"imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " +"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " +"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " +"computed based on the full target path and name. Fortunately we can avoid " +"working with such an unwieldy name by using the `chromium::import!` macro " +"from the automatically-imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " -"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح " -"برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل " -"هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` " -"از `chromium` crate که به‌طور خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز " -"کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " +"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " +"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " +"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " +"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " +"درنتیجه از کار با چنین نامی پرهیز کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -15611,30 +16056,30 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" -"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" +"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" -"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" +"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" "import`." #: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the crate " -"name has to be globally unique. crates.io guarantees uniqueness of its crate " -"names so `cargo_crate` GN targets (generated by the `gnrt` tool covered in a " -"later section) use short crate names." +"property, but doing this is discouraged. And it is discouraged because the " +"crate name has to be globally unique. crates.io guarantees uniqueness of its " +"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " +"covered in a later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، " -"اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح " -"سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین " -"می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که در بخش " -"بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " +"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " +"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " +"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " +"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -15650,13 +16095,13 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding two " -"integers received as arguments, computing the nth Fibonacci number, summing " -"integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding " +"two integers received as arguments, computing the nth Fibonacci number, " +"summing integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن " -"دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح " -"در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " +"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " +"اعداد صحیح در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -15668,114 +16113,122 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "" +"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new tools " -"being developed all the time. At the moment, Chromium uses a tool called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new " +"tools being developed all the time. At the moment, Chromium uses a tool " +"called CXX." msgstr "" "جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " -"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX " -"استفاده می‌کند." +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " +"CXX استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition language " -"(which looks a lot like Rust) and then CXX tools generate declarations for " -"functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition " +"language (which looks a lot like Rust) and then CXX tools generate " +"declarations for functions and types in both Rust and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار " -"شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع " -"و تایپ‌ها در Rust و ++C ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " +"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " +"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using " -"this." +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " +"using this." msgstr "" -"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " +"ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just the " -"same as you previously did. Point out that automating the process has the " -"following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just " +"the same as you previously did. Point out that automating the process has " +"the following benefits:" msgstr "" "از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " -"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند " -"دارای مزایای زیر است:" +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " +"فرآیند دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, " -"but with out-of-sync manual bindings you'd get Undefined Behavior)" +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " +"definitions, but with out-of-sync manual bindings you'd get Undefined " +"Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::" -"bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای " -"کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual " -"bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " +"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " +"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " +"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ methods; " -"manual bindings would require authoring such top-level, free functions manually)" +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " +"methods; manual bindings would require authoring such top-level, free " +"functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای " -"ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور " -"خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح بالا و " -"رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " +"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " +"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " +"بالا و رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - " -"به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " +"کنند - به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee " -"any particular ABI or memory layout. With manual bindings `std::span` / `&[T]` " -"have to be manually destructured and rebuilt out of a pointer and length - this " -"is error-prone given that each language represents empty slices slightly " -"differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't " +"guarantee any particular ABI or memory layout. With manual bindings `std::" +"span` / `&[T]` have to be manually destructured and rebuilt out of a " +"pointer and length - this is error-prone given that each language represents " +"empty slices slightly differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی " -"را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت " -"دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با توجه به اینکه " -"هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " +"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " +"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " +"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " +"خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are " -"natively supported. With manual bindings, one would have to pass C-ABI-compatible " -"raw pointers, which would increase lifetime and memory-safety risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " +"are natively supported. With manual bindings, one would have to pass C-ABI-" +"compatible raw pointers, which would increase lifetime and memory-safety " +"risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` " -"به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-" -"ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " +"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " +"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " +"طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" "`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can build " -"a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a " -"string)." +"string representation across the languages (e.g. `rust::String::lossy` can " +"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" +"terminate a string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها " -"درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را " -"از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک string را با NUL " -"خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " +"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " +"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " +"string را با NUL خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` " -"اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." +"rs` اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -15791,14 +16244,14 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural " -"macro does complex things to it. The generated code is quite a bit more " -"sophisticated - though this does still result in a `mod` called `ffi` in your " -"code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " +"procedural macro does complex things to it. The generated code is quite a " +"bit more sophisticated - though this does still result in a `mod` called " +"`ffi` in your code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` " -"کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این " -"کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" +"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " +"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -15818,21 +16271,22 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, " -"but this is misleading. This header is never interpreted by Rust, but simply " -"`#include`d in the generated C++ code for the benefit of C++ compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by " +"Rust, but this is misleading. This header is never interpreted by Rust, but " +"simply `#include`d in the generated C++ code for the benefit of C++ " +"compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه " -"کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد +" -"+C تولید‌شده برای کامپایلرهای ++C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " +"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " +"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://cxx.rs/" -"bindings.html)." +"By far the most useful page when using CXX is the [type reference](https://" +"cxx.rs/bindings.html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx." -"rs/bindings.html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" +"(https://cxx.rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" @@ -15840,45 +16294,51 @@ msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of it." +"Your Rust-C++ interface is sufficiently simple that you can declare all of " +"it." msgstr "" "اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " "declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example `std::" -"unique_ptr`, `std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example " +"`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" "شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " "مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` type." +"It has many limitations --- for example lack of support for Rust's `Option` " +"type." msgstr "" -"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " +"Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well isolated " -"\"leaf nodes\" rather than for arbitrary Rust-C++ interop. When considering a use-" -"case for Rust in Chromium, a good starting point is to draft the CXX bindings for " -"the language boundary to see if it appears simple enough." +"These limitations constrain us to using Rust in Chromium only for well " +"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " +"considering a use-case for Rust in Chromium, a good starting point is to " +"draft the CXX bindings for the language boundary to see if it appears simple " +"enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" " -"به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن " -"یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که پیش نویس " -"پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا ببینید آیا به " -"اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " +"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " +"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " +"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " +"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You should also discuss some of the other sticky points with CXX, for example:" +"You should also discuss some of the other sticky points with CXX, for " +"example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "Its error handling is based around C++ exceptions (given on the next slide)" +msgid "" +"Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -15887,12 +16347,12 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C+" -"+ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " +"on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ " -"exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های " -"آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" +"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " +"جایگزین‌های آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -15901,11 +16361,12 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be " -"passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " +"be passed across the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این " -"مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " +"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " +"باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -15916,18 +16377,19 @@ msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای " -"یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " +"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " +"`Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed when `T` " -"is a Rust type, which cannot be passed across the FFI boundary, and cannot be " -"stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed " +"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " +"cannot be stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است " -"زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و " -"نمی تواند در `UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " +"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " +"کند و نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -15935,18 +16397,19 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` representing " -"failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` " +"representing failure)" msgstr "" "به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " "نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been needed in " -"practice." +"Preserving error details is in theory possible, but so far hasn't been " +"needed in practice." msgstr "" -"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " +"است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -15955,15 +16418,15 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;" -"l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to " -"communicate success vs failure, and where the successful result can be passed " -"across the FFI boundary:" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." +"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " +"used to communicate success vs failure, and where the successful result can " +"be passed across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:" -"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و جایی " -"که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" +"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " +"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -15971,36 +16434,37 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. This is " -"not the size of the vector, but the size of the QR code (and admittedly it is a " -"bit redundant - this is the square root of the size of the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. " +"This is not the size of the vector, but the size of the QR code (and " +"admittedly it is a bit redundant - this is the square root of the size of " +"the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه " -"بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه " -"بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " +"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " +"جذر اندازه بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` before " -"calling into the Rust function. Creation of a Rust reference that points to " -"uninitialized memory results in Undefined Behavior (unlike in C++, when only the " -"act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` " +"before calling into the Rust function. Creation of a Rust reference that " +"points to uninitialized memory results in Undefined Behavior (unlike in C++, " +"when only the act of dereferencing such memory results in UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` " -"اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار " -"نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB " -"می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " +"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " +"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " +"حافظه‌ای منجر به UB می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable references " -"to C++ data: the answer is that C++ data can’t be moved around like Rust data, " -"because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable " +"references to C++ data: the answer is that C++ data can’t be moved around " +"like Rust data, because it may contain self-referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل " -"تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند " -"داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential " -"pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " +"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " +"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " +"خودارجاعی (self-referential pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -16008,11 +16472,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the successful " -"result cannot be passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the " +"successful result cannot be passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI " -"عبور کند و چه کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " +"FFI عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -16037,29 +16501,31 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types " -"cannot cross the FFI boundary without indirection of a `Box`. We can't have an " -"`out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust " -"objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " +"types cannot cross the FFI boundary without indirection of a `Box`. We " +"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " +"to store Rust objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این " -"نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم " -"`out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust " -"object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " +"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " +"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " +"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary generics " -"nor templates, we can still pass them across the FFI boundary by manually " -"specializing / monomorphizing them into a non-generic type. In the example " -"`ResultOfPngReader` is a non-generic type that forwards into appropriate methods " -"of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary " +"generics nor templates, we can still pass them across the FFI boundary by " +"manually specializing / monomorphizing them into a non-generic type. In the " +"example `ResultOfPngReader` is a non-generic type that forwards into " +"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " +"`as_mut`)." msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی " -"نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی " -"تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در " -"مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای مناسب `Result` " -"(به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» ارسال می‌شود." +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " +"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " +"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " +"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " +"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " +"ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -16067,13 +16533,13 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node " -"where we want to use Rust. You'd typically have one for each " +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" +"node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust " -"استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. " -"پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " +"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " +"یکی دارید. پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -16105,13 +16571,15 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium C++ " -"types to CXX Rust types --- for example [`SpanToRustSlice`](https://source." -"chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium " +"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" +"l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به " -"انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source." -"chromium.org/chromium/chromium/src /+/main:base/containers/span_rust.h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " +"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." +"h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" @@ -16120,31 +16588,32 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. " -"Calling back and forth to C/C++ from Rust may do arbitrary things to memory, and " -"compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` " -"keywords in C/C++ interop can harm the signal-to-noise ratio of such a keyword, " -"and is [controversial](https://steveklabnik.com/writing/the-cxx-debate), but " -"strictly, bringing any foreign code into a Rust binary can cause unexpected " -"behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " +"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " +"to memory, and compromise the safety of Rust's own data layouts. Presence of " +"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " +"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" +"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " +"binary can cause unexpected behavior from Rust's perspective." msgstr "" "پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " -"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام " -"دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار " -"زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین کلمه کلیدی آسیب " -"برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/the-cxx-debate) است، " -"اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث رفتار غیرمنتظره " -"از دیدگاه Rust شود." +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " +"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " +"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " +"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" +"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " +"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust `unsafe` " -"and `extern \"C\"` functions just like we did manually in the previous section." +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " +"`unsafe` and `extern \"C\"` functions just like we did manually in the " +"previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است " -"--- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل " -"به صورت دستی انجام دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " +"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " +"در بخش قبل به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -16156,13 +16625,13 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a " -"single function, to be called from C++, called `hello_from_rust`, taking no " -"parameters and returning no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which " +"specifies a single function, to be called from C++, called " +"`hello_from_rust`, taking no parameters and returning no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را " -"مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه " -"پارامتر و هیچ مقداری برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " +"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " +"بدون اینکه پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -16178,11 +16647,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, " -"include the generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. " +"Instead, include the generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، " -"فایل هِدِر تولید شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " +"عوض، فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -16194,11 +16663,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how flexible " -"Rust in Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how " +"flexible Rust in Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید " -"که Rust در Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " +"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -16213,25 +16682,26 @@ msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما " -"باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " +"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the `unsafe` " -"keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++." -"html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the " +"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" +"extern-c++.html#functions-and-member-functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` " -"را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx." -"rs/extern-c++.html#functions-and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " +"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" +"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"` را وارد کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" +"cxx.h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -16246,32 +16716,32 @@ msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " -"خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " +"و به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " -"خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " +"به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own " -"some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " +"own some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند " -"دارای یک C++ object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " +"بتواند دارای یک C++ object باشد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a " -"`Box`)." +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " +"need a `Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: " -"شما به یک `Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " +"(نکته: شما به یک `Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -16291,9 +16761,9 @@ msgid "" "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای " -"Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این " -"رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " +"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " +"تعریف این رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -16310,39 +16780,40 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "" -"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با آن " -"مواجه شوید:" +"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با " +"آن مواجه شوید:" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X and Y " -"are both function types. This is because your C++ function doesn't quite match " -"the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X " +"and Y are both function types. This is because your C++ function doesn't " +"quite match the declaration in your `cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر " -"دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::" -"bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " +"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " +"`cxx::bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. Doesn't " -"that risk UB? For CXX's _opaque_ types, no, because they are zero-sized. For CXX " -"trivial types yes, it's _possible_ to cause UB, although CXX's design makes it " -"quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. " +"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" +"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " +"CXX's design makes it quite difficult to craft such an example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB " -"را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع " -"بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار " -"دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " +"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " +"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " +"نمونه‌ای را بسیار دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://crates." -"io). It's _very easy_ for Rust crates to depend upon one another. So they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://" +"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " +"they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) " -"یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این " -"کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." +"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " +"آنها این کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -16397,16 +16868,16 @@ msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها " -"در Chromium را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " +"آن‌ها در Chromium را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely have " -"to bring in multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely " +"have to bring in multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود " -"چندین کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " +"بود چندین کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -16430,13 +16901,15 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. These " -"are managed through a single [`Cargo.toml`](https://source.chromium.org/chromium/" -"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. " +"These are managed through a single [`Cargo.toml`](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." +"toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. " -"اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/" -"+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " +"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " +"می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16459,13 +16932,14 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies." -"html) --- most commonly, you'll want to specify the `features` that you wish to " -"enable in the crate." +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" +"dependencies.html) --- most commonly, you'll want to specify the `features` " +"that you wish to enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://" -"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- " -"معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" +"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " +"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " +"کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16483,13 +16957,15 @@ msgid "" msgstr "" "در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت crate " -"است." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " +"crate است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"If you add a new crate, you should specify at least the `group`. This is one of:" -msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +"If you add a new crate, you should specify at least the `group`. This is one " +"of:" +msgstr "" +"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -16498,27 +16974,27 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this file to " -"specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this " +"file to specify where its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن " -"فایل (های) مجوز آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " +"یافتن فایل (های) مجوز آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file to " -"resolve problems." +"Later, we'll see some other things you will need to configure in this file " +"to resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده " -"خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " +"مشاهده خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` " -"rules." +"A tool called `gnrt` knows how to download crates and how to generate `BUILD." +"gn` rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD." -"gn` را ایجاد کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " +"`BUILD.gn` را ایجاد کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -16526,13 +17002,14 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running this " -"command you will be downloading and running its dependencies from `crates.io`. " -"See [the earlier section](../cargo.md) discussing this security decision." +"Although the `gnrt` tool is part of the Chromium source code, by running " +"this command you will be downloading and running its dependencies from " +"`crates.io`. See [the earlier section](../cargo.md) discussing this security " +"decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن " -"را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این " -"تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " +"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." +"md) را در مورد این تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -16548,11 +17025,11 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete set " -"of crates required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete " +"set of crates required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های " -"مورد نیاز Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " +"جعبه‌های مورد نیاز Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -16560,12 +17037,13 @@ msgid "" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" -"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال " -"می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" +"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " +"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "" +"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" @@ -16575,8 +17053,10 @@ msgstr "اکنون `git status` را اجرا کنید. شما باید این #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" -msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +"At least one new crate source code in `third_party/rust/chromium_crates_io/" +"vendor`" +msgstr "" +"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" @@ -16592,44 +17072,46 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://doc." -"rust-lang.org/cargo/reference/semver.html)." +"The \"major semver version\" is a [Rust \"semver\" version number](https://" +"doc.rust-lang.org/cargo/reference/semver.html)." msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه " -"کنید." +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Take a close look, especially at the things generated in `third_party/rust`." +msgid "" +"Take a close look, especially at the things generated in `third_party/rust`." msgstr "" "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium it's to " -"allow multiple incompatible versions of a crate, which is discouraged but " -"sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium " +"it's to allow multiple incompatible versions of a crate, which is " +"discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" "کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " -"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع " -"می‌شود ولی گاهی اوقات ضروری است." +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " +"منع می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the design of " -"`gn` and `ninja` which aim for static, deterministic, build rules to maximize " -"parallelism and repeatability of builds." +"arbitrary things at build time. This is fundamentally at odds with the " +"design of `gn` and `ninja` which aim for static, deterministic, build rules " +"to maximize parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که " -"کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی " -"`gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر رساندن " -"موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " +"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " +"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " +"رساندن موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "Some `build.rs` actions are automatically supported; others require action:" +msgid "" +"Some `build.rs` actions are automatically supported; others require action:" msgstr "" -"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام " -"دارند:" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " +"اقدام دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -16688,28 +17170,30 @@ msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها " -"تنها دو عمل اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " +"scriptها تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که " -"آیا کدهای منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " +"ببینید که آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add " -"`build-script-outputs` to the crate. If this is a transitive dependency, that is, " -"one on which Chromium code should not directly depend, also add `allow-first-" -"party-usage=false`. There are several examples already in that file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " +"add `build-script-outputs` to the crate. If this is a transitive dependency, " +"that is, one on which Chromium code should not directly depend, also add " +"`allow-first-party-usage=false`. There are several examples already in that " +"file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر " -"دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، " -"یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس `allow-first-" -"party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " +"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " +"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " +"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " +"فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -16728,26 +17212,27 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input to " -"subsequent build steps." +"`BUILD.gn` files to inform ninja that this particular output file is input " +"to subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا " -"فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی " -"خاص ورودی مراحل build بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " +"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " +"فایل خروجی خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/" -"C++ libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/" -"crates/bindgen) within their build scripts. These actions can't be supported in a " -"Chromium context --- our gn, ninja and LLVM build system is very specific in " -"expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build " -"و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از " -"[`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه " -"می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، " -"ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " +"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" +"crates.io/crates/bindgen) within their build scripts. These actions can't be " +"supported in a Chromium context --- our gn, ninja and LLVM build system is " +"very specific in expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " +"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " +"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " +"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " +"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " +"است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -16764,25 +17249,27 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - " -"see for example the [patches against the `cxx` crate](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - " -"and will be applied automatically by `gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" +"` - see for example the [patches against the `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - and will be applied automatically by " +"`gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` " -"نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" -"cxx/) - و هر بار که crate را upgrade می‌کند به‌طور خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" +"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " +"خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending on a " -"crate is simple. Find your `rust_static_library` target, and add a `dep` on the `:" -"lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending " +"on a crate is simple. Find your `rust_static_library` target, and add a " +"`dep` on the `:lib` target within your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه " -"به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا " -"کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " +"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " +"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -16792,13 +17279,15 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" @@ -16827,41 +17316,43 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-" -"review), but of course also subject to security review. As you may be bringing in " -"not just a single crate but also transitive dependencies, there may be a lot of " -"code to review. On the other hand, safe Rust code can have limited negative side " -"effects. How should you review it?" -msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/" -"src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما " -"البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، " -"بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای زیادی برای بررسی وجود داشته " -"باشد. از سوی دیگر، safe Rust code می‌تواند عوارض جانبی محدودی داشته باشد. پس " -"چگونه باید آن را بررسی کنید؟" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Third_party-review), but of course also subject to security review. As " +"you may be bringing in not just a single crate but also transitive " +"dependencies, there may be a lot of code to review. On the other hand, safe " +"Rust code can have limited negative side effects. How should you review it?" +msgstr "" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" +"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " +"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " +"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " +"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " +"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet](https://" -"mozilla.github.io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet]" +"(https://mozilla.github.io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla." -"github.io/cargo-vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" +"mozilla.github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "Meanwhile, for each new crate addition, we are checking for the following:" +msgid "" +"Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? If the " -"build system for each crate contains a `build.rs` or procedural macros, work out " -"what they're for. Are they compatible with the way Chromium is normally built?" +"Understand why each crate is used. What's the relationship between crates? " +"If the build system for each crate contains a `build.rs` or procedural " +"macros, work out what they're for. Are they compatible with the way Chromium " +"is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر " -"جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که " -"آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول ساخته و built " -"می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " +"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " +"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " +"ساخته و built می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -16876,18 +17367,19 @@ msgid "" "cargo.md))" msgstr "" "از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " -"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` " -"که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" +"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." +"md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" -"safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." +"md#unsafe-code-in-safe-languages)" msgstr "" "مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" -"safe-languages) خوب است" +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" +"in-safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -16895,21 +17387,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place that " -"might have been maliciously inserted. (You can't realistically aim for 100% " -"perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place " +"that might have been maliciously inserted. (You can't realistically aim for " +"100% perfection here: there's often just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد " -"شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ " -"درصدی باشید: اغلب کدهای زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " +"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " +"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium.org` to " -"work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium." +"org` to work out the right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار " -"کنید تا راه درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " +"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -16928,7 +17420,8 @@ msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" -"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" +"`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -16936,16 +17429,16 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` " -"changes, into the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config." +"toml` changes, into the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن " -"Chromium قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " +"مخزن Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` files " -"may result in some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` " +"files may result in some files being skipped." msgstr "" "**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." "gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." @@ -16954,48 +17447,49 @@ msgstr "" #, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git branches, " -"and many projects still use non-inclusive terminology there. So you may need to " -"run:" +"language. This is because Rust crate data tends to include names of git " +"branches, and many projects still use non-inclusive terminology there. So " +"you may need to run:" msgstr "" "در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " -"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام " -"شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده " -"می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " +"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " +"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to keep it " -"up to date with any security fixes](https://chromium.googlesource.com/chromium/" -"src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will " -"soon automate this for Rust crates, but for now, it's still your responsibility " -"just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to " +"keep it up to date with any security fixes](https://chromium.googlesource." +"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " +"hoped that we will soon automate this for Rust crates, but for now, it's " +"still your responsibility just as it is for any other third party dependency." msgstr "" "شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " -"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/" -"main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی این را " -"برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که " -"برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " +"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " +"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/features." -"html#the-default-feature). Assume that the crate will be used in shipping " -"Chromium, but won't be used to handle untrustworthy input." -msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های " -"پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features.html#the-default-" -"feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، " -"اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده نمی‌شود." +"crate's [default features](https://doc.rust-lang.org/cargo/reference/" +"features.html#the-default-feature). Assume that the crate will be used in " +"shipping Chromium, but won't be used to handle untrustworthy input." +msgstr "" +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " +"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " +"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " +"نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead " -"and do that now if you like. Or, you could create a new [`rust_executable` target]" -"(https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " +"ahead and do that now if you like. Or, you could create a new " +"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" +"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" "(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " "می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" @@ -17044,17 +17538,18 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to turn off " -"the default features." +"If students are downloading even more than that, they probably forgot to " +"turn off the default features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های " -"پیش‌فرض را خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " +"ویژگی‌های پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" -"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " +"crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -17065,8 +17560,8 @@ msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی " -"را که قبلاً یاد گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " +"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -17074,43 +17569,46 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. It's " -"important that we get Chromium for Pixies delivered to them as soon as possible." +"A community of pixies has been discovered living in a remote rainforest. " +"It's important that we get Chromium for Pixies delivered to them as soon as " +"possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم " -"است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " +"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie language." +"The requirement is to translate all Chromium's UI strings into Pixie " +"language." msgstr "" -"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " +"شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie language " -"is very close to English, and it turns out there's a Rust crate which does the " -"translation." +"There's not time to wait for proper translations, but fortunately pixie " +"language is very close to English, and it turns out there's a Rust crate " +"which does the translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie " -"بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را " -"انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " +"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " +"که ترجمه را انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/" -"uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" +"crates/uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and diligence. " -"Don't ship this!)" +"(Obviously, real translations of Chrome require incredible care and " +"diligence. Don't ship this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این " -"مورد را ارسال نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " +"این مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -17119,83 +17617,84 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" "Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always do " -"this irrespective of the setting of `mangle_localized_strings_`." +"strings before display. In this special build of Chromium, it should always " +"do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را " -"قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات " -"`mangle_localized_strings_` همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " +"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " +"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, you " -"should have created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, " +"you should have created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را " -"برای pixies ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " +"را برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and " -"will probably decide that it's better to do the conversion on the C++ side using " -"`base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " +"and will probably decide that it's better to do the conversion on the C++ " +"side using `base::UTF16ToUTF8` and back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و " -"احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::" -"UTF16ToUTF8` انجام دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " +"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " +"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " "consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which [CXX " -"supported types can transfer a lot of u16s](https://cxx.rs/binding/slice.html)." +"String.html#method.from_utf16), consider error handling, and consider which " +"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" +"slice.html)." msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. taking " -"and returning strings by value, or taking a mutable reference to a string. If a " -"mutable reference is used, CXX will likely tell the student that they need to use " -"[`Pin`](https://doc.rust-lang.org/std/pin/). You may need to explain what `Pin` " -"does, and then explain why CXX needs it for mutable references to C++ data: the " -"answer is that C++ data can't be moved around like Rust data, because it may " -"contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. " -"گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک " -"string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که " -"باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. ممکن است لازم " -"باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به آن برای ارجاع‌های " -"قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های C++ را نمی‌توان " -"مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" -"referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. " +"taking and returning strings by value, or taking a mutable reference to a " +"string. If a mutable reference is used, CXX will likely tell the student " +"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " +"need to explain what `Pin` does, and then explain why CXX needs it for " +"mutable references to C++ data: the answer is that C++ data can't be moved " +"around like Rust data, because it may contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " +"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " +"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " +"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " +"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " +"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " +"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " +"نشانگرهای خودارجاعی (self-referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need " -"to depend on a `rust_static_library` target. The student probably already did " -"this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " +"need to depend on a `rust_static_library` target. The student probably " +"already did this." msgstr "" "هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " -"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده " -"است." +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " +"داده است." #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" -"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته " -"باشد." +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " +"وابسته باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs](https://" -"chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs]" +"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review." -"googlesource.com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -17203,22 +17702,22 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people who " -"are familiar with the basics of Rust (perhaps from completing the Comprehensive " -"Rust course), and ideally also have some experience with bare-metal programming " -"in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people " +"who are familiar with the basics of Rust (perhaps from completing the " +"Comprehensive Rust course), and ideally also have some experience with bare-" +"metal programming in some other language such as C." msgstr "" -"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با اصول " -"Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز تجربه " -"برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." +"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با " +"اصول Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز " +"تجربه برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." #: src/bare-metal.md msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" -"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون سیستم‌عامل " -"در ادامه به چند بخش تقسیم خواهد شد:" +"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون " +"سیستم‌عامل در ادامه به چند بخش تقسیم خواهد شد:" #: src/bare-metal.md msgid "What is `no_std` Rust?" @@ -17239,20 +17738,22 @@ msgstr "برخی از crateهای مفید برای توسعه bare-metal Rust." #: src/bare-metal.md msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://tech." -"microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some " -"LEDs and buttons, an I2C-connected accelerometer and compass, and an on-board SWD " -"debugger." +"(https://microbit.org/) v2 as an example. It's a [development board](https://" +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " +"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " +"an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "" +"To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" -"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس یا " -"دبیان:" +"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس " +"یا دبیان:" #: src/bare-metal.md -msgid "And give users in the `plugdev` group access to the micro:bit programmer:" +msgid "" +"And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md @@ -17381,26 +17882,26 @@ msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را `panic = " -"\"abort\"` کامپایل کنید." +"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را " +"`panic = \"abort\"` کامپایل کنید." #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to define " -"your own entry point. This will typically involve a linker script and some " -"assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to " +"define your own entry point. This will typically involve a linker script and " +"some assembly code to set things up ready for Rust code to run." msgstr "" -"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما بستگی " -"دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker و مقداری " -"کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." +"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما " +"بستگی دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker " +"و مقداری کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-" -"lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc." +"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" -"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-lang." -"org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." +"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-" +"lang.org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." #: src/bare-metal/alloc.md #, fuzzy @@ -17424,31 +17925,31 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy system " -"allocator. Other crates are available, or you can write your own or hook into " -"your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy " +"system allocator. Other crates are available, or you can write your own or " +"hook into your existing allocator." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " -"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " -"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in " -"this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " +"in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" #: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in the " -"top-level binary crate." +"exactly one global allocator defined in your binary. Usually this is done in " +"the top-level binary crate." msgstr "" #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate " -"is linked in so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " +"crate is linked in so we get its panic handler." msgstr "" "برای اطمینان از اینکه `panic_halt` crate لینک شده است، استفاده `extern crate " "panic_halt as _` ضروری است، بنابراین panic handler آن را دریافت می‌کنیم." @@ -17459,27 +17960,27 @@ msgstr "این مثال ساخته می شود اما اجرا نمی‌شود، #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex " -"M microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for " +"Cortex M microcontrollers." msgstr "" -"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای میکروکنترلرهای " -"Cortex M فراهم می‌کند." +"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای " +"میکروکنترلرهای Cortex M فراهم می‌کند." #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" -"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع بررسی " -"خواهیم کرد." +"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع " +"بررسی خواهیم کرد." #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, " -"because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" +"> !`, because returning to the reset handler doesn't make sense." msgstr "" -"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::entry` " -"باشد، زیرا بازگشت به reset handler منطقی نیست." +"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::" +"entry` باشد، زیرا بازگشت به reset handler منطقی نیست." #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" @@ -17487,8 +17988,8 @@ msgstr "مثال را با `cargo embed --bin minimal` اجرا کنید" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning " -"on an LED on our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try " +"turning on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -17506,7 +18007,8 @@ msgstr "// GPIO peripheral offsets\n" msgid "// PIN_CNF fields\n" msgstr "// PIN_CNF fields\n" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" @@ -17521,7 +18023,8 @@ msgstr "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" @@ -17529,11 +18032,13 @@ msgstr "// Set pin 28 low and pin 21 high to turn the LED on.\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to " -"the first row." -msgstr "در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " +"to the first row." +msgstr "" +"در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" @@ -17546,20 +18051,21 @@ msgstr "Crateهای دسترسی جانبی" #: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/" -"doc/CMSIS/SVD/html/index.html) files." +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" +"pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" -"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust عمدتاً " -"ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD](https://www." -"keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." +"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust " +"عمدتاً ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD]" +"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by silicon " -"vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by " +"silicon vendors which describe the memory map of the device." msgstr "" -"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً توسط " -"فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را توصیف می‌کنند." +"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً " +"توسط فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را " +"توصیف می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -17569,12 +18075,13 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects which " -"patch the mistakes, add missing details, and publish the generated crates." +"SVD files are often buggy and incomplete, so there are various projects " +"which patch the mistakes, add missing details, and publish the generated " +"crates." msgstr "" -"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد که " -"اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید شده را " -"منتشر می‌کنند." +"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد " +"که اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید " +"شده را منتشر می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." @@ -17582,8 +18089,8 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac " -"-- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " +"pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" #: src/bare-metal/microcontrollers/hals.md @@ -17593,14 +18100,14 @@ msgstr "HAL crates" #: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around various " -"peripherals. These generally implement traits from [`embedded-hal`](https://" -"crates.io/crates/embedded-hal)." +"implementation-crates) for many microcontrollers provide wrappers around " +"various peripherals. These generally implement traits from [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal)." msgstr "" "این [crateهای HAL]‌(https://github.com/rust-embedded/wesome-embedded-rust#hal-" "implementation-crates) برای بسیاری از میکروکنترلرها بسته‌بندی‌هایی را در اطراف " -"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`](https://" -"crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." +"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" @@ -17613,8 +18120,8 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, " -"GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various " +"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" "بسیاری از HAL crateها برای انواعی از دستگاه های Cortex-M و RISC-V از جمله " "میکروکنترلرهای STM32، GD32، nRF، NXP، MSP430، AVR و PIC مختلف وجود دارد." @@ -17626,16 +18133,16 @@ msgstr "Board support crates" #: src/bare-metal/microcontrollers/board-support.md #, fuzzy msgid "" -"Board support crates provide a further level of wrapping for a specific board for " -"convenience." +"Board support crates provide a further level of wrapping for a specific " +"board for convenience." msgstr "" -"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک board " -"خاص فراهم می‌کنند." +"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک " +"board خاص فراهم می‌کنند." #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, and a " -"bit of initialisation." +"In this case the board support crate is just providing more useful names, " +"and a bit of initialisation." msgstr "" #: src/bare-metal/microcontrollers/board-support.md @@ -17664,37 +18171,37 @@ msgstr "// pin_input.is_high(); // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. " -"Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can " +"exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" -"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام می‌تواند " -"وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس دیگری نمی " -"تواند آن را بگیرد." +"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام " +"می‌تواند وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس " +"دیگری نمی تواند آن را بگیرد." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you can’t " -"keep use the old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you " +"can’t keep use the old instance afterwards." msgstr "" -"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از آن از " -"pin قدیمی استفاده کنید." +"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از " +"آن از pin قدیمی استفاده کنید." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, the " -"configuration state of a GPIO pin. This encodes the state machine into the type " -"system, and ensures that you don't try to use a pin in a certain way without " -"properly configuring it first. Illegal state transitions are caught at compile " -"time." +"The type of a value indicates the state that it is in: e.g. in this case, " +"the configuration state of a GPIO pin. This encodes the state machine into " +"the type system, and ensures that you don't try to use a pin in a certain " +"way without properly configuring it first. Illegal state transitions are " +"caught at compile time." msgstr "" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but not " -"vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but " +"not vice-versa." msgstr "" -"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی فراخوانی " -"کنید، اما برعکس امکان پذیر نیست." +"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی " +"فراخوانی کنید، اما برعکس امکان پذیر نیست." #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." @@ -17705,8 +18212,8 @@ msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" -"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی ویژگی را " -"ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" +"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی " +"ویژگی را ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" @@ -17726,36 +18233,38 @@ msgstr "گذرگاه‌ها و دستگاه‌های I2C و SPI" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out " -"into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`]" -"(https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/" -"crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" -"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم شدن " -"به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-can`]" -"(https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates.io/crates/" -"rand_core) به ترتیب." +"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم " +"شدن به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-" +"can`](https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates." +"io/crates/rand_core) به ترتیب." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-" -"embedded-rust#driver-crates) in terms of these traits, e.g. an accelerometer " -"driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/" +"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" -"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-embedded-" -"rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به عنوان مثال. یک " -"درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز داشته باشد." +"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-" +"embedded-rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به " +"عنوان مثال. یک درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز " +"داشته باشد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring them, " -"as initialisation and configuration is usually highly platform-specific." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other platforms " -"such as Linux on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other " +"platforms such as Linux on Raspberry Pi." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -17763,30 +18272,32 @@ msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) نسخه‌های " -"async از traitها را ارائه می دهد." +" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " +"نسخه‌های async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another " -"approach to non-blocking I/O, based on the [`nb`](https://crates.io/crates/nb) " -"crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" -"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد دیگری " -"را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// crates.io/" -"crates/nb) crate است." +"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد " +"دیگری را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// " +"crates.io/crates/nb) crate است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like " -"OpenOCD but better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " +"like OpenOCD but better integrated." msgstr "" -"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی جاسازی شده " -"است، مانند OpenOCD است، اما بهتر یکپارچه شده است." +"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی " +"جاسازی شده است، مانند OpenOCD است، اما بهتر یکپارچه شده است." #: src/bare-metal/microcontrollers/probe-rs.md -msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" -msgstr "SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" +msgid "" +"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgstr "" +"SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" @@ -17798,52 +18309,54 @@ msgstr "ادغام Cargo" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real " -"Time Transfers) output and connect GDB. It's configured by an `Embed.toml` file " -"in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " +"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." +"toml` file in your project directory." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " -"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " -"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm " -"standard protocol over USB for an in-circuit debugger to access the CoreSight " -"Debug Access Port of various Arm Cortex processors. It's what the on-board " -"debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " +"an Arm standard protocol over USB for an in-circuit debugger to access the " +"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " +"on-board debugger on the BBC micro:bit uses." msgstr "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک پروتکل " -"استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی به پورت " -"CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد استفاده قرار " -"گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از آن استفاده می‌کند." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک " +"پروتکل استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی " +"به پورت CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد " +"استفاده قرار گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از " +"آن استفاده می‌کند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a " -"range from SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " +"is a range from SEGGER." msgstr "" -"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link محدوده ای " -"از SEGGER است." +"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link " +"محدوده ای از SEGGER است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial " -"Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " +"Serial Wire Debug." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"probe-rs is a library which you can integrate into your own tools if you want to." +"probe-rs is a library which you can integrate into your own tools if you " +"want to." msgstr "" -"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود ادغام " -"کنید." +"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود " +"ادغام کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-" -"protocol/) lets VSCode and other IDEs debug code running on any supported " -"microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" +"adapter-protocol/) lets VSCode and other IDEs debug code running on any " +"supported microcontroller." msgstr "" "[پروتکل آداپتور Debug مایکروسافت](https://microsoft.github.io/debug-adapter-" "protocol/) به VSCode و سایر IDE‌ها اجازه می‌دهد کدهای موجود در هر میکروکنترلر " @@ -17852,15 +18365,16 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده است." +"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده " +"است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host " -"and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " +"host and the target through a number of ringbuffers." msgstr "" -"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و target از " -"طریق تعدادی بافر حلقه‌ای (ringbuffers) است." +"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و " +"target از طریق تعدادی بافر حلقه‌ای (ringbuffers) است." #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" @@ -17896,10 +18410,11 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "Shared resource management, message passing, task scheduling, timer queue" +msgid "" +"Shared resource management, message passing, task scheduling, timer queue" msgstr "" -"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر (timer " -"queue)" +"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر " +"(timer queue)" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" @@ -17918,7 +18433,8 @@ msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از حافظه" +"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از " +"حافظه" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" @@ -17926,8 +18442,8 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged " -"drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, " +"unprivileged drivers, IPC" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17936,16 +18452,17 @@ msgstr "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github." -"io/book/overview/using-the-standard-library.html)." -msgstr "" -"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-rs." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." "github.io/book/overview/using-the-standard-library.html)." +msgstr "" +"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-" +"rs.github.io/book/overview/using-the-standard-library.html)." #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر گرفت." +"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر " +"گرفت." #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." @@ -17953,8 +18470,8 @@ msgstr "این شامل هیچ HAL نیست." #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling " -"rather than a proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " +"scheduling rather than a proper kernel." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -17962,7 +18479,8 @@ msgid "Cortex-M only." msgstr "Cortex-M فقط." #: src/bare-metal/microcontrollers/other-projects.md -msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "" +"Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" "گوگل از TockOS در میکروکنترلر Haven برای کلیدهای امنیتی Titan استفاده می‌کند." @@ -17974,27 +18492,28 @@ msgstr "" #: src/exercises/bare-metal/morning.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial " -"port." -msgstr "ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port." +msgstr "" +"ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-morning." -"md) provided." +"After looking at the exercises, you can look at the [solutions](solutions-" +"morning.md) provided." msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه " -"کنید." +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " +"نگاه کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial " -"port. If you have time, try displaying it on the LEDs somehow too, or use the " -"buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port. If you have time, try displaying it on the LEDs somehow too, or " +"use the buttons somehow." msgstr "" -"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. اگر " -"وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از دکمه‌ها " -"استفاده کنید." +"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. " +"اگر وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از " +"دکمه‌ها استفاده کنید." #: src/exercises/bare-metal/compass.md msgid "Hints:" @@ -18002,14 +18521,15 @@ msgstr "نکته‌ها:" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/" -"lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) " -"crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" +"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" +"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." +"org/hardware/)." msgstr "" -"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و [`microbit-" -"v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه crateهای آن را بررسی " -"کنید همانطور که [micro:bit hardware](https://tech.microbit.org/hardware/) را " -"بررسی می‌کنید." +"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و " +"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه " +"crateهای آن را بررسی کنید همانطور که [micro:bit hardware](https://tech." +"microbit.org/hardware/) را بررسی می‌کنید." #: src/exercises/bare-metal/compass.md msgid "" @@ -18017,38 +18537,40 @@ msgid "" msgstr "" #: src/exercises/bare-metal/compass.md -msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "" +"TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" "TWI نام دیگری برای I2C است، بنابراین دستگاه جانبی اصلی I2C TWIM نامیده می‌شود." #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` " -"trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/" -"hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct." -"Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" -"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف دارید." +"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/" +"microbit/struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف " +"دارید." #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/" -"pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this " -"exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " +"this exercise." msgstr "" -"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi.com/" -"pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." +"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " -"in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `compass` directory for the following files." msgstr "" "این [الگوی تمرین](../../comprehensive-rust-exercises.zip) را دانلود کنید و " "فایل‌های زیر را در دایرکتوری `compass` جستجو کنید." @@ -18074,8 +18596,10 @@ msgid "See the serial output on Linux with:" msgstr "مشاهده خروجی سریال در لینوکس با:" #: src/exercises/bare-metal/compass.md -msgid "Or on Mac OS something like (the device name may be slightly different):" -msgstr "یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" +msgid "" +"Or on Mac OS something like (the device name may be slightly different):" +msgstr "" +"یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." @@ -18128,10 +18652,12 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md #, fuzzy msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" msgstr "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" #: src/bare-metal/aps.md @@ -18140,14 +18666,15 @@ msgstr "" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now " -"let's try writing something for Cortex-A. For simplicity we'll just work with " -"QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " -"board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " +"Now let's try writing something for Cortex-A. For simplicity we'll just work " +"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" +"virt.html) board." msgstr "" -"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا بیایید " -"سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's aarch64 " -"['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) کار می‌کنیم." +"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا " +"بیایید سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's " +"aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " +"کار می‌کنیم." #: src/bare-metal/aps.md msgid "" @@ -18165,15 +18692,16 @@ msgid "" "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" -"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی می " -"کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای ماشین‌های " -"مجازی طراحی شده است." +"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی " +"می کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای " +"ماشین‌های مجازی طراحی شده است." #: src/bare-metal/aps/entry-point.md -msgid "Before we can start running Rust code, we need to do some initialisation." +msgid "" +"Before we can start running Rust code, we need to do some initialisation." msgstr "" -"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه را " -"انجام دهیم." +"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه " +"را انجام دهیم." #: src/bare-metal/aps/entry-point.md msgid "" @@ -18182,8 +18710,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU " -"and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18202,7 +18730,8 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18212,7 +18741,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18253,8 +18783,8 @@ msgstr "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU " -"and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18273,7 +18803,8 @@ msgstr "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18283,7 +18814,8 @@ msgstr "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18321,58 +18853,60 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, zeroing " -"the BSS, and setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, " +"zeroing the BSS, and setting up the stack pointer." msgstr "" -"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر کردن " -"BSS و تنظیم stack pointer." +"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر " +"کردن BSS و تنظیم stack pointer." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the object " -"file which containing statically allocated variables which are initialised to " -"zero. They are omitted from the image, to avoid wasting space on zeroes. The " -"compiler assumes that the loader will take care of zeroing them." +"The BSS (block starting symbol, for historical reasons) is the part of the " +"object file which containing statically allocated variables which are " +"initialised to zero. They are omitted from the image, to avoid wasting space " +"on zeroes. The compiler assumes that the loader will take care of zeroing " +"them." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and the " -"image is loaded, but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and " +"the image is loaded, but we zero it to be sure." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If we " -"don't:" +"We need to enable the MMU and cache before reading or writing any memory. If " +"we don't:" msgstr "" -"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار را " -"نکنیم:" +"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار " +"را نکنیم:" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-" -"none` target which sets `+strict-align` to prevent the compiler generating " -"unaligned accesses, so it should be fine in this case, but this is not " -"necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-" +"unknown-none` target which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses, so it should be fine in this case, but this " +"is not necessarily the case in general." msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem " -"is that the VM is accessing memory directly with the cache disabled, while the " -"host has cacheable aliases to the same memory. Even if the host doesn't " -"explicitly access the memory, speculative accesses can lead to cache fills, and " -"then changes from one or the other will get lost when the cache is cleaned or the " -"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost when the cache " +"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " +"not VA or IPA.)" msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity " -"maps the first 1 GiB of address space for devices, the next 1 GiB for DRAM, and " -"another 1 GiB higher up for more devices. This matches the memory layout that " -"QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " +"identity maps the first 1 GiB of address space for devices, the next 1 GiB " +"for DRAM, and another 1 GiB higher up for more devices. This matches the " +"memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -18380,14 +18914,14 @@ msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" -"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در مورد " -"آن خواهیم دید." +"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در " +"مورد آن خواهیم دید." #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 (EL1). " -"If you need to run at a different exception level you'll need to modify `entry.S` " -"accordingly." +"All examples this afternoon assume we will be running at exception level 1 " +"(EL1). If you need to run at a different exception level you'll need to " +"modify `entry.S` accordingly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -18396,13 +18930,13 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with Rust " -"code. For example, to make an HVC (hypervisor call) to tell the firmware to power " -"off the system:" +"Sometimes we need to use assembly to do things that aren't possible with " +"Rust code. For example, to make an HVC (hypervisor call) to tell the " +"firmware to power off the system:" msgstr "" "گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " -"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به " -"firmware بگویید سیستم را خاموش کند:" +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " +"که به firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -18460,56 +18994,58 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of functions " -"to manage system and CPU power states, among other things. It is implemented by " -"EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of " +"functions to manage system and CPU power states, among other things. It is " +"implemented by EL3 firmware and hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای " -"مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط " -"میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " +"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " +"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the inline " -"assembly code, and ignore its contents afterwards. We need to use `inout` rather " -"than `in` because the call could potentially clobber the contents of the " -"registers." +"The `0 => _` syntax means initialise the register to 0 before running the " +"inline assembly code, and ignore its contents afterwards. We need to use " +"`inout` rather than `in` because the call could potentially clobber the " +"contents of the registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی " -"به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به " -"جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را " -"مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " +"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " +"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " +"محتویات رجیسترها را مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is " -"called from our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " +"it is called from our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه " -"ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " +"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used " -"by the bootloader to pass things like a pointer to the device tree. According to " -"the standard aarch64 calling convention (which is what `extern \"C\"` specifies " -"to use), registers `x0`–`x7` are used for the first 8 arguments passed to a " -"function, so `entry.S` doesn't need to do anything special except make sure it " -"doesn't change these registers." -msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader " -"برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد " -"فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` برای استفاده مشخص " -"می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده به یک تابع استفاده " -"می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست کار خاصی انجام " -"دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " +"used by the bootloader to pass things like a pointer to the device tree. " +"According to the standard aarch64 calling convention (which is what `extern " +"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " +"arguments passed to a function, so `entry.S` doesn't need to do anything " +"special except make sure it doesn't change these registers." +msgstr "" +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " +"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " +"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " +"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " +"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " +"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " +"نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" +"examples`." msgstr "" -"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -18528,44 +19064,45 @@ msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را " -"دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " +"ساختارها را دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent the " -"compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent " +"the compiler or hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته " -"باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها " -"جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " +"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " +"حذف آنها جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the compiler " -"may assume that the value read is the same as the value just written, and not " -"bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the " +"compiler may assume that the value read is the same as the value just " +"written, and not bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر " -"ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع " -"خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " +"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " +"است و در واقع خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but this " -"is unsound. Whenever a reference exist, the compiler may choose to dereference it." +"Some existing crates for volatile access to hardware do hold references, but " +"this is unsound. Whenever a reference exist, the compiler may choose to " +"dereference it." msgstr "" "برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " -"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته " -"باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " +"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار " -"استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " +"ساختار استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -18573,11 +19110,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/" -"ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" +"documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/" -"g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -18592,8 +19129,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -18601,8 +19140,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -18636,37 +19177,40 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is because " -"as long as the caller of `Uart::new` guarantees that its safety requirements are " -"met (i.e. that there is only ever one instance of the driver for a given UART, " -"and nothing else aliasing its address space), then it is always safe to call " -"`write_byte` later because we can assume the necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is " +"because as long as the caller of `Uart::new` guarantees that its safety " +"requirements are met (i.e. that there is only ever one instance of the " +"driver for a given UART, and nothing else aliasing its address space), then " +"it is always safe to call `write_byte` later because we can assume the " +"necessary preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن " -"هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که " -"الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص " -"وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس همیشه می‌توان " -"`write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " +"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " +"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " +"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " +"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " +"را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but `write_byte` " -"unsafe), but that would be much less convenient to use as every place that calls " -"`write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but " +"`write_byte` unsafe), but that would be much less convenient to use as every " +"place that calls `write_byte` would need to reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما " -"`write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر " -"مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " +"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " +"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " +"استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving the " -"burden of proof for soundness from a large number of places to a smaller number " -"of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving " +"the burden of proof for soundness from a large number of places to a smaller " +"number of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت " -"عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " +"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" @@ -18674,9 +19218,10 @@ msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more traits " -"too." -msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +"We derived the `Debug` trait. It would be useful to implement a few more " +"traits too." +msgstr "" +"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -18700,8 +19245,8 @@ msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -18712,15 +19257,15 @@ msgstr "یک درایور UART بهتر" msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to read. " -"Plus, some of them are bit fields which would be nice to access in a structured " -"way." +"offsets to construct pointers to access them is error-prone and hard to " +"read. Plus, some of them are bit fields which would be nice to access in a " +"structured way." msgstr "" "‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " -"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند خواندن " -"را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی به آنها به " -"روشی ساختاریافته خوب است." +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " +"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " +"به آنها به روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -18884,8 +19429,8 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working " -"with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " +"working with bitflags." msgstr "" "این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " "bitflags مفید است." @@ -18942,34 +19487,37 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a " -"bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " +"with a bunch of method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی " -"متد برای دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " +"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "We can use a struct to represent the memory layout of the UART's registers." +msgid "" +"We can use a struct to represent the memory layout of the UART's registers." msgstr "" -"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " +"کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to (among " -"other things) reorder fields however it sees fit." +"predictable layout, as default Rust representation allows the compiler to " +"(among other things) reorder fields however it sees fit." msgstr "" "‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این " -"پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای داشتن یک طرح " -"قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر اجازه می دهد تا (از " -"جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب کند." +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " +"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " +"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " +"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " +"کند." #: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." @@ -19015,8 +19563,8 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields " -"without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"fields without creating an intermediate reference, which would be unsound." msgstr "" "به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " "جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." @@ -19027,11 +19575,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, and " -"echo incoming bytes." +"Let's write a small program using our driver to write to the serial console, " +"and echo incoming bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم " -"و بایت‌های ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " +"بنویسیم و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -19072,27 +19620,30 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` function " -"is called from our entry point code in `entry.S`. See the speaker notes there for " -"details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از " -"کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های " -"سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " +"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " +"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`](https://" -"crates.io/crates/log) crate. We can do this by implementing the `Log` trait." +"It would be nice to be able to use the logging macros from the [`log`]" +"(https://crates.io/crates/log) crate. We can do this by implementing the " +"`Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/" -"log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" +"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " +"دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -19108,8 +19659,8 @@ msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی " -"اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " +"مقداردهی اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." @@ -19130,39 +19681,40 @@ msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, " -"current EL with SPx, lower EL using AArch64, lower EL using AArch32). We " -"implement this in assembly to save volatile registers to the stack before calling " -"into Rust code:" +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " +"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " +"We implement this in assembly to save volatile registers to the stack before " +"calling into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، " -"IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL " -"using AArch64, lower EL using AArch32) تعریف می‌کند. ما این کار را در اسمبلی " -"پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از فراخوانی Rust در stack " -"ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " +"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " +"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " +"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " +"فراخوانی Rust در stack ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "" +"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current EL " -"exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current " +"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 " -"برای استثناهای پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " +"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't expect any " -"of them to actually happen." +"For this example we just log the exception and power down, as we don't " +"expect any of them to actually happen." msgstr "" "برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " "نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." @@ -19170,19 +19722,20 @@ msgstr "" #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or less " -"like different threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will " -"control what we can share between them, just like with threads. For example, if " -"we want to share some value between exception handlers and the rest of the " -"program, and it's `Send` but not `Sync`, then we'll need to wrap it in something " -"like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or " +"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." +"md) will control what we can share between them, just like with threads. For " +"example, if we want to share some value between exception handlers and the " +"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " +"it in something like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای " -"مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که " -"می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای " -"مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و بقیه برنامه به اشتراک " -"بگذاریم که بیشتر در مورد `Send` است اما مربوط به `Sync` نیست، باید آن را در چیزی " -"مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " +"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." +"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " +"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " +"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " +"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " +"قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -19203,27 +19756,27 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" -"OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" -"OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception " -"handling, page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " +"exception handling, page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception " -"و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " +"exception و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای " -"کپی کردن برای کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " +"برای کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -19235,43 +19788,44 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. " -"This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " +"enabled. This will read and write memory (e.g. the stack). However:" msgstr "" "آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " -"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " +"بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-" -"unknown-none` which sets `+strict-align` to prevent the compiler generating " -"unaligned accesses so it should be alright, but this is not necessarily the case " -"in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with " +"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses so it should be alright, but this is not " +"necessarily the case in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-" -"unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های " -"غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً " -"اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " +"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " +"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " +"صحیح باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem " -"is that the VM is accessing memory directly with the cache disabled, while the " -"host has cacheable aliases to the same memory. Even if the host doesn't " -"explicitly access the memory, speculative accesses can lead to cache fills, and " -"then changes from one or the other will get lost. Again this is alright in this " -"particular case (running directly on the hardware with no hypervisor), but isn't " -"a good pattern in general." -msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. " -"مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا " -"می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. حتی اگر host به طور " -"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش " -"شود و سپس تغییرات از یکی پس از دیگری از بین می‌رود. باز هم در این مورد خاص درست " -"است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما به‌طورکلی الگوی خوبی " -"نیست." +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost. Again this is " +"alright in this particular case (running directly on the hardware with no " +"hypervisor), but isn't a good pattern in general." +msgstr "" +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " +"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " +"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " +"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " +"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " +"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " +"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" @@ -19282,41 +19836,42 @@ msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" -"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل " -"می‌کند." +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " +"را حل می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits " -"and macros for safely converting between byte sequences and other types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " +"traits and macros for safely converting between byte sequences and other " +"types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی " -"را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " +"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but " -"can be useful for working with structures shared with hardware e.g. by DMA, or " -"sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " +"but can be useful for working with structures shared with hardware e.g. by " +"DMA, or sent over some external interface." msgstr "" "این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " -"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط " -"DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " +"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is valid, and " -"so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is " +"valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" "‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " -"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل " -"کرد." +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " +"تبدیل کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not all " -"byte patterns are valid." +"`RequestType` doesn't use all possible u32 values as discriminants, so not " +"all byte patterns are valid." msgstr "" "تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " "`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " @@ -19324,25 +19879,29 @@ msgstr "" #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "" +"`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-" -"example/`. (It won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"zerocopy-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا " -"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" +"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you " -"create page tables according to the AArch64 Virtual Memory System Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " +"you create page tables according to the AArch64 Virtual Memory System " +"Architecture." msgstr "" "این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " -"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " +"کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -19361,47 +19920,50 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should be " -"straightforward to add." +"For now it only supports EL1, but support for other exception levels should " +"be straightforward to add." msgstr "" -"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده " -"باشد." +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " +"ساده باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android.com/" -"android/platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android." +"com/android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/" -"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده " -"می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/) استفاده می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware or " -"under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware " +"or under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت " -"QEMU اجرا شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " +"یا تحت QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a " -"third-party crate implementing a basic buddy system allocator. It can be used " -"both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " +"is a third-party crate implementing a basic buddy system allocator. It can " +"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" "buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " -"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other " -"address space. For example, we might want to allocate MMIO space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک " -"third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن " -"را هم برای ['LockedHeap'](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) در پیاده‌سازی [`GlobalAlloc`]‌" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) استفاده کرد. " -"بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " -"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم " -"فضای MMIO را برای PCI BARها اختصاص دهیم:" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " +"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " +"allocating other address space. For example, we might want to allocate MMIO " +"space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " +"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " +"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " +"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " +"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " +"اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -19409,29 +19971,32 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-" -"example/`. (It won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"allocator-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا " -"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " +"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without heap " -"allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector " -"backed by an array or slice, which could be statically allocated or on the stack, " -"which keeps track of how many elements are used and panics if you try to use more " -"than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without " +"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " +"this: a vector backed by an array or slice, which could be statically " +"allocated or on the stack, which keeps track of how many elements are used " +"and panics if you try to use more than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما " -"بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را " -"فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت " -"ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده شده را ردیابی می‌کند و " -"اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " +"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " +"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " +"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " +"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " +"کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"`tinyvec` requires that the element type implement `Default` for initialisation." +"`tinyvec` requires that the element type implement `Default` for " +"initialisation." msgstr "" "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." @@ -19439,14 +20004,14 @@ msgstr "" msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی " -"اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " +"داخلی اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are " -"not available in `core` or `alloc`. How can we manage synchronisation or interior " -"mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " +"are not available in `core` or `alloc`. How can we manage synchronisation or " +"interior mutability, such as for sharing state between different CPUs?" msgstr "" "‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " "`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " @@ -19457,48 +20022,51 @@ msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، " -"بسیاری از این موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " +"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" -"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " +"کنید." #: src/bare-metal/useful-crates/spin.md msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و " -"`Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " +"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful " -"types for late initialisation with a slightly different approach to `spin::once::" -"Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " +"useful types for late initialisation with a slightly different approach to " +"`spin::once::Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های " -"مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " +"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" +"once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "The Rust Playground includes `spin`, so this example will run fine inline." +msgid "" +"The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" -"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا " -"می‌شود." +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` " -"Soong rule to build your Rust code, then a `cc_binary` with a linker script to " -"produce the binary itself, and then a `raw_binary` to convert the ELF to a raw " -"binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a " +"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " +"with a linker script to produce the binary itself, and then a `raw_binary` " +"to convert the ELF to a raw binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong " -"برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script " -"برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw " -"binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " +"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " +"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " +"ELF به یک raw binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -19508,30 +20076,31 @@ msgstr "vmbase" #, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/" -"libvmbase/) library provides a linker script and useful defaults for the build " -"rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" "برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" -"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/" -"heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای " -"این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و موارد دیگر." +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" +"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " +"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " +"موارد دیگر." #: src/bare-metal/android/vmbase.md msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` entry " -"point." +"The `main!` macro marks your main function, to be called from the `vmbase` " +"entry point." msgstr "" -"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی " -"شود." +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " +"فراخوانی شود." #: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main " -"function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " +"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -19542,10 +20111,11 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده " -"نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +"شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" @@ -19553,27 +20123,28 @@ msgstr "RTC driver" #, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, you " -"should write a driver for it." +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " +"you should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن " -"بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." +"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " +"برای آن بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the [`chrono`]" -"(https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the " +"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`]" -"(https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " +"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given time, " -"e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-" -"lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given " +"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" +"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" "از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " "بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" @@ -19581,13 +20152,14 @@ msgstr "" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by the " -"RTC match. You can use the driver provided in the [`arm-gic`](https://docs.rs/arm-" -"gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by " +"the RTC match. You can use the driver provided in the [`arm-gic`](https://" +"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را " -"مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/" -"arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " +"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" +"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -19598,22 +20170,24 @@ msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به " -"حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" +"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " +"به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " -"in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `rtc` directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های " -"زیر را در دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " +"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the " -"exercise):" -msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " +"the exercise):" +msgstr "" +"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -19788,8 +20362,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -19797,8 +20373,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19827,10 +20405,12 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19851,12 +20431,14 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19879,50 +20461,54 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md msgid "" -"Rust has full support for concurrency using OS threads with mutexes and channels." +"Rust has full support for concurrency using OS threads with mutexes and " +"channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از " -"mutex ها و channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " +"از mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since you " -"can rely on the compiler to ensure correctness at runtime." +"compile time bugs. This is often referred to as _fearless concurrency_ since " +"you can rely on the compiler to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان " -"کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " -"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در زمان " -"اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " +"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " +"زمان اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. " -"شامل موارد زیر است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " +"بکشد. شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: " -"thread‌ها، سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " +"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." -msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgstr "" +"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e.g., a " -"called function that might mutate an argument or save references to it to read " -"later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند " -"یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای " -"خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " +"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " +"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " +"می‌دهند. " #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -19943,8 +20529,8 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the end " -"of `main`." +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." msgstr "" "ایجاد threadهای جدید به طور خودکار خاتمه برنامه را تا پایان `main` به تاخیر " "نمی‌اندازد." @@ -19956,13 +20542,14 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" -"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " +"کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" -"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها " -"است." +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " +"آن‌ها است." #: src/concurrency/threads/plain.md msgid "Run the example." @@ -19970,7 +20557,8 @@ msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in lockstep." +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." msgstr "" "زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " "عمدتاً همگام می‌مانند." @@ -19978,15 +20566,16 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان " -"می‌رسد!" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " +"پایان می‌رسد!" #: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it persist." +"This is because main ends the program and spawned threads do not make it " +"persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم " -"آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " +"تداوم آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -19998,11 +20587,11 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " -"`JoinHandle`. Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " -"`JoinHandle`. به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" @@ -20014,11 +20603,11 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the " -"thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " +"the thread to finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا " -"منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " +"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -20030,25 +20619,26 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " -"returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " -"returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md msgid "" -"Use the `Result` return value from `handle.join()` to get access to the returned " -"value." -msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +"Use the `Result` return value from `handle.join()` to get access to the " +"returned value." +msgstr "" +"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -20056,19 +20646,21 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "" +"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://doc." -"rust-lang.org/std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://" +"doc.rust-lang.org/std/any/index.html)." msgstr "" "دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" "(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "" +"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -20081,8 +20673,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق " -"شده را برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " +"مشتق شده را برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -20090,17 +20682,17 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just return " -"and leave them running." +"Main kills child threads when it returns, but another function would just " +"return and leave them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return " -"می‌شود و آنها را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " +"return می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض " -"می‌کند!" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " +"نقض می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -20112,27 +20704,28 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn." -"scope.html) for this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" +"fn.scope.html) for this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/" -"thread/fn.scope.html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" +"std/thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all the " -"threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all " +"the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین " -"می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " +"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, " -"or immutably by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one " +"thread, or immutably by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با " -"یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " +"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " +"بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -20140,11 +20733,12 @@ msgstr "این بخش باید حدود ۲۰ دقیقه طول بکشد. این #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts " -"are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two " +"parts are connected via the channel, but you only see the end-points." msgstr "" -"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از طریق " -"channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را می‌بینید." +"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از " +"طریق channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را " +"می‌بینید." #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" @@ -20153,7 +20747,8 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does not." +"implement `Clone` (so you can make multiple producers) but `Receiver` does " +"not." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -20183,30 +20778,32 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "With bounded (synchronous) channels, `send` can block the current thread:" +msgid "" +"With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" -"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را مسدود کند:" +"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را " +"مسدود کند:" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the channel " -"for the new message. The thread can be blocked indefinitely if there is nobody " -"who reads from the channel." +"Calling `send` will block the current thread until there is space in the " +"channel for the new message. The thread can be blocked indefinitely if there " +"is nobody who reads from the channel." msgstr "" -"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته باشد، " -"thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread را می‌توان " -"به طور نامحدود مسدود کرد." +"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته " +"باشد، thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread " +"را می‌توان به طور نامحدود مسدود کرد." #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) if " -"the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) " +"if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". Every " -"send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". " +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -20219,48 +20816,48 @@ msgstr "همگام‌سازی" #: src/concurrency/send-sync/marker-traits.md msgid "" -"How does Rust know to forbid shared access across threads? The answer is in two " -"traits:" +"How does Rust know to forbid shared access across threads? The answer is in " +"two traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو " -"trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " +"دو trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is " -"`Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " +"is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" "‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " "جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is " -"`Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " +"is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" "‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " -"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` " -"است." +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " +"`Sync` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The " -"compiler will automatically derive them for your types as long as they only " -"contain `Send` and `Sync` types. You can also implement them manually when you " -"know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" "‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " -"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای " -"انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی پیاده سازی " -"کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " +"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " +"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-safety " -"properties." +"One can think of these traits as markers that the type has certain thread-" +"safety properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety " -"خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" +"safety خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -20268,37 +20865,39 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if " -"it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " +"if it is safe to move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc." -"rust-lang.org/std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" +"doc.rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will run " -"in that thread. So the question is when you can allocate a value in one thread " -"and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will " +"run in that thread. So the question is when you can allocate a value in one " +"thread and deallocate it in another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " -"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی " -"می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " +"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " +"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " +"thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from a " -"single thread." +"As an example, a connection to the SQLite library must only be accessed from " +"a single thread." msgstr "" -"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " +"باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if " -"it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " +"if it is safe to access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync." -"html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن " -"باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." +"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " +"همزمان امن باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -20310,26 +20909,27 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is thread-" -"safe for shared use, it is also thread-safe to pass references of it across " -"threads." +"This statement is essentially a shorthand way of saying that if a type is " +"thread-safe for shared use, it is also thread-safe to pass references of it " +"across threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده " -"مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " +"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " +"امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across multiple " -"threads without the risk of data races or other synchronization issues, so it is " -"safe to move it to another thread. A reference to the type is also safe to move " -"to another thread, because the data it references can be accessed from any thread " -"safely." +"This is because if a type is Sync it means that it can be shared across " +"multiple threads without the risk of data races or other synchronization " +"issues, so it is safe to move it to another thread. A reference to the type " +"is also safe to move to another thread, because the data it references can " +"be accessed from any thread safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را " -"در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک " -"گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ نیز برای " -"انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع می‌دهد می‌توانند از " -"هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " +"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " +"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " +"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " +"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -20357,7 +20957,8 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "" +"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -20365,15 +20966,16 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "" +"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md msgid "" -"The generic types are typically `Send + Sync` when the type parameters are `Send " -"+ Sync`." -msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." +"The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." +msgstr "" +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " +"هستند.`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -20381,8 +20983,8 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. Typically " -"because of interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. " +"Typically because of interior mutability:" msgstr "" "این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " "معمول به دلیل تغییرپذیری داخلی(interior mutability):" @@ -20406,18 +21008,18 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple threads, but " -"they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" msgstr "" -"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل " -"کرد:" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on the " -"thread which created them. However, an already-locked mutex can have its guarded " -"variable read by any thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on " +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" "‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " "threadای که آنها را ایجاد کرده است، توزیع شوند." @@ -20429,24 +21031,24 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" -"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل " -"کرد:" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع " -"غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " +"مراجع غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است " -"ملاحظات همزمانی خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " +"است ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -20458,11 +21060,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-" -"only access via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " +"read-only access via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا " -"دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " +"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -20474,32 +21076,33 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that " -"uses atomic operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " +"that uses atomic operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات " -"atomic استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " +"عملیات atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and " -"`Sync` if and only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " +"and `Sync` if and only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. " -"`Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را " -"پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " +"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " +"آنها را پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but after " -"that the use of the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but " +"after that the use of the `T` is free." msgstr "" -"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن استفاده " -"از 'T' آزاد است." +"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن " +"استفاده از 'T' آزاد است." #: src/concurrency/shared-state/arc.md msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect them." +"Beware of reference cycles, `Arc` does not use a garbage collector to detect " +"them." msgstr "" "مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " "استفاده نمی‌کند." @@ -20510,14 +21113,15 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual " -"exclusion _and_ allows mutable access to `T` behind a read-only interface " -"(another form of [interior mutability](../../borrowing/interior-mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " +"mutual exclusion _and_ allows mutable access to `T` behind a read-only " +"interface (another form of [interior mutability](../../borrowing/interior-" +"mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که " -"حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only " -"interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../borrowing/interior-" -"mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " +"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " +"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" +"borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -20525,41 +21129,42 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang." -"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " +"implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang." -"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن " -"داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " +"کامل آن داریم." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the protected " -"data." +"`Mutex` in Rust looks like a collection with just one element --- the " +"protected data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) " -"به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " +"(protected) به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md msgid "" -"It is not possible to forget to acquire the mutex before accessing the protected " -"data." +"It is not possible to forget to acquire the mutex before accessing the " +"protected data." msgstr "" -"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش " -"کرد." +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " +"فراموش کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` " -"ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The " +"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین " -"می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " +"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements " -"`Send`." +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " +"implements `Send`." msgstr "" "‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " "استفاده‌ می‌کنند." @@ -20574,17 +21179,18 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to " -"signal that the data it protected might be in an inconsistent state. Calling " -"`lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang." -"org/std/sync/struct.PoisonError.html). You can call `into_inner()` on the error " -"to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» " -"می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. " -"فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang." -"org/std/sync/struct.PoisonError.html) انجام نمی‌شود. می‌توانید `into_inner()` را در " -"مورد خطا برای بازیابی داده‌ها بدون توجه به آن فراخوانی کنید." +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" +"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " +"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " +"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " +"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " +"فراخوانی کنید." #: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" @@ -20604,28 +21210,30 @@ msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " +"orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between " -"threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " +"between threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل " -"تغییر (mutable) بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " +"قابل تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل " -"کرد. نکته `move` به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " +"منتقل کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." +"Blocks are introduced to narrow the scope of the `LockGuard` as much as " +"possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -20634,31 +21242,33 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has their own " -"place at the table. There is a fork between each plate. The dish served is a kind " -"of spaghetti which has to be eaten with two forks. Each philosopher can only " -"alternately think and eat. Moreover, a philosopher can only eat their spaghetti " -"when they have both a left and right fork. Thus two forks will only be available " -"when their two nearest neighbors are thinking, not eating. After an individual " -"philosopher finishes eating, they will put down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز " -"دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که " -"باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا " -"بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی بخورد که هم چنگال " -"چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط زمانی در دسترس خواهد بود " -"که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس از اینکه یک " -"فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has " +"their own place at the table. There is a fork between each plate. The dish " +"served is a kind of spaghetti which has to be eaten with two forks. Each " +"philosopher can only alternately think and eat. Moreover, a philosopher can " +"only eat their spaghetti when they have both a left and right fork. Thus two " +"forks will only be available when their two nearest neighbors are thinking, " +"not eating. After an individual philosopher finishes eating, they will put " +"down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " +"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " +"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " +"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " +"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " +"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " +"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " +"پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) for " -"this exercise. Copy the code below to a file called `src/main.rs`, fill out the " -"blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) " +"for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی " -"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " -"کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " +"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " +"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -20773,47 +21383,49 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It should " -"start at a webpage and check that links on the page are valid. It should " -"recursively check other pages on the same domain and keep doing this until all " -"pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It " +"should start at a webpage and check that links on the page are valid. It " +"should recursively check other pages on the same domain and keep doing this " +"until all pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. " -"باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. " -"باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این کار را تا زمانی " -"که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " +"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " +"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " +"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`](https://" -"docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use " -"[`thiserror`](https://docs.rs/thiserror/)." -msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز " -"دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " -"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی برای " -"رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`]" +"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " +"we will use [`thiserror`](https://docs.rs/thiserror/)." +msgstr "" +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " +"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " +"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" "thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام " -"کنید:" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " +"اعلام کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` " -"را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." +"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "" +"The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "" +"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -20825,7 +21437,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -20838,15 +21451,16 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://www." -"google.org/`." +"You can now download the start page. Try with a small site such as `https://" +"www.google.org/`." msgstr "" "اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." "google.org/` امتحان کنید." @@ -20904,18 +21518,19 @@ msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند " -"به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " +"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " +"بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google.org` " -"domain. Put an upper limit of 100 pages or so so that you don't end up being " -"blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google." +"org` domain. Put an upper limit of 100 pages or so so that you don't end up " +"being blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google." -"org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط " -"سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." +"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " +"نهایت توسط سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -20942,8 +21557,10 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "/// Determine whether links within the given page should be extracted.\n" -msgstr "/// Determine whether links within the given page should be extracted.\n" +msgid "" +"/// Determine whether links within the given page should be extracted.\n" +msgstr "" +"/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -20969,57 +21586,57 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed concurrently " -"by executing each task until it would block, then switching to another task that " -"is ready to make progress. The model allows running a larger number of tasks on a " -"limited number of threads. This is because the per-task overhead is typically " -"very low and operating systems provide primitives for efficiently identifying I/O " -"that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر " -"کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است " -"سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از " -"رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار کم است و " -"سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به ادامه هستند فراهم " -"می‌کنند." +"\"Async\" is a concurrency model where multiple tasks are executed " +"concurrently by executing each task until it would block, then switching to " +"another task that is ready to make progress. The model allows running a " +"larger number of tasks on a limited number of threads. This is because the " +"per-task overhead is typically very low and operating systems provide " +"primitives for efficiently identifying I/O that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " +"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " +"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " +"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " +"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " +"ادامه هستند فراهم می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work that " -"may be completed in the future. Futures are \"polled\" until they signal that " -"they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work " +"that may be completed in the future. Futures are \"polled\" until they " +"signal that they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن " -"است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، " -"«polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " +"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " +"ندهند، «polled» می‌شوند." #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس " -"هستند." +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " +"دسترس هستند." #: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", similar " -"to a runtime in Rust." +"callback-based, and not polled. Async Python programs require a \"loop\", " +"similar to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر " -"callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime " -"در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " +"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " +"runtime در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language runtime " -"implements the event loop, so many of the details of Promise resolution are " -"hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language " +"runtime implements the event loop, so many of the details of Promise " +"resolution are hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. " -"runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از " -"جزئیات واضح در Promise پنهان می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " +"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " +"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -21028,7 +21645,8 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential code:" +"At a high level, async Rust code looks very much like \"normal\" sequential " +"code:" msgstr "" "در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " "sequential code):" @@ -21043,8 +21661,8 @@ msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی " -"مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " +"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -21053,23 +21671,24 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" -"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " +"کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return type " -"with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return " +"type with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک " -"future جایگزین می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " +"یک future جایگزین می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the compiler on " -"how to use the returned future." +"You cannot make `main` async, without additional instructions to the " +"compiler on how to use the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future " -"بازگشتی، `main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " +"future بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md msgid "" @@ -21081,8 +21700,8 @@ msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. Unlike " -"`block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. " +"Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" "همیشه `await` به طور ناهمزمان (asyn) منتظر تکمیل یک عملیات دیگر است. برخلاف " "`block_on` یک `await` معمولاً thread فعلی را مسدود نمی‌کند." @@ -21092,101 +21711,102 @@ msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در " -"آینده معرفی می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " +"مورد در آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, " -"implemented by objects that represent an operation that may not be complete yet. " -"A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/" -"std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " +"trait, implemented by objects that represent an operation that may not be " +"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، " -"اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده " -"باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/" -"std/task/enum.Poll.html) را برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " +"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " +"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but uncommon) to " -"implement `Future` for your own types. For example, the `JoinHandle` returned " -"from `tokio::spawn` implements `Future` to allow joining to it." +"An async function returns an `impl Future`. It's also possible (but " +"uncommon) to implement `Future` for your own types. For example, the " +"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " +"joining to it." msgstr "" "یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " -"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` " -"برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا امکان پیوستن " -"(joining) به آن را فراهم کند." +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " +"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " +"امکان پیوستن (joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function to " -"pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function " +"to pause until that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا " -"زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " +"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the links " -"to show the implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the " +"links to show the implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای " -"نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " +"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async code, " -"rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async " +"code, rather than building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر " -"نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " +"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md msgid "" -"`Context` allows a Future to schedule itself to be polled again when an event " -"occurs." +"`Context` allows a Future to schedule itself to be polled again when an " +"event occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll " -"مجدد برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " +"poll مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into that " -"future remain valid. This is required to allow references to remain valid after " -"an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into " +"that future remain valid. This is required to allow references to remain " +"valid after an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future " -"معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `." -"await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " +"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " +"ماندن پس از `.await` لازم است." #: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust does " -"not have a \"built-in\" runtime, but several options are available:" +"_reactor_) and is responsible for executing futures (an _executor_). Rust " +"does not have a \"built-in\" runtime, but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و " -"مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین " -"گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " +"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " +"اما چندین گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github." -"com/hyperium/tonic) for gRPC." +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" +"github.com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به " -"خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://" -"github) .com/hyperium/tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " +"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " +"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a " -"basic runtime in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " +"a basic runtime in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل " -"یک runtime اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " +"شامل یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -21195,8 +21815,8 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/" -"src/lib.rs) already has one." +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" +"async/src/lib.rs) already has one." msgstr "" "چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " "[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" @@ -21204,24 +21824,25 @@ msgstr "" #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust playground. " -"The playground also does not permit any I/O, so most interesting async things " -"can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust " +"playground. The playground also does not permit any I/O, so most interesting " +"async things can't run in the playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان " -"Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین " -"بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " +"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " +"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never used." +"Promises, for example, which will run to completion even if they are never " +"used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/" -"O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling " -"کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند " -"تا پایان کامل شدن برنامه اجرا خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " +"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " +"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " +"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21230,7 +21851,8 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "" +"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -21268,8 +21890,8 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait until " -"it finishes." +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " +"until it finishes." msgstr "" "چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " "`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." @@ -21288,16 +21910,17 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make progress. " -"That future may have one or more nested futures that its `poll` method polls, " -"corresponding loosely to a call stack. Concurrency within a task is possible by " -"polling multiple child futures, such as racing a timer and an I/O operation." +"A task has a single top-level future which the executor polls to make " +"progress. That future may have one or more nested futures that its `poll` " +"method polls, corresponding loosely to a call stack. Concurrency within a " +"task is possible by polling multiple child futures, such as racing a timer " +"and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را " -"poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` " -"آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده مطابقت دارد. " -"همزمانی در یک task با poll از چندین child future، مانند رقابت یک تایمر و یک " -"عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " +"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " +"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " +"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " +"یک تایمر و یک عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -21327,47 +21950,53 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"از تماس تلفنی متشکریم، {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "Copy this example into your prepared `src/main.rs` and run it from there." +msgid "" +"Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " +"کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/" -"man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix." +"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" +"telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/" -"nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" +"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with a " -"few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with " +"a few connected clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه " -"taskهایی وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " +"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a closure, " -"but does not take any arguments. Its return value is a Future, similar to an " -"`async fn`." +"This is the first time we've seen an `async` block. This is similar to a " +"closure, but does not take any arguments. Its return value is a Future, " +"similar to an `async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ " -"استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " +"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md msgid "" -"Refactor the async block into a function, and improve the error handling using `?" -"`." +"Refactor the async block into a function, and improve the error handling " +"using `?`." msgstr "" -"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " +"بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "" +"Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "" +"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" @@ -21394,12 +22023,13 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "" +"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the [morning " -"class](../channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the " +"[morning class](../channels.md)." msgstr "" "به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" "channels.md) دیده می‌شود." @@ -21411,30 +22041,31 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient for " -"complex applications with both IO and heavy CPU processing tasks." +"implement both `sync` and `async` `send` and `recv`. This can be convenient " +"for complex applications with both IO and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی " -"است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای " -"برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " +"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " +"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to combine " -"them with other `future`s to combine them and create complex control flow." +"What makes working with `async` channels preferable is the ability to " +"combine them with other `future`s to combine them and create complex control " +"flow." msgstr "" "چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " "`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns a " -"collection of their results. This is similar to `Promise.all` in JavaScript or " -"`asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns " +"a collection of their results. This is similar to `Promise.all` in " +"JavaScript or `asyncio.gather` in Python." msgstr "" "عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " -"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در " -"JavaScript یا `asyncio.gather` در پایتون است." +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " +"در JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" @@ -21454,59 +22085,62 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but you " -"must know how many futures you will have at compile time. This is currently in " -"the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but " +"you must know how many futures you will have at compile time. This is " +"currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، " -"اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در " -"جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " +"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " +"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " +"می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would cause " -"your program to stall." +"The risk of `join` is that one of the futures may never resolve, this would " +"cause your program to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث " -"می‌شود برنامه شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " +"باعث می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all requests to " -"an http service as well as a database query. Try adding a `tokio::time::sleep` to " -"the future, using `futures::join!`. This is not a timeout (that requires `select!" -"`, explained in the next chapter), but demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all " +"requests to an http service as well as a database query. Try adding a " +"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " +"timeout (that requires `select!`, explained in the next chapter), but " +"demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن " -"(`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید " -"`tokio::time::sleep` را با استفاده از `futures::join!` به future اضافه کنید. این " -"یک timeout نیست (که به `select!`نیاز دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه " -"`join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " +"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " +"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " +"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " +"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and responds to " -"that future's result. In JavaScript, this is similar to `Promise.race`. In " -"Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"A select operation waits until any of a set of futures is ready, and " +"responds to that future's result. In JavaScript, this is similar to `Promise." +"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به " -"نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و " -"در پایتون با `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل " -"مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " +"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " +"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)` قابل مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, each of " -"the form `pattern = future => statement`. When a `future` is ready, its return " -"value is destructured by the `pattern`. The `statement` is then run with the " -"resulting variables. The `statement` result becomes the result of the `select!` " -"macro." +"Similar to a match statement, the body of `select!` has a number of arms, " +"each of the form `pattern = future => statement`. When a `future` is ready, " +"its return value is destructured by the `pattern`. The `statement` is then " +"run with the resulting variables. The `statement` result becomes the result " +"of the `select!` macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که " -"هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` " -"آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس `statement` با " -"متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو `select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " +"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " +"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " +"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " +"`select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -21528,30 +22162,32 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, or " -"for a timeout. Change the `sleep` to sleep longer to see it fail. Why does the " -"`send` also fail in this situation?" +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" -"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async یا " -"به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر دهید تا " -"شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" +"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async " +"یا به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر " +"دهید تا شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a task " -"reacts to events in a loop. That has some pitfalls, which will be discussed in " -"the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes with " -"its share of pitfalls and footguns. We illustrate some of them in this chapter." +"asynchronous programming. However, the async/await model in Rust also comes " +"with its share of pitfalls and footguns. We illustrate some of them in this " +"chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous " -"فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و " -"pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " +"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " +"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " +"می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -21563,14 +22199,15 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that CPU " -"blocking tasks will block the executor and prevent other tasks from being " -"executed. An easy workaround is to use async equivalent methods where possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that " +"CPU blocking tasks will block the executor and prevent other tasks from " +"being executed. An easy workaround is to use async equivalent methods where " +"possible." msgstr "" "اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " -"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن " -"executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این است که در صورت " -"امکان از متدهای معادل async استفاده کنید." +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " +"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " +"است که در صورت امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -21592,69 +22229,73 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the " -"effect more obvious, but the bug is still present in the multi-threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This " +"makes the effect more obvious, but the bug is still present in the multi-" +"threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را " -"آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " +"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " +"دارد." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " +"باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و " -"handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " +"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, where " -"that library might depend on thread-local storage or map to specific OS threads " -"(e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." -msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ " -"به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک " -"thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از " -"طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به ذخیره‌سازی محلی thread یا " -"نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی داشته باشد. در چنین " -"شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"particularly problematic when interacting with other libraries via FFI, " +"where that library might depend on thread-local storage or map to specific " +"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " +"situations." +msgstr "" +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " +"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " +"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " +"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " +"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " +"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause another " -"task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause " +"another task to block, and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` " -"ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال " -"اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." +"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " +"thread در حال اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The type " -"returned is the result of a compiler transformation which turns local variables " -"into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The " +"type returned is the result of a compiler transformation which turns local " +"variables into data stored inside the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. " -"نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در " -"future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " +"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " +"ذخیره شده در future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because of " -"that, the future should never be moved to a different memory location, as it " -"would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because " +"of that, the future should never be moved to a different memory location, as " +"it would invalidate those pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به " -"همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را " -"باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " +"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " +"این pointerها را باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" @@ -21663,10 +22304,10 @@ msgid "" "operations that would move the instance it points to into a different memory " "location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می " -"توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی " -"را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند " -"را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " +"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " +"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " +"متفاوت منتقل کند را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -21718,147 +22359,154 @@ msgstr "\"نتیجه کار برای تکرار {i}: {resp}\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically call " -"`select!` in a loop." +"You may recognize this as an example of the actor pattern. Actors typically " +"call `select!` in a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. " -"بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " +"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"This serves as a summation of a few of the previous lessons, so take your time " -"with it." +"This serves as a summation of a few of the previous lessons, so take your " +"time with it." msgstr "" -"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن " -"کنید." +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " +"آن کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the " -"`select!`. This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " +"the `select!`. This will never execute. Why?" msgstr "" "به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " "`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "" +"Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::pin`:" +"`timeout_fut` in the `select!` to work around the move, then using `Box::" +"pin`:" msgstr "" "این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " -"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` " -"استفاده کنید:" +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" +"pin` استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset `timeout_fut` " -"every time it expires:" +"iteration (a fused future would help with this). Update to reset " +"`timeout_fut` every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::" -"Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی " -"`timeout_fut` هر بار که منقضی می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " +"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " +"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, but " -"that is difficult to use for a future that is reassigned." +"stabilized, with older code often using `tokio::pin!`) is also an option, " +"but that is difficult to use for a future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت " -"شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه " -"است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " +"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " +"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " +"دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that will " -"send to a `oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that " +"will send to a `oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد " -"کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " +"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, the " -"Rust borrow checker would prevent self-referential data from being moved, as the " -"references cannot outlive the data they point to. However, the code " -"transformation for async blocks and functions is not verified by the borrow " -"checker." +"Data that contains pointers to itself is called self-referential. Normally, " +"the Rust borrow checker would prevent self-referential data from being " +"moved, as the references cannot outlive the data they point to. However, the " +"code transformation for async blocks and functions is not verified by the " +"borrow checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده " -"می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری " -"می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده " -"بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط borrow checker تأیید " -"نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " +"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " +"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " +"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " +"borrow checker تأیید نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its place " -"using a pinned pointer. However, it can still be moved through an unpinned " -"pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its " +"place using a pinned pointer. However, it can still be moved through an " +"unpinned pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از " -"یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق " -"یک pointer بدون پین جابجا کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " +"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " +"از طریق یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut " -"Self` to refer to the instance. That's why it can only be called on a pinned " -"pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " +"`&mut Self` to refer to the instance. That's why it can only be called on a " +"pinned pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به " -"نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک " -"اشاره‌‌گر پین شده فراخوانی کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " +"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " +"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 release. " -"This required support for using return-position `impl Trait` (RPIT) in traits, as " -"the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی " -"برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا " -"شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " +"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " +"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " +"Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around `async " -"fn` and RPIT in traits:" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT " -"در ویژگی‌ها وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " +"RPIT در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns of " -"borrowing cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین " -"برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " +"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not `dyn` " -"compatible." +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند " -"با `dyn` سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " +"می‌کنند با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/" -"latest/async_trait/) provides a workaround through a macro, with some caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) provides a workaround through a macro, with some " +"caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/" -"latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " +"چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -21875,40 +22523,43 @@ msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف " -"از heap allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " +"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " +"عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and probably " -"not worth describing in-depth. Niko Matsakis did a good job of explaining them in " -"[this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-" -"traits-are-hard/) if you are interested in digging deeper." +"The challenges in language support for `async trait` are deep Rust and " +"probably not worth describing in-depth. Niko Matsakis did a good job of " +"explaining them in [this post](https://smallcultfollowing.com/babysteps/" +"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " +"digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش " -"توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) " -"آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " +"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " +"هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of time and " -"adding it to the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of " +"time and adding it to the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به " -"Vec اضافه کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " +"را به Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to ensure " -"the system works correctly even when futures are cancelled. For example, it " -"shouldn't deadlock or lose data." +"_cancellation_ and it can occur at any `await` point. Care is needed to " +"ensure the system works correctly even when futures are cancelled. For " +"example, it shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این " -"حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از " -"عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، " -"نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " +"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " +"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " +"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -21928,16 +22579,16 @@ msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و " -"در نظر بگیرید که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " +"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-" -"handling)." +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " +"error-handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به " -"خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " +"به خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." @@ -21945,12 +22596,15 @@ msgstr "اسن مثال بخش‌هایی از string را از دست می‌د #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." -msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " +"dropped." +msgstr "" +"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" +"`LinesReader` can be made cancellation-safe by making `buf` part of the " +"struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -21961,22 +22615,22 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a tick " -"has been 'delivered'." +"html#method.tick) is cancellation-safe because it keeps track of whether a " +"tick has been 'delivered'." msgstr "" "‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick " -"تحویل داده شده است." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " +"tick تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." -"html#method.read) is cancellation-safe because it either returns or doesn't read " -"data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) is cancellation-safe because it either " +"returns or doesn't read data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." -"html#method.read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا " -"نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " +"برمی‌گرداند یا نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" @@ -21985,8 +22639,8 @@ msgid "" "cancellation-safe. See its documentation for details and alternatives." msgstr "" "‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-safe " -"نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" +"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -21999,18 +22653,18 @@ msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers." -"md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" +"philosophers.md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-locally." -"md) for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-" +"locally.md) for this exercise. Copy the code below to a file called `src/" +"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) " -"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " -"کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." +"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " +"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22026,11 +22680,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. You " -"can use the following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. " +"You can use the following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. " -"می‌توانید از `Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " +"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -22041,8 +22695,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" -"multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" msgstr "" "```toml\n" @@ -22052,14 +22706,14 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" -"multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module from " -"the `tokio` crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module " +"from the `tokio` crate." msgstr "" "همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " "crate استفاده کنید." @@ -22070,26 +22724,28 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast chat " -"application. We have a chat server that the clients connect to and publish their " -"messages. The client reads user messages from the standard input, and sends them " -"to the server. The chat server broadcasts each message that it receives to all " -"the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast " +"chat application. We have a chat server that the clients connect to and " +"publish their messages. The client reads user messages from the standard " +"input, and sends them to the server. The chat server broadcasts each message " +"that it receives to all the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast " -"chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود " -"را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به " -"سرور ارسال می‌کند. سرور چت هر پیامی را که دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " +"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " +"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " +"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " +"دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" -"broadcast/fn.channel.html) on the server, and [`tokio_websockets`](https://docs." -"rs/tokio-websockets/) for the communication between the client and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" +"(https://docs.rs/tokio-websockets/) for the communication between the client " +"and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" -"broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/" -"tokio-websockets/) برای ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" +"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -22112,8 +22768,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", " -"\"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22126,8 +22782,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", " -"\"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22137,31 +22793,31 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes to " -"familiarize yourself with the API." +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " +"to familiarize yourself with the API." msgstr "" "شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" "websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait." -"StreamExt.html#method.next) implemented by `WebSocketStream`: for asynchronously " -"reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " +"asynchronously reading messages from a Websocket Stream." msgstr "" "‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان " -"پیام‌ها از یک جریان وب سوکت." +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " +"ناهمزمان پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." -"SinkExt.html#method.send) implemented by `WebSocketStream`: for asynchronously " -"sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " +"asynchronously sending messages on a Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." -"SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال " -"ناهمزمان پیام‌ها در یک Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " +"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" @@ -22170,15 +22826,16 @@ msgid "" "standard input." msgstr "" "‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " +"استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." -"Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." -"Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -22186,28 +22843,31 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` " -"file. In this project, we need two binaries. One for the client, and one for the " -"server. You could potentially make them two separate Cargo projects, but we are " -"going to put them in a single Cargo project with two binaries. For this to work, " -"the client and the server code should go under `src/bin` (see the [documentation]" -"(https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." -msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/" -"main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و " -"دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه " -"بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری قرار می‌دهیم. برای این " -"کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند (به[documentation](https://" -"doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) مراجعه کنید )." +"Normally in a Cargo project, you can have only one binary, and one `src/main." +"rs` file. In this project, we need two binaries. One for the client, and one " +"for the server. You could potentially make them two separate Cargo projects, " +"but we are going to put them in a single Cargo project with two binaries. " +"For this to work, the client and the server code should go under `src/bin` " +"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" +"targets.html#binaries))." +msgstr "" +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " +"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " +"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " +"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " +"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " +"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." +"html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/bin/" -"client.rs`, respectively. Your task is to complete these files as described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/" +"bin/client.rs`, respectively. Your task is to complete these files as " +"described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی " -"کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است " -"تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " +"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " +"شده است تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md @@ -22269,13 +22929,14 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous " -"loop. One task receives messages from the client and broadcasts them. The other " -"sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a " +"continuous loop. One task receives messages from the client and broadcasts " +"them. The other sends messages received by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده " -"کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. " -"دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " +"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " +"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " +"می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -22284,21 +22945,21 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and sending " -"them to the server, and (2) receiving messages from the server, and displaying " -"them for the user." +"performing two tasks: (1) reading user messages from standard input and " +"sending them to the server, and (2) receiving messages from the server, and " +"displaying them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task " -"استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و " -"(۲) دریافت پیام از سرور و نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " +"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " +"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز " -"فرستنده پیام، منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " +"جز فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -22364,33 +23025,33 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it " -"was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " -"باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " +"برده باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not perfect, so " -"if you spotted any mistakes or have ideas for improvements, please get in " -"[contact with us on GitHub](https://github.com/google/comprehensive-rust/" -"discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not " +"perfect, so if you spotted any mistakes or have ideas for improvements, " +"please get in [contact with us on GitHub](https://github.com/google/" +"comprehensive-rust/discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی " -"را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید]" -"(https://github.com/google/comprehensive-rust/discussions) وارد شوید. ما دوست " -"داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " +"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " +"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " +"شوید. ما دوست داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many Rust " -"terms. For translations, this also serves to connect the term back to the English " -"original." +"The following is a glossary which aims to give a short definition of many " +"Rust terms. For translations, this also serves to connect the term back to " +"the English original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان " -"Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی " -"است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " +"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " +"انگلیسی است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -22412,8 +23073,8 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the relationship " -"between types." +"A type associated with a specific trait. Useful for defining the " +"relationship between types." msgstr "" #: src/glossary.md @@ -22423,8 +23084,8 @@ msgid "" "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-" -"metal Rust](bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " +"[Bare-metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -22463,7 +23124,8 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable program." +"The process of converting source code into executable code or a usable " +"program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -22482,7 +23144,8 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " +"می‌شود." #: src/glossary.md msgid "" @@ -22504,7 +23167,8 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "" +"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -22517,8 +23181,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in a " -"program." +"The order in which the individual statements or instructions are executed in " +"a program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -22538,8 +23202,8 @@ msgid "" "associated tuple or struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار " -"مرتبط، نگه می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " +"ساختار مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" @@ -22577,22 +23241,22 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are no " -"longer in use." +"A mechanism that automatically frees up memory occupied by objects that are " +"no longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را " -"آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " +"نمی‌شوند را آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling code " -"reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling " +"code reuse with different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده " -"مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " +"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -22614,12 +23278,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and cannot " -"be used as an identifier." +"A reserved word in a programming language that has a specific meaning and " +"cannot be used as an identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به " -"عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " +"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -22633,14 +23297,14 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when normal " -"functions are not enough. A typical example is `format!`, which takes a variable " -"number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when " +"normal functions are not enough. A typical example is `format!`, which takes " +"a variable number of arguments, which isn't supported by Rust functions." msgstr "" "macro: \n" "ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " -"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از " -"آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " +"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -22654,22 +23318,22 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the value of " -"an expression." +"A control flow construct in Rust that allows for pattern matching on the " +"value of an expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم " -"می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " +"فراهم می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer needed, " -"leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer " +"needed, leading to a gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر " -"به افزایش تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " +"منجر به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -22682,12 +23346,12 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, to " -"organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, " +"to organize code in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust " -"است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " +"Rust است." #: src/glossary.md msgid "" @@ -22713,14 +23377,14 @@ msgid "" "managing the memory associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار " -"است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " +"مقدار است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of the " -"program." +"An unrecoverable error condition in Rust that results in the termination of " +"the program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -22736,12 +23400,12 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against an " -"expression in Rust." +"A combination of values, literals, or structures that can be matched against " +"an expression in Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت " -"داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " +"مطابقت داده شوند." #: src/glossary.md msgid "" @@ -22754,39 +23418,40 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task or " -"solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task " +"or solve a particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " -"مشکل خاصی اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " -"مشکل خاص اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاص اجرا کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which the " -"method is called." +"The first parameter in a Rust method that represents the instance on which " +"the method is called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " +"می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object is " -"tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object " +"is tracked, and the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که " -"شمارش به صفر می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " +"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -22835,8 +23500,8 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, preventing " -"memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, " +"preventing memory-related errors." msgstr "" "safe: \n" "به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " @@ -22871,7 +23536,8 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" "string: \n" "نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" @@ -22880,16 +23546,18 @@ msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different types " -"under a single name." +"A composite data type in Rust that groups together variables of different " +"types under a single name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " +"می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other functions." +"A Rust module containing functions that test the correctness of other " +"functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -22914,8 +23582,8 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to achieve " -"polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to " +"achieve polymorphism in Rust." msgstr "" "trait: \n" "مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " @@ -22929,33 +23597,34 @@ msgid "" "interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان " -"به typeها نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " +"علاقه‌تان به typeها نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple fields " -"have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple " +"fields have no names, and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام " -"هستند و با شماره ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " +"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values of a " -"particular kind in Rust." +"A classification that specifies which operations can be performed on values " +"of a particular kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در " -"Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " +"در Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or expression." +"The ability of the Rust compiler to deduce the type of a variable or " +"expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -22963,12 +23632,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading to " -"unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading " +"to unpredictable program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل " -"پیش‌بینی برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " +"غیرقابل پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" @@ -22976,8 +23645,8 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در " -"یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " +"یکی در یک زمان خاص." #: src/glossary.md msgid "" @@ -22986,8 +23655,8 @@ msgid "" "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر " -"ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " +"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -22995,18 +23664,18 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده " -"است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " +"شده است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe " -"Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See " +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. " -"[Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " +"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -23022,8 +23691,10 @@ msgstr "سایر منابع برای Rust" #: src/other-resources.md msgid "" -"The Rust community has created a wealth of high-quality and free resources online." -msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +"The Rust community has created a wealth of high-quality and free resources " +"online." +msgstr "" +"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -23032,45 +23703,46 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" -"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " +"می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical " -"free book about Rust. Covers the language in detail and includes a few projects " -"for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " +"canonical free book about Rust. Covers the language in detail and includes a " +"few projects for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف " -"در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت " -"نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " +"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " +"پروژه برای ساخت نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust " -"syntax via a series of examples which showcase different constructs. Sometimes " -"includes small exercises where you are asked to expand on the code in the " -"examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " +"Rust syntax via a series of examples which showcase different constructs. " +"Sometimes includes small exercises where you are asked to expand on the code " +"in the examples." msgstr "" "‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " "syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " -"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را در " -"مثال‌ها گسترش دهید." +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " +"در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of " -"the standard library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " +"of the standard library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه " -"استاندارد برای Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " +"کتابخانه استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book " -"which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " +"book which describes the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر " -"و مدل حافظه Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " +"گرامر و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -23079,30 +23751,32 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages (FFI)." +"including working with raw pointers and interfacing with other languages " +"(FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش " -"می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را " -"تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " +"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " +"(FFI) را تشریح می‌کند." #: src/other-resources.md msgid "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the Rust " -"Book was written." +"covers the new asynchronous programming model which was introduced after the " +"Rust Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل " -"برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از " -"نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " +"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " +"پس از نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an " -"introduction to using Rust on embedded devices without an operating system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"an introduction to using Rust on embedded devices without an operating " +"system." msgstr "" "‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل " -"می‌شود." +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " +"شامل می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -23114,113 +23788,115 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from " -"the perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " +"from the perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را " -"از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " +"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." -"html): covers Rust from the perspective of developers who write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." -"html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش " -"می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " +"زبان C می‌نویسند پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers " -"the syntax of Rust using side-by-side comparisons with other languages such as C, " -"C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): " +"covers the syntax of Rust using side-by-side comparisons with other " +"languages such as C, C++, Java, JavaScript, and Python." msgstr "" "‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " -"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، " -"Java، JavaScript و Python پوشش می‌دهد." +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " +"C++، Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you " -"learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " +"you learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک " -"به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " +"کمک به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" -"index.html): a series of small presentations covering both basic and advanced " -"part of the Rust language. Other topics such as WebAssembly, and async/await are " -"also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): a series of small presentations covering both basic " +"and advanced part of the Rust language. Other topics such as WebAssembly, " +"and async/await are also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" -"index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را " -"پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " +"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " +"پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" "[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" "testing/): a self-paced workshop that goes beyond Rust's built-in testing " -"framework. It covers `googletest`, snapshot testing, mocking as well as how to " -"write your own custom test harness." +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-" -"testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این " -"`googletest`، تست snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را " -"پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" +"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " +"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " +"تست‌های سفارشی خود را پوشش می‌دهد." #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs.microsoft.com/" -"en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. " -"The first is a set of 35 videos and the second is a set of 11 modules which " -"covers Rust syntax and basic constructs." +"series-to-rust/) and [Take your first steps with Rust](https://docs." +"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " +"new developers. The first is a set of 35 videos and the second is a set of " +"11 modules which covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. " -"com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان " -"جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از ۱۱ ماژول است که دستور " -"Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" +"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" +"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " +"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " +"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github." -"io/too-many-lists/): in-depth exploration of Rust's memory management rules, " -"through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." +"github.io/too-many-lists/): in-depth exploration of Rust's memory management " +"rules, through implementing a few different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/" -"too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف " -"list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." +"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " +"نوع مختلف list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for " -"even more Rust books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " +"for even more Rust books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های " -"بیشتر در مورد Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " +"کتاب‌های بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust documentation. " -"See the page on [other resources](other-resources.md) for a full list of useful " -"resources." +"The material here builds on top of the many great sources of Rust " +"documentation. See the page on [other resources](other-resources.md) for a " +"full list of useful resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست " -"کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " +"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 " -"license, please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/" -"main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache " +"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" +"rust/blob/main/LICENSE) for details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر " -"به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/LICENSE) " -"مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " +"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" +"LICENSE) مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -23228,13 +23904,14 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-" -"example/` directory for details, including the license terms." +"Some examples and exercises have been copied and adapted from [Rust by " +"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " +"`third_party/rust-by-example/` directory for details, including the license " +"terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-" -"example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به " -"دایرکتوری `third_party/rust-by-example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" +"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " +"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -23246,9 +23923,9 @@ msgid "" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس " -"شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-" -"on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " +"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " +"`third_party/rust-on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -23256,13 +23933,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section uses an " -"image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory " -"for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section " +"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " +"directory for details, including the license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از " -"[CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، " -"دایرکتوری `third_party/cxx/` را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " +"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " +"license، دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -23271,27 +23948,31 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` keyword " -#~ "makes them capture by value." +#~ "By default, closures will capture by reference if they can. The `move` " +#~ "keyword makes them capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. " -#~ "کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " +#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " +#~ "value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction), [ChromeOS](https://chromium.googlesource.com/" -#~ "chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/" -#~ "bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." +#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" -#~ "bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" -#~ "bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." +#~ "com/docs/setup/build/bazel/introduction) به Bazel." -#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "" +#~ "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "" +#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "" +#~ "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -23316,44 +23997,45 @@ msgstr "" #~ msgid "" #~ "In this example, we have a race between a cat and a dog. " -#~ "`first_animal_to_finish_race` listens to both channels and will pick whichever " -#~ "arrives first. Since the dog takes 50ms, it wins against the cat that take " -#~ "500ms." +#~ "`first_animal_to_finish_race` listens to both channels and will pick " +#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " +#~ "cat that take 500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر " -#~ "دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین " -#~ "سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز " -#~ "شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " +#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." +#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " +#~ "می‌کشد تا پیروز شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are supposed to " -#~ "receive only one `send`." +#~ "You can use `oneshot` channels in this example as the channels are " +#~ "supposed to receive only one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها " -#~ "فقط یک `send` را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " +#~ "کانال‌ها فقط یک `send` را دریافت کنند." #~ msgid "" -#~ "Try adding a deadline to the race, demonstrating selecting different sorts of " -#~ "futures." +#~ "Try adding a deadline to the race, demonstrating selecting different " +#~ "sorts of futures." #~ msgstr "" -#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان " -#~ "دهید." +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " +#~ "نشان دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their futures. It " -#~ "is easiest to use when every execution of `select!` creates new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their " +#~ "futures. It is easiest to use when every execution of `select!` creates " +#~ "new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future " -#~ "آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد " -#~ "می‌کند، راحت‌ترین استفاده از آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " +#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " +#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but this " -#~ "can lead to issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but " +#~ "this can lead to issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما " -#~ "این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) " -#~ "شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " +#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " +#~ "(pinning slide) شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -23389,8 +24071,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " -#~ "اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -23404,11 +24086,11 @@ msgstr "" #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." #~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/* ... */" -#~ "`." +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." #~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " -#~ "می‌شوند." +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " +#~ "مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -23418,20 +24100,21 @@ msgstr "" #~ msgid "" #~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgstr "" +#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; 3]" +#~ "[20, 30, 40], [0; " +#~ "3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), (T1, T2), …" +#~ "(), (T,), " +#~ "(T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" @@ -23452,16 +24135,17 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, " -#~ "and the only valid value of that type --- that is to say both the type and its " -#~ "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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " -#~ "این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به " -#~ "صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک " -#~ "تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی " -#~ "خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " +#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " +#~ "که در اسلاید بعدی خواهیم دید. " #, fuzzy #~ msgid "" @@ -23474,7 +24158,8 @@ msgstr "" #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" #~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " +#~ "کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -23487,9 +24172,11 @@ msgstr "" #~ "Point out that how `..` will expand to account for different number of " #~ "elements." #~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +#~ "یافت." -#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "" +#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" #~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " #~ "`[a@..,b]` را نشان دهید." @@ -23499,8 +24186,9 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-scoped " -#~ "values that cannot be moved or reallocated during the execution of the program." +#~ "Static and constant variables are two different ways to create globally-" +#~ "scoped values that cannot be moved or reallocated during the execution of " +#~ "the program." #~ msgstr "" #~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " #~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " @@ -23536,16 +24224,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " -#~ "اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل تغییر " -#~ "به یک برش از رشته‌ است." +#~ "&str یک مرجع غیرقابل " +#~ "تغییر به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -23773,12 +24461,13 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "" +#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." #~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the standard " -#~ "library." +#~ "Day 2: Memory management, ownership, compound data types, and the " +#~ "standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -23811,28 +24500,30 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " -#~ "`continue`." +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " +#~ "and `continue`." #~ msgstr "" #~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " #~ "`continue`. " #~ msgid "" #~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a major " -#~ "feature and we should show students this right away." +#~ "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 یک ویژگی مهم است و باید آن را بلافاصله به " +#~ "دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over the " -#~ "schedule. We suggest splitting the day into two parts (following the slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over " +#~ "the schedule. We suggest splitting the day into two parts (following the " +#~ "slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس " -#~ "می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال " -#~ "کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -23844,8 +24535,8 @@ msgstr "" #~ "You can of course adjust this as necessary. Please make sure to include " #~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را " -#~ "نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -23884,54 +24575,56 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop will " -#~ "always end, but this is not yet proved. Edit the code and play with different " -#~ "inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این " -#~ "است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و " -#~ "با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to trigger " -#~ "type inference. Try with `i8` instead and trigger a runtime integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا " -#~ "استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در " -#~ "زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match the " -#~ "format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها " -#~ "با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد " -#~ "است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::fmt` " -#~ "which has the rules of the formatting mini-language. It's important that the " -#~ "students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان " -#~ "با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " +#~ "`std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::fmt " -#~ "documentation" +#~ "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` را توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات " +#~ "محلی ‍`std::fmt` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -23943,7 +24636,8 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" @@ -23969,8 +24663,8 @@ msgstr "" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" #~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " -#~ "(line 29)" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -23987,12 +24681,12 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning level, " -#~ "even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش " +#~ "فرض کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" @@ -24000,32 +24694,33 @@ msgstr "" #~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند " -#~ "نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" #~ msgid "" #~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-" -#~ "attempt-of-2003)" +#~ "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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of " +#~ "2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-" +#~ "of-2003)" #~ 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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability]" +#~ "(https://dwheeler.com/essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](https://" -#~ "nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-break-that-" -#~ "broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke " +#~ "sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-" +#~ "hole-the-break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -24047,122 +24742,127 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence you " -#~ "can't accidentally forget a `break`." +#~ "`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 را " #~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding " -#~ "`Box` leaves the scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` " -#~ "مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of " -#~ "a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get " -#~ "یک برش (`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped and " -#~ "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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را فراموش کنید، " -#~ "کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند " +#~ "و در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی " +#~ "تابعی که با `#[must_use]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" #~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get runtime-" -#~ "initialized and runtime-sized static variables" +#~ "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) برای نشت دادن یک اشاره‌گر استفاده کنید.یک " -#~ "مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی " -#~ "اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/" +#~ "boxed/struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget." -#~ "html) to make the compiler \"forget\" about a value (meaning the destructor is " -#~ "never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" +#~ "std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را " +#~ "فراموش کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-lang.org/" -#~ "book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory leak " -#~ "and Rust does not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر " -#~ "می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood as " -#~ "\"Pretty much no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" #~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " #~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang." -#~ "org/rustc/codegen-options/index.html#overflow-checks) compile-time flag. If " -#~ "enabled, the program will panic (a controlled crash of the program), otherwise " -#~ "you get wrap-around semantics. By default, you get panics in debug mode " -#~ "(`cargo build`) and wrap-around in release mode (`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be " -#~ "disabled directly with the `unsafe` keyword. However, `unsafe` allows you to " -#~ "call functions such as `slice::get_unchecked` which does not do bounds " -#~ "checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور " -#~ "مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان " -#~ "می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را " -#~ "انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." #~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده " -#~ "است." +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -24171,51 +24871,51 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for " -#~ "higher-level programming constructs with memory or CPU. For example, writing a " -#~ "loop using `for` should result in roughly the same low level instructions as " -#~ "using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " +#~ "شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +#~ "«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for " +#~ "باید تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار " +#~ "`iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also " -#~ "known as 'sum types', which allow the type system to express things like " -#~ "`Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also 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` را بیان کند." #~ msgid "" #~ "Remind people to read the errors --- many developers have gotten used to " #~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with _actionable_ " -#~ "feedback, ready to copy-paste into your code." +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" #~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل " -#~ "توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار " -#~ "شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, Python, " -#~ "and Go. Rust does not come with several things you might consider standard and " -#~ "essential:" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " -#~ "است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " -#~ "بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" -#~ "rand/) را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" @@ -24224,44 +24924,44 @@ msgstr "" #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/" -#~ "serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library cannot " -#~ "go away, so it has to be very stable. For the examples above, the Rust " -#~ "community is still working on finding the best solution --- and perhaps there " -#~ "isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this makes " -#~ "it trivial to download and compile third-party crates. A consequence of this " -#~ "is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار آسان می کند. یکی از " -#~ "پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و " +#~ "این امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates to find a " -#~ "good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." #~ msgstr "" #~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates به " -#~ "شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "dir=ltr> با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است " +#~ "که در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -24275,12 +24975,12 @@ msgstr "" #~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " #~ "pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای " -#~ "C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values over " -#~ "their lifetime." +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." #~ msgstr "" #~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " #~ "مختلفی ارجاع داده شوند." @@ -24292,8 +24992,8 @@ msgstr "" #~ "Rust is tracking the lifetimes of all references to ensure they live long " #~ "enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را " -#~ "رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " @@ -24302,94 +25002,100 @@ msgstr "" #~ "You can borrow `&str` slices from `String` via `&` and optionally range " #~ "selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و " -#~ "انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." #~ 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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward declarations " -#~ "nor headers are necessary. " +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " -#~ "می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر " -#~ "نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains `=n`, " -#~ "which causes it to include the upper bound." +#~ "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` است که " -#~ "باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "All language items in Rust can be documented using special `///` syntax." +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." #~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but in " -#~ "real code they should be present." +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما " -#~ "در کدهای دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need not " -#~ "be addressed here." +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." #~ msgstr "" #~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " #~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" #~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../testing/" -#~ "doc-tests.html)." +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." #~ msgstr "" #~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست " -#~ "نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a method " -#~ "is an instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" #~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's class." +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را " -#~ "از `main` فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static methods " -#~ "are commonly used to initialize structs (but don't have to). The actual " -#~ "constructor, `Rectangle { width, height }`, could be called directly. See the " -#~ "[Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." #~ msgid "" #~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " #~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، " -#~ "با ارگمان‌های یک سازنده `Rectangle::square(width: u32)` " -#~ "اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -24413,13 +25119,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind of " -#~ "limited polymorphism on argument types. We will see more details in a later " -#~ "section." +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " -#~ "می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات " -#~ "بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -24438,95 +25144,98 @@ msgstr "" #~ msgid "" #~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo.md) " -#~ "for details on installing Rust." +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل " -#~ "خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه " -#~ "مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets lose " -#~ "their state if you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج " -#~ "شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." #~ msgid "" #~ "Rust will not automatically apply _implicit conversions_ between types " #~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/w/cpp/language/" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/" -#~ "std/convert/trait.From.html) and [`Into`](https://doc.rust-lang.org/std/" -#~ "convert/trait.Into.html) traits to let us convert between them. The `From` " -#~ "trait has a single `from()` method and similarly, the `Into` trait has a " -#~ "single `into()` method. Implementing these traits is how a type expresses that " -#~ "it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان " -#~ "می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "dir=ltr>`From`](https://doc.rust-lang.org/std/convert/trait." +#~ "From.html) را پیاده‌سازی می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح " +#~ "را بدهند. با پیاده سازی ویژگی `From` همه انواع به " +#~ "صورت مشترک یک متد `from()` را دارند. با پیاده‌سازی " +#~ "تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which means " -#~ "that we can convert a variable `x` of type `i8` to an `i16` by calling `i16::" -#~ "from(x)`. Or, simpler, with `x.into()`, because `From for i16` " -#~ "implementation automatically create an implementation of `Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد " -#~ "`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " -#~ "`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." -#~ "into()` ، زیرا پیاده‌سازی `From` برای نوع " -#~ "`i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, so it " -#~ "is sufficient to only implement `From` to get a respective `Into` " +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " #~ "implementation automatically." #~ msgstr "" #~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " #~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه " -#~ "را دریافت کنید." +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای " -#~ "انجام تبدیل استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." #~ msgid "" #~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " #~ "`i128`) to see which types you can convert to which other types. Try " #~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/trait." -#~ "From.html) to see if `From` is implemented for the pairs you check." +#~ "[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` برای تبدیل انواع‌ایی که بررسی می‌کنید " -#~ "پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) " +#~ "تغییر دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل " +#~ "کنید. سعی کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات " +#~ "کتابخانه استاندارد](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را بررسی کنید تا ببینید آیا `From` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -24535,10 +25244,11 @@ msgstr "" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " #~ msgid "" -#~ "You can print such an array by asking for its debug representation with `{:?}`:" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}" -#~ "` چاپ کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" #~ msgid "" #~ "Rust lets you iterate over things like arrays and ranges using the `for` " @@ -24551,36 +25261,36 @@ msgstr "" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your " -#~ "argument and return types? Something like `&[&[i32]]` for a two-dimensional " -#~ "slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" #~ msgstr "" #~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " -#~ "چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان " -#~ "پذیر هست؟ چرا اره و چرا نه؟" +#~ "dir=ltr>`&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " -#~ "implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-" +#~ "and-for-loops) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به " -#~ "ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for " +#~ "n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." @@ -24590,77 +25300,80 @@ msgstr "" #~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال " +#~ "۲۰۲۱ معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/" +#~ "IntoIterator-for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, then " -#~ "`[i32; 3]` is also a copy type." +#~ "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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally " -#~ "evaluate one of two blocks, but the blocks can have a value which then becomes " -#~ "the value of the `if` expression. Other control flow expressions work " -#~ "similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود " -#~ "که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این " -#~ "بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته " -#~ "باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is the " -#~ "return value:" +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" #~ msgstr "" #~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " #~ "برگشتی است: " #~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in Rust. " +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " #~ msgstr "" #~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " #~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely " -#~ "related to the [`while let` loop](while-let-expressions.md). It will " -#~ "automatically call `into_iter()` on the expression and then iterate over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی عبارت فراخوانی می‌کند و " -#~ "سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور " +#~ "نزدیکی به حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. " +#~ "حلقه `for` به طور خودکار `into_iter()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." #~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که ویژگی " -#~ "`Iterator` را پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." #~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every other " -#~ "element. " +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه " -#~ "عناصر را برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." #~ 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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را " +#~ "قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v.iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" @@ -24669,58 +25382,60 @@ msgstr "" #~ "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) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/" +#~ "expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" #~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the types " -#~ "less and less as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و " -#~ "کمتر آن را نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic container " -#~ "without the code ever explicitly specifying the contained type, using `_` as a " -#~ "placeholder:" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در " -#~ "یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک " -#~ "جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " #~ msgid "" #~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/std/" -#~ "iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.org/std/" -#~ "collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-HashSet%3CT," -#~ "+S%3E) implements." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." +#~ "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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse memory " -#~ "locations when shadowing an immutable variable in a scope, even if the type " -#~ "does not change." +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که " -#~ "قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل " -#~ "تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" #~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " @@ -24733,18 +25448,19 @@ msgstr "" #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده " +#~ "باشند. سپس می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There is no " -#~ "fall-through like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There " +#~ "is no fall-through like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از " -#~ "بالا به پایین نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." #~ msgid "" #~ "The match expression has a value. The value is the last expression in the " @@ -24754,17 +25470,17 @@ msgstr "" #~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 " -#~ "اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته " +#~ "باشد، سپس کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه " +#~ "توی match اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را " -#~ "بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." #~ msgid "" #~ "It is possible to retrieve the discriminant by calling `std::mem::" @@ -24774,98 +25490,102 @@ msgstr "" #~ "تشخیصی پنهان را دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs where " -#~ "comparing field values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت " -#~ "`PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` " -#~ "with a top level `struct Click { ... }`. The inlined version cannot implement " -#~ "traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." #~ msgstr "" #~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click { ... }" -#~ "` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را " -#~ "پیاده‌سازی کند." +#~ "dir=ltr>`WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." #~ msgid "" #~ "Rust enums are packed tightly, taking constraints due to alignment into " #~ "account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های " -#~ "ناشی از هم ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" #~ msgid "" #~ "Internally Rust is using a field (discriminant) to keep track of the enum " #~ "variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای " -#~ "`enum` استفاده می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی حافظه " -#~ "1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, " -#~ "see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): اندازه " -#~ "توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، " -#~ "در زیر ببینید)" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی حافظه " -#~ "۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" #~ msgid "" #~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " #~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): اندازه " -#~ "توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی " -#~ "اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" #~ msgid "" #~ "Niche optimization: Rust will merge unused bit patterns for the enum " #~ "discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` " -#~ "ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain more " -#~ "than 256 `Option`s together." +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد " -#~ "`Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/" -#~ "flow_control/let_else.html) construct allows to do a destructuring assignment, " -#~ "or if it fails, execute a block which is required to abort normal control flow " -#~ "(with `panic`/`return`/`break`/`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-" +#~ "lang.org/rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک " +#~ "انتساب به صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا " +#~ "کند که برای خاتمه دادن به جریان کنترل عادی (با panic/return/break/" +#~ "continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-" -#~ "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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-" +#~ "expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از " +#~ "این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." #~ msgstr "" @@ -24873,71 +25593,76 @@ msgstr "" #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و خطا را " -#~ "توضیح دهید." +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot match " -#~ "against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان " -#~ "`String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our case, " -#~ "this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "dir=ltr>`Option` را به `Option<&T::Target>` تبدیل می‌کند. در مورد ما، این `Option` " +#~ "را به `Option<&str>` تبدیل می‌کند." #~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside `Option`." +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل " -#~ "`Option` استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، " -#~ "به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف " +#~ "`q`، به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable patterns, as " -#~ "the term can show up in error messages." +#~ "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) باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار " +#~ "(irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" #~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of fixed " -#~ "length." +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." #~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می " -#~ "کند." +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت بولین " -#~ "دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "You can use the variables defined in the pattern in your if expression." -#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -24953,36 +25678,41 @@ msgstr "" #~ 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." +#~ "integers. Then, revisit the solution and try to implement it with " +#~ "iterators." #~ msgstr "" -#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح " -#~ "حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " +#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " +#~ "کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based memory " -#~ "management, and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت " -#~ "حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` " -#~ "and `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." #~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و " -#~ "`Arc`." +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -24997,76 +25727,84 @@ msgstr "" #~ "If not done with care, this can lead to crashes, bugs, security " #~ "vulnerabilities, and memory leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی " -#~ "و نشتی حافظه شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" #~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and `free`: " -#~ "the pointer is lost and we cannot deallocate the memory. Worse, freeing the " -#~ "pointer twice, or accessing a freed pointer can lead to exploitable security " -#~ "vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه " -#~ "نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، " -#~ "آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر " -#~ "به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "Constructors and destructors let you hook into the lifetime of an object." +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." #~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object is " -#~ "destroyed. The compiler guarantees that this happens, even if an exception is " -#~ "raised." +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را " -#~ "آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception " -#~ "ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and gives " -#~ "you smart pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." #~ msgstr "" #~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " #~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory " -#~ "allocated on the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به " -#~ "حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." #~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا " -#~ "می‌شود." +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "Special move constructors are used when passing ownership to a function:" -#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic memory " -#~ "management:" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" #~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." #~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the programmer." +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." #~ msgstr "" #~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " #~ "تخصیص‌زدایی (آزاد) می‌کند." @@ -25088,15 +25826,15 @@ msgstr "" #~ msgid "Scope-based like C++, but the compiler enforces full adherence." #~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت " -#~ "می‌کند." +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even have " -#~ "no cost at runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، " -#~ "برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." @@ -25104,25 +25842,26 @@ msgstr "" #~ msgid "" #~ "If asked how at this point, you can mention that in Rust this is usually " #~ "handled by RAII wrapper types such as [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), or [Arc](https://" -#~ "doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate ownership and " -#~ "memory allocation via various means, and prevent the potential errors in C." +#~ "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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید " +#~ "به این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی " +#~ "[Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -25133,17 +25872,18 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a way to " -#~ "generate code in Rust at compile time. In this case the default " +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای " +#~ "تولید کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض " +#~ "صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From 9edb806eca983ec21db6c7b599cec08e0e8cc5b2 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 13 Oct 2024 23:03:46 +0330 Subject: [PATCH 85/92] try to complete Farsi part 4 --- po/fa.po | 14328 +++++++++++------------ src/running-the-course/translations.md | 5 +- 2 files changed, 6884 insertions(+), 7449 deletions(-) diff --git a/po/fa.po b/po/fa.po index a58bfc3ac14..624a328eb16 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-10-04 21:48+0330\n" +"PO-Revision-Date: 2024-10-13 22:50+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -52,15 +52,14 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md +#: src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md -#: src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -76,8 +75,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -105,17 +104,16 @@ msgstr "تمرین: دنباله فیبوناچی" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md -#: src/std-traits/solution.md src/memory-management/solution.md -#: src/smart-pointers/solution.md src/borrowing/solution.md -#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md -#: src/testing/solution.md src/error-handling/solution.md +#: src/generics/solution.md src/std-types/solution.md src/std-traits/solution.md +#: src/memory-management/solution.md src/smart-pointers/solution.md +#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md +#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-1.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -152,8 +150,7 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -161,8 +158,7 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md -#: src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -187,8 +183,7 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -226,13 +221,11 @@ msgstr "تمرین: هندسه" msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md -#: src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -261,8 +254,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -279,8 +272,7 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md -#: src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -288,8 +280,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -438,8 +430,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -475,8 +467,8 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-3.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md +#: src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" @@ -551,10 +543,10 @@ msgstr "تمرین: تجزیه Protobuf" msgid "Day 4: Morning" msgstr "روز چهارم: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/iterators.md msgid "Iterators" -msgstr "" +msgstr "Iterators" #: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md msgid "`Iterator`" @@ -572,8 +564,8 @@ msgstr "`FromIterator`" msgid "Exercise: Iterator Method Chaining" msgstr "تمرین: روش Iterator Chaining" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/modules.md src/modules/modules.md msgid "Modules" msgstr "ماژول‌ها" @@ -593,8 +585,8 @@ msgstr "" msgid "Exercise: Modules for a GUI Library" msgstr "تمرین: ماژولهایی برای کتابخانه رابط کاربری گرافیکی" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-4.md src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md +#: src/testing.md src/chromium/testing.md msgid "Testing" msgstr "تست‌کردن" @@ -776,7 +768,7 @@ msgstr "GoogleTest" #: src/SUMMARY.md src/android/testing/mocking.md msgid "Mocking" -msgstr "" +msgstr "Mocking" #: src/SUMMARY.md src/android/logging.md src/bare-metal/aps/logging.md msgid "Logging" @@ -812,7 +804,7 @@ msgstr "Rust Bridge" #: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md msgid "Generated C++" -msgstr "" +msgstr "Generated C++" #: src/SUMMARY.md msgid "C++ Bridge" @@ -836,7 +828,7 @@ msgstr "مدیریت خطا ++C " #: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" -msgstr "" +msgstr "تایپ‌های اضافی" #: src/SUMMARY.md msgid "Building for Android: C++" @@ -904,9 +896,8 @@ msgid "`chromium::import!` Macro" msgstr "`chromium::import!` Macro" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md -#, fuzzy msgid "Interoperability with C++" -msgstr "قابلیت همکاری" +msgstr "قابلیت همکاری با ++C" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy @@ -915,7 +906,7 @@ msgstr "مثال‌ها" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Limitations of CXX" -msgstr "" +msgstr "محدودیت‌های CXX" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md msgid "CXX Error Handling" @@ -935,7 +926,7 @@ msgstr "استفاده از CXX در Chromium" #: src/SUMMARY.md src/chromium/adding-third-party-crates.md msgid "Adding Third Party Crates" -msgstr "" +msgstr "اضافه‌کردن Crateهای شخص ثالث" #: src/SUMMARY.md msgid "Configuring Cargo.toml" @@ -969,8 +960,7 @@ msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کن msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." -#: src/SUMMARY.md -#: src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/SUMMARY.md src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "وابسته به یک Crate" @@ -984,7 +974,7 @@ msgstr "کد‌های Chromium را بررسی کنید." #: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "Keeping Crates Up to Date" -msgstr "" +msgstr "به روز نگه داشتن Crateها" #: src/SUMMARY.md msgid "Bringing It Together - Exercise" @@ -1058,8 +1048,7 @@ msgid "Compass" msgstr "قطب‌نما" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/solutions.md -#: src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md #: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "راه حل‌ها" @@ -1178,13 +1167,11 @@ msgstr "کانال‌ها" msgid "Senders and Receivers" msgstr "متد دریافتی" -#: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" -#: src/SUMMARY.md src/concurrency/channels.md -#: src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1206,8 +1193,7 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync.md -#: src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md src/concurrency/send-sync/examples.md msgid "Examples" msgstr "مثال‌ها" @@ -1232,8 +1218,7 @@ msgstr "مثال" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/dining-philosophers.md -#: src/concurrency/sync-exercises/solutions.md -#: src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" @@ -1346,53 +1331,53 @@ msgstr "اعتبارها" #: src/index.md msgid "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" -"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" -"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" -"[GitHub contributors](https://img.shields.io/github/contributors/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." -"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." -"com/google/comprehensive-rust/stargazers)" -msgstr "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" -"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" -"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" -"[GitHub contributors](https://img.shields.io/github/contributors/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." -"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." -"com/google/comprehensive-rust/stargazers)" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" +"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" +"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " +"contributors](https://img.shields.io/github/contributors/google/comprehensive-" +"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" +"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" +"rust/stargazers)" +msgstr "" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" +"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" +"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " +"contributors](https://img.shields.io/github/contributors/google/comprehensive-" +"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" +"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" +"rust/stargazers)" #: src/index.md msgid "" -"This is a free Rust course developed by the Android team at Google. The " -"course covers the full spectrum of Rust, from basic syntax to advanced " -"topics like generics and error handling." +"This is a free Rust course developed by the Android team at Google. The course " +"covers the full spectrum of Rust, from basic syntax to advanced topics like " +"generics and error handling." msgstr "" -"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این " -"این دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته " -"مانند جنریک و مدیریت خطاها." +"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این این " +"دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته مانند " +"جنریک و مدیریت خطاها." #: src/index.md msgid "" "The latest version of the course can be found at . If you are reading somewhere else, please check there " -"for updates." +"comprehensive-rust/>. If you are reading somewhere else, please check there for " +"updates." msgstr "" -"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " -"نیز بررسی کنید." +"آخرین نسخه از دوره را میتوان در " +"پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز " +"بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language " -"in the top right corner of the page or check the [Translations](running-the-" -"course/translations.md) page for a list of all available translations." +"The course is available in other languages. Select your preferred language in the " +"top right corner of the page or check the [Translations](running-the-course/" +"translations.md) page for a list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " -"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " -"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای " +"صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای " +"فهرستی از تمام ترجمه‌های موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1400,11 +1385,11 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know " -"anything about Rust and hope to:" +"The goal of the course is to teach you Rust. We assume you don't know anything " +"about Rust and hope to:" msgstr "" -"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " -"نمی دانید :" +"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی " +"دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1413,8 +1398,8 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " -"در Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در " +"Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1427,8 +1412,7 @@ msgstr "ما چهار روز اول دوره را اصول Rust می نامیم #: src/index.md msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "" -"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" @@ -1440,13 +1424,13 @@ msgstr "" #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium " -"based browsers. This includes interoperability with C++ and how to include " -"third-party crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium based " +"browsers. This includes interoperability with C++ and how to include third-party " +"crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " -"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " -"جعبه های(crates) شخص ثالث در کروم است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای " +"مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه " +"های(crates) شخص ثالث در کروم است." #: src/index.md msgid "" @@ -1455,21 +1439,20 @@ msgid "" "covered." msgstr "" "[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " -"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " -"داده شده اند." +"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده " +"شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " -"Rust. We cover both classical concurrency (preemptively scheduling using " -"threads and mutexes) and async/await concurrency (cooperative multitasking " -"using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. " +"We cover both classical concurrency (preemptively scheduling using threads and " +"mutexes) and async/await concurrency (cooperative multitasking using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " -"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " -"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " -"استفاده از futures را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " +"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و " +"mutexها ) و async/await concurrency (multitasking مشارکتی) با استفاده از futures " +"را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1477,8 +1460,8 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few " -"days. Some non-goals of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few days. " +"Some non-goals of this course are:" msgstr "" "زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." "چندتا از اهداف خارج از این دوره عبارتند از:" @@ -1489,9 +1472,9 @@ msgid "" "(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" "(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://" +"doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-" +"lang.org/rust-by-example/macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1499,14 +1482,14 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a " -"statically-typed language and we will sometimes make comparisons with C and " -"C++ to better explain or contrast the Rust approach." +"The course assumes that you already know how to program. Rust is a statically-" +"typed language and we will sometimes make comparisons with C and C++ to better " +"explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " -"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا " +"رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" @@ -1519,12 +1502,12 @@ msgstr "" #: src/index.md msgid "" "This is an example of a _speaker note_. We will use these to add additional " -"information to the slides. This could be key points which the instructor " -"should cover as well as answers to typical questions which come up in class." +"information to the slides. This could be key points which the instructor should " +"cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " -"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " -"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات " +"بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و " +"همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1532,24 +1515,22 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the " -"course internally at Google." -msgstr "" -"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the course " +"internally at Google." +msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " -"in the middle. This leaves 3 hours for the morning class and 3 hours for the " -"afternoon class. Both sessions contain multiple breaks and time for students " -"to work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in " +"the middle. This leaves 3 hours for the morning class and 3 hours for the " +"afternoon class. Both sessions contain multiple breaks and time for students to " +"work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " -"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " -"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " -"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " -"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " -"ظهر خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت " +"ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس " +"بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: شما می‌توانید ۳ " +"ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته منفی این کار این است که " +"با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1557,103 +1538,100 @@ msgstr "قبل از اجرای دوره، شما می‌خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker " -"notes to help highlight the key points (please help us by contributing more " -"speaker notes!). When presenting, you should make sure to open the speaker " -"notes in a popup (click the link with a little arrow next to \"Speaker " -"Notes\"). This way you have a clean screen to present to the class." +"Make yourself familiar with the course material. We've included speaker notes to " +"help highlight the key points (please help us by contributing more speaker " +"notes!). When presenting, you should make sure to open the speaker notes in a " +"popup (click the link with a little arrow next to \"Speaker Notes\"). This way " +"you have a clean screen to present to the class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " -"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " -"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " -"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " -"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات " +"کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). " +"هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید " +"(روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک " +"صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." #: src/running-the-course.md msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " -"schedule the days over two weeks. Course participants have said that they " -"find it helpful to have a gap in the course since it helps them process all " -"the information we give them." +"schedule the days over two weeks. Course participants have said that they find it " +"helpful to have a gap in the course since it helps them process all the " +"information we give them." msgstr "" "در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " -"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " -"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " -"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره " +"گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا تمام " +"اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a " -"class size of 15-25 people. That's small enough that people are comfortable " -"asking questions --- it's also small enough that one instructor will have " -"time to answer the questions. Make sure the room has _desks_ for yourself " -"and for the students: you will all need to be able to sit and work with your " -"laptops. In particular, you will be doing a lot of live-coding as an " -"instructor, so a lectern won't be very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " -"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " -"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " -"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " -"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" -"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " -"نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a class " +"size of 15-25 people. That's small enough that people are comfortable asking " +"questions --- it's also small enough that one instructor will have time to answer " +"the questions. Make sure the room has _desks_ for yourself and for the students: " +"you will all need to be able to sit and work with your laptops. In particular, " +"you will be doing a lot of live-coding as an instructor, so a lectern won't be " +"very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر " +"را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین " +"مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر " +"_میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که بتونید بشنید و با لپتاپ " +"های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-coding انجام خواهید داد پس " +"صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things " -"up. We recommend presenting directly using `mdbook serve` running on your " -"laptop (see the [installation instructions](https://github.com/google/" -"comprehensive-rust#building)). This ensures optimal performance with no lag " -"as you change pages. Using your laptop will also allow you to fix typos as " -"you or the course participants spot them." +"On the day of your course, show up to the room a little early to set things up. " +"We recommend presenting directly using `mdbook serve` running on your laptop (see " +"the [installation instructions](https://github.com/google/comprehensive-" +"rust#building)). This ensures optimal performance with no lag as you change " +"pages. Using your laptop will also allow you to fix typos as you or the course " +"participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " -"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " -"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " -"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " -"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " -"شما یا شرکت کنندگان در دوره اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه " +"می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای " +"نصب](https://github.com/google/comprehensive-rust#building) را ببنیید). با این " +"کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین " +"به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده شما یا شرکت کنندگان در دوره " +"اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We " -"typically spend 30-45 minutes on exercises in the morning and in the " -"afternoon (including time to review the solutions). Make sure to ask people " -"if they're stuck or if there is anything you can help with. When you see " -"that several people have the same problem, call it out to the class and " -"offer a solution, e.g., by showing people where to find the relevant " -"information in the standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " -"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " -"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " -"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " -"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " -"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " -"کنند." +"Let people solve the exercises by themselves or in small groups. We typically " +"spend 30-45 minutes on exercises in the morning and in the afternoon (including " +"time to review the solutions). Make sure to ask people if they're stuck or if " +"there is anything you can help with. When you see that several people have the " +"same problem, call it out to the class and offer a solution, e.g., by showing " +"people where to find the relevant information in the standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ " +"الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) " +"صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که " +"می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, خطاب به " +"کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که می‌توانند اطلاعات " +"مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun " -"for you as it has been for us!" +"That is all, good luck running the course! We hope it will be as much fun for you " +"as it has been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " -"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه " +"که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We " -"would love to hear what worked well for you and what can be made better. " -"Your students are also very welcome to [send us feedback](https://github.com/" -"google/comprehensive-rust/discussions/100)!" +"discussions/86) afterwards so that we can keep improving the course. We would " +"love to hear what worked well for you and what can be made better. Your students " +"are also very welcome to [send us feedback](https://github.com/google/" +"comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" -"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " -"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " -"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" -"github.com/google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/" +"discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم " +"بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور شما " +"دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://github.com/" +"google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1661,11 +1639,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " -"days are fast paced and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days " +"are fast paced and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " -"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز " +"با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1689,12 +1667,11 @@ msgstr "بخش" #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md #: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md -#: src/std-types.md src/std-traits.md src/welcome-day-3.md -#: src/memory-management.md src/smart-pointers.md -#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md -#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md -#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md src/memory-management.md +#: src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md +#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md +#: src/testing.md src/welcome-day-4-afternoon.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/threads.md #: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md @@ -1706,10 +1683,10 @@ msgstr "مدت زمان" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/lifetimes.md -#: src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/shared-state.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/shared-state.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" @@ -1806,8 +1783,7 @@ msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" msgstr "" -"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " -"دهیم:" +"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1815,38 +1791,38 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using " -"Rust for Android platform development. This includes interoperability with " -"C, C++, and Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust " +"for Android platform development. This includes interoperability with C, C++, and " +"Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " -"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " -"با C، C++ و جاوا می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده " +"از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/" -"download/downloading). Make a checkout of the [course repository](https://" -"github.com/google/comprehensive-rust) on the same machine and move the `src/" -"android/` directory into the root of your AOSP checkout. This will ensure " -"that the Android build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/" +"downloading). Make a checkout of the [course repository](https://github.com/" +"google/comprehensive-rust) on the same machine and move the `src/android/` " +"directory into the root of your AOSP checkout. This will ensure that the Android " +"build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" -"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" -"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" -"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " -"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/" +"download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/" +"google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن " +"ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build اندروید فایل های " +"`Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build " -"all Android examples using `src/android/build_all.sh`. Read the script to " -"see the commands it runs and make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build all " +"Android examples using `src/android/build_all.sh`. Read the script to see the " +"commands it runs and make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " -"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " -"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " -"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه " +"نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. " +"اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها " +"را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1854,25 +1830,24 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " -"using Rust as part of the Chromium browser. It includes using Rust in " -"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " -"and C++ interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using " +"Rust as part of the Chromium browser. It includes using Rust in Chromium's `gn` " +"build system, bringing in third-party libraries (\"crates\") and C++ " +"interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " -"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " -"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" -"+C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به " +"عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` " +"Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری ++C است." #: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. " -"Ensure that you can run the Chromium browser that you've built." +"[recommended](../chromium/setup.md) for speed but any build will work. Ensure " +"that you can run the Chromium browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " -"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " -"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت " +"[توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که " +"می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1880,25 +1855,24 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " -"using Rust for bare-metal (embedded) development. Both microcontrollers and " -"application processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using " +"Rust for bare-metal (embedded) development. Both microcontrollers and application " +"processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " -"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " -"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " -"کارایی خاص را پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک " +"روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل " +"(embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را " +"پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit]" -"(https://microbit.org/) v2 development board ahead of time. Everybody will " -"need to install a number of packages as described on the [welcome page](../" -"bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit](https://" +"microbit.org/) v2 development board ahead of time. Everybody will need to install " +"a number of packages as described on the [welcome page](../bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " -"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" -"(../bare-metal.md) توضیح داده شده نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 " +"را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-" +"metal.md) توضیح داده شده نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1910,18 +1884,17 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " -"شامل همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل " +"همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready " -"to go. You can then copy/paste the examples into `src/main.rs` to experiment " -"with them:" +"You will need a fresh crate set up and the dependencies downloaded and ready to " +"go. You can then copy/paste the examples into `src/main.rs` to experiment with " +"them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " -"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " -"آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. " +"سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" @@ -1957,11 +1930,11 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the " -"questions drive the exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the questions " +"drive the exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " -"Rust را هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را " +"هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1992,69 +1965,65 @@ msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" msgstr "" -"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " -"است:" +"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " -"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " -"[@henrif75](https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by " +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" +"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and [@henrif75]" +"(https://github.com/henrif75)." msgstr "" "[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." -"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " -"[@henrif75](https://github.com/henrif75)." +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" +"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و [@henrif75]" +"(https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " -"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" -"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" -"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by " +"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " +"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " +"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" +"superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " "[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " "[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " "[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." -"com/nodmp)." +"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github.com/" +"nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " -"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" "github.com/kuanhungchen), and [@johnathan79717](https://github.com/" "johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" +"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " +"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" +"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" -"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " -"and [@kantasv](https://github.com/kantasv)." +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), " +"[@HidenoriKobayashi](https://github.com/HidenoriKobayashi) and [@kantasv](https://" +"github.com/kantasv)." msgstr "" "[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" -"momotaro1105)." +"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " -"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." -"com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://" +"github.com/keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan]" +"(https://github.com/jooyunghan), and [@namhyung](https://github.com/namhyung)." msgstr "" "[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " @@ -2062,8 +2031,8 @@ msgstr "" #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" -"(https://github.com/deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://" +"github.com/deavid)." msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2071,16 +2040,15 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" -"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" -"yaremam) and [@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp]" +"(https://github.com/git-user-cpp), [@yaremam](https://github.com/yaremam) and " +"[@reta](https://github.com/reta)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "" -"Use the language picker in the top-right corner to switch between languages." +msgid "Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." @@ -2090,17 +2058,17 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most " -"recently updated translations:" +"There is a large number of in-progress translations. We link to the most recently " +"updated translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " -"پیوند می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند " +"می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" -"(https://github.com/younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://" +"github.com/younies)" msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2116,77 +2084,77 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" -"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " -"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" -"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" -"moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://" +"github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp]" +"(https://github.com/hamidrezakp), [@javad-jafari](https://github.com/javad-" +"jafari) and [@moaminsharifi](https://github.com/moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" -"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" -"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" -"johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" +"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " +"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" +"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " -"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://" +"github.com/KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont]" +"(https://github.com/AdrienBaudemont)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" -"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://" +"github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" -"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://" +"github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by " -"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" -"github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder]" +"(https://github.com/henrythebuilder) and [@detro](https://github.com/detro)." msgstr "" "[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available " -"either [as of their last update](https://google.github.io/comprehensive-rust/" -"translation-report.html) or [synced to the latest version of the course]" -"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." +"The full list of translations with their current status is also available either " +"[as of their last update](https://google.github.io/comprehensive-rust/translation-" +"report.html) or [synced to the latest version of the course](https://google." +"github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" +"فهرست کامل ترجمه‌ها با وضعیت فعلی‌شان نیز [در آخرین به‌روزرسانی](https://google." +"github.io/comprehensive-rust/translation-report.html) یا [همگام‌سازی شده با آخرین " +"نسخه دوره](https://google.github.io/comprehensive-rust/synced-translation-report." +"html)." #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " -"get going. Translations are coordinated on the [issue tracker](https://" -"github.com/google/comprehensive-rust/issues/282)." +"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get " +"going. Translations are coordinated on the [issue tracker](https://github.com/" +"google/comprehensive-rust/issues/282)." msgstr "" "اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" -"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " -"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" -"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." +"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار " +"ببینید. ترجمه ها در [issue tracker](https://github.com/google/comprehensive-rust/" +"issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc." -"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " -"and run Rust applications. Here we want to give a brief overview of what " -"Cargo is and how it fits into the wider ecosystem and how it fits into this " -"training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-" +"lang.org/cargo/), the standard tool used in the Rust ecosystem to build and run " +"Rust applications. Here we want to give a brief overview of what Cargo is and how " +"it fits into the wider ecosystem and how it fits into this training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." -"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " -"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " -"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " -"را در این آموزش ارائه دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-" +"lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه " +"های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در " +"مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه " +"دهیم." #: src/cargo.md msgid "Installation" @@ -2199,8 +2167,8 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will " -"pass them to `rustc` when building your project. Cargo also comes with a " -"built-in test runner which is used to execute unit tests." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to download " +"dependencies, usually hosted on , and it will pass them to " +"`rustc` when building your project. Cargo also comes with a built-in test runner " +"which is used to execute unit tests." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " -"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " -"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " -"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها " +"را که معمولاً در میزبانی می شوند دانلود کند و هنگام ساخت پروژه " +"آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که " +"برای اجرای unit test استفاده می شود." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to " -"install and update `rustc` and `cargo` when new versions of Rust are " -"released. In addition, `rustup` can also download documentation for the " -"standard library. You can have multiple versions of Rust installed at once " -"and `rustup` will let you switch between them as needed." +"`rustup`: the Rust toolchain installer and updater. This tool is used to install " +"and update `rustc` and `cargo` when new versions of Rust are released. In " +"addition, `rustup` can also download documentation for the standard library. You " +"can have multiple versions of Rust installed at once and `rustup` will let you " +"switch between them as needed." msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " -"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " -"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " -"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " -"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز " +"رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. " +"علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود " +"کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما " +"اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md #: src/references/exclusive.md src/memory-management/move.md @@ -2299,81 +2266,79 @@ msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six " -"weeks. New releases maintain backwards compatibility with old releases --- " -"plus they enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six weeks. " +"New releases maintain backwards compatibility with old releases --- plus they " +"enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " -"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " -"علاوه قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر " +"می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه " +"قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "" -"There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes " -"\"stable\" every six weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" " +"every six weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " -"هفته \"stable\" می شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته " +"\"stable\" می شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc." -"rust-lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc.rust-" +"lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current " +"edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " -"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه " +"فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md msgid "" -"The editions are allowed to make backwards incompatible changes to the " -"language." +"The editions are allowed to make backwards incompatible changes to the language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for " -"your crate via the `Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for your " +"crate via the `Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " -"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد " +"نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " -"برای نسخه های مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای " +"نسخه های مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " -"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` " +"بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " -"comprehensive tool. It is capable of many advanced features including but " -"not limited to:" +"comprehensive tool. It is capable of many advanced features including but not " +"limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " -"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است " +"که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2381,8 +2346,7 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "" -"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" @@ -2390,33 +2354,27 @@ msgstr "وابستگی های Dev و وابستگی‌های Runtime Manageme #: src/cargo/rust-ecosystem.md msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." -"html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" #: src/cargo/rust-ecosystem.md msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." -"html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo " -"clippy](https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo clippy]" +"(https://github.com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" -"lang/rust-clippy)) قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/" +"rust-clippy)) قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "" -"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "" -"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2425,22 +2383,22 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " -"which can be executed through your browser. This makes the setup much easier " -"and ensures a consistent experience for everyone." +"which can be executed through your browser. This makes the setup much easier and " +"ensures a consistent experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " -"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " -"کند و تجربه ای ثابت را برای همه تضمین می کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر " +"شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه " +"ای ثابت را برای همه تضمین می کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do " -"the exercises. On the last day, we will do a larger exercise which shows you " -"how to work with dependencies and for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do the " +"exercises. On the last day, we will do a larger exercise which shows you how to " +"work with dependencies and for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " -"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " -"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. " +"در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با " +"وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2453,8 +2411,8 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy msgid "" -"You can use Ctrl + Enter to execute the code when focus is in the " -"text box." +"You can use Ctrl + Enter to execute the code when focus is in the text " +"box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md @@ -2462,26 +2420,26 @@ msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " -"کد به دلایل مختلف قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به " +"دلایل مختلف قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " -"open it in the real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open " +"it in the real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " -"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و " +"آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from " -"the page! This is the reason that the students should solve the exercises " -"using a local Rust installation or via the Playground." +"The embedded playgrounds lose their state the moment you navigate away from the " +"page! This is the reason that the students should solve the exercises using a " +"local Rust installation or via the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " -"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " -"استفاده از local Rust installation یا از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را " +"از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از " +"local Rust installation یا از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2489,60 +2447,56 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will " -"need to first install Rust. Do this by following the [instructions in the " -"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " -"should give you a working `rustc` and `cargo`. At the time of writing, the " -"latest stable Rust release has these version numbers:" +"If you want to experiment with the code on your own system, then you will need to " +"first install Rust. Do this by following the [instructions in the Rust Book]" +"(https://doc.rust-lang.org/book/ch01-01-installation.html). This should give you " +"a working `rustc` and `cargo`. At the time of writing, the latest stable Rust " +"release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " -"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" -"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " -"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " -"این version numberها است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این " +"کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/" +"book/ch01-01-installation.html) انجام دهید. این باید به شما یک `rustc` و `cargo` " +"کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای این version numberها " +"است:" #: src/cargo/running-locally.md msgid "" -"You can use any later version too since Rust maintains backwards " -"compatibility." +"You can use any later version too since Rust maintains backwards compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " -"های قبلی را حفظ می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های " +"قبلی را حفظ می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of " -"the examples in this training:" +"With this in place, follow these steps to build a Rust binary from one of the " +"examples in this training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " -"باینری Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری " +"Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "" -"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" -"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " -"استفاده کنید:" +"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده " +"کنید:" #: src/cargo/running-locally.md -msgid "" -"Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" -"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " -"کنید:" +"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For " -"example, using the example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For example, " +"using the example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " -"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از " +"مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2550,35 +2504,35 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo " -"build` to compile it without running it. You will find the output in `target/" -"debug/` for a normal debug build. Use `cargo build --release` to produce an " -"optimized release build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo build` to " +"compile it without running it. You will find the output in `target/debug/` for a " +"normal debug build. Use `cargo build --release` to produce an optimized release " +"build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " -"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" -"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " -"شده در `target/release/` از `cargo build --release` استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo " +"build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای " +"ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/" +"release/` از `cargo build --release` استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you " -"run `cargo` commands, it will automatically download and compile missing " -"dependencies for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you run " +"`cargo` commands, it will automatically download and compile missing dependencies " +"for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " -"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " -"نیاز را برای شما دانلود و کامپایل می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که " +"دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما " +"دانلود و کامپایل می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local " -"editor. It will make their life easier since they will have a normal " -"development environment." +"Try to encourage the class participants to install Cargo and use a local editor. " +"It will make their life easier since they will have a normal development " +"environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " -"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " -"محیط توسعه عادی خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر " +"محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی " +"خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" @@ -2586,19 +2540,17 @@ msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md msgid "" -"This is the first day of Rust Fundamentals. We will cover a lot of ground " -"today:" +"This is the first day of Rust Fundamentals. We will cover a lot of ground today:" msgstr "" -"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " -"داد:" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" #: src/welcome-day-1.md 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 msgid "Types and type inference." @@ -2617,87 +2569,79 @@ msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/welcome-day-4.md src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 " -"minutes. It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. " +"It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "" -"They should ask questions when they get them, don't save them to the end." -msgstr "" -"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "They should ask questions when they get them, don't save them to the end." +msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md msgid "" -"The class is meant to be interactive and discussions are very much " -"encouraged!" +"The class is meant to be interactive and discussions are very much encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., " -"keep the discussions related to how Rust does things vs some other language. " -"It can be hard to find the right balance, but err on the side of allowing " -"discussions since they engage people much more than one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., keep the " +"discussions related to how Rust does things vs some other language. It can be " +"hard to find the right balance, but err on the side of allowing discussions since " +"they engage people much more than one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " -"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " -"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " -"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های " +"مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا " +"کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، " +"زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." #: src/welcome-day-1.md msgid "" "The questions will likely mean that we talk about things ahead of the slides." msgstr "" -"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " -"کنیم." +"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. " -"Remember that the slides are just a support and you are free to skip them as " -"you like." +"This is perfectly okay! Repetition is an important part of learning. Remember " +"that the slides are just a support and you are free to skip them as you like." msgstr "" "این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " -"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " -"صرف نظر کنید." +"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف " +"نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that " -"should have immediate parallels in other languages. The more advanced parts " -"of Rust come on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that should " +"have immediate parallels in other languages. The more advanced parts of Rust come " +"on the subsequent days." msgstr "" "ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " -"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " -"شوند." +"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." #: src/welcome-day-1.md msgid "" "If you're teaching this in a classroom, this is a good place to go over the " -"schedule. Note that there is an exercise at the end of each segment, " -"followed by a break. Plan to cover the exercise solution after the break. " -"The times listed here are a suggestion in order to keep the course on " -"schedule. Feel free to be flexible and adjust as necessary!" +"schedule. Note that there is an exercise at the end of each segment, followed by " +"a break. Plan to cover the exercise solution after the break. The times listed " +"here are a suggestion in order to keep the course on schedule. Feel free to be " +"flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " -"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " -"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " -"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " -"باشید و در صورت لزوم تنظیم کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه " +"داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن " +"محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد " +"برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم " +"کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" @@ -2706,46 +2650,44 @@ msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شام #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md -#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/threads.md src/concurrency/channels.md -#: src/concurrency/send-sync.md src/concurrency/shared-state.md -#: src/concurrency/sync-exercises.md src/concurrency/async.md -#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-exercises.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md +#: src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md src/testing.md +#: src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/async.md src/concurrency/async-control-flow.md +#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" #: src/hello-world.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md -#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md +#: src/borrowing.md src/lifetimes.md src/modules.md src/unsafe-rust.md +#: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md -#: src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015](https://" +"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" -"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://" +"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" -"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ " +"دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2756,8 +2698,8 @@ msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" -"rustc/platform-support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/" +"platform-support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2804,8 +2746,7 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "" -"Can be scaled down to very constrained devices such as microcontrollers." +msgid "Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2825,8 +2766,7 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " -"می شود" +"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2861,8 +2801,8 @@ msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " -"نامشخص باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص " +"باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2874,10 +2814,8 @@ msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wr #: src/hello-world/benefits.md msgid "" -"_Modern language features_ - as expressive and ergonomic as higher-level " -"languages" -msgstr "" -"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +"_Modern language features_ - as expressive and ergonomic as higher-level languages" +msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2913,98 +2851,93 @@ msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md msgid "" -"Do not spend much time here. All of these points will be covered in more " -"depth later." +"Do not spend much time here. All of these points will be covered in more depth " +"later." msgstr "" -"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " -"خواهد شد." +"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. " -"Depending on the answer you can highlight different features of Rust:" +"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/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " -"via the borrow checker. You get performance like in C and C++, but you don't " -"have the memory unsafety issues. In addition, you get a modern language with " -"constructs like pattern matching and built-in dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via " +"the borrow checker. You get performance like in C and C++, but you don't 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++ را " -"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " -"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را دارید اما " +"مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن با ساختارهایی " +"مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory " -"safety as in those languages, plus a similar high-level language feeling. In " -"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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory safety " +"as in those languages, plus a similar high-level language feeling. In 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++ (بدون " -"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " -"می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن زبان‌ها " +"دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، شما عملکرد " +"سریع و قابل پیش‌بینی مانند C و C++ (بدون جمع‌آوری زباله) و " +"همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " -"run short Rust programs, and is the basis for the examples and exercises in " -"this course. Try running the \"hello-world\" program it starts with. It " -"comes with a few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run " +"short Rust programs, and is the basis for the examples and exercises in this " +"course. Try running the \"hello-world\" program it starts with. It comes with a " +"few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " -"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " -"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " -"مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های " +"Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه " +"\"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" #: src/hello-world/playground.md msgid "" -"Under \"Tools\", use the `rustfmt` option to format your code in the " -"\"standard\" way." +"Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" " +"way." msgstr "" "در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " "\"استاندارد\" استفاده کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime " -"checks, less optimization) and Release (fewer runtime checks, lots of " -"optimization). These are accessible under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, " +"less optimization) and Release (fewer runtime checks, lots of optimization). " +"These are accessible under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " -"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " -"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، " +"بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در " +"قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." #: src/hello-world/playground.md msgid "" -"If you're interested, use \"ASM\" under \"...\" to see the generated " -"assembly code." +"If you're interested, use \"ASM\" under \"...\" to see the generated assembly " +"code." msgstr "" "اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " "استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground " -"and experiment a little. Encourage them to keep the tab open and try things " -"out during the rest of the course. This is particularly helpful for advanced " -"students who want to know more about Rust's optimizations or generated " -"assembly." +"As students head into the break, encourage them to open up the playground and " +"experiment a little. Encourage them to keep the tab open and try things out " +"during the rest of the course. This is particularly helpful for advanced students " +"who want to know more about Rust's optimizations or generated assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " -"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " -"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " -"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " -"بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground " +"را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در " +"بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند " +"درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" @@ -3015,8 +2948,7 @@ msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " -"بپردازیم:" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -3033,8 +2965,7 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " -"می‌شوند." +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -3043,32 +2974,30 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک " -"نمونه از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه " +"از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " -"باشند." +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will " -"see a ton of it over the next four days so we start small with something " -"familiar." +"This slide tries to make the students comfortable with Rust code. They will see a " +"ton of it over the next four days so we start small with something familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " -"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده " +"خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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) و سعی نمی‌کند چیزی را مگر اینکه " -"کاملاً ضروری باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/" +"Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری " +"باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -3086,36 +3015,34 @@ msgstr "" #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers " -"from the scope they are used in. Rust macros are actually only [partially " -"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." -"html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers from " +"the scope they are used in. Rust macros are actually only [partially hygienic]" +"(https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " -"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " -"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" -"minutiae/hygiene.html هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را " +"از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا " +"حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html " +"هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented " -"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " -"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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented programming " +"features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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) " -"است." +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و در " +"حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم فانکشنال]" +"(https://doc.rust-lang.org/book/ch13-00-functional-features.html) است." #: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " -"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض " +"تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -3132,29 +3059,27 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by " -"default. Add the `mut` keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by default. " +"Add the `mut` keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " -"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را " +"حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile " -"time, but type inference (covered later) allows the programmer to omit it in " -"many cases." +"The `i32` here is the type of the variable. This must be known at compile time, " +"but type inference (covered later) allows the programmer to omit it in many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " -"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " -"بسیاری از موارد آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج " +"نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد " +"آن را حذف کند." #: src/types-and-values/values.md msgid "" -"Here are some basic built-in types, and the syntax for literal values of " -"each type." +"Here are some basic built-in types, and the syntax for literal values of each " +"type." msgstr "" -"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " -"است." +"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3203,8 +3128,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, 2_f32" +"3.14, -10.0e20, " +"2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3257,13 +3182,13 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " -"`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " -"as `123i64`." +"`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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3271,13 +3196,13 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the " -"meaning should be clear: it takes three integers, and returns an integer. " -"Functions will be covered in more detail later." +"This is the first time we've seen a function other than `main`, but the meaning " +"should be clear: it takes three integers, and returns an integer. Functions will " +"be covered in more detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " -"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " -"بیشتر پوشش داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: " +"سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش " +"داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3287,33 +3212,31 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do unknown things at runtime. In Rust, it's " -"defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " -"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " -"مختلف انجام دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف " +"نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام " +"دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics " -"(checked) in a debug build and wraps in a release build. There are other " -"options, such as overflowing, saturating, and carrying. These are accessed " -"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " -"a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in " +"a debug build and wraps in a release build. There are other options, such as " +"overflowing, saturating, and carrying. These are accessed with method syntax, e." +"g., `(a * b).saturating_add(b * c).saturating_add(c * a)`." msgstr "" "«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " -"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " -"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " -"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." +"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری " +"مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان " +"مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is " -"why the example requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is why " +"the example requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " -"مثال به یک تابع جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به " +"یک تابع جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3321,35 +3244,34 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on " -"constraints given by variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on constraints " +"given by variable declarations and usages." msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not " -"of some sort of dynamic \"any type\" that can hold any data. The machine " -"code generated by such declaration is identical to the explicit declaration " -"of a type. The compiler does the job for us and helps us write more concise " -"code." +"It is very important to emphasize that variables declared like this are not of " +"some sort of dynamic \"any type\" that can hold any data. The machine code " +"generated by such declaration is identical to the explicit declaration of a type. " +"The compiler does the job for us and helps us write more concise code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " -"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " -"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " -"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " -"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده " +"پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** " +"استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و " +"کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین تایپ ضمنی میتوانید " +"کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to " -"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " -"floating-point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to `i32`. " +"This sometimes appears as `{integer}` in error messages. Similarly, floating-" +"point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " -"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " -"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» " +"قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به " +"طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3357,20 +3279,19 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " -"number is calculated recursively as the sum of the n-1'th and n-2'th " -"Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is " +"calculated recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " -"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی " +"به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " -"will this function panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will " +"this function panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " -"panic می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic " +"می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3407,11 +3328,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" -"if-expr.html#if-expressions) exactly like `if` statements in other languages:" +"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) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-" +"expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3427,11 +3348,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each " -"block becomes the value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار هم " +"استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3447,30 +3368,28 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its " -"branch blocks must have the same type. Show what happens if you add `;` " -"after `\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its branch " +"blocks must have the same type. Show what happens if you add `;` after " +"`\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " -"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " -"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و " +"`else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` " +"در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. " -"For example, when it is used in a `let` statement, the statement must be " -"terminated with a `;` as well. Remove the `;` before `println!` to see the " -"compiler error." +"An `if` expression should be used in the same way as the other expressions. For " +"example, when it is used in a `let` statement, the statement must be terminated " +"with a `;` as well. Remove the `;` before `println!` to see the compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " -"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " -"کامپایلر را ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از " +"عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را " +"ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "" -"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3478,12 +3397,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) works much like in other languages, executing the " -"loop body as long as the condition is true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr." +"html#predicate-loops) works much like in other languages, executing the loop body " +"as long as the condition is true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" -"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr." +"html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3491,8 +3410,8 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " -"over ranges of values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over " +"ranges of values or the items in a collection:" msgstr "" "حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " "مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" @@ -3503,30 +3422,30 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle " -"iterating over different kinds of ranges/collections. Iterators will be " -"discussed in more detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle iterating " +"over different kinds of ranges/collections. Iterators will be discussed in more " +"detail later." msgstr "" "حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " -"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " -"قرار خواهند گرفت." +"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار " +"خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " -"for an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for " +"an inclusive range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " -"یک محدوده فراگیر نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک " +"محدوده فراگیر نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " -"زمانی که یک «break» ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که " +"یک «break» ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3534,23 +3453,21 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://" -"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +"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) " -"استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#continue-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). With " -"`loop`, this can take an optional expression that becomes the value of the " -"`loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions). With `loop`, this " +"can take an optional expression that becomes the value of the `loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/" +"reference/expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md @@ -3564,22 +3481,21 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-" -"trivial value. This is because it's guaranteed to only return at a `break` " -"statement (unlike `while` and `for` loops, which can also return when the " -"condition fails)." +"Note that `loop` is the only looping construct which can return a non-trivial " +"value. This is because it's guaranteed to only return at a `break` statement " +"(unlike `while` and `for` loops, which can also return when the condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " -"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " -"(برخلاف حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را " +"برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف " +"حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is " -"used to break out of nested loops:" +"Both `continue` and `break` can optionally take a label argument which is used to " +"break out of nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " -"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب " +"(label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3591,12 +3507,11 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " -"Each block has a value and a type, which are those of the last expression of " -"the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each " +"block has a value and a type, which are those of the last expression of the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " -"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. " +"هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" @@ -3604,18 +3519,17 @@ msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"If the last expression ends with `;`, then the resulting value and type is " -"`()`." +"If the last expression ends with `;`, then the resulting value and type is `()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر می‌کند. " +"به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید واژه " +"`return` تغییرات را اعمال کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." @@ -3623,11 +3537,11 @@ msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محا #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"You can shadow variables, both those from outer scopes and variables from " -"the same scope:" +"You can shadow variables, both those from outer scopes and variables from the " +"same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " -"هم متغیرهایی که از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم " +"متغیرهایی که از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3652,22 +3566,22 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block " -"in the last example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block in the " +"last example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " -"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در " +"خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both " -"variables' memory locations exist at the same time. Both are available under " -"the same name, depending where you use it in the code." +"Shadowing is different from mutation, because after shadowing both variables' " +"memory locations exist at the same time. Both are available under the same name, " +"depending where you use it in the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " -"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " -"کد استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور " +"همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد " +"استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3683,22 +3597,21 @@ msgstr "" #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some " -"programming languages), then a return type." +"Declaration parameters are followed by a type (the reverse of some programming " +"languages), then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " -"برخی از زبان‌های برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی " +"از زبان‌های برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return " -"value. Simply omit the `;` at the end of the expression. The `return` " -"keyword can be used for early return, but the \"bare value\" form is " -"idiomatic at the end of a function (refactor `gcd` to use a `return`)." +"The last expression in a function body (or any block) becomes the return value. " +"Simply omit the `;` at the end of the expression. The `return` keyword can be " +"used for early return, but the \"bare value\" form is idiomatic at the end of a " +"function (refactor `gcd` to use a `return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " -"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " -"عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته " +"می‌شود. به همین سادگی `;` را میتوان در انتهای عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy @@ -3706,56 +3619,55 @@ 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/control-flow-basics/functions.md -msgid "" -"Overloading is not supported -- each function has a single implementation." +msgid "Overloading is not supported -- each function has a single implementation." msgstr "" "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not " -"supported. Macros can be used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not supported. " +"Macros can be used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " -"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. " +"ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, " -"which will be covered later." +"Always takes a single set of parameter types. These types can be generic, which " +"will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a " -"variable number of arguments. They are distinguished by a `!` at the end. " -"The Rust standard library includes an assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a variable " +"number of arguments. They are distinguished by a `!` at the end. The Rust " +"standard library includes an assortment of useful macros." msgstr "" "ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " -"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " -"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." +"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد " +"Rust شامل مجموعه ای از ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " -"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " -"را اعمال می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح " +"داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال " +"می کند. ." #: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " -"یک رشته برمی گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک " +"رشته برمی گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." @@ -3763,19 +3675,17 @@ msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن ر #: src/control-flow-basics/macros.md msgid "" -"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " -"panic." +"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." msgstr "" -"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " -"panic می کند." +"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می " +"کند." #: src/control-flow-basics/macros.md msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will " -"panic." +"`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " -"اعدام شود وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود " +"وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3783,21 +3693,21 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and " -"how to use them. Why they are defined as macros, and what they expand to, is " -"not especially critical." +"The takeaway from this section is that these common conveniences exist, and how " +"to use them. Why they are defined as macros, and what they expand to, is not " +"especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " -"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " -"یابند، بسیار مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. " +"اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار " +"مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe " -"use of derive macros." +"The course does not cover defining macros, but a later section will describe use " +"of derive macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " -"مشتق شده توضیح داده خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده " +"توضیح داده خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy @@ -3805,27 +3715,22 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " -"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر " +"تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is 1, then the sequence terminates at _ni_." +msgid "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " -"می‌یابد." +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "" -"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "" -"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " -"+ ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3888,8 +3793,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 35 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " -"آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن " +"شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3897,27 +3802,26 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) " -"elements of the same type `T`. Note that the length of the array is _part of " -"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " -"different types. Slices, which have a size determined at runtime, are " -"covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements " +"of the same type `T`. Note that the length of the array is _part of its type_, " +"which means that `[u8; 3]` and `[u8; 4]` are considered two different types. " +"Slices, which have a size determined at runtime, are covered later." msgstr "" "یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " -"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " -"نظر گرفته می‌شوند." +"span> (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` است. " +"توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر " +"گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be " -"avoided using unsafe Rust." +"runtime. Rust can usually optimize these checks away, and they can be avoided " +"using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " -"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " -"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در " +"زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با " +"استفاده از Rust ناایمن از آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3926,25 +3830,23 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. " -"Types such as integers and strings implement the default output, but arrays " -"only implement the debug output. This means that we must use debug output " -"here." -msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " -"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " -"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " -"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " -"خروجی دیباگ استفاده کنیم." +"parameter: `{}` gives the default output, `{:?}` gives the debug output. Types " +"such as integers and strings implement the default output, but arrays only " +"implement the debug output. This means that we must use debug output here." +msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` " +"نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، " +"`{:?}` خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و " +"رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها فقط خروجی دیباگ را پیاده " +"سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک " -"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت " +"«چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3956,16 +3858,16 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, " -"e.g. `t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند `t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies " -"absence of a return value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of " +"a return value, akin to `void` in other languages." msgstr "" "تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " "بازگشتی است، مشابه `void` در زبان‌های دیگر." @@ -3976,22 +3878,20 @@ msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه ت #: src/tuples-and-arrays/iteration.md msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered " -"that yet." +"This functionality uses the `IntoIterator` trait, but we haven't covered that yet." msgstr "" -"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " -"پرداخته‌ایم." +"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked, while debug-only variants like " -"`debug_assert!` compile to nothing in release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` " +"macros. These are always checked, while debug-only variants like `debug_assert!` " +"compile to nothing in release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" -"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " -"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` " +"وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند " +"`debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -3999,9 +3899,9 @@ msgid "" "extract the inner values into local variables. This can be done manually by " "directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " -"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " -"دسترسی مستقیم به مقادیر داخلی انجام داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی " +"را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به " +"مقادیر داخلی انجام داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -4009,47 +3909,46 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger " -"value into its constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger value " +"into its constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " -"در بخش های تشکیل دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در " +"بخش های تشکیل دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " -"statically verify that the value on the right of `=` has the same structure " -"as the pattern." +"statically verify that the value on the right of `=` has the same structure as " +"the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " -"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " -"دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می " +"تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, " -"hence why we can also use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, hence " +"why we can also use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " -"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو " +"می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " -"comparison and destructuring to happen at the same time. This form of " -"pattern matching will be discussed in more detail later." +"comparison and destructuring to happen at the same time. This form of pattern " +"matching will be discussed in more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " -"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " -"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و " +"تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات " +"بیشتری مورد بحث قرار خواهد گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't " -"match the value being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't match " +"the value being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " -"مطابقت‌شده مطابقت ندارد نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده " +"مطابقت ندارد نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -4069,11 +3968,11 @@ msgstr "" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the " -"function. This function only operates on 3x3 matrices." +"Copy the code below to and implement the function. " +"This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و توابع " +"را پیاده‌سازی کنید:" #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md @@ -4104,23 +4003,22 @@ msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن ش #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership " -"of the value, and is also called \"borrowing\". Shared references are read-" -"only, and the referenced data cannot change." +"A reference provides a way to access another value without taking ownership of " +"the value, and is also called \"borrowing\". Shared references are read-only, and " +"the referenced data cannot change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " -"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " -"نمی توانند تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن " +"«قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند " +"تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made " -"with the `&` operator. The `*` operator \"dereferences\" a reference, " -"yielding its value." +"A shared reference to a type `T` has type `&T`. A reference value is made with " +"the `&` operator. The `*` operator \"dereferences\" a reference, yielding its " +"value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " -"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " -"دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته " +"می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -4130,114 +4028,107 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The " -"course will get into more detail on ownership in day 3." +"access the value, but is still \"owned\" by the original variable. The course " +"will get into more detail on ownership in day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " -"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " -"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " -"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و " +"این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع " +"برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در " +"روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can " -"be much smaller than the thing they point to. Students familiar with C or C+" -"+ will recognize references as pointers. Later parts of the course will " -"cover how Rust prevents the memory-safety bugs that come from using raw " -"pointers." +"References are implemented as pointers, and a key advantage is that they can be " +"much smaller than the thing they point to. Students familiar with C or C++ will " +"recognize references as pointers. Later parts of the course will cover how Rust " +"prevents the memory-safety bugs that come from using raw pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " -"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " -"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " -"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " -"استفاده از نشانگرهای خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند " +"بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ " +"آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این " +"موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از استفاده از نشانگرهای " +"خام جلوگیری می‌کند." #: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." -msgstr "" -"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " -"C++." +"Rust will auto-dereference in some cases, in particular when invoking methods " +"(try `r.is_ascii()`). There is no need for an `->` operator like in C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " -"متدها (`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها " +"(`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " -"Note that this re-binds `r`, so that it refers to something else. This is " -"different from C++, where assignment to a reference changes the referenced " -"value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note " +"that this re-binds `r`, so that it refers to something else. This is different " +"from C++, where assignment to a reference changes the referenced value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " -"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " -"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " -"تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه " +"داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می " +"کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if " -"that value was mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if that " +"value was mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " -"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن " +"مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long enough. " +"Dangling references cannot occur in safe Rust. `x_axis` would return a reference " +"to `point`, but `point` will be deallocated when the function returns, so this " +"will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " -"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " -"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " -"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه " +"کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک " +"ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، " +"بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " -"خواهیم کرد." +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the " -"value they refer to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the value " +"they refer to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " -"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند " +"مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the " -"value. No other references (shared or exclusive) can exist at the same time, " -"and the referenced value cannot be accessed while the exclusive reference " -"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " -"alive." +"\"Exclusive\" means that only this reference can be used to access the value. No " +"other references (shared or exclusive) can exist at the same time, and the " +"referenced value cannot be accessed while the exclusive reference exists. Try " +"making an `&point.0` or changing `point.0` while `x_coord` is alive." msgstr "" "\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " -"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " -"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " -"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " -"`point.0` را تغییر دهید." +"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود " +"داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده " +"دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا `point.0` را تغییر " +"دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let " -"x_coord: &mut i32`. The first one represents a shared reference which can be " -"bound to different values, while the second represents an exclusive " -"reference to a mutable value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: " +"&mut i32`. The first one represents a shared reference which can be bound to " +"different values, while the second represents an exclusive reference to a mutable " +"value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " -"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " -"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. " +"مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در " +"حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -4250,13 +4141,13 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` " +"تغییر دهید چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending " -"indexes in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending indexes " +"in brackets." msgstr "" "ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " "براکت‌ها، برش (slice) ایجاد می‌کنیم." @@ -4264,62 +4155,59 @@ msgstr "" #: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " -"identical." +"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/references/slices.md 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/references/slices.md -msgid "" -"To easily create a slice of the full array, we can therefore use `&a[..]`." +msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " "استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " -"(`&[i32]`) no longer mentions the array length. This allows us to perform " -"computation on slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) " +"no longer mentions the array length. This allows us to perform computation on " +"slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " -"`s` (`&[i32]`) دیگر طول آرایه را " -"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " -"انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. " +"این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." #: src/references/slices.md 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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but the " +"answer is that for memory safety reasons you cannot do it through `a` at this " +"point in the execution, but you can read the data from both `a` and `s` safely. " +"It works before you created the slice, and again after the `println`, when the " +"slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " -"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " -"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " -"داده‌ها را از هر دو `a` و `s` به " -"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " -"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، " +"اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر " +"دو `a` و `s` به طور ایمن بخوانید. این " +"کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، " +"زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow " +"checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -4331,8 +4219,7 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "" -"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4358,31 +4245,31 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`\"Hello\"`), are stored in the program’s binary." +"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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a " -"`Vec`, it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, " +"it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " -"بایت‌هاست. مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. " +"مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string " -"literal; `String::new()` creates a new empty string, to which string data " -"can be added using the `push()` and `push_str()` methods." +"As with many other types `String::from()` creates a string from a string 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()` که رشته " -"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `String::from()` یک رشته از یک " +"لیترال رشته ایجاد می‌کند. `String::new()` که رشته خالی جدید " +"ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md @@ -4390,9 +4277,9 @@ 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!()` یک راه راحت برای ایجاد یک رشته Owned " -"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" -"()` است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned از " +"مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` " +"است." #: src/references/strings.md msgid "" @@ -4401,63 +4288,60 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " -"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " -"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " -"درست کردن مرزهای کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. " +"اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. " +"تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای " +"کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " -"one that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain " -"UTF-8 encoded bytes and will never use a small-string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one " +"that always points to a valid string in memory. Rust `String` is a rough " +"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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` " +"ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: `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\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " -"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" == \"\\\\n\"`.شما " +"می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را " +"جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, " -"representing a point as `[f64;3]`. It is up to you to determine the function " -"signatures." +"We will create a few utility functions for 3-dimensional geometry, representing a " +"point as `[f64;3]`. It is up to you to determine the function signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " -"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان " +"`[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" +"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " -"`v.sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v." +"sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4489,8 +4373,7 @@ msgstr "/// اندازه‌ی بردار داده شده را محاسبه کن #: src/references/solution.md msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its " -"direction.\n" +"/// Change the magnitude of the vector to 1.0 without changing its direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4537,50 +4420,47 @@ msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری #: src/user-defined-types/named-structs.md msgid "" -"This may be a good time to let people know there are different types of " -"structs." +"This may be a good time to let people know there are different types of structs." msgstr "" -"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " -"دارد." +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " -"trait on some type but don’t have any data that you want to store in the " -"value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait " +"on some type but don’t have any data that you want to store in the value itself." msgstr "" "ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " -"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " -"که بخواهید در خود مقدار ذخیره کنید." +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که " +"بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md msgid "" -"The next slide will introduce Tuple structs, used when the field names are " -"not important." +"The next slide will introduce Tuple structs, used when the field names are not " +"important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " -"استفاده می‌شوند که نام فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده " +"می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " -"یک روش میانبر ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک " +"روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the " -"old struct without having to explicitly type it all out. It must always be " -"the last element." +"The syntax `..avery` allows us to copy the majority of the fields from the old " +"struct without having to explicitly type it all out. It must always be the last " +"element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " -"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم " +"بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" -msgstr "" +msgstr "اگر نام فیلدها بی‌اهمیت هستند، می‌توانید از ساختار tuple استفاده کنید:" #: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" @@ -4604,32 +4484,37 @@ msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in " -"a primitive type, for example:" +"Newtypes are a great way to encode additional information about the value in a " +"primitive type, for example:" msgstr "" -"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " -"اولیه (primitive type) است، به عنوان مثال:" +"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع اولیه " +"(primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." -msgstr "" +msgstr "این عدد در برخی واحدها اندازه گیری می‌شود: `Newtons` در مثال بالا." #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have " -"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have to " +"validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" +"مقدار زمانی که ایجاد شد مقداری اعتبارسنجی را دریافت کرد، بنابراین دیگر لازم نیست " +"در هر بار استفاده دوباره آن را تأیید کنید: `PhoneNumber(String)` یا " +"`OddNumber(u32)`." #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " -"single field in the newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single " +"field in the newtype." msgstr "" +"نحوه افزودن مقدار `f64` به نوع `Newtons` را با دسترسی به single field در نوع جدید " +"نشان دهید." #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " -"for instance using booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for " +"instance using booleans as integers." msgstr "" "Rust معمولاً چیزهای غیر واضح را دوست ندارد، مانند automatic unwrapping یا " "به‌عنوان‌مثال استفاده از booleanها به عنوان اعداد صحیح." @@ -4643,14 +4528,15 @@ msgid "" "The example is a subtle reference to the [Mars Climate Orbiter](https://en." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" +"این مثال، اشاره ظریفی به شکست [مدارگَرد آب‌و‌هوای مریخ](https://en.wikipedia.org/" +"wiki/Mars_Climate_Orbiter) است." #: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" -"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " -"است:" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" #: src/user-defined-types/enums.md #, fuzzy @@ -4674,8 +4560,8 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " -"تحت یک نوع جمع آوری کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک " +"نوع جمع آوری کنید." #: src/user-defined-types/enums.md msgid "" @@ -4687,9 +4573,9 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, " -"Rust will store a discriminant so that it knows at runtime which variant is " -"in a `PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, Rust " +"will store a discriminant so that it knows at runtime which variant is in a " +"`PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4698,53 +4584,52 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one " -"with different types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع مختلف " +"فیلد (variant payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate " -"structs but then they wouldn’t be the same type as they would if they were " -"all defined in an enum." +"You could even implement the different variants of an enum with separate structs " +"but then they wouldn’t be the same type as they would if they were all defined in " +"an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " -"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " -"نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، " +"اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "" -"Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." +msgstr "Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" -msgstr "" +msgstr "در صورت لزوم، یک عدد صحیح با کوچکترین اندازه مورد نیاز را ذخیره می‌کند" #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use " -"invalid bit patterns to encode the discriminant (the \"niche " -"optimization\"). For example, `Option<&u8>` stores either a pointer to an " -"integer or `NULL` for the `None` variant." +"If the allowed variant values do not cover all bit patterns, it will use invalid " +"bit patterns to encode the discriminant (the \"niche optimization\"). For " +"example, `Option<&u8>` stores either a pointer to an integer or `NULL` for the " +"`None` variant." msgstr "" +"اگر مقادیر متغیر مجاز همه الگوهای bit را پوشش ندهند، از الگوهای bit نامعتبر برای " +"رمزگذاری متمایز کننده (یک \"niche optimization\") استفاده می‌کند. برای مثال، " +"`Option<&u8>` یک اشاره‌گر به یک عدد صحیح یا `NULL` را برای نوع `None` ذخیره می‌کند." #: src/user-defined-types/enums.md -msgid "" -"You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " -"را کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را " +"کنترل کنید:" #: src/user-defined-types/enums.md msgid "" -"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " -"bytes." +"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." msgstr "" -"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " -"بایت جا می‌شود." +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا " +"می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md @@ -4755,31 +4640,30 @@ msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md msgid "" -"Rust has several optimizations it can employ to make enums take up less " -"space." +"Rust has several optimizations it can employ to make enums take up less space." msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" -"option/#representation), Rust guarantees that `size_of::()` equals " -"`size_of::>()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" +"#representation), Rust guarantees that `size_of::()` equals `size_of::" +">()`." msgstr "" "بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::" -">()` است." +"dir=ltr>`size_of::()` برابر با `size_of::>()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look " -"like in practice. It's important to note that the compiler provides no " -"guarantees regarding this representation, therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look like " +"in practice. It's important to note that the compiler provides no guarantees " +"regarding this representation, therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " -"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " -"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر " +"برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، " +"بنابراین این کاملاً ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4788,44 +4672,43 @@ msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined " -"wherever they are used:" +"Constants are evaluated at compile time and their values are inlined wherever " +"they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " -"استفاده می شوند، درج می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده " +"می شوند، درج می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." +"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)، این موارد هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static.html)، " +"این موارد هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate " -"`const` values. `const` functions can however be called at runtime." +"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` را می توان در " -"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای تولید " +"مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در زمان اجرا " +"فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` " +"عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but " -"it is helpful and safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا ارزیابی " +"می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده `static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4836,8 +4719,7 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " -"نمی‌شوند:" +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4850,30 +4732,29 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html), these are not inlined upon use and have an actual " -"associated memory location. This is useful for unsafe and embedded code, and " -"the variable lives through the entirety of the program execution. When a " -"globally-scoped value does not have a reason to need object identity, " -"`const` is generally preferred." +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" +"static.html), these are not inlined upon use and have an actual associated memory " +"location. This is useful for unsafe and embedded code, and the variable lives " +"through the entirety of the program execution. When a 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` ترجیح داده می‌شود." +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان حافظه " +"واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل اجرای " +"برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, استفاده از " +"`const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " -"`C++` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C++` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as " -"required by types with interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as required by " +"types with interior mutability such as `Mutex`." msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." @@ -4881,17 +4762,17 @@ msgstr "" #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be " -"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be `Sync`. " +"Interior mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/" +"sync/struct.Mutex.html), atomic or similar." 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) نگاه خواهیم کرد." +"`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang.org/std/" +"sync/struct.Mutex.html)، اتمی یا مشابه امکان پذیر است. البته که داشتن متغییر های " +"استاتیک قابل تغییر هم امکان پذیر هست اما برای این کار نیاز به همگام سازی دستی " +"دارند. بنابراین هر دسترسی به آنها نیاز به کد `unsafe` دارد. ما در فصل Unsafe " +"Rust به استاتیک های قابل تغییر [mutable statics](../unsafe/mutable-static-" +"variables.md) نگاه خواهیم کرد." #: src/user-defined-types/static.md #, fuzzy @@ -4918,30 +4799,27 @@ msgstr "برنامه‌نویسان C این را شبیه به `typedef` تشخ #: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " -"system. It is up to you to define the types and functions to construct " -"various events. Use `#[derive(Debug)]` to allow the types to be formatted " -"with `{:?}`." +"system. It is up to you to define the types and functions to construct various " +"events. Use `#[derive(Debug)]` to allow the types to be formatted with `{:?}`." msgstr "" -"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد " -"خواهیم کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای " -"مختلف تعریف کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با " -"`{:?}` قالببندی شوند." +"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد خواهیم " +"کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای مختلف تعریف " +"کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با `{:?}` قالببندی " +"شوند." #: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " -"`main` runs without errors. The next part of the course will cover getting " -"data out of these structures." +"`main` runs without errors. The next part of the course will cover getting data " +"out of these structures." msgstr "" -"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا " -"اجرا شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." +"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا اجرا " +"شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy -msgid "" -"/// An event in the elevator system that the controller must react to.\n" -msgstr "" -"/// An event in the elevator system that the controller must react to.\n" +msgid "/// An event in the elevator system that the controller must react to.\n" +msgstr "/// An event in the elevator system that the controller must react to.\n" #: src/user-defined-types/exercise.md #, fuzzy @@ -4971,11 +4849,9 @@ msgstr "/// The car doors have closed.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy msgid "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +"/// A directional button was pressed in an elevator lobby on the given floor.\n" msgstr "" -"/// A directional button was pressed in an elevator lobby on the given " -"floor.\n" +"/// A directional button was pressed in an elevator lobby on the given floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy @@ -5076,18 +4952,16 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "" -"Standard library types and traits: a tour of Rust's rich standard library." -msgstr "" -"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "Standard library types and traits: a tour of Rust's rich standard library." +msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " -"این شامل:" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این " +"شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md @@ -5096,8 +4970,8 @@ msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شا #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " "دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." @@ -5118,9 +4992,9 @@ msgstr "'q'" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md -#: src/generics/solution.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md +#: src/std-traits/solution.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'a'" msgstr "'a'" @@ -5164,44 +5038,42 @@ msgstr "\"یک چیز دیگر\"" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be exhaustive, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." +"The `_` pattern is a wildcard pattern which matches any value. The expressions " +"_must_ be exhaustive, meaning that it covers every possibility, so `_` is often " +"used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " -"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " -"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید " +"جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان " +"آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " -"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " -"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match " +"باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته " +"باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that can " +"be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " -"بخش مطابقت استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش " +"مطابقت استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " -"باشد که شرط برقرار باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد " +"که شرط برقرار باشد." #: src/pattern-matching/match.md msgid "" -"You might point out how some specific characters are being used when in a " -"pattern" -msgstr "" -"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +"You might point out how some specific characters are being used when in a pattern" +msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -5222,29 +5094,28 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when " -"we wish to concisely express more complex ideas than patterns alone would " -"allow." +"Match guards as a separate syntax feature are important and necessary when we " +"wish to concisely express more complex ideas than patterns alone would allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " -"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و " +"ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"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." +"They are not the same as separate `if` expression inside of the match arm. An " +"`if` expression inside of the branch block (after `=>`) happens after the 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` اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک عبارت " +"`if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به اون شاخه " +"خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های عبارت `match` " +"اصلی ندارد." #: src/pattern-matching/match.md msgid "" -"The condition defined in the guard applies to every expression in a pattern " -"with an `|`." +"The condition defined in the guard applies to every expression in a pattern with " +"an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -5277,13 +5148,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to " -"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." +"The distinction between a capture and a constant expression can be hard to 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` تغییر دهید و خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید ‍`2` " +"را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را به یک " +"`const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -5291,13 +5162,12 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is " -"how you inspect the structure of your types. Let us start with a simple " -"`enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is how " +"you inspect the structure of your types. Let us start with a simple `enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " -"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " -"بیایید با یک نوع ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده " +"شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع " +"ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -5313,21 +5183,21 @@ msgstr "\"با عرض‌پوزش، خطایی رخ داده است: {msg}\"" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first " -"arm, `half` is bound to the value inside the `Ok` variant. In the second " -"arm, `msg` is bound to the error message." +"Here we have used the arms to _destructure_ the `Result` value. In the first arm, " +"`half` is bound to the value inside the `Ok` variant. In the second arm, `msg` is " +"bound to the error message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " -"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " -"`msg` به پیام خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` " +"به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام " +"خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md msgid "" -"The `if`/`else` expression is returning an enum that is later unpacked with " -"a `match`." +"The `if`/`else` expression is returning an enum that is later unpacked with a " +"`match`." msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " -"هم باز می‌شود." +"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از هم باز " +"می‌شود." #: src/pattern-matching/destructuring-enums.md msgid "" @@ -5335,50 +5205,47 @@ 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` اضافه کنید و نمایش " -"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " -"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش خطاها " +"هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش " +"کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md msgid "" -"The values in the enum variants can only be accessed after being pattern " -"matched." +"The values in the enum variants can only be accessed after being pattern matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage " -"the Rust compiler provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage the " +"Rust compiler provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " -"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " -"شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر " +"Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it " -"in a loop. That won't compile because `msg` is consumed when matched. To fix " -"it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " -"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " -"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " -"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " -"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" -"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " -"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " -"msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it in a " +"loop. That won't compile because `msg` is consumed when matched. To fix it, match " +"`&result` instead of `result`. That will make `msg` a reference so it won't be " +"consumed. This [\"match ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-" +"ergonomics.html) appeared in Rust 2018. If you want to support older Rust, " +"replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با " +"استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف " +"می‌شود. برای رفع این مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث " +"می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. این ویژگی که به نام [\"match " +"ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) شناخته " +"می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی " +"کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. " -"They are used for pattern matching:" +"Rust has a few control flow constructs which differ from other languages. They " +"are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " -"ساختارها برای مطابقت الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها " +"برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5394,13 +5261,13 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-let-expressions) lets you execute different code depending on " -"whether a value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " -"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-" +"let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت " +"دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md #, fuzzy @@ -5409,15 +5276,15 @@ msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " -"- anything but falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, use " +"[`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else." +"html). The \"else\" case must diverge (`return`, `break`, or panic - anything but " +"falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" -"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " -"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " -"- به غیر از اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc." +"rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، " +"حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` - به غیر از " +"اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -5436,32 +5303,31 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md -#: src/android/testing.md src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md +#: src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " -"repeatedly tests a value against a pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/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) وجود دارد که مقادیر " -"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر مقابل " +"الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) returns `Some(c)` until the string is empty, after " -"which it will return `None`. The `while let` lets us keep iterating through " -"all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String." +"html#method.pop) returns `Some(c)` until the string is empty, after which it will " +"return `None`. The `while let` lets us keep iterating through all items." msgstr "" "در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " -"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " -"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و " +"پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد " +"که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -5469,25 +5335,24 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make " -"it more concise than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make it " +"more concise than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " -"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " -"کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی " +"نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" -"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " -"`Option` است:" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` " +"است:" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " -"الگو استفاده نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو " +"استفاده نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5495,14 +5360,13 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports " -"flattening this nested code. Rewrite the awkward version for students, so " -"they can see the transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports flattening " +"this nested code. Rewrite the awkward version for students, so they can see the " +"transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " -"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " -"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " -"مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده " +"شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی " +"پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5514,22 +5378,21 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value " -"matches the pattern." +"Point out that the `while let` loop will keep going as long as the value matches " +"the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " -"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته " +"باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if " -"statement that breaks when there is no value to unwrap for `name.pop()`. The " -"`while let` provides syntactic sugar for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if statement " +"that breaks when there is no value to unwrap for `name.pop()`. The `while let` " +"provides syntactic sugar for the above scenario." msgstr "" "شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." -"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " -"می‌دهد." +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، " +"شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5537,49 +5400,48 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later " -"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " -"tests. To evaluate a boxed expression, use the deref operator (`*`) to " -"\"unbox\" it: `eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later in " +"the course. An expression can be \"boxed\" with `Box::new` as seen in the tests. " +"To evaluate a boxed expression, use the deref operator (`*`) to \"unbox\" it: " +"`eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " -"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " -"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " -"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی " +"قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور " +"که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) " +"برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" "Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " +"type is an enum that represents either a successful value (`Ok(Value)`) or an " +"error (`Err(String)`). We will cover this type in detail later." msgstr "" "برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " +"یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " "(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing " -"`eval`. The final product should pass the tests. It may be helpful to use " -"`todo!()` and get the tests to pass one-by-one. You can also skip a test " -"temporarily with `#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing `eval`. " +"The final product should pass the tests. It may be helpful to use `todo!()` and " +"get the tests to pass one-by-one. You can also skip a test temporarily with " +"`#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " -"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " -"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " -"را با استفاده از `[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. " +"محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها " +"به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از " +"`[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " -"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " -"panic مدیریت کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز " +"عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت " +"کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md #, fuzzy @@ -5611,11 +5473,11 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with " -"an `impl` block:" +"Rust allows you to associate functions with your new types. You do this with an " +"`impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " -"کار را با استفاده از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار " +"را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md #, fuzzy @@ -5659,39 +5521,39 @@ msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts " -"on. There are several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts on. " +"There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " -"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. " +"چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " -"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض " +"می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " -"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " -"به پایان برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر " +"قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان " +"برسد." #: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " -"method becomes the owner of the object. The object will be dropped " -"(deallocated) when the method returns, unless its ownership is explicitly " -"transmitted. Complete ownership does not automatically mean mutability." +"method becomes the owner of the object. The object will be dropped (deallocated) " +"when the method returns, unless its ownership is explicitly transmitted. Complete " +"ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " -"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " -"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک " +"شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور " +"صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5699,8 +5561,8 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to " -"create constructors which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to create " +"constructors which are called `new` by convention." msgstr "" "بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " "سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." @@ -5711,21 +5573,21 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the " -"first parameter represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the first " +"parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " -"پارامتر اول نمونه را به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر " +"اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver " -"syntax and to help keep them more organized. By using methods we can keep " -"all the implementation code in one predictable place." +"Developers may choose to use methods to take advantage of method receiver syntax " +"and to help keep them more organized. By using methods we can keep all the " +"implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " -"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " -"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد " +"بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم " +"تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." @@ -5734,53 +5596,53 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how " -"the struct name could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how the " +"struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " -"دهید که چگونه نام struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که " +"چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and " -"can be used elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and can " +"be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " -"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار " +"دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to " -"refer to individual fields." +"Note how `self` is used like other structs and dot notation can be used to refer " +"to individual fields." msgstr "" "توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " "می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` " -"by trying to run `finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` by " +"trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " -"تلاش برای اجرای متد `finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش " +"برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://" -"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " -"receiver types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://doc." +"rust-lang.org/reference/special-types-and-traits.html) allowed to be receiver " +"types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) نیز وجود دارند که " -"به‌عنوان تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that " -"redundant?" +"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that redundant?" msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point Point`, but methods in this " -"block will only be available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this block " +"will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type parameters. " +"Here, `Foo::from(\"hello\")` would not compile because there is no `From<&str>` " +"implementation for `Foo`." msgstr "" "پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can be " +"arbitrary, like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه " -"باشد، مانند `() -> B` can return any " -"type satisfying `B`, and the caller may need to choose one, such as with " -"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" -">()`." +"Inference is hard in return position. A function returning `impl Foo` picks the " +"concrete type it returns, without writing it out in the source. A function " +"returning a generic type like `collect() -> B` can return any type satisfying " +"`B`, and the caller may need to choose one, such as with `let x: Vec<_> = foo." +"collect()` or with the turbofish, `foo.collect::>()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " -"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " -"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " -"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " -"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " -"یا با استفاده از ()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ " +"مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. " +"تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که " +"`B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از " +"آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` یا با استفاده از " +"()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " -"the error message shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the " +"error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " -"ببینید پیام خطا چه چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید " +"پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also " -"supports using them for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also supports " +"using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " -"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " -"اشیاء trait پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین " +"از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait " +"پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -6386,87 +6238,82 @@ msgstr "// Uses type-erasure and dynamic dispatch.\n" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a " -"specialized instance of the function for each different type that the " -"generic is instantiated with. This means that calling a trait method from " -"within a generic function still uses static dispatch, as the compiler has " -"full type information and can resolve which type's trait implementation to " -"use." +"Generics, including `impl Trait`, use monomorphization to create a specialized " +"instance of the function for each different type that the generic is instantiated " +"with. This means that calling a trait method from within a generic function still " +"uses static dispatch, as the compiler has full type information and can resolve " +"which type's trait implementation to use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " -"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " -"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " -"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " -"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از " +"تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست " +"که فراخوانی یک متد trait از درون یک تابع generic همچنان از فراخوانی استاتیک " +"استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و می‌تواند پیاده‌سازی trait " +"مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " -"This means that there's a single version of `fn dynamic` that is used " -"regardless of what type of `Pet` is passed in." -msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " -"یک [virtual method table](https://en.wikipedia.org/wiki/" -"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " -"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " -"استفاده می‌شود." +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This " +"means that there's a single version of `fn dynamic` that is used regardless of " +"what type of `Pet` is passed in." +msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک " +"[virtual method table](https://en.wikipedia.org/wiki/Virtual_method_table) " +"(vtable) استفاده می‌کند. این بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد " +"که بدون توجه به تایپ `Pet` که وارد می‌شود، استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, the trait object needs to be behind some kind of " -"indirection. In this case it's a reference, though smart pointer types like " -"`Box` can also be used (this will be demonstrated on day 3)." +"indirection. In this case it's a reference, though smart pointer types like `Box` " +"can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " -"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " -"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " -"سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته " +"باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند " +"مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " -"two pointers: One pointer points to the concrete object that implements " -"`Pet`, and the other points to the vtable for the trait implementation for " -"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " -"up the function pointer for `talk` in the vtable and then invokes the " -"function, passing the pointer to the `Dog` or `Cat` into that function. The " -"compiler doesn't need to know the concrete type of the `Pet` in order to do " -"this." -msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " -"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " -"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " -"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " -"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " -"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " -"`Pet` برای انجام این کار ندارد." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two " +"pointers: One pointer points to the concrete object that implements `Pet`, and " +"the other points to the vtable for the trait implementation for that type. When " +"calling the `talk` method on `&dyn Pet` the compiler looks up the function " +"pointer for `talk` in the vtable and then invokes the function, passing the " +"pointer to the `Dog` or `Cat` into that function. The compiler doesn't need to " +"know the concrete type of the `Pet` in order to do this." +msgstr "" +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، " +"یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی " +"می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام " +"فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع `talk` را در vtable " +"جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به `Dog` یا `Cat` را به آن تابع " +"پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " -"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا " +"دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using the [`Ord`](https://doc.rust-" -"lang.org/stable/std/cmp/trait.Ord.html) trait." +"determines the minimum of two values, using the [`Ord`](https://doc.rust-lang.org/" +"stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " -"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." -"rust-lang.org/stable/std/cmp/trait.Ord.html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از " +"دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/" +"stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md #, fuzzy msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "// TODO: implement the `min` function used in `main`.\n" -#: src/generics/exercise.md src/generics/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md +#: src/error-handling/solution.md msgid "'z'" msgstr "'z'" @@ -6497,8 +6344,8 @@ msgid "" "Ordering.html) enum." msgstr "" "[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " -"enum را به دانش‌آموزان نشان دهید." +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را " +"به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -6525,35 +6372,33 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " -"از متدهای رایج‌تر را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از " +"متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common " -"types used by Rust libraries and programs. This way, two libraries can work " -"together smoothly because they both use the same `String` type." +"Rust comes with a standard library which helps establish a set of common types " +"used by Rust libraries and programs. This way, two libraries can work together " +"smoothly because they both use the same `String` type." msgstr "" "Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " -"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " -"استفاده می‌کنند." +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه " +"می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." #: src/std-types/std.md msgid "" -"In fact, Rust contains several layers of the Standard Library: `core`, " -"`alloc` and `std`." +"In fact, Rust contains several layers of the Standard Library: `core`, `alloc` " +"and `std`." msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " -"`std`." +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on " -"`libc`, allocator or even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on `libc`, " +"allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " -"حتی وجود یک سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی " +"وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" @@ -6564,8 +6409,7 @@ msgstr "" "`Vec`، `Box` و `Arc`." #: src/std-types/std.md -msgid "" -"Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " "می‌کنند." @@ -6584,21 +6428,21 @@ msgstr "" #: src/std-types/docs.md msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." +"html)." msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." -"u8.html)." +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." +"html)." #: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" -"std/collections/struct.BinaryHeap.html)." +"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" +"collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" -"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" -"stable/std/collections/struct.BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/" +"option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" +"collections/struct.BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6607,13 +6451,11 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md #, fuzzy msgid "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" +"/// Determine whether the first argument is divisible by the second argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" +"/// Determine whether the first argument is divisible by the second argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" @@ -6621,50 +6463,46 @@ msgstr "" msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " -"idiomatic to document all public items in an API using this pattern." +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is idiomatic to " +"document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " -"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " -"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " -"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " -"رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust " +"به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc]" +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند می‌شوند. مستند کردن " +"تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!" -"` or `/*! .. */`, called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!` or " +"`/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " -"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/" +"* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md #, fuzzy msgid "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers.\n" msgstr "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers.\n" #: src/std-types/docs.md msgid "" -"Show students the generated docs for the `rand` crate at ." +"Show students the generated docs for the `rand` crate at ." msgstr "" -"مستندات تولیدشده برای `rand` crate را در به " -"دانش‌آموزان نشان دهید." +"مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان " +"نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of " -"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" -"stable/std/string/struct.String.html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of type " +"`T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/stable/" +"std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in " -"memory as `T`." +"The niche optimization means that `Option` often has the same size in memory " +"as `T`." msgstr "" -"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، " -"هرکدام با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str), which means that you can call " -"all `str` methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/string/" +"struct.String.html#deref-methods-str), which means that you can call all `str` " +"methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" -"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " -"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" +"string/struct.String.html#deref-methods-str) است، که به این معناست که می‌توانید " +"تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when " -"you know how much data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when you " +"know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " -"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده " +"کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be " -"different from its length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be different " +"from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " -"طول آن به‌صورت کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول " +"آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " -"`char` can be different from what a human will consider a \"character\" due " -"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" +"`char` can be different from what a human will consider a \"character\" due to " +"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " -"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " -"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" -"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." -"html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه " +"داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر " +"می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/unicode-" +"segmentation/latest/unicode_segmentation/struct.Graphemes.html)." #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " -"باشد." +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it " -"access to `str`'s methods." +"`String` implements `Deref` which transparently gives it access to " +"`str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " -"methods on a `Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/struct." +"Vec.html#deref-methods-%5BT%5D), which means that you can call slice methods on a " +"`Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" -"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " -"متدهای برش را بر روی یک `Vec` فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/" +"struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را " +"بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data " -"it contains is stored on the heap. This means the amount of data doesn't " -"need to be known at compile time. It can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data it " +"contains is stored on the heap. This means the amount of data doesn't need to be " +"known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " -"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " -"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap " +"ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و " +"می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " -"explicitly. As always with Rust type inference, the `T` was established " -"during the first `push` call." +"explicitly. As always with Rust type inference, the `T` was established during " +"the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " -"us to easily initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://doc." +"rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);" +"+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to easily " +"initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" -"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" -"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " -"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K," +"+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی " +"یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md msgid "" -"Alternatively HashMap can be built from any `Iterator` which yields key-" -"value tuples." +"Alternatively HashMap can be built from any `Iterator` which yields key-value " +"tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " -"تولید می‌کند، ساخته شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید " +"می‌کند، ساخته شود." #: src/std-types/hashmap.md msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, " -"but it can lead into complications with the borrow checker." +"examples easier. Using references in collections can, of course, be done, but it " +"can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is used " +"to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" "`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " "ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "" -"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, " -"because it is reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, because " +"it is reflexive:" msgstr "" "`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " "بازتابی است:" #: src/std-traits/comparisons.md msgid "" -"In practice, it's common to derive these traits, but uncommon to implement " -"them." +"In practice, it's common to derive these traits, but uncommon to implement them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " -"آن‌ها به‌طور دستی پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها " +"به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc." -"rust-lang.org/std/ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-" +"lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." -"org/std/ops/index.html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/" +"std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -7324,17 +7148,15 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "" -"You could implement `Add` for `&Point`. In which situations is that useful?" +msgid "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " -"مفید است؟" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " -"the operator is not `Copy`, you should consider overloading the operator for " -"`&T` as well. This avoids unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the " +"operator is not `Copy`, you should consider overloading the operator for `&T` as " +"well. This avoids unnecessary cloning on the call site." msgstr "" "پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " "بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " @@ -7345,22 +7167,21 @@ msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " -"متد تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد " +"تعریف کرد؟" #: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " -"associated types (like `Output`) are controlled by the implementer of a " -"trait." +"associated types (like `Output`) are controlled by the implementer of a trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " -"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های " +"مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, " -"i32)> for Point` would add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for " +"Point` would add a tuple to a `Point`." msgstr "" "شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." @@ -7368,27 +7189,26 @@ msgstr "" #: src/std-traits/operators.md #, fuzzy msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " -"like the same operator in C-family languages; instead, for integer types it " -"negates each bit of the number, which arithmetically is equivalent to " -"subtracting it from -1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like " +"the same operator in C-family languages; instead, for integer types it negates " +"each bit of the number, which arithmetically is equivalent to subtracting it from " +"-1: `!5 == -6`." msgstr "" -"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در " -"زبان‌های خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، " -"هر بیت از عدد را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == " -"-6` است." +"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در زبان‌های " +"خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، هر بیت از عدد " +"را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == -6` است." #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions. Unlike `as`, these traits correspond to " -"lossless, infallible conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " +"and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate " +"type conversions. Unlike `as`, these traits correspond to lossless, infallible " +"conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " -"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای " +"تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -7396,18 +7216,18 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " -"automatically implemented when [`From`](https://doc.rust-lang.org/std/" -"convert/trait.From.html) is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically " +"implemented when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " +"is implemented:" msgstr "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" -"trait.From.html) پیاده‌سازی شده باشد:" +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get " -"`Into` implementation too." +"That's why it is common to only implement `From`, as your type will get `Into` " +"implementation too." msgstr "" "به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " "پیاده‌سازی `Into` را نیز دریافت می‌کند." @@ -7415,19 +7235,19 @@ msgstr "" #: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " -"converted into a `String`\", the rule is opposite, you should use `Into`. " -"Your function will accept types that implement `From` and those that _only_ " -"implement `Into`." +"converted into a `String`\", the rule is opposite, you should use `Into`. Your " +"function will accept types that implement `From` and those that _only_ implement " +"`Into`." msgstr "" "هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " -"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " -"پیاده‌سازی کرده‌اند." +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول " +"می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی " +"کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts " -"with `as`. These generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts with " +"`as`. These generally follow C semantics where those are defined." msgstr "" "Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " "می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." @@ -7446,42 +7266,39 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across " -"platforms. This might not match your intuition for changing sign or casting " -"to a smaller type -- check the docs, and comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across platforms. " +"This might not match your intuition for changing sign or casting to a smaller " +"type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " -"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " -"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. " +"این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته " +"باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use " -"incorrectly, and can be a source of subtle bugs as future maintenance work " -"changes the types that are used or the ranges of values in types. Casts are " -"best used only when the intent is to indicate unconditional truncation (e.g. " -"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " -"was in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and " +"can be a source of subtle bugs as future maintenance work changes the types that " +"are used or the ranges of values in types. Casts are best used only when the " +"intent is to indicate unconditional truncation (e.g. selecting the bottom 32 bits " +"of a `u64` with `as u32`, regardless of what was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " -"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " -"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " -"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " -"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " -"بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان " +"است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث " +"تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها " +"زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط باشد (مثلاً انتخاب 32 " +"بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " -"over `as` to confirm that the cast is in fact infallible. For fallible " -"casts, `TryFrom` and `TryInto` are available when you want to handle casts " -"that fit differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over " +"`as` to confirm that the cast is in fact infallible. For fallible casts, " +"`TryFrom` and `TryInto` are available when you want to handle casts that fit " +"differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " -"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " -"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " -"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " -"کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` " +"بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با " +"احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که " +"به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -7489,29 +7306,26 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might " -"be lost is generally discouraged, or at least deserves an explanatory " -"comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might be " +"lost is generally discouraged, or at least deserves an explanatory comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " -"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " -"دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است " +"داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " -"است." +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " -"abstract over `u8` sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`]" +"(https://doc.rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` " +"sources:" msgstr "" "با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " -"بر روی منابع `u8` انتزاع کنید:" +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی " +"منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -7527,11 +7341,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " -"you abstract over `u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you " +"abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " -"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما " +"امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -7550,8 +7364,8 @@ msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک " +"مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -7570,8 +7384,7 @@ msgstr "\" مقدار Y وارد شده است!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md -#: src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" @@ -7584,25 +7397,25 @@ msgstr "" #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to " -"their default values." +"A derived implementation will produce a value where all fields are set to their " +"default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " -"پیش‌فرض خود تنظیم شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض " +"خود تنظیم شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " -"پیاده‌سازی کنند." +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی " +"کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. " -"`0`, `\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, " +"`\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " -"(مثل `0`، `\"\"` و غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل " +"`0`، `\"\"` و غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -7613,31 +7426,30 @@ msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " -"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی " +"کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" -"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" -"with-struct-update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/" +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" +"update-syntax)." msgstr "" "سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" -"struct-update-syntax) شناخته می‌شود." +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" +"update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, they " +"implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), " +"[`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`]" +"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " -"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" -"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." -"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " -"هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها " +"پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`]" +"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -7660,65 +7472,63 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " -"be called needing only a shared reference to the closure, which means the " -"closure can be executed repeatedly and even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be " +"called needing only a shared reference to the closure, which means the closure " +"can be executed repeatedly and even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " -"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " -"چندین بار فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر " +"می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار " +"فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " -"object is accessed via exclusive reference, so it can be called repeatedly " -"but not concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object " +"is accessed via exclusive reference, so it can be called repeatedly but not " +"concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " -"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما " +"می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " -"Doing so consumes the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing " +"so consumes the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " -"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار " +"فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. " +"you can use an `FnMut` wherever an `FnOnce` is called for, and you can use an " +"`Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " -"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " -"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " -"کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` " +"است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید " +"و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if you " +"can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most " +"flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " -"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " -"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " -"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده " +"کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از " +"`FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای " +"فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then " -"`FnMut`, and lastly `FnOnce`." +"(which can be passed to a consumer of any of the 3 closure traits), then `FnMut`, " +"and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " -"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " -"`FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید " +"`Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." #: src/std-traits/closures.md #, fuzzy @@ -7732,15 +7542,13 @@ msgstr "" #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the " -"least demanding form of access they can (by shared reference if possible, " -"then exclusive reference, then by move). The `move` keyword forces capture " -"by value." +"By default, closures will capture each variable from an outer scope by the least " +"demanding form of access they can (by shared reference if possible, then " +"exclusive reference, then by move). The `move` keyword forces capture by value." msgstr "" -"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با " -"کمترین سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس " -"با انتقال) capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت " -"value اجباری می‌کند." +"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با کمترین " +"سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس با انتقال) " +"capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت value اجباری می‌کند." #: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" @@ -7756,15 +7564,15 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://" -"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " -"implement the missing bits. Only rotate ASCII alphabetic characters, to " -"ensure the result is still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://en." +"wikipedia.org/wiki/ROT13). Copy this code to the playground, and implement the " +"missing bits. Only rotate ASCII alphabetic characters, to ensure the result is " +"still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." -"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " -"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " -"تا نتیجه همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/" +"wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و " +"بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه " +"همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7780,11 +7588,11 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating " -"by 13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating by " +"13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " -"۱۳ کاراکتر را بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ " +"کاراکتر را بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7800,11 +7608,11 @@ msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md msgid "" -"Memory management, lifetimes, and the borrow checker: how Rust ensures " -"memory safety." +"Memory management, lifetimes, and the borrow checker: how Rust ensures memory " +"safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " -"Rust از ایمنی حافظه اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از " +"ایمنی حافظه اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7815,8 +7623,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " -"بکشد. این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. " +"این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7833,8 +7641,7 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "" -"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " -"می‌شود." +"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7870,41 +7677,39 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically " -"sized data, the actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized " +"data, the actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " -"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، " +"یعنی رشته واقعی، را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " -"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " -"کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول " +"است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." #: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" -"struct.System.html) and custom allocators can be implemented using the " -"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" +"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/struct." +"System.html) and custom allocators can be implemented using the [Allocator API]" +"(https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " -"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." -"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " -"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " -"پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده " +"از [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر " +"روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator " +"API](https://doc.rust-lang.org/std/alloc/index.html) پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should " -"point out that this is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should point " +"out that this is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " -"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با " +"این حال، باید اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7917,13 +7722,11 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" +" // String provides no guarantees about its layout, so this could lead to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7943,11 +7746,9 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "" -"Programmer must determine whether a pointer still points to valid memory." +msgid "Programmer must determine whether a pointer still points to valid memory." msgstr "" -"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " -"یا نه." +"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." @@ -7958,22 +7759,20 @@ msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" -"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " -"هسکل، ..." +"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." #: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " -"ارجاع داده شود، آزاد نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع " +"داده شود، آزاد نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "" -"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7991,80 +7790,78 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put " -"Rust in context." +"This slide is intended to help students coming from other languages to put Rust " +"in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " -"را در زمینه مناسب قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را " +"در زمینه مناسب قرار دهند." #: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " -"forgetting to call `free`, calling it multiple times for the same pointer, " -"or dereferencing a pointer after the memory it points to has been freed." +"forgetting to call `free`, calling it multiple times for the same pointer, or " +"dereferencing a pointer after the memory it points to has been freed." msgstr "" "C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " "خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " -"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " -"اشاره می‌کند." +"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره " +"می‌کند." #: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " -"advantage of language guarantees about calling destructors to ensure memory " -"is freed when a function returns. It is still quite easy to mis-use these " -"tools and create similar bugs to C." +"advantage of language guarantees about calling destructors to ensure memory is " +"freed when a function returns. It is still quite easy to mis-use these tools and " +"create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " -"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " -"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " -"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " -"ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از " +"تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن " +"حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که " +"از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that " -"is no longer reachable and discard it. This guarantees that any pointer can " -"be dereferenced, eliminating use-after-free and other classes of bugs. But, " -"GC has a runtime cost and is difficult to tune properly." +"Java, Go, and Python rely on the garbage collector to identify memory that is no " +"longer reachable and discard it. This guarantees that any pointer can be " +"dereferenced, eliminating use-after-free and other classes of bugs. But, GC has a " +"runtime cost and is difficult to tune properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " -"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " -"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " -"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " -"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای " +"که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر " +"اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از آزادسازی (use-" +"after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای در زمان اجرا دارد و " +"تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance " -"of C, with alloc and free operations precisely where they are required -- " -"zero cost. It also provides tools similar to C++'s smart pointers. When " -"required, other options such as reference counting are available, and there " -"are even third-party crates available to support runtime garbage collection " -"(not covered in this class)." +"Rust's ownership and borrowing model can, in many cases, get the performance of " +"C, with alloc and free operations precisely where they are required -- zero cost. " +"It also provides tools similar to C++'s smart pointers. When required, other " +"options such as reference counting are available, and there are even third-party " +"crates available to support runtime garbage collection (not covered in this " +"class)." msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " -"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " -"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" -"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " -"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " -"اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد " +"عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه " +"صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم " +"می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در دسترس هستند و حتی " +"crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان اجرا موجود است (که در این " +"کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error " -"to use a variable outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error to " +"use a variable outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " -"از متغیر خارج از دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از " +"متغیر خارج از دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely " -"one owner at all times." +"We say that the variable _owns_ the value. Every Rust value has precisely one " +"owner at all times." msgstr "" -"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " -"دارد." +"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." #: src/memory-management/ownership.md msgid "" @@ -8077,12 +7874,12 @@ msgstr "" #: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " -"garbage collector starts with a set of \"roots\" to find all reachable " -"memory. Rust's \"single owner\" principle is a similar idea." +"garbage collector starts with a set of \"roots\" to find all reachable memory. " +"Rust's \"single owner\" principle is a similar idea." msgstr "" "دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " -"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " -"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." +"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی " +"شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -8103,8 +7900,7 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" -"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " -"نیست." +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -8167,8 +7963,8 @@ msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " -"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده " +"می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -8185,29 +7981,27 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` " -"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ است که " +"در ان مقدار کپی میشود مگر که از `std::move` استفاده کنیم " +"( تا یک مقدار را جا به جا کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated " -"to manipulate the data itself is a matter of optimization, and such copies " -"are aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated to " +"manipulate the data itself is a matter of optimization, and such copies are " +"aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " -"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " -"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود " +"داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی " +"(aggressively) بهینه‌سازی می‌شوند." #: src/memory-management/move.md -msgid "" -"Simple values (such as integers) can be marked `Copy` (see later slides)." +msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" -"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " -"ببینید)." +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -8222,42 +8016,41 @@ 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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس از " +"آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the " -"`say_hello` function." +"The heap memory allocated for `name` will be freed at the end of the `say_hello` " +"function." msgstr "" -"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " -"خواهد شد." +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and " -"if `say_hello` accepts a reference as a parameter." +"`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` یک مرجع " -"را به عنوان پارامتر باید بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع (`&name`) منتقل کند و صد البته که `say_hello` یک مرجع را به عنوان " +"پارامتر باید بپذیرد." #: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " -"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع " +"ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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++ است که سهوا کپی ایجاد کنیم, " -"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " -"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, زیر به " +"صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که " +"لازم هست به صورت صریح کلون را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -8279,14 +8072,14 @@ msgstr "// Duplicate the data in s1.\n" msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " -"این کپی به صورت مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این " +"کپی به صورت مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " -"جداگانه‌ای حافظه خود را آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای " +"حافظه خود را آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -8298,84 +8091,83 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, " -"the string data has to be cloned. Otherwise we would get a double-free when " -"either string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, the " +"string data has to be cloned. Otherwise we would get a double-free when either " +"string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " -"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " -"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " -"آزادسازی مجدد حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده " +"است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، " +"هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد " +"حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " -"which is used to indicate when a value may be moved from. If the example had " -"been `s2 = std::move(s1)`, no heap allocation would take place. After the " -"move, `s1` would be in a valid but unspecified state. Unlike Rust, the " -"programmer is allowed to keep using `s1`." +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which " +"is used to indicate when a value may be moved from. If the example had been `s2 = " +"std::move(s1)`, no heap allocation would take place. After the 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` استفاده کند." +"البته که زبان C++ دارای [`std::move`]" +"(https://en.cppreference.com/w/cpp/utility/move) است که برای انتقال یک متغییر " +"استفاده میشود. اگر مثال ما `s2 = std::move(s1)` بود هیچ " +"تخصیص انباشتی صورت نمیگرفت بلکه `s1` در یک وضعیت معتبر البته نامشخص قرار میگرفت و " +"برخلاف زبان Rust, توی زبان C++ برنامه‌نویس مجاز است که دوباره " +"از `s1` استفاده کند." #: src/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " -"which is being copied or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is " +"being copied or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " -"انتقال دادن استفاده شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال " +"دادن استفاده شود." #: src/memory-management/clone.md msgid "" -"Sometimes you _want_ to make a copy of a value. The `Clone` trait " -"accomplishes this." +"Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes " +"this." msgstr "" -"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " -"انجام می‌دهد." +"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام " +"می‌دهد." #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " "occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " -"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال " +"`()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, " -"and return later to try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, and " +"return later to try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " -"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن " +"استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e." -"g. clone an array, all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e.g. " +"clone an array, all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " -"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان " +"مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning " -"logic if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning logic " +"if needed." msgstr "" "رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " "کپی‌برداری سفارشی را اجرا کند." #: src/memory-management/copy-types.md -msgid "" -"While move semantics are the default, certain types are copied by default:" +msgid "While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " -"صورت پیش‌فرض کپی می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت " +"پیش‌فرض کپی می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -8401,15 +8193,14 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on " -"arbitrary objects." +"Copying refers to bitwise copies of memory regions and does not work on arbitrary " +"objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " -"تعریف شده توسط شما کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف " +"شده توسط شما کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "" -"Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." @@ -8419,13 +8210,12 @@ msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " -"رفتار سفارشی را فراهم می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار " +"سفارشی را فراهم می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "" -"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -8433,19 +8223,19 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` " -"is not a `Copy` type." +"Add a `String` field to `struct Point`. It will not compile because `String` is " +"not a `Copy` type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " -"یک نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک " +"نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " -"برای `p1` قرار دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای " +"`p1` قرار دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -8453,16 +8243,16 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is " -"because rust requires that mutable references be exclusive, so while it's " -"valid to make a copy of a shared reference, creating a copy of a mutable " -"reference would violate Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is because " +"rust requires that mutable references be exclusive, so while it's valid to make a " +"copy of a shared reference, creating a copy of a mutable reference would violate " +"Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " -"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " -"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " -"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " -"قوانین قرض‌گیری Rust را نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات " +"قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز " +"دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک " +"ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را " +"نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -8473,9 +8263,8 @@ msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " -"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " -"شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را " +"پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -8512,8 +8301,7 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "" -"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -8521,38 +8309,38 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" -"drop` implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " +"implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " -"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی " +"کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " -"کرده باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده " +"باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The " -"significance is that it takes ownership of the value, so at the end of its " -"scope it gets dropped. This makes it a convenient way to explicitly drop " -"values earlier than they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The significance " +"is that it takes ownership of the value, so at the end of its scope it gets " +"dropped. This makes it a convenient way to explicitly drop values earlier than " +"they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " -"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " -"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " -"دامنه خارج می‌شوند، تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که " +"مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن " +"را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، " +"تبدیل می‌کند." #: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " -"کردن قفل‌ها، بستن فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن " +"قفل‌ها، بستن فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -8563,9 +8351,8 @@ msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " -"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " -"می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر " +"به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -8573,13 +8360,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its " -"data. We will use the \"builder pattern\" to support building a new value " -"piece-by-piece, using convenience functions." +"In this example, we will implement a complex data type that owns all of its data. " +"We will use the \"builder pattern\" to support building a new value piece-by-" +"piece, using convenience functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " -"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " -"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های " +"خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت " +"قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -8605,8 +8392,7 @@ msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md #, fuzzy -msgid "" -"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" @@ -8700,11 +8486,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " -"pointer to data on the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer " +"to data on the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " -"به داده‌های روی heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به " +"داده‌های روی heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -8712,22 +8498,22 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call " -"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" -"trait.Deref.html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can [call methods " +"from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref." +"html#more-on-deref-coercion)." msgstr "" "`| Element | 2 | o--+--->| Nil | // " -"| // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " +"| :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " -"- - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " -"- - - - -.\n" +".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - - - - " +"- -.\n" ": : : :\n" ": " "list : : :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " -"| // | :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----" -"+----+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " +"| :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----+----" +"+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " -"- - - - -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" #: src/smart-pointers/box.md msgid "" -"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " -"not null." +"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not " +"null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " -"هیچ‌گاه تهی (null) نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه " +"تهی (null) نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -8797,51 +8583,51 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust " -"compiler wants to know an exact size." +"have a type whose size that can't be known at compile time, but the Rust compiler " +"wants to know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " -"به دانستن اندازه دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به " +"دانستن اندازه دقیق آن دارد." #: src/smart-pointers/box.md msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " -"amounts of data on the stack, instead store the data on the heap in a `Box` " -"so only the pointer is moved." +"amounts of data on the stack, instead store the data on the heap in a `Box` so " +"only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " -"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " -"کنید تا فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم " +"زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا " +"فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not be able to compute a fixed size for the " -"struct in memory (the `List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the struct in " +"memory (the `List` would be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " -"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " -"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` " +"قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا " +"`List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and " -"just points at the next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and just " +"points at the next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " -"به عنصر بعدی `List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به " +"عنصر بعدی `List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get " -"the message \"recursive without indirection\", because for data recursion, " -"we have to use indirection, a `Box` or reference of some kind, instead of " -"storing the value directly." +"Remove the `Box` in the List definition and show the compiler error. We get the " +"message \"recursive without indirection\", because for data recursion, we have to " +"use indirection, a `Box` or reference of some kind, instead of storing the value " +"directly." msgstr "" "`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " -"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " -"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " -"مستقیم مقدار استفاده کنیم." +"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها " +"باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم " +"مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -8849,24 +8635,24 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " -"This makes `Box` one of the types that allow the compiler to optimize " -"storage of some enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This " +"makes `Box` one of the types that allow the compiler to optimize storage of some " +"enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" -"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " -"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null " +"باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه " +"می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" "For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit " -"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"compiler uses NULL-value to discriminate variants instead of using explicit tag " +"([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" "#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn Pet`. " +"However, we can also use trait objects with smart pointers like `Box` to create " +"an owned trait object: `Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده " -"کرد، مثلاً `dyn Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای " -"هوشمند مانند `Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait " -"object) ایجاد کنیم: `\" : : \"data: Cat\" +----+----+----" -"+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" +"+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | o " +"| :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" +"+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -9015,45 +8799,45 @@ msgid "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" +" `- - -| - - |- - - - - - - - - - - - - - - - " +"-'\n" " | |\n" -" | | " -"\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" +" | | \"Program " +"text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - - " +"-.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk\" " +"| :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk\" " +"| :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" '- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----" -"+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" +"+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | o " +"| :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" +"+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -9072,32 +8856,32 @@ msgstr "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" +" `- - -| - - |- - - - - - - - - - - - - - - - " +"-'\n" " | |\n" -" | | " -"\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" +" | | \"Program " +"text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - - " +"-.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::" -"talk\" | :\n" +" : | `----->| \"::talk\" " +"| :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::" -"talk\" | :\n" +" : '----------->| \"::talk\" " +"| :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" '- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" #: src/smart-pointers/trait-objects.md @@ -9105,45 +8889,44 @@ msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته " -"باشند. این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " "method:" msgstr "" -"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " -"کنید:" +"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" #: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the " -"doctor\"" +"\"Update a user's statistics based on measurements from a visit to the doctor\"" msgstr "\"به‌روزرسانی آمار یک کاربر بر اساس اندازه‌گیری معبار بازدید از پزشک\"" #: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md -#: src/android/aidl/example-service/client.md +#: src/android/build-rules/library.md src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -9569,23 +9339,23 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers " -"to. This is verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. " +"This is verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " -"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع " +"توسط بررسی‌کننده قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes " -"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " -"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " -"`Point` which is valid for at least the lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes can " +"also be explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and " +"`'a` is a typical default name. Read `&'a Point` as \"a borrowed `Point` which is " +"valid for at least the lifetime `a`\"." msgstr "" "طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " -"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " -"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " -"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." +"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` " +"شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک `Point` " +"قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9593,9 +9363,9 @@ msgid "" "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " -"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " -"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر " +"را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود " +"ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9617,15 +9387,14 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that " -"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " -"requires explicit annotations of lifetimes on function arguments and return " -"values." +"Looking inside the function body shows that it can only safely assume that `p3`'s " +"lifetime is the shorter of `p1` and `p2`. But just like types, Rust requires " +"explicit annotations of lifetimes on function arguments and return values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " -"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " -"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " -"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به " +"بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر " +"از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در " +"آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -9633,18 +9402,17 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for " +"at least `'a`." msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " "می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +msgid "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " -"بعدی توضیح داده شده است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی " +"توضیح داده شده است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -9652,37 +9420,36 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, " -"but Rust allows lifetimes to be elided in most cases with [a few simple " -"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " -"inference -- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, but " +"Rust allows lifetimes to be elided in most cases with [a few simple rules]" +"(https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not inference " +"-- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " -"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." -"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " -"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما " +"Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang." +"org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- " +"بلکه تنها یک اصطلاح نوشتاری کوتاه است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" -"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " -"می‌شود." +"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there is only one argument lifetime, it is given to all un-annotated " -"return values." +"If there is only one argument lifetime, it is given to all un-annotated return " +"values." msgstr "" "اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " "حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, " -"that lifetime is given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, that " +"lifetime is given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " -"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام " +"مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -9693,50 +9460,46 @@ msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " -"نیاز به حاشیه‌نویسی صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به " +"حاشیه‌نویسی صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" -"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " -"داده می‌شوند:" +"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده " +"می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for " -"validity by the compiler. Note that this is not the case for raw pointers " -"(unsafe), and this is a common source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for validity " +"by the compiler. Note that this is not the case for raw pointers (unsafe), and " +"this is a common source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " -"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " -"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " -"ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر " +"برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام " +"(ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have " -"lifetimes. Most of the time, elision and type inference mean these don't " -"need to be written out. In more complicated cases, lifetime annotations can " -"help resolve ambiguity. Often, especially when prototyping, it's easier to " -"just work with owned data by cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. " +"Most of the time, elision and type inference mean these don't need to be written " +"out. In more complicated cases, lifetime annotations can help resolve ambiguity. " +"Often, especially when prototyping, it's easier to just work with owned data by " +"cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " -"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " -"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " -"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " -"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " -"صورت لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، " +"_همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی " +"است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر " +"می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که " +"با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "Lifetimes in Data Structures" #: src/lifetimes/struct-lifetimes.md -msgid "" -"If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "" -"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -9765,27 +9528,27 @@ msgid "" "underlying the contained `&str` lives at least as long as any instance of " "`Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " -"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " -"می‌کند، زنده بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` " +"به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده " +"بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the " +"borrow checker throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " -"(borrow checker) خطا می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow " +"checker) خطا می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This " -"can be useful for creating lightweight views, but it generally makes them " -"somewhat harder to use." +"Types with borrowed data force users to hold on to the original data. This can be " +"useful for creating lightweight views, but it generally makes them somewhat " +"harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " -"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " -"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های " +"اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً " +"استفاده از آنها را تا حدی دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -9795,37 +9558,37 @@ msgstr "در صورت امکان، داده‌های ساختارها را به msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime " -"of the struct itself. Those are very advanced use cases." +"relationships between the references themselves, in addition to the lifetime of " +"the struct itself. Those are very advanced use cases." msgstr "" "برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " -"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " -"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " -"بسیار پیشرفته هستند." +"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین " +"ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد بسیار پیشرفته " +"هستند." #: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " -"simpler than it seems! This illustrates a common parsing pattern, passing " -"slices of data. The underlying data itself is never copied." +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's simpler " +"than it seems! This illustrates a common parsing pattern, passing slices of data. " +"The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" -"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " -"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " -"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf." +"dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن " +"است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل " +"عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` " -"file. In this exercise, we'll encode that information into `match` " -"statements in functions that get called for each field." +"indexed by their field numbers. That is typically provided in a `proto` file. In " +"this exercise, we'll encode that information into `match` statements in functions " +"that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " -"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " -"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " -"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس " +"شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. " +"در این تمرین، ما این اطلاعات را به صورت عبارات `match` در توابعی که برای هر فیلد " +"فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -9833,27 +9596,27 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each " -"is implemented as a \"tag\" followed by the value. The tag contains a field " -"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each is " +"implemented as a \"tag\" followed by the value. The tag contains a field number " +"(e.g., `2` for the `id` field of a `Person` message) and a wire type defining how " +"the payload should be determined from the byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " -"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " -"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " -"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر " +"فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد " +"(مانند `2` برای فیلد `id` در پیام `Person`) و wire type است که نحوه تعیین بار را " +"از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +"called VARINT. Luckily, `parse_varint` is defined for you below. The given code " +"also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse " +"a message into a series of calls to those callbacks." msgstr "" "اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " -"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " -"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " -"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." +"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین " +"بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به " +"مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" @@ -9877,32 +9640,26 @@ msgstr "/// The Varint WireType indicates the value is a single VARINT.\n" #, fuzzy msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double " -"type.\n" +" /// little-endian order containing a 64-bit signed integer or double type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double " -"type.\n" +" /// little-endian order containing a 64-bit signed integer or double type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as " -"a\n" +" /// The Len WireType indicates that the value is a length represented as a\n" " /// VARINT followed by exactly that number of bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float " -"type.\n" +" // little-endian order containing a 32-bit signed integer or float type.\n" " //I32, -- not needed for this exercise\n" msgstr "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float " -"type.\n" +" // little-endian order containing a 32-bit signed integer or float type.\n" " //I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -9957,10 +9714,8 @@ msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy -msgid "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" -msgstr "" -"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgstr "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" @@ -9996,10 +9751,8 @@ msgstr "/// Parse a field, returning the remaining bytes\n" #: src/lifetimes/exercise.md msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as " -"necessary.\"" -msgstr "" -"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +"\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" +msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -10008,14 +9761,12 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" msgstr "" -"/// Parse a message in the given data, calling `T::add_field` for each field " -"in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -10027,18 +9778,18 @@ msgstr "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, " -"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " -"the data buffer. In normal Rust code we'd handle this with the `Result` " -"enum, but for simplicity in this exercise we panic if any errors are " -"encountered. On day 4 we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, e.g. " +"if you try to parse an `i32` when there are fewer than 4 bytes left in the data " +"buffer. In normal Rust code we'd handle this with the `Result` enum, but for " +"simplicity in this exercise we panic if any errors are encountered. On day 4 " +"we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " -"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " -"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " -"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " -"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " -"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، " +"مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، " +"تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما " +"برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به جای آن که با `Result` " +"برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، به بررسی دقیق‌تر مدیریت خطا " +"در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" @@ -10084,16 +9835,15 @@ msgstr "به روز ۱ خوش آمدید" msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" -"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش " -"خواهیم داد:" +"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش خواهیم داد:" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." -msgstr "" +msgstr "Iterators: شیرجه عمیق در ویژگی `Iterator`." #: src/welcome-day-4.md msgid "Modules and visibility." -msgstr "" +msgstr "ماژول ها و قابلیت مشاهده" #: src/welcome-day-4.md msgid "Testing." @@ -10104,25 +9854,25 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "رسیدگی به خطا: panics در `Result` و اپراتور تلاش مجدد `?`." #: src/welcome-day-4.md -msgid "" -"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" +"با Unsafe Rust: پنجره فرار مبتنی بر زمان که نمی‌توانید خود را در safe Rust بیان " +"کنید." #: src/welcome-day-4.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 40 " "minutes. It contains:" msgstr "" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۴۰ دقیقه طول بکشد. شامل:" #: src/iterators.md -#, fuzzy msgid "Iterator" -msgstr "FromIterator" +msgstr "Iterator" #: src/iterators.md -#, fuzzy msgid "IntoIterator" -msgstr "FromIterator" +msgstr "IntoIterator" #: src/iterators.md src/iterators/fromiterator.md msgid "FromIterator" @@ -10130,16 +9880,15 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait " +"supports iterating over values in a collection. It requires a `next` method and " +"provides lots of methods. Many standard library types implement `Iterator`, and " +"you can implement it yourself, too:" msgstr "" -"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"از تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` " -"نیاز دارد و متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد " -"`Iterator` را پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی " -"کنید:" +"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) از " +"تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` نیاز دارد و " +"متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد `Iterator` را " +"پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی کنید:" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" @@ -10147,41 +9896,40 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming " -"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"The `Iterator` trait implements many common functional programming operations " +"over collections (e.g. `map`, `filter`, `reduce`, etc). This is the trait where " +"you can find all the documentation about them. In Rust these functions should " +"produce the code as efficient as equivalent imperative implementations." msgstr "" "ویژگی `Iterator` بسیاری از عملیات برنامه‌نویسی تابعی رایج را روی collectionها " -"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که " -"در آن می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع " -"باید کد را به اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." +"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که در آن " +"می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع باید کد را به " +"اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." #: src/iterators/iterator.md msgid "" "`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"collection types such as `Vec` and references to them such as `&Vec` and " +"`&[T]`. Ranges also implement it. This is why you can iterate over a vector with " +"`for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه " -"(collection) توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند " -"`&Vec` و `&[T]` پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین " -"دلیل است که می‌توانید روی یک بردار با `برای i در some_vec { .. }` تکرار کنید، " -"اما درنهایت `some_vec.next()`وجود ندارد." +"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه (collection) " +"توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند `&Vec` و `&[T]` " +"پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین دلیل است که می‌توانید روی " +"یک بردار با `برای i در some_vec { .. }` تکرار کنید، اما درنهایت `some_vec." +"next()`وجود ندارد." #: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " -"It is used automatically by the `for` loop." +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/" +"trait.IntoIterator.html) defines how to create an iterator for a type. It is used " +"automatically by the `for` loop." msgstr "" -"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، " -"_iterate_ کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/" -"iter/trait.IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص " -"می‌کند. به طور خودکار توسط حلقه `for` استفاده می‌شود." +"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، _iterate_ " +"کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait." +"IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص می‌کند. به طور " +"خودکار توسط حلقه `for` استفاده می‌شود." #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" @@ -10192,8 +9940,8 @@ msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" -"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع " -"را اعلام کند:" +"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع را " +"اعلام کند:" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," @@ -10209,45 +9957,48 @@ msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" -"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده " -"(iterator) باید همان `Item` type را داشته باشد، به این معنی که " -"`Option` را برمی‌گرداند." +"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده (iterator) " +"باید همان `Item` type را داشته باشد، به این معنی که `Option` را برمی‌گرداند." #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." -msgstr "" +msgstr "مثال روی تمام ترکیبات مختصات x و y تکرار می‌شود." #: src/iterators/intoiterator.md msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ " -"توجه داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." +"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ توجه " +"داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference " +"to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in " -"some_vector` will take ownership of `some_vector` and iterate over owned " -"elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." +"The same problem can occur for standard library types: `for e in some_vector` " +"will take ownership of `some_vector` and iterate over owned elements from that " +"vector. Use `for e in &some_vector` instead, to iterate over references to " +"elements of `some_vector`." msgstr "" +"همین مشکل می‌تواند برای انواع کتابخانه استاندارد رخ دهد: `برای e در some_vector` " +"مالکیت `some_vector` را در اختیار می‌گیرد و روی عناصر متعلق به آن بردار تکرار " +"می‌شود. به جای آن از `e در &some_vector` برای تکرار بر روی ارجاعات به عناصر " +"`some_vector` استفاده کنید." #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets " +"you build a collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/" +"trait.Iterator.html)." msgstr "" "گزینه [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator." -"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/" -"iter/trait.Iterator.html) یک مجموعه یا collection بسازید." +"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/iter/" +"trait.Iterator.html) یک مجموعه یا collection بسازید." #: src/iterators/fromiterator.md #, fuzzy @@ -10264,54 +10015,59 @@ msgstr "دو راه برای تعیین`B` برای این روش وجود دا #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." +"With the \"turbofish\": `some_iterator.collect::()`, as shown. " +"The `_` shorthand used here lets Rust infer the type of the `Vec` elements." msgstr "" +"با کمک \"turbofish\": `some_iterator.collect::()`، همانطور که " +"نشان داده شده است و به طور خلاصه `_` استفاده شده در اینجا به Rust امکان می‌دهد نوع " +"عناصر \"Vec\" را استنتاج کند." #: src/iterators/fromiterator.md msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" -"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"این مثال را برای استفاده از این فرم بازنویسی کنید." +"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. این " +"مثال را برای استفاده از این فرم بازنویسی کنید." #: src/iterators/fromiterator.md msgid "" "There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +"There are also more specialized implementations which let you do cool things like " +"convert an `Iterator>` into a `Result, E>`." msgstr "" +"پیاده‌سازی‌های اولیه `FromIterator` برای`Vec`, `HashMap` و غیره وجود دارد. همچنین " +"پیاده‌سازی‌های تخصصی‌تری وجود دارد که به شما امکان می‌دهد کارهای جالبی مانند تبدیل " +"`Iterator>` به یک `Result, E>` انجام دهید." #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods " -"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait to implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods in " +"the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to " +"implement a complex calculation." msgstr "" +"در این تمرین، باید برخی از روش های ارائه شده در [`Iterator`](https://doc.rust-" +"lang.org/std/iter/trait.Iterator.html) را برای پیاده‌سازی یک ویژگی پیدا کنید و از " +"آنها برای محاسبه پیچیده استفاده کنید." #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests " -"pass. Use an iterator expression and `collect` the result to construct the " -"return value." +"Copy the following code to and make the tests pass. " +"Use an iterator expression and `collect` the result to construct the return value." msgstr "" -"کد زیر را در کپی کنید و تست ها را قبول کنید. از " -"یک عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) " -"کنید تا مقدار بازگشتی را بسازید." +"کد زیر را در کپی کنید و تست ها را قبول کنید. از یک " +"عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) کنید تا " +"مقدار بازگشتی را بسازید." #: src/iterators/exercise.md src/iterators/solution.md #, fuzzy msgid "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -"/// Calculate the differences between elements of `values` offset by " -"`offset`,\n" +"/// Calculate the differences between elements of `values` offset by `offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -10323,14 +10079,14 @@ msgstr "use, super, self" #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" -"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را " -"به یک type تبدیل کنیم." +"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را به " +"یک type تبدیل کنیم." #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت " -"داشته باشیم:" +"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت داشته " +"باشیم:" #: src/modules/modules.md msgid "\"In the foo module\"" @@ -10342,38 +10098,36 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that " -"describes how to build a bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that describes how " +"to build a bundle of 1+ crates." msgstr "" -"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` " -"می‌شوند که نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." +"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` می‌شوند که " +"نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and " -"a library crate compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and a " +"library crate compiles to a library." msgstr "" -"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل " -"اجرایی ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." +"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل اجرایی " +"ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." -msgstr "" +msgstr "ماژول‌های organization، scope، و تمرکز این بخش را تعریف می‌کنند." #: src/modules/filesystem.md -msgid "" -"Omitting the module content will tell Rust to look for it in another file:" +msgid "Omitting the module content will tell Rust to look for it in another file:" msgstr "حذف محتوای ماژول به Rust می‌گوید که آن را در فایل دیگری جستجو کند:" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden." -"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" -"vegetables.rs`." +"This tells rust that the `garden` module content is found at `src/garden.rs`. " +"Similarly, a `garden::vegetables` module can be found at `src/garden/vegetables." +"rs`." msgstr "" -"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به " -"طور مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables." -"rs` یافت." +"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به طور " +"مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables.rs` یافت." #: src/modules/filesystem.md msgid "The `crate` root is in:" @@ -10389,20 +10143,19 @@ msgstr "`src/main.rs` (for a binary crate)" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc " -"comments\". These document the item that contains them -- in this case, a " -"module." +"Modules defined in files can be documented, too, using \"inner doc comments\". " +"These document the item that contains them -- in this case, a module." msgstr "" +"ماژول‌های تعریف‌شده در فایل‌ها را نیز می‌توان با استفاده از «کامنت‌های مستند داخلی» " +"مستند کرد. اینها موردی را که حاوی آنها است - در این مورد، یک ماژول مستند می‌کنند." #: src/modules/filesystem.md #, fuzzy msgid "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" msgstr "" -"//! This module implements the garden, including a highly performant " -"germination\n" +"//! This module implements the garden, including a highly performant germination\n" "//! implementation.\n" #: src/modules/filesystem.md @@ -10430,21 +10183,23 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod." -"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` " +"was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" +"دلیل اصلی معرفی `filename.rs` به‌عنوان جایگزین `filename/mod.rs` این بود که تشخیص " +"بسیاری از فایل‌ها با نام `mod.rs` در IDE‌ها دشوار است." #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول " -"اصلی یک فایل باشد:" +"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول اصلی یک " +"فایل باشد:" #: src/modules/filesystem.md msgid "" -"The place rust will look for modules can be changed with a compiler " -"directive:" +"The place rust will look for modules can be changed with a compiler directive:" msgstr "" +"مکانی که rust به دنبال ماژول‌ها می‌گردد را می‌توان با دستور کامپایلر تغییر داد:" #: src/modules/filesystem.md msgid "\"some/path.rs\"" @@ -10452,20 +10207,20 @@ msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module " -"in a file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module in a " +"file named `some_module_test.rs`, similar to the convention in Go." msgstr "" "برای مثال، اگر می‌خواهید تست‌هایی را برای یک ماژول در فایلی به نام " -"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در " -"Go." +"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در Go." #: src/modules/visibility.md msgid "Modules are a privacy boundary:" -msgstr "" +msgstr "ماژول‌ها یک مرز حریم خصوصی هستند:" #: src/modules/visibility.md msgid "Module items are private by default (hides implementation details)." msgstr "" +"گزینه‌های ماژول به طور پیش‌فرض private هستند (جزئیات پیاده سازی را پنهان می‌کند)." #: src/modules/visibility.md msgid "Parent and sibling items are always visible." @@ -10473,11 +10228,11 @@ msgstr "کزینه‌های sibling و sibling همیشه قابل مشاهده #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all " -"the descendants of `foo`." +"In other words, if an item is visible in module `foo`, it's visible in all the " +"descendants of `foo`." msgstr "" -"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه " -"فرزندان`foo` قابل مشاهده است." +"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه فرزندان`foo` " +"قابل مشاهده است." #: src/modules/visibility.md msgid "\"outer::private\"" @@ -10501,9 +10256,11 @@ msgstr "از کلمه کلیدی `pub` برای public کردن ماژول‌ه #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " -"of public visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of " +"public visibility." msgstr "" +"علاوه بر این، مشخص‌کننده‌های پیشرفته `pub(...)` برای محدود کردن دامنه دید عمومی " +"وجود دارد." #: src/modules/visibility.md msgid "" @@ -10519,19 +10276,18 @@ msgstr "پیکربندی قابل نمایش بودن `pub(crate)` یک الگو #: src/modules/visibility.md msgid "Less commonly, you can give visibility to a specific path." -msgstr "" +msgstr "این مورد کمتر متداول است، شما می‌توانید به یک مسیر خاص دید بدهید." #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of " -"its descendants)." -msgstr "" -"در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." +"In any case, visibility must be granted to an ancestor module (and all of its " +"descendants)." +msgstr "در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You " -"will typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You will " +"typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -10544,7 +10300,7 @@ msgstr "مسیرها (Paths) به شرح زیر حل می‌شوند:" #: src/modules/paths.md msgid "As a relative path:" -msgstr "" +msgstr "به عنوان یک path نسبی:" #: src/modules/paths.md msgid "`foo` or `self::foo` refers to `foo` in the current module," @@ -10556,7 +10312,7 @@ msgstr "" #: src/modules/paths.md msgid "As an absolute path:" -msgstr "" +msgstr "به عنوان یک path مطلق:" #: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," @@ -10568,47 +10324,55 @@ msgstr "یک `bar::foo` به `foo` در `bar` crate اشاره دارد." #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the " -"top-level `lib.rs` in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the top-" +"level `lib.rs` in a crate might have" msgstr "" +"این\"re-export\" نمادها در مسیر کوتاه‌تری معمول است. برای مثال، `lib.rs` سطح بالا " +"در یک crate ممکن است داشته باشد" #: src/modules/paths.md msgid "" "making `DiskStorage` and `NetworkStorage` available to other crates with a " "convenient, short path." msgstr "" +"در دسترس قرار دادن `DiskStorage` و `NetworkStorage` برای سایر crateها با یک مسیر " +"راحت و کوتاه." #: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if " -"a type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to " -"`use std::io::Read`." +"However, a trait must be in scope to call any methods on that trait, even if a " +"type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to `use " +"std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is " -"discouraged because it is not clear which items are imported, and those " -"might change over time." +"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged " +"because it is not clear which items are imported, and those might change over " +"time." msgstr "" -"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع " -"شده است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر " -"کنند." +"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع شده " +"است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر کنند." #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. " -"This library defines a `Widget` trait and a few implementations of that " -"trait, as well as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. This " +"library defines a `Widget` trait and a few implementations of that trait, as well " +"as a `main` function." msgstr "" +"در این تمرین، یک پیاده‌سازی کتابخانه GUI کوچک را دوباره سازماندهی خواهید کرد. این " +"کتابخانه یک ویژگی`Widget` و چند پیاده‌سازی از آن ویژگی و همچنین یک تابع `main` را " +"تعریف می‌کند." #: src/modules/exercise.md msgid "" "It is typical to put each type or set of closely-related types into its own " "module, so each widget type should get its own module." msgstr "" +"معمول است که هر نوع یا مجموعه‌ای از انواع مرتبط نزدیک را در ماژول خود قرار دهید، " +"بنابراین هر نوع ویجت باید ماژول خاص خود را داشته باشد." #: src/modules/exercise.md #, fuzzy @@ -10620,12 +10384,16 @@ msgid "" "The Rust playground only supports one file, so you will need to make a Cargo " "project on your local filesystem:" msgstr "" +"یک Rust playground فقط از یک فایل پشتیبانی می‌کند، بنابراین باید یک پروژه Cargo " +"را در سیستم فایل محلی خود ایجاد کنید:" #: src/modules/exercise.md msgid "" "Edit the resulting `src/main.rs` to add `mod` statements, and add additional " "files in the `src` directory." msgstr "" +"این `src/main.rs` حاصل را ویرایش کنید تا عبارات `mod` را اضافه کنید و فایل‌های " +"اضافی را در دایرکتوری `src` اضافه کنید." #: src/modules/exercise.md msgid "Source" @@ -10662,12 +10430,10 @@ msgstr "// Add 4 paddings for borders\n" #: src/modules/exercise.md #, fuzzy msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " -"the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" " // ?-operator here instead of .unwrap().\n" #: src/modules/exercise.md src/modules/solution.md @@ -10713,10 +10479,13 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, " -"and get accustomed to the required `mod`, `use`, and `pub` declarations. " -"Afterward, discuss what organizations are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, and " +"get accustomed to the required `mod`, `use`, and `pub` declarations. Afterward, " +"discuss what organizations are most idiomatic." msgstr "" +"دانش‌آموزان را تشویق کنید تا کد را به‌گونه‌ای تقسیم کنند که برایشان طبیعی است و به " +"اعلان‌های `mod`, `use` و `pub`عادت کنند. پس از آن، در مورد اینکه چه " +"organizationهایی idiomatic هستند بحث کنید." #: src/modules/solution.md msgid "// ---- src/widgets.rs ----\n" @@ -10808,17 +10577,17 @@ msgstr "" #: src/testing/unit-tests.md msgid "Integration tests are supported via the `tests/` directory." -msgstr "" +msgstr "تست‌های یکپارچه‌سازی از طریق دایرکتوری `tests/` پشتیبانی می‌شوند." #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested " -"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " -"building tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` " +"module, using `#[cfg(test)]` to conditionally compile them only when building " +"tests." msgstr "" -"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` " -"تودرتو قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت " -"مشروط تنها در هنگام build تست‌ها کامپایل کنند." +"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` تودرتو " +"قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت مشروط تنها در " +"هنگام build تست‌ها کامپایل کنند." #: src/testing/unit-tests.md msgid "\"Hello World\"" @@ -10830,8 +10599,7 @@ msgstr "این به شما امکان می‌دهد تا private helper را آ #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." -msgstr "" -"ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." +msgstr "ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." @@ -10844,6 +10612,8 @@ msgstr "Integration Tests" #: src/testing/other.md msgid "If you want to test your library as a client, use an integration test." msgstr "" +"اگر می‌خواهید کتابخانه خود را به عنوان یک سرویس‌گیرنده آزمایش کنید، از تست " +"یکپارچه‌سازی (integration test) استفاده کنید." #: src/testing/other.md msgid "Create a `.rs` file under `tests/`:" @@ -10864,7 +10634,7 @@ msgstr "تست‌ سندها" #: src/testing/other.md msgid "Rust has built-in support for documentation tests:" -msgstr "" +msgstr "زبان Rust دارای پشتیبانی داخلی برای تست‌های مستندسازی است:" #: src/testing/other.md #, fuzzy @@ -10887,17 +10657,15 @@ msgstr "" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." -msgstr "" -"بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." +msgstr "بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." -msgstr "" +msgstr "این کد به عنوان بخشی از `cargo test` کامپایل و اجرا می‌شود." #: src/testing/other.md msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/" -"run it." +"Adding `#` in the code will hide it from the docs, but will still compile/run it." msgstr "" #: src/testing/other.md @@ -10906,46 +10674,49 @@ msgid "" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" "کد بالا را در [Rust Playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " -"تست کنید." +"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) تست " +"کنید." #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful " -"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " -"more lints, organized into groups that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful built-in " +"lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, " +"organized into groups that can be enabled per-project." msgstr "" +"کامپایلر Rust پیام‌های خطای جالب و همچنین built-in lint مناسبی تولید می‌کند. " +"[Clippy](https://doc.rust-lang.org/clippy/) که lintهای بیشتری را ارائه می‌دهد، که " +"در گروه‌هایی سازماندهی شده‌اند که می‌توانند در هر پروژه فعال شوند." #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب " -"است، درست است؟ {}\"" +"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب است، " +"درست است؟ {}\"" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints " -"visible here, but those will not be shown once the code compiles. Switch to " -"the Playground site to show those lints." +"Run the code sample and examine the error message. There are also lints visible " +"here, but those will not be shown once the code compiles. Switch to the " +"Playground site to show those lints." msgstr "" -"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل " -"مشاهده هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن " -"lintها به سایت Playground بروید." +"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل مشاهده " +"هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن lintها به " +"سایت Playground بروید." #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show " -"clippy warnings. Clippy has extensive documentation of its lints, and adds " -"new lints (including default-deny lints) all the time." +"After resolving the lints, run `clippy` on the playground site to show clippy " +"warnings. Clippy has extensive documentation of its lints, and adds new lints " +"(including default-deny lints) all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " -"or via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or " +"via your editor." msgstr "" -"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با " -"`cargo fix` یا از طریق ویرایشگر خود برطرف کرد." +"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با `cargo " +"fix` یا از طریق ویرایشگر خود برطرف کرد." #: src/testing/exercise.md msgid "Luhn Algorithm" @@ -10953,14 +10724,13 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " -"to validate credit card numbers. The algorithm takes a string as input and " -"does the following to validate the credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used 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) برای " -"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " -"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " -"انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای اعتبارسنجی " +"شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی " +"دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -10969,12 +10739,11 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل " -"می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره `1234`، `3` " +"و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل می‌کنیم." #: src/testing/exercise.md msgid "" @@ -10995,20 +10764,21 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, " -"along with two basic unit tests that confirm that most of the algorithm is " -"implemented correctly." +"The provided code provides a buggy implementation of the luhn algorithm, along " +"with two basic unit tests that confirm that most of the algorithm is implemented " +"correctly." msgstr "" +"کد ارائه شده یک پیاده‌سازی باگ از الگوریتم luhn را به همراه دو unit test پایه " +"ارائه می‌کند که تأیید می‌کند بیشتر الگوریتم به درستی پیاده‌سازی شده است." #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional " -"tests to uncover bugs in the provided implementation, fixing any bugs you " -"find." +"Copy the code below to and write additional tests " +"to uncover bugs in the provided implementation, fixing any bugs you find." msgstr "" -"کد زیر را به کپی کنید و " -"تابع را پیاده‌سازی کنید." +"کد زیر را به کپی کنید و تابع " +"را پیاده‌سازی کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -11090,8 +10860,7 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 15 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" #: src/error-handling.md #, fuzzy @@ -11132,7 +10901,7 @@ msgstr "خرابی‌های زمان اجرا مانند failed bounds checkها #: src/error-handling/panics.md msgid "Assertions (such as `assert!`) panic on failure" -msgstr "" +msgstr "Assertions (such as `assert!`) panic on failure" #: src/error-handling/panics.md msgid "Purpose-specific panics can use the `panic!` macro." @@ -11140,24 +10909,21 @@ msgstr "پنیک‌های خاص می‌توانند از ماکرو `panic!` ا #: src/error-handling/panics.md msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions " -"had returned." +"A panic will \"unwind\" the stack, dropping values just as if the functions had " +"returned." msgstr "" #: src/error-handling/panics.md -msgid "" -"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" -"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده " -"کنید." +"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده کنید." #: src/error-handling/panics.md msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be " -"caught:" +"By default, a panic will cause the stack to unwind. The unwinding can be caught:" msgstr "" -"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان " -"گرفت( در واقع منظور این است که می‌توان آن را caught کرد):" +"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان گرفت( در " +"واقع منظور این است که می‌توان آن را caught کرد):" #: src/error-handling/panics.md msgid "\"No problem here!\"" @@ -11173,82 +10939,86 @@ msgstr "\"oh no!\"" #: src/error-handling/panics.md msgid "" -"Catching is unusual; do not attempt to implement exceptions with " -"`catch_unwind`!" +"Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" msgstr "" "گرفتن (Catching) غیر معمول است. سعی نکنید exceptionها را با `catch_unwind` " "پیاده‌سازی کنید!" #: src/error-handling/panics.md msgid "" -"This can be useful in servers which should keep running even if a single " -"request crashes." +"This can be useful in servers which should keep running even if a single request " +"crashes." msgstr "" -"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، " -"باید به کار خود ادامه دهند." +"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، باید به " +"کار خود ادامه دهند." #: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" -"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار " -"نمی‌کند." +"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار نمی‌کند." #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://" -"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " -"saw when discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://doc." +"rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly saw when " +"discussing standard library types." msgstr "" -"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-" -"lang.org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث " -"در مورد تایپ‌های کتابخانه استاندارد مشاهده کردیم." +"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-lang." +"org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث در مورد " +"تایپ‌های کتابخانه استاندارد مشاهده کردیم." #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` " -"which contains an error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` which " +"contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's " -"type signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's type " +"signature by having the function return a `Result` value." msgstr "" -"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با " -"برگرداندن تابع مقدار `Result` کدگذاری می‌شود." +"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با برگرداندن " +"تابع مقدار `Result` کدگذاری می‌شود." #: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern " -"matching on the `Result` to check which variant you have. Methods like " -"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " -"error handling, but means that you can always see in your source code where " -"proper error handling is being skipped." -msgstr "" +"access either the success value or the error value without first pattern matching " +"on the `Result` to check which variant you have. Methods like `unwrap` make it " +"easier to write quick-and-dirty code that doesn't do robust error handling, but " +"means that you can always see in your source code where proper error handling is " +"being skipped." +msgstr "" +"مانند `Option`، هیچ راهی برای فراموش کردن خطا وجود ندارد: شما نمی‌توانید به مقدار " +"موفقیت یا مقدار خطا بدون تطبیق الگوی اولیه در `Result` دسترسی پیدا کنید تا بررسی " +"کنید کدام نوع را دارید. روش‌هایی مانند`unwrap` نوشتن کدهای سریع و کثیف را آسان‌تر " +"می‌کنند که مدیریت خطا را به خوبی انجام نمی‌دهد، اما به این معنی است که همیشه " +"می‌توانید در کد منبع خود ببینید که در کجا مدیریت صحیح خطا نادیده گرفته می‌شود." #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling " -"conventions that students may be familiar with from other programming " -"languages." +"It may be helpful to compare error handling in Rust to error handling conventions " +"that students may be familiar with from other programming languages." msgstr "" +"مقایسه مدیریت خطا در Rust با قراردادهای مدیریت خطا که دانش‌آموزان ممکن است با سایر " +"زبان‌های برنامه‌نویسی آشنا باشند، ممکن است مفید باشد." #: src/error-handling/result.md msgid "Many languages use exceptions, e.g. C++, Java, Python." msgstr "" +"بسیاری از زبان‌ها از exceptionها استفاده می‌کنند، به عنوان مثال. ++C، جاوا، پایتون." #: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means " -"that you can't tell when calling a function if it may throw an exception or " -"not." +"exception is not visible as part of its type signature. This generally means that " +"you can't tell when calling a function if it may throw an exception or not." msgstr "" -"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند " -"یا نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور " -"کلی به این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن " -"است یک exception ایجاد کند یا خیر." +"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند یا " +"نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور کلی به " +"این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن است یک " +"exception ایجاد کند یا خیر." #: src/error-handling/result.md msgid "" @@ -11256,6 +11026,9 @@ msgid "" "block is reached. An error originating deep in the call stack may impact an " "unrelated function further up." msgstr "" +"استثناها معمولاً call stack را باز می‌کنند و تا رسیدن به بلوک `try` به سمت بالا " +"منتشر می‌شوند. خطایی که در اعماق call stack ایجاد می‌شود ممکن است بر عملکرد نامرتبط " +"بیشتر تأثیر بگذارد." #: src/error-handling/result.md msgid "Error Numbers" @@ -11263,29 +11036,33 @@ msgstr "شماره‌های خطا" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error " -"value) separately from the successful return value of the function. Examples " -"include C and Go." +"Some languages have functions return an error number (or some other error value) " +"separately from the successful return value of the function. Examples include C " +"and Go." msgstr "" +"برخی از زبان‌ها دارای توابعی هستند که یک عدد خطا (یا مقداری خطای دیگر) را جدا از " +"مقدار بازگشت موفقیت‌آمیز تابع برمی‌گردانند. به عنوان مثال می توان به C و Go اشاره " +"کرد." #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error " -"value, in which case you may be accessing an uninitialized or otherwise " -"invalid success value." +"Depending on the language it may be possible to forget to check the error value, " +"in which case you may be accessing an uninitialized or otherwise invalid success " +"value." msgstr "" +"بسته به زبان ممکن است فراموش کنید مقدار خطا را بررسی کنید، در این صورت ممکن است " +"به یک مقدار موفقیت نامعتبر یا نامعتبر دسترسی داشته باشید." #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with " -"the `Result` type, but matching this type on every call can be cumbersome. " -"The try-operator `?` is used to return errors to the caller. It lets you " -"turn the common" +"Runtime errors like connection-refused or file-not-found are handled with the " +"`Result` type, but matching this type on every call can be cumbersome. The try-" +"operator `?` is used to return errors to the caller. It lets you turn the common" msgstr "" -"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» " -"مدیریت می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` " -"برای برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا " -"موارد مشترک را بازگردانید." +"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» مدیریت " +"می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` برای " +"برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا موارد " +"مشترک را بازگردانید." #: src/error-handling/try.md msgid "into the much simpler" @@ -11322,26 +11099,25 @@ msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" -"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، " -"فایل خالی، فایل با نام کاربری." +"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، فایل " +"خالی، فایل با نام کاربری." #: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. " -"The executable will print the `Err` variant and return a nonzero exit status " -"on error." +"process::Termination`. In practice, this means that `E` implements `Debug`. The " +"executable will print the `Err` variant and return a nonzero exit status on error." msgstr "" -"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را " -"پیاده‌سازی کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است " -"که `E` پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند " -"و در صورت خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." +"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را پیاده‌سازی " +"کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است که `E` " +"پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند و در صورت " +"خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." #: src/error-handling/try-conversions.md msgid "" "The effective expansion of `?` is a little more complicated than previously " "indicated:" -msgstr "" +msgstr "گسترش مؤثر `?` کمی پیچیده‌تر از آنچه قبلاً ذکر شد است:" #: src/error-handling/try-conversions.md msgid "works the same as" @@ -11349,13 +11125,13 @@ msgstr "به طو مشابه کار می‌کند" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the " -"type returned by the function. This makes it easy to encapsulate errors into " -"higher-level errors." +"The `From::from` call here means we attempt to convert the error type to the type " +"returned by the function. This makes it easy to encapsulate errors into higher-" +"level errors." msgstr "" -"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را " -"به نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح " -"بالاتر کپسوله شوند." +"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را به " +"نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح بالاتر " +"کپسوله شوند." #: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" @@ -11373,38 +11149,37 @@ msgstr "//std::fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. " -"A function that returns `Result` can only use `?` on a value " -"of type `Result` if `ErrorOuter` and `ErrorInner` are the " -"same type or if `ErrorOuter` implements `From`." +"function. For `Result`, it means that the error types have to be compatible. A " +"function that returns `Result` can only use `?` on a value of type " +"`Result` if `ErrorOuter` and `ErrorInner` are the same type or if " +"`ErrorOuter` implements `From`." msgstr "" -"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به " -"این معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` " -"را برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا " -"اگر `ErrorOuter` از` را پیاده‌سازی کند." +"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به این " +"معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` را " +"برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` " +"استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا اگر `ErrorOuter` " +"از` را پیاده‌سازی کند." #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, " -"especially when the conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, especially " +"when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and " -"`U` types." +"`Option` can use the `?` operator on `Option` for arbitrary `T` and `U` " +"types." msgstr "" -"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی " -"گرداند می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` " -"استفاده کند." +"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی گرداند " +"می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` استفاده کند." #: src/error-handling/try-conversions.md msgid "" "A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " -"turns `Result` into `Option`." +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` turns " +"`Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -11413,14 +11188,13 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing " -"our own enum covering all the different possibilities. The `std::error::" -"Error` trait makes it easy to create a trait object that can contain any " -"error." +"Sometimes we want to allow any type of error to be returned without writing our " +"own enum covering all the different possibilities. The `std::error::Error` trait " +"makes it easy to create a trait object that can contain any error." msgstr "" "گاهی اوقات می‌خواهیم اجازه دهیم هر نوع خطای بدون نوشتن enum خودمان که تمام " -"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد " -"یک object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." +"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد یک " +"object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." #: src/error-handling/error.md msgid "\"count.dat\"" @@ -11440,33 +11214,35 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) " -"or `std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) or " +"`std::num::ParseIntError` (from `String::parse`)." msgstr "" "تابع `read_count`می‌تواند `std::io::Error` (از عملیات فایل) یا `std::num::" "ParseIntError` (از `String::parse`) را برگرداند." #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle " -"different error cases differently in the program. As such it's generally not " -"a good idea to use `Box` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle different " +"error cases differently in the program. As such it's generally not a good idea to " +"use `Box` in the public API of a library, but it can be a good option " +"in a program where you just want to display the error message somewhere." msgstr "" -"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای " -"مختلف را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از " -"`Box` در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه " -"خوبی در برنامه‌ای باشد که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." +"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای مختلف " +"را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از `Box` " +"در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه خوبی در برنامه‌ای باشد " +"که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom error " +"type so it can be boxed. But if you need to support the `no_std` attribute, keep " +"in mind that the `std::error::Error` trait is currently compatible with `no_std` " +"in [nightly](https://github.com/rust-lang/rust/issues/103765) only." msgstr "" +"هنگام تعریف یک نوع خطای سفارشی، مطمئن شوید که ویژگی `std::error::Error` را اجرا " +"کنید تا بتوان آن را در جعبه قرار داد. اما اگر نیاز به پشتیبانی از ویژگی `no_std` " +"دارید، به خاطر داشته باشید که ویژگی `std::error::Error` در حال حاضر با `no_std` " +"در [nightly](https://github.com/rust-lang) سازگار است." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11474,8 +11250,7 @@ msgid "" "anyhow/) crates are widely used to simplify error handling." msgstr "" "این [`thiserror`](https://docs.rs/thiserror/) و [`anyhow`](https://docs.rs/" -"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده " -"می‌شوند." +"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده می‌شوند." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11485,8 +11260,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in functions, " +"including adding contextual information to your errors." msgstr "" " اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " "اطلاعات متنی به خطاهای شما، استفاده می‌شود." @@ -11525,8 +11300,8 @@ msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید " -"زیادی برای کمک به تعریف انواع خطا به روشی فشرده است." +"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید زیادی " +"برای کمک به تعریف انواع خطا به روشی فشرده است." #: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." @@ -11534,7 +11309,7 @@ msgstr "ویژگی `std::error::Error` به طور خودکار مشتق می‌ #: src/error-handling/thiserror-and-anyhow.md msgid "The message from `#[error]` is used to derive the `Display` trait." -msgstr "" +msgstr "پیام `#[error]` برای استخراج ویژگی `Display` استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow`" @@ -11542,13 +11317,13 @@ msgstr "`anyhow`" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such it's " +"again generally not a good choice for the public API of a library, but is widely " +"used in applications." msgstr "" -" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " -"ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " -"در برنامه‌های مختلف استفاده می‌شود." +" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این ترتیب " +"معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده در " +"برنامه‌های مختلف استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." @@ -11561,35 +11336,43 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go developers, " +"as it provides similar usage patterns and ergonomics to `(T, error)` from Go." msgstr "" +"عملکرد ارائه شده توسط `anyhow::Result` ممکن است برای توسعه‌دهندگان Go آشنا " +"باشد، زیرا الگوهای استفاده و ارگونومی مشابهی را با `(T, error)` از Go ارائه می‌دهد." #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` " +"types. `use anyhow::Context` is necessary to enable `.context()` and `." +"with_context()` on those types." msgstr "" -"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و " -"`Option` پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `." -"context()` و `.with_context()` در آن typeها ضروری است." +"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و `Option` " +"پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `.context()` و `." +"with_context()` در آن typeها ضروری است." #: src/error-handling/exercise.md msgid "" "The following implements a very simple parser for an expression language. " "However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"error handling and propagate errors to a return from `main`. Feel free to use " +"`thiserror` and `anyhow`." msgstr "" +"در زیر یک تجزیه‌کننده بسیار ساده برای یک زبان عبارت پیاده‌سازی می‌کند. با این حال، " +"با panic خطاها را کنترل می‌کند. آن را بازنویسی کنید تا به جای آن از مدیریت خطای " +"اصطلاحی استفاده کنید و خطاها را به بازگشت از `main` منتشر کنید. با خیال راحت از " +"`thiserror` و `anyhow` استفاده کنید." #: src/error-handling/exercise.md msgid "" "HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." +"working correctly, update `Tokenizer` to implement `Iterator>` and handle that in the parser." msgstr "" +"نکته: با رفع خطا در عملکرد `parse` شروع کنید. هنگامی که به درستی کار کرد، " +"`Tokenizer` را برای پیاده‌سازی `Iterator>` " +"به‌روزرسانی کنید و آن را در parser کنترل کنید." #: src/error-handling/exercise.md src/error-handling/solution.md #, fuzzy @@ -11684,40 +11467,37 @@ msgstr "این بخش باید حدود ۱ ساعت و ۵ دقیقه طول بک #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" -msgstr "" +msgstr "زبان Rust دو بخش دارد:" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان " -"پذیر نیست." +"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان پذیر " +"نیست." #: src/unsafe-rust/unsafe.md msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are " -"violated." -msgstr "" -"در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." +"**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." +msgstr "در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." #: src/unsafe-rust/unsafe.md msgid "" -"We saw mostly safe Rust in this course, but it's important to know what " -"Unsafe Rust is." +"We saw mostly safe Rust in this course, but it's important to know what Unsafe " +"Rust is." msgstr "" -"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust " -"چیست." +"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust چیست." #: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" -"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در " -"یک لایه انتزاعی ایمن پیچیده می‌شود." +"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در یک " +"لایه انتزاعی ایمن پیچیده می‌شود." #: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" -msgstr "" +msgstr "این Unsafe Rust به شما امکان دسترسی به پنج قابلیت جدید را می‌دهد:" #: src/unsafe-rust/unsafe.md msgid "Dereference raw pointers." @@ -11733,29 +11513,31 @@ msgstr "" #: src/unsafe-rust/unsafe.md msgid "Call `unsafe` functions, including `extern` functions." -msgstr "" +msgstr "توابع `unsafe`، از جمله توابع `extern` را فراخوانی کنید." #: src/unsafe-rust/unsafe.md msgid "Implement `unsafe` traits." -msgstr "" +msgstr "ویژگی‌های `unsafe` را اجرا کنید." #: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" +"rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" -"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً " -"به [Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" -"unsafe-rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً به " +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" +"rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers " -"have turned off some compiler safety features and have to write correct code " -"by themselves. It means the compiler no longer enforces Rust's memory-safety " -"rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers have " +"turned off some compiler safety features and have to write correct code by " +"themselves. It means the compiler no longer enforces Rust's memory-safety rules." msgstr "" +"همینطور Unsafe Rust به این معنی نیست که کد نادرست است. این بدان معنی است که " +"توسعه‌دهندگان برخی از ویژگی‌های ایمنی کامپایلر را خاموش کرده‌اند و باید کد صحیح را " +"خودشان بنویسند. این بدان معناست که کامپایلر دیگر قواعد ایمنی Rust را اجرا نمی‌کند." #: src/unsafe-rust/dereferencing.md msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" @@ -11769,15 +11551,13 @@ msgstr "\"مراقب باش!\"" #, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the " -"references\n" +" // be non-null and properly aligned, the objects underlying the references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11812,30 +11592,35 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write " -"a comment for each `unsafe` block explaining how the code inside it " -"satisfies the safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write a " +"comment for each `unsafe` block explaining how the code inside it satisfies the " +"safety requirements of the unsafe operations it is doing." msgstr "" +"این تمرین خوبی است (و طبق راهنمای سبک Android Rust لازم است) برای هر بلوک " +"`unsafe` یک نظر بنویسید و توضیح دهد که چگونه کد داخل آن الزامات ایمنی عملیات " +"ناامنی را که انجام می‌دهد برآورده می‌کند." #: src/unsafe-rust/dereferencing.md msgid "" "In the case of pointer dereferences, this means that the pointers must be " "[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" +"در مورد عدم ارجاع اشاره‌گر، این بدان معنی است که نشانگرها باید [_valid_](https://" +"doc.rust-lang.org/std/ptr/index.html#safety) باشند، یعنی:" #: src/unsafe-rust/dereferencing.md msgid "The pointer must be non-null." -msgstr "" +msgstr "اشاره‌گر باید غیر تهی یا non-null باشد." #: src/unsafe-rust/dereferencing.md msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single " -"allocated object)." -msgstr "" +"The pointer must be _dereferenceable_ (within the bounds of a single allocated " +"object)." +msgstr "اشاره‌گر باید _dereferenceable_ باشد (در محدوده یک object اختصاص داده شده)." #: src/unsafe-rust/dereferencing.md msgid "The object must not have been deallocated." -msgstr "" +msgstr "این object نباید جابجا شده باشد." #: src/unsafe-rust/dereferencing.md msgid "There must not be concurrent accesses to the same location." @@ -11843,9 +11628,11 @@ msgstr "دسترسی همزمان به یک مکان نباید وجود داش #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object " -"must be live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object must be " +"live and no reference may be used to access the memory." msgstr "" +"اگر اشاره‌گر با فرستادن یک reference به دست آمده باشد، object زیرین باید live باشد " +"و نمی‌توان از هیچ مرجعی برای دسترسی به حافظه استفاده کرد." #: src/unsafe-rust/dereferencing.md msgid "In most cases the pointer must also be properly aligned." @@ -11853,18 +11640,17 @@ msgstr "در بیشتر موارد، اشاره‌گر نیز باید به در #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has " +"the `'static` lifetime, so `r3` has type `&'static String`, and thus outlives " +"`s`. Creating a reference from a pointer requires _great care_." msgstr "" -"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` " -"دارای طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است " -"و بنابراین عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت " -"بسیار دارد." +"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` دارای " +"طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است و بنابراین " +"عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت بسیار دارد." #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" -msgstr "" +msgstr "خواندن یک متغیر استاتیک تغییرناپذیر بی‌خطر است:" #: src/unsafe-rust/mutable-static.md msgid "\"Hello, world!\"" @@ -11879,13 +11665,13 @@ msgid "" "However, since data races can occur, it is unsafe to read and write mutable " "static variables:" msgstr "" +"با‌این‌حال، از آنجایی که شرایط رقابتی داده‌ها ممکن است رخ دهد، خواندن و نوشتن " +"متغیرهای mutable static ناامن است:" #: src/unsafe-rust/mutable-static.md #, fuzzy -msgid "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" -msgstr "" -"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" #: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" @@ -11894,24 +11680,29 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" "The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"compiler is conservative and will assume the worst. Try removing the `unsafe` and " +"see how the compiler explains that it is undefined behavior to mutate a static " +"from multiple threads." msgstr "" +"برنامه در اینجا امن است زیرا single-thread است. با این حال، کامپایلر Rust محافظه " +"کار است و بدترین‌ها را در نظر می‌گیرد. `unsafe` را حذف کنید و ببینید چگونه " +"کامپایلر توضیح می‌دهد که جهش یک static از چندین thread یک رفتار تعریف نشده است." #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases where it " +"might make sense in low-level `no_std` code, such as implementing a heap " +"allocator or working with some C APIs." msgstr "" -"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما " -"مواردی وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند " -"اجرای یک heap allocator یا کار با برخی از APIهای مربوط به زبان C." +"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما مواردی " +"وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند اجرای یک heap " +"allocator یا کار با برخی از APIهای مربوط به زبان C." #: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" msgstr "" +"همینطور Unionها مانند enum‌ها هستند، اما شما باید خودتان active field را ردیابی " +"کنید:" #: src/unsafe-rust/unions.md msgid "\"int: {}\"" @@ -11928,17 +11719,23 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They " -"are occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They are " +"occasionally needed for interacting with C library APIs." msgstr "" +"به طور کلی Unionها در Rust به ندرت مورد نیاز هستند زیرا معمولاً می‌توانید از enum " +"استفاده کنید. آنها گاهی اوقات برای تعامل با APIهای کتابخانه C مورد نیاز هستند." #: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." -"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" -"crates/zerocopy) crate." +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute." +"html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/" +"zerocopy) crate." msgstr "" +"اگر فقط می‌خواهید بایت‌ها را به‌عنوان نوع متفاوتی تفسیر کنید، احتمالاً [`std::mem::" +"transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute.html را " +"می‌خواهید ) یا یک safe wrapper مانند جعبه [`zerocopy`(https://crates.io/crates/" +"zerocopy)." #: src/unsafe-rust/unsafe-functions.md msgid "Calling Unsafe Functions" @@ -11946,8 +11743,8 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions you " +"must uphold to avoid undefined behaviour:" msgstr "" #: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md @@ -12012,8 +11809,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular conditions " +"to avoid undefined behaviour." msgstr "" "اگر عملکردهای خود را برای جلوگیری از رفتار نامشخص به شرایط خاصی نیاز دارند، " "می‌توانید به‌عنوان`unsafe` علامت‌گذاری کنید." @@ -12045,44 +11842,45 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"create UB if the range is incorrect. `abs` is incorrect for a different reason: " +"it is an external function (FFI). Calling external functions is usually only a " +"problem when those functions do things with pointers which might violate Rust's " +"memory model, but in general any C function might have undefined behaviour under " +"any arbitrary circumstances." msgstr "" "تابع `get_unchecked`، مانند اکثر توابع `_unchecked`، ناامن است، زیرا اگر در " -"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: " -"این یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است " -"که آن توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه " -"Rust را نقض کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه " -"رفتار نامشخصی داشته باشد." +"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: این " +"یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است که آن " +"توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه Rust را نقض " +"کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه رفتار نامشخصی داشته " +"باشد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too]" -"(https://doc.rust-lang.org/reference/items/external-blocks.html)." +"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://" +"doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" -"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس " -"هستند](https://doc.rust-lang.org/reference/items/external-blocks.html)." +"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس هستند]" +"(https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +"We wouldn't actually use pointers for a `swap` function - it can be done safely " +"with references." msgstr "" +"ما در واقع از pointerها برای یک تابع`swap` استفاده نمی‌کنیم - این کار را می‌توان " +"به‌طور ایمن با referenceها انجام داد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"Note that unsafe code is allowed within an unsafe function without an `unsafe` " +"block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " +"and see what happens. This will likely change in a future Rust edition." msgstr "" -"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. " -"ما می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. " -"سعی کنید آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه " -"بعدی Rust تغییر خواهد کرد." +"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. ما " +"می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. سعی کنید " +"آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه بعدی Rust تغییر " +"خواهد کرد." #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" @@ -12090,14 +11888,16 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation " -"must guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation must " +"guarantee particular conditions to avoid undefined behaviour." msgstr "" +"مانند توابع، اگر پیاده‌سازی باید شرایط خاصی را تضمین کند تا از رفتار نامشخص " +"جلوگیری شود، می‌توانید یک ویژگی را به‌عنوان `unsafe` علامت‌گذاری کنید." #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something like " +"this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -12118,21 +11918,20 @@ msgstr "// SAFETY: `u32` has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining " -"the requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining the " +"requirements for the trait to be safely implemented." msgstr "" -"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که " -"شرایط لازم برای اجرای ایمن این trait را توضیح دهد." +"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که شرایط " +"لازم برای اجرای ایمن این trait را توضیح دهد." #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more " -"complicated." +"The actual safety section for `AsBytes` is rather longer and more complicated." msgstr "بخش ایمنی واقعی برای `AsBytes` نسبتا طولانی‌تر و پیچیده‌تر است." #: src/unsafe-rust/unsafe-traits.md msgid "The built-in `Send` and `Sync` traits are unsafe." -msgstr "" +msgstr "ویژگی‌های داخلی`Send` و `Sync` ناامن (unsafe) هستند." #: src/unsafe-rust/exercise.md msgid "Safe FFI Wrapper" @@ -12144,6 +11943,10 @@ msgid "" "interface_ (FFI). We will use this to build a safe wrapper for the `libc` " "functions you would use from C to read the names of files in a directory." msgstr "" +"زبان Rust پشتیبانی بسیار خوبی برای فراخوانی توابع از طریق رابط تابع خارجی " +"_foreign function interface_ (FFI) دارد. ما از آن برای ساختن یک پوشش امن برای " +"توابع `libc` استفاده می‌کنیم که از C برای خواندن نام فایل ها در یک فهرست استفاده " +"می کنید." #: src/unsafe-rust/exercise.md msgid "You will want to consult the manual pages:" @@ -12163,14 +11966,13 @@ msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" -"ffi/) module. There you find a number of string types which you need for the " -"exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) " +"module. There you find a number of string types which you need for the exercise:" msgstr "همچنین می‌خواهید [`std::ffi`](https://doc.rust-lang.or) را مرور کنید" #: src/unsafe-rust/exercise.md msgid "Encoding" -msgstr "" +msgstr "رمزگذاری" #: src/unsafe-rust/exercise.md msgid "Use" @@ -12178,11 +11980,11 @@ msgstr "استفاده" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://" +"doc.rust-lang.org/std/string/struct.String.html)" msgstr "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`]" -"(https://doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`](https://" +"doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" @@ -12210,8 +12012,8 @@ msgstr "ارتباط با توابع C" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " -"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`]" +"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) و [`OsString`]" "(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" @@ -12230,8 +12032,7 @@ msgstr "شما بین تمام این typeها تبدیل خواهید کرد:" #: src/unsafe-rust/exercise.md msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` " -"character," +"`&str` to `CString`: you need to allocate space for a trailing `\\0` character," msgstr "" #: src/unsafe-rust/exercise.md @@ -12243,8 +12044,7 @@ msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" -"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " -"پیدا کند." +"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را پیدا کند." #: src/unsafe-rust/exercise.md msgid "" @@ -12258,8 +12058,8 @@ msgid "" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" "از `&[u8]` به `&OsStr`: `&OsStr` گامی به سوی `OsString` است، از [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد " -"آن استفاده کنید،" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد آن " +"استفاده کنید،" #: src/unsafe-rust/exercise.md msgid "" @@ -12269,19 +12069,19 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " -"useful chapter about FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful " +"chapter about FFI." msgstr "" -"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل " -"بسیار مفید در مورد FFI دارد." +"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل بسیار " +"مفید در مورد FFI دارد." #: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" -"کد زیر را در کپی کنید و توابع و متدهای از " -"مفقود شده را پر کنید:" +"کد زیر را در کپی کنید و توابع و متدهای از مفقود شده " +"را پر کنید:" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" @@ -12317,18 +12117,14 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" msgstr "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" " -"refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " -"PowerPC.\n" +" // \"Platforms that existed before these updates were available\" refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" @@ -12448,102 +12244,101 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can " -"write new services, libraries, drivers or even firmware in Rust (or improve " -"existing code as needed)." +"Rust is supported for system software on Android. This means that you can write " +"new services, libraries, drivers or even firmware in Rust (or improve existing " +"code as needed)." msgstr "" "‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " -"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " -"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا " +"در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to find " +"a little corner of your code base where we can move some lines of code to Rust. " +"The fewer dependencies and \"exotic\" types the better. Something that parses " +"some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " -"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " -"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " -"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین " +"سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به " +"Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. " +"چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md msgid "" -"The speaker may mention any of the following given the increased use of Rust " -"in Android:" +"The speaker may mention any of the following given the increased use of Rust in " +"Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " -"زیر اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر " +"اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" +"http3-in-android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" +"http3-in-android.html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/" +"rutabaga_gfx.html)" msgstr "" "کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" +"binder-v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" +"binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" +"in-android.html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" +"in-android.html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make " -"sure you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure " +"you have access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " -"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. " +"مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/" -"setup/start) for details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/" +"start) for details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" -"docs/setup/start) مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/" +"setup/start) مراجعه کنید." #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " "desktops. MacOS support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " -"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی " +"طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is " -"the ideal emulator to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is the " +"ideal emulator to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " -"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل " +"برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "" -"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -12567,8 +12362,7 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "" -"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -12576,11 +12370,11 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static and " +"shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " -"متغیرهای static و share را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای " +"static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" @@ -12588,10 +12382,8 @@ msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins." -msgstr "" -"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +"Produces a `proc-macro` Rust library. These are analogous to compiler plugins." +msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -12600,8 +12392,7 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" -"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " -"می‌کند." +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -12617,8 +12408,8 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for " -"a particular protobuf." +"Generates source and produces a Rust library that provides an interface for a " +"particular protobuf." msgstr "" "یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " "protobuf خاص فراهم می‌کند." @@ -12645,28 +12436,28 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages " -"from the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages from " +"the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " -"اینترنت دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت " +"دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must " -"also interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must also " +"interop with C/C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " -"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/" +"C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the " -"open-source variant of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-" +"source variant of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " -"استفاده در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده " +"در google3)." #: src/android/build-rules.md #, fuzzy @@ -12679,11 +12470,11 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, " -"create the following files:" +"Let us start with a simple application. At the root of an AOSP checkout, create " +"the following files:" msgstr "" -"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " -"ایجاد کنید:" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد " +"کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -12758,9 +12549,9 @@ msgid "" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/) عرضه شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://" +"cs.android.com/android/platform/superproject/+/master:external/rust/crates/) عرضه " +"شده است." #: src/android/build-rules/library.md msgid "\"hello_rust_with_dep\"" @@ -12783,9 +12574,8 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md -#: src/android/aidl/example-service/service.md src/android/testing.md -#: src/android/interoperability/java.md +#: src/android/build-rules/library.md src/android/aidl/example-service/service.md +#: src/android/testing.md src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -12814,22 +12604,20 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android." -"com/guide/components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android.com/" +"guide/components/aidl) is supported in Rust:" msgstr "" "‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" "guide/components/aidl) در Rust پشتیبانی می‌شود:" @@ -12845,12 +12633,12 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement " -"the described service and write client code that talks to that service." +"process of creating a Binder interface. We're then going to both implement the " +"described service and write client code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " -"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " -"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder " +"را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را " +"می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -12862,10 +12650,8 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "" -"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -12898,14 +12684,13 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match " -"the package name used in the AIDL file, i.e. the package is `com.example." +"Note that the directory structure under the `aidl/` directory needs to match the " +"package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " -"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." -"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." -"aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package " +"استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example." +"birthdayservice` و این فایل در `aidl/com/example/IBirthdayService.aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -12913,11 +12698,11 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to " -"talk to the service." +"Binder generates a trait corresponding to the interface definition. trait to talk " +"to the service." msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " -"با سرویس" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با " +"سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -12925,24 +12710,24 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use " -"this trait to talk to the service." +"Your service will need to implement this trait, and your client will use this " +"trait to talk to the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " -"صحبت با سرویس‌ها استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با " +"سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md msgid "" -"The generated bindings can be found at `out/soong/.intermediates//`." +"The generated bindings can be found at `out/soong/.intermediates//" +"`." msgstr "" -"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" -"` یافت." +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//` " +"یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument " -"and return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument and " +"return types, correspond the interface definition." msgstr "" "اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " "بازگشتی، با تعریف interface مطابقت دارد." @@ -12952,8 +12737,8 @@ msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " -"type برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type " +"برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -13011,19 +12796,19 @@ msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain " -"why each of the segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain why " +"each of the segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " -"از بخش‌ها ضروری است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از " +"بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to " -"override? Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to override? " +"Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " -"برای override وجود دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای " +"override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -13067,17 +12852,17 @@ msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case " -"the `BirthdayService` type, which implements the `IBirthdayService`) and " -"starting it as a Binder service has multiple steps, and may appear more " -"complicated than students are used to if they've used Binder from C++ or " -"another language. Explain to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case the " +"`BirthdayService` type, which implements the `IBirthdayService`) and starting it " +"as a Binder service has multiple steps, and may appear more complicated than " +"students are used to if they've used Binder from C++ or another language. Explain " +"to students why each step is necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " -"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " -"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " -"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " -"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " +"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند " +"مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. " +"اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید " +"که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -13085,33 +12870,33 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " -"this case). This type is generated by Binder and provides the common Binder " +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this " +"case). This type is generated by Binder and provides the common Binder " "functionality that would be provided by the `BnBinder` base class in C++. We " "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" "این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" -"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " -"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " -"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را " +"ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust ارث‌بری یا " +"inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " "`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object " -"(the `BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object (the " +"`BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " -"(شی‏ «BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " +"«BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool " -"and start listening for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool and " +"start listening for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " -"اضافه کنید و شروع به گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه " +"کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -13121,16 +12906,14 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -13160,9 +12943,8 @@ msgstr "_birthday_service/src/client.rs_:" msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" -#: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md +#: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md +#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -13197,67 +12979,63 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service " -"that the client has connected to." +"`Strong` is the trait object representing the service that " +"the client has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " -"که کلاینت به آن متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که " +"کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-" -"process ref count for the service trait object, and the global Binder ref " -"count that tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-process " +"ref count for the service trait object, and the global Binder ref count that " +"tracks how many processes have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " -"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " -"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " -"ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون " +"فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global " +"Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses " -"the exact same trait that the server implements. For a given Binder " -"interface, there is a single Rust trait generated that both client and " -"server use." +"Note that the trait object that the client uses to talk to the service uses the " +"exact same trait that the server implements. For a given Binder interface, there " +"is a single Rust trait generated that both client and server use." msgstr "" "توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " "دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " -"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " -"از آن استفاده می کنند." +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور از آن " +"استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This " -"should ideally be defined in a common crate that both the client and server " -"can depend on." +"Use the same service identifier used when registering the service. This should " +"ideally be defined in a common crate that both the client and server can depend " +"on." msgstr "" "از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " -"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " -"آن وابسته باشند." +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن " +"وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +"Let us extend the API with more functionality: we want to let clients specify a " +"list of lines for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " -"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم " +"لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -13265,13 +13043,13 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a " -"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " -"generated bindings wherever possible:" +"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in " +"Rust, i.e. that idiomatic Rust types are used in the generated bindings wherever " +"possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " -"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " -"شده تا جایی که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust " +"ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی " +"که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -13309,10 +13087,8 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "" -"TODO: Move code snippets into project files where they'll actually be built?" -msgstr "" -"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "TODO: Move code snippets into project files where they'll actually be built?" +msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -13324,21 +13100,18 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "" -"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "" -"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" -"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " -"کرد." +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -13347,8 +13120,7 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "" -"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -13455,22 +13227,20 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md -#: src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " -"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " -"array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes " +"`[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. `int[3][4]`). In " +"the Java backend, fixed-size arrays are represented as array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " -"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " -"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " -"type نمایش داده می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به " +"`[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3]" +"[4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array type نمایش داده " +"می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -13478,24 +13248,21 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-" -"erased `IBinder` interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-erased " +"`IBinder` interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " -"interface پاک‌شده ارسال کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface " +"پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" @@ -13527,10 +13294,8 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "" -"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" @@ -13546,10 +13311,8 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -13558,11 +13321,11 @@ msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md msgid "" -"Files can be sent between Binder clients/servers using the " -"`ParcelFileDescriptor` type:" +"Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` " +"type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" -"سرورهای Binder ارسال کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای " +"Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -13599,13 +13362,11 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a " -"`File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -13614,21 +13375,21 @@ msgstr "\"کنترل فایل نامعتبر\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " -"`File` (or any other type that wraps an `OwnedFd`), and can be used to " -"create a new `File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` " +"(or any other type that wraps an `OwnedFd`), and can be used to create a new " +"`File` handle on the other side." msgstr "" "‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " -"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " -"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای " +"ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " -"UNIX sockets." +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX " +"sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " -"سوکت های TCP، UDP و UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های " +"TCP، UDP و UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -13636,11 +13397,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests " -"work in AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests work in " +"AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " -"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم " +"پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -13706,8 +13467,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " +"2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13717,8 +13478,8 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " -"in 2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " +"2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13729,16 +13490,16 @@ msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " -"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی " +"در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " -"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه " +"می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13750,55 +13511,52 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured error " +"message pin-pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " -"که خطا را pin-pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که " +"خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this example in " +"a local environment. Use `cargo add googletest` to quickly add it to an existing " +"Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " -"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " -"add googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add " +"googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used macros " +"and types](https://docs.rs/googletest/latest/googletest/prelude/index.html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" -"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " -"می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://" +"docs.rs/googletest/latest/googletest/prelude/index.html) را وارد می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider " -"going through the first chapter of [\"Advanced testing for Rust " -"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " -"Rust course: it provides a guided introduction to the library, with " -"exercises to help you get comfortable with `googletest` macros, its matchers " -"and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider going " +"through the first chapter of [\"Advanced testing for Rust applications\"](https://" +"rust-exercises.com/advanced-testing/), a self-guided Rust course: it provides a " +"guided introduction to the library, with exercises to help you get comfortable " +"with `googletest` macros, its matchers and its overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " -"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" -"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " -"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " -"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-" +"workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه راهنمایی برای " +"کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای `googletest` و مطابقت‌های آن " +"و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md msgid "" -"A particularly nice feature is that mismatches in multi-line strings are " -"shown as a diff:" +"A particularly nice feature is that mismatches in multi-line strings are shown as " +"a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " -"نشان داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان " +"داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -13829,109 +13587,103 @@ msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " -"در Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در " +"Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You " +"need to refactor your code to use traits, which you can then quickly mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " -"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " -"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده " +"استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس " +"می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are " -"other [mocking libraries available on crates.io](https://crates.io/keywords/" -"mock), in particular in the area of mocking HTTP services. The other mocking " -"libraries work in a similar fashion as Mockall, meaning that they make it " -"easy to get a mock implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are other " +"[mocking libraries available on crates.io](https://crates.io/keywords/mock), in " +"particular in the area of mocking HTTP services. The other mocking libraries work " +"in a similar fashion as Mockall, meaning that they make it easy to get a mock " +"implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " -"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " -"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " -"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " -"را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking " +"دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در " +"زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار " +"می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." +"isolate a test from its dependencies. The immediate result is faster and more " +"stable test execution. On the other hand, the mocks can be configured wrongly and " +"return output different from what the real dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " -"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " -"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " -"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " -"برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان " +"را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای " +"سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد " +"و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As an " +"example, many databases allow you to configure an in-memory backend. This means " +"that you get the correct behavior in your tests, plus they are fast and will " +"automatically clean up after themselves." msgstr "" "در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " -"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " -"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " -"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " -"مخصوص به خود پاک می شوند." +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی " +"کنید. این به این معنی است که شما در تست های خود رفتار صحیح را دریافت می کنید، به " +"علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." +"binds to a random port on `localhost`. Always prefer this over mocking away the " +"framework since it helps you test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " -"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " -"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " -"را در محیط واقعی آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process " +"دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را " +"به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی " +"آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example in a " +"local environment. Use `cargo add mockall` to quickly add Mockall to an existing " +"Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " -"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " -"پروژه Cargo موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local " +"اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo " +"موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up expectations " +"which depend on the arguments passed. Here we use this to mock a cat which " +"becomes hungry 3 hours after the last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " -"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " -"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " -"گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که " +"به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat " +"استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be called " +"to `n` --- the mock will automatically panic when dropped if this isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " -"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " -"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند " +"به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف " +"کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) " -"or `stdout` (on-host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) or " +"`stdout` (on-host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " -"(روی host) استفاده کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی " +"host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -13989,15 +13741,13 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -14007,11 +13757,11 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This " -"means that you can:" +"Rust has excellent support for interoperability with other languages. This means " +"that you can:" msgstr "" -"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " -"شما می‌توانید:" +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما " +"می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -14023,8 +13773,8 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a " -"_foreign function interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a _foreign " +"function interface_, also known as FFI." msgstr "" "وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " "خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " @@ -14039,9 +13789,8 @@ msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " -"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " -"کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به " +"طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -14058,18 +13807,16 @@ msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" -"exercise.md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise." +"md)." msgstr "" -"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " -"دیدیم." +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." #: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." -msgstr "" -"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -14081,8 +13828,8 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool " +"can auto-generate bindings from a C header file." msgstr "" "ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." @@ -14140,8 +13887,7 @@ msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" -"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " -"نیست):" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -14190,40 +13936,34 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which " -"also\n" -" // remains valid. `print_card` doesn't store either pointer to use " -"later\n" +" // reference, and the `name` it contains refers to `name` above which also\n" +" // remains valid. `print_card` doesn't store either pointer to use later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " -"اتصالات (bindings) اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات " +"(bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -14318,35 +14058,32 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" -"tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will " +"just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " -"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " -"برای تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط " +"نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای " +"تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe " -"interoperability between Rust and C++." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability " +"between Rust and C++." msgstr "" -"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " -"می‌کند." +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -14354,14 +14091,13 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed " -"from each language to the other. You provide this description using extern " -"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed from " +"each language to the other. You provide this description using extern blocks in a " +"Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " -"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " -"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " -"شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض " +"دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust " +"ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -14410,25 +14146,24 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching " -"Rust and C++ type/function definitions in order to expose those items to " -"both languages." +"From the declarations made in the bridge module, CXX will generate matching Rust " +"and C++ type/function definitions in order to expose those items to both " +"languages." msgstr "" "از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" -"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " -"دهد." +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/" -"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " -"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " -"(though this doesn't apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) to view the expanded proc macro. For most of the examples you would " +"use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't " +"apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" -"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " -"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " -"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-" +"expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از " +"`cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای " +"پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -14453,23 +14188,22 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in " -"the parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in the " +"parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " -"والد قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد " +"قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" -"+ header file containing the corresponding C++ declarations. The generated " -"header has the same path as the Rust source file containing the bridge, " -"except with a .rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ " +"header file containing the corresponding C++ declarations. The generated header " +"has the same path as the Rust source file containing the bridge, except with a ." +"rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" -"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " -"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." -"h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C " +"حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که " +"فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs.h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -14494,8 +14228,8 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed " -"in are accurate. CXX performs static assertions that the signatures exactly " +"The programmer does not need to promise that the signatures they have typed in " +"are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" "برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " @@ -14504,11 +14238,11 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to " -"call from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to call " +"from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " -"Rust امن هستند را اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust " +"امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -14525,9 +14259,9 @@ msgid "" "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " -"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " -"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد " +"مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، " +"پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -14541,14 +14275,14 @@ msgstr "Generated C++:" #, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum " -"class to hold a value different from all of the listed variants, and our " -"Rust representation needs to have the same behavior." +"wrapping a numeric value. This is because it is not UB in C++ for an enum class " +"to hold a value different from all of the listed variants, and our Rust " +"representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " -"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " -"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " -"رفتار مشابهی داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی " +"را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از " +"همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی " +"داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -14560,25 +14294,23 @@ msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ " -"side." +"Rust functions that return `Result` are translated to exceptions on the C++ side." msgstr "" "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come " -"from the error type's `Display` impl." +"exposes a way to get the error message string. The error message will come from " +"the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " -"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " -"خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول " +"راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to " -"immediately terminate." +"A panic unwinding from Rust to C++ will always cause the process to immediately " +"terminate." msgstr "" "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." @@ -14593,24 +14325,23 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception " -"on the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception on " +"the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " -"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " -"برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت +" +"+C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not " -"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" -"terminate`. The behavior is equivalent to the same exception being thrown " -"through a `noexcept` C++ function." +"If an exception is thrown from an extern \"C++\" function that is not declared by " +"the CXX bridge to return `Result`, the program calls C++'s `std::terminate`. The " +"behavior is equivalent to the same exception being thrown through a `noexcept` C+" +"+ function." msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " -"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " -"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " -"C++ function فعال می‌شود." +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی " +"می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C++ function " +"فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -14670,42 +14401,41 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments " -"and returns of extern functions." +"These types can be used in the fields of shared structs and the arguments and " +"returns of extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " -"functionها استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها " +"استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are " -"a few reasons for this:" +"Note that Rust's `String` does not map directly to `std::string`. There are a few " +"reasons for this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " -"چند دلیل برای این وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند " +"دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "" -"`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed " -"directly between languages." +"The two types have different layouts in memory and so can't be passed directly " +"between languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " -"مستقیماً بین زبان‌ها منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً " +"بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move " -"semantics, so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move semantics, " +"so a `std::string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " -"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، " +"بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14718,8 +14448,8 @@ msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " -"شده CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده " +"CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -14746,43 +14476,43 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the " +"dependencies for the CXX-generated C++ bindings. We'll show how these are setup " +"on the next slide." msgstr "" "به این نکته اشاره کنید که `libcxx_test_bridge_header` و " -"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" -"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​هستند. " +"نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in order to " +"pull in common CXX definitions." msgstr "" "توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" "header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +"Full docs for using CXX in Android can be found in [the Android docs](https://" +"source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" +"patterns#rust-cpp-interop-using-cxx). You may want to share that link with the " +"class so that students know where they can find these instructions again in the " +"future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " -"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" -"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " -"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " -"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید " +"[the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" +"modules/android-rust-patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن " +"پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند که در آینده می‌توانند این " +"دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the " -"CXX source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the CXX " +"source file. These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " -"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. " +"سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -14837,16 +14567,14 @@ msgid "" "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." -"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " -"اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و " +"فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" -"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " -"دارد." +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -14866,10 +14594,9 @@ msgid "" "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " -"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " -"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " -"کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface " +"(JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` " +"crate](https://docs.rs/jni/) به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -14939,11 +14666,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with and " +"try to integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " -"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و " +"سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -14955,11 +14682,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone in " +"the class having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " -"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی " +"است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -14967,51 +14694,51 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party " -"glue code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party glue " +"code to connect between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " -"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص " +"برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've " -"got a corner of the code where you're displaying a UTF8 string to the user, " -"feel free to follow this recipe in your part of the codebase instead of the " -"exact part we talk about." +"Today, we'll call into Rust to do something silly with strings. If you've got a " +"corner of the code where you're displaying a UTF8 string to the user, feel free " +"to follow this recipe in your part of the codebase instead of the exact part we " +"talk about." msgstr "" "امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " -"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " -"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " -"پایگاه کد دنبال کنید." +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت " +"دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد " +"دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build " -"flags is OK, so long as your code is relatively recent (commit position " -"1223636 onwards, corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build flags is " +"OK, so long as your code is relatively recent (commit position 1223636 onwards, " +"corresponding to November 2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " -"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " -"commit 1223636 به بعد، مربوط به نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از " +"build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit " +"1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md msgid "" -"(A component, debug build is recommended for quickest iteration time. This " -"is the default!)" +"(A component, debug build is recommended for quickest iteration time. This is the " +"default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " -"یک حالت پیش‌فرض است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک " +"حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" -"the-code/) if you aren't already at that point. Be warned: setting up to " -"build Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-" +"code/) if you aren't already at that point. Be warned: setting up to build " +"Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." -"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " -"برای build Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium." +"org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build " +"Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -15024,20 +14751,19 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" "This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. " -"If you don't have time to complete a certain part, don't worry: you can " -"catch up in the next slot." +"We'll be doing them spread throughout the course instead of just at the end. If " +"you don't have time to complete a certain part, don't worry: you can catch up in " +"the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " -"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " -"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " -"به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها " +"را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای " +"تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io]" -"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " -"set of dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io](https://" +"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " +"dependencies." msgstr "" "جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " "استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " @@ -15049,41 +14775,41 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." -"gni` (e.g. `rust_static_library` that we'll meet later). This uses " -"Chromium's audited toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e." +"g. `rust_static_library` that we'll meet later). This uses Chromium's audited " +"toolchain and crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " -"crateهای بررسی‌شده Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای " +"بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " -"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" -"docs/rust.md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates]" +"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " -"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" -"heads/main/docs/rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium " +"محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/" +"rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " -"downloaded from the internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded " +"from the internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " -"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای " +"دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " -"code can be built into the Chromium browser. At the same time, Cargo is an " -"important part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code " +"can be built into the Chromium browser. At the same time, Cargo is an important " +"part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " -"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " -"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان " +"کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم " +"Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -15095,11 +14821,11 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the " -"risk profile of these scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk " +"profile of these scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " -"ریسک‌های این سناریوها را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های " +"این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" @@ -15112,111 +14838,105 @@ msgstr "" #: src/chromium/cargo.md msgid "" "Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them " -"to discuss in small groups of 3-4 people." +"exercise. Assuming folks taking the course are physically together, ask them to " +"discuss in small groups of 3-4 people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " -"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " -"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران " +"خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، " +"از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where " -"Cargo may offer an advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where Cargo " +"may offer an advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " -"را ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را " +"ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, " -"one has access to the rich ecosystem of crates.io libraries. There is a " -"crate for almost anything and they are usually quite pleasant to use. " -"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" -"from various formats, `itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, one " +"has access to the rich ecosystem of crates.io libraries. There is a crate for " +"almost anything and they are usually quite pleasant to use. (`clap` for command-" +"line parsing, `serde` for serializing/deserializing to/from various formats, " +"`itertools` for working with iterators, etc.)." msgstr "" "این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " -"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " -"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " -"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " -"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک " +"crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط " +"فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای " +"کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo." -"toml` and start writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` " +"and start writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " -"اضافه کنید و شروع به نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه " +"کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " -"مقایسه با `python` + `pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با " +"`python` + `pip`." #: src/chromium/cargo.md #, fuzzy msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate " -"that needs to work on nightly, current stable, and older stable) but also by " -"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a " -"streamlined way to run benchmarks)." -msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " -"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " -"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " -"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " -"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " -"راهی ساده برای اجرای benchmark‌ها می‌دهد)." +"using `rustup` to switch to a different `rustc` version when testing a crate that " +"needs to work on nightly, current stable, and older stable) but also by an " +"ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a streamlined " +"way to run benchmarks)." +msgstr "" +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای " +"تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی " +"پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز " +"انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را برای ساده‌سازی و " +"اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate راهی ساده برای اجرای " +"benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "" -"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" -"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " -"می‌کند." +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" -"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " -"باشد." +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." #: src/chromium/cargo.md -msgid "" -"Broad, generic examples of projects where `cargo` may be the right choice:" -msgstr "" -"نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" +msgid "Broad, generic examples of projects where `cargo` may be the right choice:" +msgstr "نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " -"for writing command line tools. The breadth and ergonomics of libraries is " -"comparable to Python, while being more robust (thanks to the rich " -"typesystem) and running faster (as a compiled, rather than interpreted " -"language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for " +"writing command line tools. The breadth and ergonomics of libraries is comparable " +"to Python, while being more robust (thanks to the rich typesystem) and running " +"faster (as a compiled, rather than interpreted language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " -"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " -"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " -"زبان کامپایل شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان " +"محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که " +"قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل " +"شده و نه مفسری)." #: src/chromium/cargo.md msgid "" "Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be " -"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " -"should probably use Cargo." +"Cargo. Libraries that want to get external contributions, and want to be used " +"outside of Chromium (e.g. in Bazel or Android/Soong build environments) should " +"probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " -"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " -"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " -"باید از Cargo استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. " +"کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium " +"استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo " +"استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -15224,11 +14944,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which " -"resulted in PRs with performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which resulted " +"in PRs with performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " -"با بهبود در عملکرد می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با " +"بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -15236,22 +14956,20 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` " -"for command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` for " +"command-line parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " -"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به " +"`clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " -"when building and bootstrapping Rust standard library when building Rust " -"toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when " +"building and bootstrapping Rust standard library when building Rust toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " -"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " -"toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در " +"هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." #: src/chromium/cargo.md msgid "" @@ -15260,16 +14978,14 @@ msgid "" "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" "‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " -"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." -"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " -"است.)" +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` " +"از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" -msgstr "" -"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" @@ -15278,16 +14994,16 @@ msgid "" "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" "‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " -"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر " +"Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" -"rust-lang/ - همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-" +"lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -15295,11 +15011,11 @@ msgstr "`cargo`, `rustfmt`,سایر موارد." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for " -"distributing the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for distributing " +"the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " -"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain " +"از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." @@ -15307,8 +15023,8 @@ msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by " -"security@chromium.org)" +"Rust libraries vendored into `//third_party/rust` (audited by security@chromium." +"org)" msgstr "" "کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " "security@chromium.org)" @@ -15323,94 +15039,76 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as approved by " +"Chromium's [Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/" +"main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " -"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" -"ATL_OWNERS) تأیید شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech " +"Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید " +"شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"Chromium's policy on third party libraries is outlined [here](https://chromium." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust " +"is allowed for third party libraries under various circumstances, including if " +"they're the best option for performance or for security." msgstr "" "رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " -"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " -"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده " +"است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا " +"آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"Very few Rust libraries directly expose a C/C++ API, so that means that nearly " +"all such libraries will require a small amount of first-party glue code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " -"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " -"glue code اول شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) " +"قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول " +"شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing " -"Rust :\n" +": Existing Chromium : : Chromium Rust Existing Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------" -"+ :\n" -": | | : : | | | " -"| :\n" -": | o-----+-+-----------+-+-> o-+----------+--> " -"| :\n" -": | | : Language : | | Crate | " -"| :\n" -": +---------------+ : boundary : +----------------+ API +-------------" -"+ :\n" +": +---------------+ : : +----------------+ +-------------+ :\n" +": | | : : | | | | :\n" +": | o-----+-+-----------+-+-> o-+----------+--> | :\n" +": | | : Language : | | Crate | | :\n" +": +---------------+ : boundary : +----------------+ API +-------------+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should normally be " +"kept in `third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" -"rust///wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust/" +"//wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -15423,14 +15121,13 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "" -"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " -"کنید." +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " -"مسیر مناسب ادامه یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر " +"مناسب ادامه یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -15438,23 +15135,21 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and " -"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " -"is no exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` " +"for efficiency --- its static rules allow maximum parallelism. Rust is no " +"exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " -"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " -"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت " +"کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر " +"می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "" -"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "" -"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -15478,8 +15173,8 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to " -"depend upon third party code." +"You can also add `deps` on other Rust targets. Later we'll use this to depend " +"upon third party code." msgstr "" "همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " "وابستگی به کد شخص ثالث استفاده خواهیم کرد." @@ -15487,38 +15182,37 @@ msgstr "" #: src/chromium/build-rules.md msgid "" "You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root " -"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " -"list of all source files which `ninja` needs in order to determine when " -"rebuilds are necessary." -msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " -"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " -"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " -"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " -"دارد." +"`crate_root` is the file given to the Rust compiler representing the root file of " +"the compilation unit --- typically `lib.rs`. `sources` is a complete list of all " +"source files which `ninja` needs in order to determine when rebuilds are " +"necessary." +msgstr "" +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی " +"است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- " +"معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی " +"است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire " -"crate is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate " +"is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" "(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " "جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using " -"[gn's built-in support for Rust static libraries](https://gn.googlesource." -"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " -"this template provides support for CXX interop, Rust features, and unit " -"tests, some of which we'll use later." +"Students might be wondering why we need a gn template, rather than using [gn's " +"built-in support for Rust static libraries](https://gn.googlesource.com/gn/+/main/" +"docs/reference.md#func_static_library). The answer is that this template provides " +"support for CXX interop, Rust features, and unit tests, some of which we'll use " +"later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " -"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" -"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " -"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " -"از برخی از آنها استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای " +"کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference." +"md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که این الگو از " +"CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً از برخی از آنها " +"استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -15526,15 +15220,13 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " -"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " -"the gn target. (Later in the course we'll see circumstances where this is " -"necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't " +"compile. If you need unsafe Rust code, add `allow_unsafe = true` to the gn " +"target. (Later in the course we'll see circumstances where this is necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " -"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " -"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " -"است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل " +"نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn " +"اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -15600,29 +15292,26 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than " -"for C++. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than for C+" +"+. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " -"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " -"استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد " +"ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " -"Rust support" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust " +"support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " -"قبلی پشتیبانی از Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی " +"پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output " -"directory)" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" msgstr "" -"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " -"شما)" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -15630,24 +15319,23 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-" -"analyzer might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-analyzer " +"might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " -"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های " +"code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a " -"piece of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a piece " +"of Chromium-related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " -"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به " +"Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "" -"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" @@ -15659,48 +15347,46 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " -"K)." +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." msgstr "" -"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" -"CoC = K)." +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = " +"K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " -"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This " +"will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " -"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." -"rs` می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/" +"CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` " +"می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " -"164; the outline is in the file explorer pane in vscode; typical vim/CoC " -"bindings = space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; " +"the outline is in the file explorer pane in vscode; typical vim/CoC bindings = " +"space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " -"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " -"bindings = space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط " +"164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC bindings = " +"space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the " -"`QrCode::with_bits` method)" +"Demo **type annotations** (there are quite a few nice examples in the `QrCode::" +"with_bits` method)" msgstr "" "نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" "with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will " -"need to be rerun after editing `BUILD.gn` files (which we will do a few " -"times throughout the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will need to " +"be rerun after editing `BUILD.gn` files (which we will do a few times throughout " +"the exercises in this session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " -"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " -"اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های " +"`BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" @@ -15708,53 +15394,50 @@ msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " -"containing:" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" msgstr "" -"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " -"که حاوی:" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که " +"حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " -"target." +"**Important**: note that `no_mangle` here is considered a type of unsafety by the " +"Rust compiler, so you'll need to allow unsafe code in your `gn` target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " -"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " -"`gn` target خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی " +"(type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target " +"خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " -"see how this can be automated by bindings generation tools):" +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll see " +"how this can be automated by bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " -"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " -"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را " +"در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که " +"چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " -"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " -"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " -"times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we " +"suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run " +"Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " -"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " -"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " -"بارها چاپ می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما " +"قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. " +"Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" بارها چاپ " +"می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " -"in subsequent exercises. If you've succeeded, you will be able to use right-" -"click \"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in " +"subsequent exercises. If you've succeeded, you will be able to use right-click " +"\"Go to definition\" on `println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " -"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " -"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار " +"کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک " +"راست روی\"Go to definition\" در`println!` استفاده کنید." #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md @@ -15763,38 +15446,35 @@ msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://" -"source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." -"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" -"l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." +"html#the-no_mangle-attribute)" msgstr "" "اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." "html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." -"extern.html)" -msgstr "" -"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." "html)" +msgstr "" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/" +"main/docs/reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" -"gn/+/main/docs/reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/" +"main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy @@ -15807,152 +15487,145 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-" -"denominator interop language, C. Both C++ and Rust can natively declare and " -"call C ABI functions. Later in the course, we'll connect C++ directly to " -"Rust." +"This example is unusual because it boils down to the lowest-common-denominator " +"interop language, C. Both C++ and Rust can natively declare and call C ABI " +"functions. Later in the course, we'll connect C++ directly to Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " -"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. " +"بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to " +"generate two functions with the same name, and Rust can no longer guarantee that " +"the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " -"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " -"کند که تابع مورد نظر فراخوانی شده است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به " +"Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که " +"تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " -"از الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " +"الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same " -"source file as the code being tested. This was covered [earlier](../testing." -"md) in the course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same source " +"file as the code being tested. This was covered [earlier](../testing.md) in the " +"course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " -"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " -"پوشش داده شده بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد " +"مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده " +"بود و به این صورت است:" #: src/chromium/testing.md msgid "" "In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable " -"and helps to avoid rebuilding `.rs` files a second time (in the `test` " -"configuration)." +"follow this practice for Rust --- this makes tests consistently discoverable and " +"helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " -"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " -"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " -"`test`) جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این " +"روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف " +"باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) " +"جلوگیری شود." #: src/chromium/testing.md -msgid "" -"This results in the following options for testing Rust code in Chromium:" +msgid "This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" -"rust`." +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." msgstr "" "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " -"when Rust code is just a thin FFI layer and the existing unit tests provide " -"sufficient coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when " +"Rust code is just a thin FFI layer and the existing unit tests provide sufficient " +"coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " -"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " -"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. " +"زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای " +"ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its " -"public API (using `pub mod for_testing { ... }` if needed). This is the " -"subject of the next few slides." +"`gtest` tests authored in Rust and using the crate under test through its public " +"API (using `pub mod for_testing { ... }` if needed). This is the subject of the " +"next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " -"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " -"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی " +"آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده " +"می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" "Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after " -"adding or updating third-party crates.)" +"exercised by Chromium bots. (Such testing is needed rarely --- only after adding " +"or updating third-party crates.)" msgstr "" "ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " -"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " -"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از " +"افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " -"used:" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " -"مقابل Rust `gtest` استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل " +"Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a " -"thin FFI glue) and therefore uses the existing C++ unit tests for testing " -"both the C++ and the Rust implementation (parameterizing the tests so they " -"enable or disable Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a thin " +"FFI glue) and therefore uses the existing C++ unit tests for testing both the C++ " +"and the Rust implementation (parameterizing the tests so they enable or disable " +"Rust using a `ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " -"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " -"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " -"`ScopedFeatureList` آن را فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و " +"بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند " +"(تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک `ScopedFeatureList` آن را " +"فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe " -"implementation of pixel transformations that are provided by `libpng` but " -"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " -"functionality may benefit from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe implementation " +"of pixel transformations that are provided by `libpng` but missing in the `png` " +"crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit " +"from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " -"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " -"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " -"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " -"بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی " +"داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به " +"عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن " +"است از آزمایش های جداگانه‌ای که در Rust نوشته شده است بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" +"testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" -"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " -"attribute)" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" msgstr "" "از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " "`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " -"panicking and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking " +"and not terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " -"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی " +"assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -15960,11 +15633,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing " -"test binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing test " +"binary that already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " -"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که " +"از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -15989,8 +15662,8 @@ msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " -"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام " +"دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -16032,19 +15705,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " -"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " -"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " -"computed based on the full target path and name. Fortunately we can avoid " -"working with such an unwieldy name by using the `chromium::import!` macro " -"from the automatically-imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import " +"and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an " +"explicit `crate_name` for `my_rust_lib` so its crate name is computed based on " +"the full target path and name. Fortunately we can avoid working with such an " +"unwieldy name by using the `chromium::import!` macro from the automatically-" +"imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " -"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " -"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " -"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " -"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " -"درنتیجه از کار با چنین نامی پرهیز کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " +"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح " +"برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل " +"هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` " +"از `chromium` crate که به‌طور خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز " +"کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -16056,30 +15729,30 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" -"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" +"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" -"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" +"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" "import`." #: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the " -"crate name has to be globally unique. crates.io guarantees uniqueness of its " -"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " -"covered in a later section) use short crate names." +"property, but doing this is discouraged. And it is discouraged because the crate " +"name has to be globally unique. crates.io guarantees uniqueness of its crate " +"names so `cargo_crate` GN targets (generated by the `gnrt` tool covered in a " +"later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " -"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " -"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " -"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " -"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، " +"اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح " +"سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین " +"می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که در بخش " +"بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -16095,13 +15768,13 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding " -"two integers received as arguments, computing the nth Fibonacci number, " -"summing integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding two " +"integers received as arguments, computing the nth Fibonacci number, summing " +"integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " -"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " -"اعداد صحیح در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن " +"دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح " +"در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -16113,122 +15786,114 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "" -"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new " -"tools being developed all the time. At the moment, Chromium uses a tool " -"called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new tools " +"being developed all the time. At the moment, Chromium uses a tool called CXX." msgstr "" "جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " -"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " -"CXX استفاده می‌کند." +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX " +"استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition " -"language (which looks a lot like Rust) and then CXX tools generate " -"declarations for functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition language " +"(which looks a lot like Rust) and then CXX tools generate declarations for " +"functions and types in both Rust and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " -"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " -"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار " +"شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع " +"و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " -"using this." +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using " +"this." msgstr "" -"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " -"ببینید." +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just " -"the same as you previously did. Point out that automating the process has " -"the following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just the " +"same as you previously did. Point out that automating the process has the " +"following benefits:" msgstr "" "از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " -"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " -"فرآیند دارای مزایای زیر است:" +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند " +"دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " -"definitions, but with out-of-sync manual bindings you'd get Undefined " -"Behavior)" +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, " +"but with out-of-sync manual bindings you'd get Undefined Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " -"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " -"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " -"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::" +"bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای " +"کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual " +"bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " -"methods; manual bindings would require authoring such top-level, free " -"functions manually)" +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ methods; " +"manual bindings would require authoring such top-level, free functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " -"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " -"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " -"بالا و رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای " +"ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور " +"خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح بالا و " +"رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " -"کنند - به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - " +"به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't " -"guarantee any particular ABI or memory layout. With manual bindings `std::" -"span` / `&[T]` have to be manually destructured and rebuilt out of a " -"pointer and length - this is error-prone given that each language represents " -"empty slices slightly differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee " +"any particular ABI or memory layout. With manual bindings `std::span` / `&[T]` " +"have to be manually destructured and rebuilt out of a pointer and length - this " +"is error-prone given that each language represents empty slices slightly " +"differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " -"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " -"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " -"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " -"خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی " +"را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت " +"دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با توجه به اینکه " +"هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " -"are natively supported. With manual bindings, one would have to pass C-ABI-" -"compatible raw pointers, which would increase lifetime and memory-safety " -"risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are " +"natively supported. With manual bindings, one would have to pass C-ABI-compatible " +"raw pointers, which would increase lifetime and memory-safety risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " -"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " -"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " -"طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` " +"به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-" +"ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" "`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can " -"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" -"terminate a string)." +"string representation across the languages (e.g. `rust::String::lossy` can build " +"a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a " +"string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " -"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " -"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " -"string را با NUL خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها " +"درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را " +"از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک string را با NUL " +"خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." -"rs` اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` " +"اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -16244,14 +15909,14 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " -"procedural macro does complex things to it. The generated code is quite a " -"bit more sophisticated - though this does still result in a `mod` called " -"`ffi` in your code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural " +"macro does complex things to it. The generated code is quite a bit more " +"sophisticated - though this does still result in a `mod` called `ffi` in your " +"code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" -"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " -"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` " +"کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این " +"کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -16271,22 +15936,21 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by " -"Rust, but this is misleading. This header is never interpreted by Rust, but " -"simply `#include`d in the generated C++ code for the benefit of C++ " -"compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, " +"but this is misleading. This header is never interpreted by Rust, but simply " +"`#include`d in the generated C++ code for the benefit of C++ compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " -"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " -"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه " +"کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد +" +"+C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://" -"cxx.rs/bindings.html)." +"By far the most useful page when using CXX is the [type reference](https://cxx.rs/" +"bindings.html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" -"(https://cxx.rs/bindings.html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx." +"rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" @@ -16294,51 +15958,45 @@ msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of " -"it." +"Your Rust-C++ interface is sufficiently simple that you can declare all of it." msgstr "" "اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " "declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example " -"`std::unique_ptr`, `std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example `std::" +"unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" "شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " "مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` " -"type." +"It has many limitations --- for example lack of support for Rust's `Option` type." msgstr "" -"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " -"Rust." +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well " -"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " -"considering a use-case for Rust in Chromium, a good starting point is to " -"draft the CXX bindings for the language boundary to see if it appears simple " -"enough." +"These limitations constrain us to using Rust in Chromium only for well isolated " +"\"leaf nodes\" rather than for arbitrary Rust-C++ interop. When considering a use-" +"case for Rust in Chromium, a good starting point is to draft the CXX bindings for " +"the language boundary to see if it appears simple enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " -"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " -"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " -"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " -"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" " +"به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن " +"یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که پیش نویس " +"پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا ببینید آیا به " +"اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You should also discuss some of the other sticky points with CXX, for " -"example:" +"You should also discuss some of the other sticky points with CXX, for example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "" -"Its error handling is based around C++ exceptions (given on the next slide)" +msgid "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -16347,12 +16005,12 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " -"on C++ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C+" +"+ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" -"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " -"جایگزین‌های آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ " +"exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های " +"آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -16361,12 +16019,11 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " -"be passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be " +"passed across the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " -"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " -"باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این " +"مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -16377,19 +16034,18 @@ msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " -"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " -"`Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای " +"یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed " -"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " -"cannot be stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed when `T` " +"is a Rust type, which cannot be passed across the FFI boundary, and cannot be " +"stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " -"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " -"کند و نمی تواند در `UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است " +"زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و " +"نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -16397,19 +16053,18 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` " -"representing failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` representing " +"failure)" msgstr "" "به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " "نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been " -"needed in practice." +"Preserving error details is in theory possible, but so far hasn't been needed in " +"practice." msgstr "" -"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " -"است." +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -16418,15 +16073,15 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." -"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " -"used to communicate success vs failure, and where the successful result can " -"be passed across the FFI boundary:" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;" +"l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to " +"communicate success vs failure, and where the successful result can be passed " +"across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" -"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " -"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:" +"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و جایی " +"که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -16434,37 +16089,36 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. " -"This is not the size of the vector, but the size of the QR code (and " -"admittedly it is a bit redundant - this is the square root of the size of " -"the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. This is " +"not the size of the vector, but the size of the QR code (and admittedly it is a " +"bit redundant - this is the square root of the size of the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " -"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " -"جذر اندازه بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه " +"بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه " +"بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` " -"before calling into the Rust function. Creation of a Rust reference that " -"points to uninitialized memory results in Undefined Behavior (unlike in C++, " -"when only the act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` before " +"calling into the Rust function. Creation of a Rust reference that points to " +"uninitialized memory results in Undefined Behavior (unlike in C++, when only the " +"act of dereferencing such memory results in UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " -"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " -"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " -"حافظه‌ای منجر به UB می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` " +"اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار " +"نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB " +"می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable " -"references to C++ data: the answer is that C++ data can’t be moved around " -"like Rust data, because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable references " +"to C++ data: the answer is that C++ data can’t be moved around like Rust data, " +"because it may contain self-referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " -"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " -"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " -"خودارجاعی (self-referential pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل " +"تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند " +"داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential " +"pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -16472,11 +16126,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the " -"successful result cannot be passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the successful " +"result cannot be passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " -"FFI عبور کند و چه کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI " +"عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -16501,31 +16155,29 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " -"types cannot cross the FFI boundary without indirection of a `Box`. We " -"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " -"to store Rust objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types " +"cannot cross the FFI boundary without indirection of a `Box`. We can't have an " +"`out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust " +"objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " -"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " -"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " -"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این " +"نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم " +"`out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust " +"object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary " -"generics nor templates, we can still pass them across the FFI boundary by " -"manually specializing / monomorphizing them into a non-generic type. In the " -"example `ResultOfPngReader` is a non-generic type that forwards into " -"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " -"`as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary generics " +"nor templates, we can still pass them across the FFI boundary by manually " +"specializing / monomorphizing them into a non-generic type. In the example " +"`ResultOfPngReader` is a non-generic type that forwards into appropriate methods " +"of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " -"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " -"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " -"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " -"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " -"ارسال می‌شود." +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی " +"نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی " +"تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در " +"مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای مناسب `Result` " +"(به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -16533,13 +16185,13 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" -"node where we want to use Rust. You'd typically have one for each " +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node " +"where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " -"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " -"یکی دارید. پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust " +"استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. " +"پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -16571,15 +16223,13 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium " -"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" -"l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium C++ " +"types to CXX Rust types --- for example [`SpanToRustSlice`](https://source." +"chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " -"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" -"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." -"h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به " +"انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source." +"chromium.org/chromium/chromium/src /+/main:base/containers/span_rust.h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" @@ -16588,32 +16238,31 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " -"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " -"to memory, and compromise the safety of Rust's own data layouts. Presence of " -"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " -"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" -"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " -"binary can cause unexpected behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. " +"Calling back and forth to C/C++ from Rust may do arbitrary things to memory, and " +"compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` " +"keywords in C/C++ interop can harm the signal-to-noise ratio of such a keyword, " +"and is [controversial](https://steveklabnik.com/writing/the-cxx-debate), but " +"strictly, bringing any foreign code into a Rust binary can cause unexpected " +"behavior from Rust's perspective." msgstr "" "پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " -"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " -"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " -"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " -"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" -"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " -"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام " +"دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار " +"زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین کلمه کلیدی آسیب " +"برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/the-cxx-debate) است، " +"اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث رفتار غیرمنتظره " +"از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " -"`unsafe` and `extern \"C\"` functions just like we did manually in the " -"previous section." +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust `unsafe` " +"and `extern \"C\"` functions just like we did manually in the previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " -"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " -"در بخش قبل به صورت دستی انجام دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است " +"--- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل " +"به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -16625,13 +16274,13 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which " -"specifies a single function, to be called from C++, called " -"`hello_from_rust`, taking no parameters and returning no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a " +"single function, to be called from C++, called `hello_from_rust`, taking no " +"parameters and returning no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " -"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " -"بدون اینکه پارامتر و هیچ مقداری برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را " +"مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه " +"پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -16647,11 +16296,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. " -"Instead, include the generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, " +"include the generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " -"عوض، فایل هِدِر تولید شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، " +"فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -16663,11 +16312,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how " -"flexible Rust in Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how flexible " +"Rust in Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " -"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید " +"که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -16682,26 +16331,25 @@ msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " -"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما " +"باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the " -"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" -"extern-c++.html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the `unsafe` " +"keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++." +"html#functions-and-member-functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " -"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" -"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` " +"را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx." +"rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" -"cxx.h\"` را وارد کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -16716,32 +16364,32 @@ msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " -"و به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " +"خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " -"به خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " +"خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " -"own some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own " +"some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " -"بتواند دارای یک C++ object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند " +"دارای یک C++ object باشد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " -"need a `Box`)." +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a " +"`Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " -"(نکته: شما به یک `Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: " +"شما به یک `Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -16761,9 +16409,9 @@ msgid "" "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " -"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " -"تعریف این رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای " +"Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این " +"رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -16780,40 +16428,39 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "" -"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با " -"آن مواجه شوید:" +"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با آن " +"مواجه شوید:" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X " -"and Y are both function types. This is because your C++ function doesn't " -"quite match the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X and Y " +"are both function types. This is because your C++ function doesn't quite match " +"the declaration in your `cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " -"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " -"`cxx::bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر " +"دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::" +"bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. " -"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" -"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " -"CXX's design makes it quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. Doesn't " +"that risk UB? For CXX's _opaque_ types, no, because they are zero-sized. For CXX " +"trivial types yes, it's _possible_ to cause UB, although CXX's design makes it " +"quite difficult to craft such an example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " -"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " -"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " -"نمونه‌ای را بسیار دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB " +"را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع " +"بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار " +"دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://" -"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " -"they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://crates." +"io). It's _very easy_ for Rust crates to depend upon one another. So they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." -"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " -"آنها این کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) " +"یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این " +"کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -16868,16 +16515,16 @@ msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " -"آن‌ها در Chromium را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها " +"در Chromium را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely " -"have to bring in multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely have " +"to bring in multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " -"بود چندین کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود " +"چندین کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -16901,15 +16548,13 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. " -"These are managed through a single [`Cargo.toml`](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." -"toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. These " +"are managed through a single [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " -"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" -"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " -"می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. " +"اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/" +"+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16932,14 +16577,13 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" -"dependencies.html) --- most commonly, you'll want to specify the `features` " -"that you wish to enable in the crate." +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies." +"html) --- most commonly, you'll want to specify the `features` that you wish to " +"enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" -"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " -"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " -"کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://" +"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- " +"معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16957,15 +16601,13 @@ msgid "" msgstr "" "در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " -"crate است." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت crate " +"است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"If you add a new crate, you should specify at least the `group`. This is one " -"of:" -msgstr "" -"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +"If you add a new crate, you should specify at least the `group`. This is one of:" +msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -16974,27 +16616,27 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this " -"file to specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this file to " +"specify where its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " -"یافتن فایل (های) مجوز آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن " +"فایل (های) مجوز آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file " -"to resolve problems." +"Later, we'll see some other things you will need to configure in this file to " +"resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " -"مشاهده خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده " +"خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD." -"gn` rules." +"A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` " +"rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " -"`BUILD.gn` را ایجاد کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD." +"gn` را ایجاد کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -17002,14 +16644,13 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running " -"this command you will be downloading and running its dependencies from " -"`crates.io`. See [the earlier section](../cargo.md) discussing this security " -"decision." +"Although the `gnrt` tool is part of the Chromium source code, by running this " +"command you will be downloading and running its dependencies from `crates.io`. " +"See [the earlier section](../cargo.md) discussing this security decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " -"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." -"md) را در مورد این تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن " +"را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این " +"تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -17025,11 +16666,11 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete " -"set of crates required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete set " +"of crates required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " -"جعبه‌های مورد نیاز Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های " +"مورد نیاز Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -17037,13 +16678,12 @@ msgid "" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" -"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " -"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" +"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال " +"می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" @@ -17053,10 +16693,8 @@ msgstr "اکنون `git status` را اجرا کنید. شما باید این #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/" -"vendor`" -msgstr "" -"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +"At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" +msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" @@ -17072,46 +16710,44 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://" -"doc.rust-lang.org/cargo/reference/semver.html)." +"The \"major semver version\" is a [Rust \"semver\" version number](https://doc." +"rust-lang.org/cargo/reference/semver.html)." msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " -"مراجعه کنید." +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه " +"کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "" -"Take a close look, especially at the things generated in `third_party/rust`." +msgid "Take a close look, especially at the things generated in `third_party/rust`." msgstr "" "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium " -"it's to allow multiple incompatible versions of a crate, which is " -"discouraged but sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium it's to " +"allow multiple incompatible versions of a crate, which is discouraged but " +"sometimes necessary in the Cargo ecosystem." msgstr "" "کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " -"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " -"منع می‌شود ولی گاهی اوقات ضروری است." +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع " +"می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the " -"design of `gn` and `ninja` which aim for static, deterministic, build rules " -"to maximize parallelism and repeatability of builds." +"arbitrary things at build time. This is fundamentally at odds with the design of " +"`gn` and `ninja` which aim for static, deterministic, build rules to maximize " +"parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " -"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " -"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " -"رساندن موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که " +"کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی " +"`gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر رساندن " +"موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "" -"Some `build.rs` actions are automatically supported; others require action:" +msgid "Some `build.rs` actions are automatically supported; others require action:" msgstr "" -"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " -"اقدام دارند:" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام " +"دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -17170,30 +16806,28 @@ msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " -"scriptها تنها دو عمل اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها " +"تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " -"ببینید که آیا کدهای منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که " +"آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " -"add `build-script-outputs` to the crate. If this is a transitive dependency, " -"that is, one on which Chromium code should not directly depend, also add " -"`allow-first-party-usage=false`. There are several examples already in that " -"file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add " +"`build-script-outputs` to the crate. If this is a transitive dependency, that is, " +"one on which Chromium code should not directly depend, also add `allow-first-" +"party-usage=false`. There are several examples already in that file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " -"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " -"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " -"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " -"فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر " +"دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، " +"یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس `allow-first-" +"party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -17212,27 +16846,26 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input " -"to subsequent build steps." +"`BUILD.gn` files to inform ninja that this particular output file is input to " +"subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " -"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " -"فایل خروجی خاص ورودی مراحل build بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا " +"فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی " +"خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " -"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" -"crates.io/crates/bindgen) within their build scripts. These actions can't be " -"supported in a Chromium context --- our gn, ninja and LLVM build system is " -"very specific in expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " -"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " -"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " -"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " -"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " -"است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/" +"C++ libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/" +"crates/bindgen) within their build scripts. These actions can't be supported in a " +"Chromium context --- our gn, ninja and LLVM build system is very specific in " +"expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build " +"و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از " +"[`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه " +"می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، " +"ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -17249,27 +16882,25 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" -"` - see for example the [patches against the `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - and will be applied automatically by " -"`gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - " +"see for example the [patches against the `cxx` crate](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - " +"and will be applied automatically by `gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" -"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " -"خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` " +"نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" +"cxx/) - و هر بار که crate را upgrade می‌کند به‌طور خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending " -"on a crate is simple. Find your `rust_static_library` target, and add a " -"`dep` on the `:lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending on a " +"crate is simple. Find your `rust_static_library` target, and add a `dep` on the `:" +"lib` target within your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " -"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " -"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه " +"به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا " +"کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -17279,15 +16910,13 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" -"lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" " +------------+ +----------------------+\n" "```" @@ -17316,43 +16945,41 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Third_party-review), but of course also subject to security review. As " -"you may be bringing in not just a single crate but also transitive " -"dependencies, there may be a lot of code to review. On the other hand, safe " -"Rust code can have limited negative side effects. How should you review it?" -msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" -"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " -"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " -"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " -"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " -"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-" +"review), but of course also subject to security review. As you may be bringing in " +"not just a single crate but also transitive dependencies, there may be a lot of " +"code to review. On the other hand, safe Rust code can have limited negative side " +"effects. How should you review it?" +msgstr "" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/" +"src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما " +"البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، " +"بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای زیادی برای بررسی وجود داشته " +"باشد. از سوی دیگر، safe Rust code می‌تواند عوارض جانبی محدودی داشته باشد. پس " +"چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet]" -"(https://mozilla.github.io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet](https://" +"mozilla.github.io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" -"mozilla.github.io/cargo-vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla." +"github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "" -"Meanwhile, for each new crate addition, we are checking for the following:" +msgid "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? " -"If the build system for each crate contains a `build.rs` or procedural " -"macros, work out what they're for. Are they compatible with the way Chromium " -"is normally built?" +"Understand why each crate is used. What's the relationship between crates? If the " +"build system for each crate contains a `build.rs` or procedural macros, work out " +"what they're for. Are they compatible with the way Chromium is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " -"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " -"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " -"ساخته و built می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر " +"جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که " +"آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول ساخته و built " +"می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -17367,19 +16994,18 @@ msgid "" "cargo.md))" msgstr "" "از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " -"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" -"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." -"md))" +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` " +"که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." -"md#unsafe-code-in-safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium." +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" +"safe-languages)" msgstr "" "مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" -"in-safe-languages) خوب است" +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" +"safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -17387,21 +17013,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place " -"that might have been maliciously inserted. (You can't realistically aim for " -"100% perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place that " +"might have been maliciously inserted. (You can't realistically aim for 100% " +"perfection here: there's often just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " -"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " -"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد " +"شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ " +"درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium." -"org` to work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium.org` to " +"work out the right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " -"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار " +"کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -17420,8 +17046,7 @@ msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" -"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" -"`" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -17429,16 +17054,16 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config." -"toml` changes, into the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` " +"changes, into the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " -"مخزن Chromium قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن " +"Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` " -"files may result in some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` files " +"may result in some files being skipped." msgstr "" "**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." "gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." @@ -17447,49 +17072,48 @@ msgstr "" #, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git " -"branches, and many projects still use non-inclusive terminology there. So " -"you may need to run:" +"language. This is because Rust crate data tends to include names of git branches, " +"and many projects still use non-inclusive terminology there. So you may need to " +"run:" msgstr "" "در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " -"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " -"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " -"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام " +"شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده " +"می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to " -"keep it up to date with any security fixes](https://chromium.googlesource." -"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " -"hoped that we will soon automate this for Rust crates, but for now, it's " -"still your responsibility just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to keep it " +"up to date with any security fixes](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will " +"soon automate this for Rust crates, but for now, it's still your responsibility " +"just as it is for any other third party dependency." msgstr "" "شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " -"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" -"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " -"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " -"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/" +"main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی این را " +"برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که " +"برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/" -"features.html#the-default-feature). Assume that the crate will be used in " -"shipping Chromium, but won't be used to handle untrustworthy input." -msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " -"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." -"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " -"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " -"نمی‌شود." +"crate's [default features](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). Assume that the crate will be used in shipping " +"Chromium, but won't be used to handle untrustworthy input." +msgstr "" +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های " +"پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features.html#the-default-" +"feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، " +"اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " -"ahead and do that now if you like. Or, you could create a new " -"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" -"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead " +"and do that now if you like. Or, you could create a new [`rust_executable` target]" +"(https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"rust_executable.gni) which uses `uwuify`)." msgstr "" "(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " "می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" @@ -17538,18 +17162,17 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to " -"turn off the default features." +"If students are downloading even more than that, they probably forgot to turn off " +"the default features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " -"ویژگی‌های پیش‌فرض را خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های " +"پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" -"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " -"crate!" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -17560,8 +17183,8 @@ msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " -"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی " +"را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -17569,46 +17192,43 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. " -"It's important that we get Chromium for Pixies delivered to them as soon as " -"possible." +"A community of pixies has been discovered living in a remote rainforest. It's " +"important that we get Chromium for Pixies delivered to them as soon as possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " -"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم " +"است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie " -"language." +"The requirement is to translate all Chromium's UI strings into Pixie language." msgstr "" -"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " -"شوند." +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie " -"language is very close to English, and it turns out there's a Rust crate " -"which does the translation." +"There's not time to wait for proper translations, but fortunately pixie language " +"is very close to English, and it turns out there's a Rust crate which does the " +"translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " -"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " -"که ترجمه را انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie " +"بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را " +"انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" -"crates/uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/" +"uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and " -"diligence. Don't ship this!)" +"(Obviously, real translations of Chrome require incredible care and diligence. " +"Don't ship this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " -"این مورد را ارسال نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این " +"مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -17617,84 +17237,88 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" "Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always " -"do this irrespective of the setting of `mangle_localized_strings_`." +"strings before display. In this special build of Chromium, it should always do " +"this irrespective of the setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " -"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " -"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را " +"قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات " +"`mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, " -"you should have created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, you " +"should have created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " -"را برای pixies ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را " +"برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " -"and will probably decide that it's better to do the conversion on the C++ " -"side using `base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and " +"will probably decide that it's better to do the conversion on the C++ side using " +"`base::UTF16ToUTF8` and back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " -"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " -"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و " +"احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::" +"UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " "consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which " -"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" -"slice.html)." +"String.html#method.from_utf16), consider error handling, and consider which [CXX " +"supported types can transfer a lot of u16s](https://cxx.rs/binding/slice.html)." msgstr "" +"اگر دانش‌آموزان تصمیم بگیرند که تبدیل را در سمت Rust انجام دهند، باید [`String::" +"from_utf16`](https://doc.rust-lang.org/std/string/struct.String.html#method را در " +"نظر بگیرند. مدیریت خطا را در نظر بگیرید و در نظر داشته باشید که کدام [نوع های " +"پشتیبانی شده از CXX می توانند تعداد زیادی از u16 ها را منتقل کنند](https://cxx.rs/" +"binding/slice.html)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. " -"taking and returning strings by value, or taking a mutable reference to a " -"string. If a mutable reference is used, CXX will likely tell the student " -"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " -"need to explain what `Pin` does, and then explain why CXX needs it for " -"mutable references to C++ data: the answer is that C++ data can't be moved " -"around like Rust data, because it may contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " -"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " -"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " -"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " -"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " -"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " -"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " -"نشانگرهای خودارجاعی (self-referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. taking " +"and returning strings by value, or taking a mutable reference to a string. If a " +"mutable reference is used, CXX will likely tell the student that they need to use " +"[`Pin`](https://doc.rust-lang.org/std/pin/). You may need to explain what `Pin` " +"does, and then explain why CXX needs it for mutable references to C++ data: the " +"answer is that C++ data can't be moved around like Rust data, because it may " +"contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. " +"گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک " +"string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که " +"باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. ممکن است لازم " +"باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به آن برای ارجاع‌های " +"قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های C++ را نمی‌توان " +"مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" +"referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " -"need to depend on a `rust_static_library` target. The student probably " -"already did this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need " +"to depend on a `rust_static_library` target. The student probably already did " +"this." msgstr "" "هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " -"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " -"داده است." +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده " +"است." #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" -"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " -"وابسته باشد." +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته " +"باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs]" -"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs](https://" +"chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" -"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review." +"googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -17702,22 +17326,22 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people " -"who are familiar with the basics of Rust (perhaps from completing the " -"Comprehensive Rust course), and ideally also have some experience with bare-" -"metal programming in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people who " +"are familiar with the basics of Rust (perhaps from completing the Comprehensive " +"Rust course), and ideally also have some experience with bare-metal programming " +"in some other language such as C." msgstr "" -"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با " -"اصول Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز " -"تجربه برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." +"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با اصول " +"Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز تجربه " +"برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." #: src/bare-metal.md msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" -"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون " -"سیستم‌عامل در ادامه به چند بخش تقسیم خواهد شد:" +"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون سیستم‌عامل " +"در ادامه به چند بخش تقسیم خواهد شد:" #: src/bare-metal.md msgid "What is `no_std` Rust?" @@ -17738,23 +17362,21 @@ msgstr "برخی از crateهای مفید برای توسعه bare-metal Rust." #: src/bare-metal.md msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " -"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " -"an on-board SWD debugger." +"(https://microbit.org/) v2 as an example. It's a [development board](https://tech." +"microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some " +"LEDs and buttons, an I2C-connected accelerometer and compass, and an on-board SWD " +"debugger." msgstr "" #: src/bare-metal.md -msgid "" -"To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" -"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس " -"یا دبیان:" +"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس یا " +"دبیان:" #: src/bare-metal.md -msgid "" -"And give users in the `plugdev` group access to the micro:bit programmer:" -msgstr "" +msgid "And give users in the `plugdev` group access to the micro:bit programmer:" +msgstr "و به کاربران گروه `plugdev` اجازه دسترسی به برنامه‌نویس micro:bit را بدهید:" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" @@ -17875,33 +17497,33 @@ msgstr "" #: src/bare-metal/minimal.md msgid "It can also be provided by another crate, such as `panic-halt`." -msgstr "" +msgstr "همچنین می‌توان آن را توسط crate دیگری مانند `panic-halt` تهیه کرد." #: src/bare-metal/minimal.md msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را " -"`panic = \"abort\"` کامپایل کنید." +"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را `panic = " +"\"abort\"` کامپایل کنید." #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to " -"define your own entry point. This will typically involve a linker script and " -"some assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to define " +"your own entry point. This will typically involve a linker script and some " +"assembly code to set things up ready for Rust code to run." msgstr "" -"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما " -"بستگی دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker " -"و مقداری کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." +"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما بستگی " +"دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker و مقداری " +"کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc." -"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-" +"lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" -"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-" -"lang.org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." +"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-lang." +"org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." #: src/bare-metal/alloc.md #, fuzzy @@ -17925,31 +17547,36 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy system " +"allocator. Other crates are available, or you can write your own or hook into " +"your existing allocator." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " -"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " -"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " +"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " +"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " -"in this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in " +"this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" +"پارامتر const `LockedHeap` حداکثر ترتیب تخصیص‌دهنده (allocator) است. یعنی در این " +"مورد می‌تواند مناطقی تا 2\\*\\*32 بایت را اختصاص دهد." #: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in " -"the top-level binary crate." +"exactly one global allocator defined in your binary. Usually this is done in the " +"top-level binary crate." msgstr "" +"اگر هر crate ای در درخت وابستگی شما به `alloc` بستگی دارد، باید دقیقاً یک " +"تخصیص‌دهنده سراسری در باینری خود تعریف کنید. معمولاً این کار در binary crate سطح " +"بالا انجام می‌شود." #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " -"crate is linked in so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate " +"is linked in so we get its panic handler." msgstr "" "برای اطمینان از اینکه `panic_halt` crate لینک شده است، استفاده `extern crate " "panic_halt as _` ضروری است، بنابراین panic handler آن را دریافت می‌کنیم." @@ -17960,27 +17587,27 @@ msgstr "این مثال ساخته می شود اما اجرا نمی‌شود، #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for " -"Cortex M microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex " +"M microcontrollers." msgstr "" -"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای " -"میکروکنترلرهای Cortex M فراهم می‌کند." +"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای میکروکنترلرهای " +"Cortex M فراهم می‌کند." #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" -"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع " -"بررسی خواهیم کرد." +"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع بررسی " +"خواهیم کرد." #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" -"> !`, because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, " +"because returning to the reset handler doesn't make sense." msgstr "" -"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::" -"entry` باشد، زیرا بازگشت به reset handler منطقی نیست." +"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::entry` " +"باشد، زیرا بازگشت به reset handler منطقی نیست." #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" @@ -17988,8 +17615,8 @@ msgstr "مثال را با `cargo embed --bin minimal` اجرا کنید" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try " -"turning on an LED on our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning " +"on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -18007,8 +17634,7 @@ msgstr "// GPIO peripheral offsets\n" msgid "// PIN_CNF fields\n" msgstr "// PIN_CNF fields\n" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" @@ -18023,8 +17649,7 @@ msgstr "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" @@ -18032,13 +17657,11 @@ msgstr "// Set pin 28 low and pin 21 high to turn the LED on.\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " -"to the first row." -msgstr "" -"در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to " +"the first row." +msgstr "در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." -#: src/bare-metal/microcontrollers/mmio.md -#: src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" @@ -18051,37 +17674,37 @@ msgstr "Crateهای دسترسی جانبی" #: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" -"pack/doc/CMSIS/SVD/html/index.html) files." +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/" +"doc/CMSIS/SVD/html/index.html) files." msgstr "" -"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust " -"عمدتاً ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD]" -"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." +"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust عمدتاً " +"ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD](https://www." +"keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by " -"silicon vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by silicon " +"vendors which describe the memory map of the device." msgstr "" -"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً " -"توسط فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را " -"توصیف می‌کنند." +"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً توسط " +"فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را توصیف می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "" "They are organised by peripheral, register, field and value, with names, " "descriptions, addresses and so on." msgstr "" +"آنها بر اساس peripheral، register، field و value، با نام، توضیحات، آدرس و غیره " +"سازماندهی می‌شوند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects " -"which patch the mistakes, add missing details, and publish the generated " -"crates." +"SVD files are often buggy and incomplete, so there are various projects which " +"patch the mistakes, add missing details, and publish the generated crates." msgstr "" -"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد " -"که اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید " -"شده را منتشر می‌کنند." +"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد که " +"اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید شده را " +"منتشر می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." @@ -18089,9 +17712,11 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " -"pac -- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac " +"-- -d --no-show-raw-insn` to see the resulting binary." msgstr "" +"اگر`cargo install cargo-binutils` را انجام دهید، می‌توانید `cargo objdump --bin " +"pac -- -d --no-show-raw-insn` را اجرا کنید تا باینری حاصل را ببینید." #: src/bare-metal/microcontrollers/hals.md msgid "HAL crates" @@ -18100,14 +17725,14 @@ msgstr "HAL crates" #: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around " -"various peripherals. These generally implement traits from [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal)." +"implementation-crates) for many microcontrollers provide wrappers around various " +"peripherals. These generally implement traits from [`embedded-hal`](https://" +"crates.io/crates/embedded-hal)." msgstr "" "این [crateهای HAL]‌(https://github.com/rust-embedded/wesome-embedded-rust#hal-" "implementation-crates) برای بسیاری از میکروکنترلرها بسته‌بندی‌هایی را در اطراف " -"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`]" -"(https://crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." +"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`](https://" +"crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" @@ -18120,8 +17745,8 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various " -"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, " +"GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" "بسیاری از HAL crateها برای انواعی از دستگاه های Cortex-M و RISC-V از جمله " "میکروکنترلرهای STM32، GD32، nRF، NXP، MSP430، AVR و PIC مختلف وجود دارد." @@ -18133,23 +17758,27 @@ msgstr "Board support crates" #: src/bare-metal/microcontrollers/board-support.md #, fuzzy msgid "" -"Board support crates provide a further level of wrapping for a specific " -"board for convenience." +"Board support crates provide a further level of wrapping for a specific board for " +"convenience." msgstr "" -"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک " -"board خاص فراهم می‌کنند." +"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک board " +"خاص فراهم می‌کنند." #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, " -"and a bit of initialisation." +"In this case the board support crate is just providing more useful names, and a " +"bit of initialisation." msgstr "" +"در این مورد crate پشتیبانی برد فقط نام‌های مفیدتر و مقداری مقداردهی اولیه را ارائه " +"می‌دهد." #: src/bare-metal/microcontrollers/board-support.md msgid "" "The crate may also include drivers for some on-board devices outside of the " "microcontroller itself." msgstr "" +"این crate ممکن است شامل درایورهایی برای برخی از دستگاه‌های داخلی خارج از خود " +"میکروکنترلر نیز باشد." #: src/bare-metal/microcontrollers/board-support.md msgid "`microbit-v2` includes a simple driver for the LED matrix." @@ -18157,7 +17786,7 @@ msgstr "ء `microbit-v2` شامل یک درایور ساده برای ماتری #: src/bare-metal/microcontrollers/type-state.md msgid "The type state pattern" -msgstr "" +msgstr "یک تایپ state pattern" #: src/bare-metal/microcontrollers/type-state.md #, fuzzy @@ -18171,49 +17800,54 @@ msgstr "// pin_input.is_high(); // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can " -"exist. Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. " +"Once a pin is moved out of the port struct nobody else can take it." msgstr "" -"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام " -"می‌تواند وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس " -"دیگری نمی تواند آن را بگیرد." +"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام می‌تواند " +"وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس دیگری نمی " +"تواند آن را بگیرد." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you " -"can’t keep use the old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you can’t " +"keep use the old instance afterwards." msgstr "" -"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از " -"آن از pin قدیمی استفاده کنید." +"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از آن از " +"pin قدیمی استفاده کنید." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, " -"the configuration state of a GPIO pin. This encodes the state machine into " -"the type system, and ensures that you don't try to use a pin in a certain " -"way without properly configuring it first. Illegal state transitions are " -"caught at compile time." +"The type of a value indicates the state that it is in: e.g. in this case, the " +"configuration state of a GPIO pin. This encodes the state machine into the type " +"system, and ensures that you don't try to use a pin in a certain way without " +"properly configuring it first. Illegal state transitions are caught at compile " +"time." msgstr "" +"این type یک مقدار state را نشان می‌دهد که در آن قرار دارد: به عنوان مثال. در این " +"مورد، وضعیت پیکربندی یک پین GPIO. این state machine را در type system رمزگذاری " +"می‌کند و تضمین می‌کند که سعی نکنید از pin به روشی خاص استفاده کنید بدون اینکه ابتدا " +"آن را به درستی پیکربندی کنید. state transition غیرمجاز در زمان کامپایل شناسایی " +"می‌شود." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but " -"not vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but not " +"vice-versa." msgstr "" -"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی " -"فراخوانی کنید، اما برعکس امکان پذیر نیست." +"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی فراخوانی " +"کنید، اما برعکس امکان پذیر نیست." #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." -msgstr "" +msgstr "بسیاری از HAL crateها از این الگو پیروی می‌کنند." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" -"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی " -"ویژگی را ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" +"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی ویژگی را " +"ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" @@ -18233,75 +17867,76 @@ msgstr "گذرگاه‌ها و دستگاه‌های I2C و SPI" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " -"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" -"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" -"crates.io/crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out " +"into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`]" +"(https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/" +"crates/rand_core) respectively." msgstr "" -"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم " -"شدن به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-" -"can`](https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates." -"io/crates/rand_core) به ترتیب." +"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم شدن " +"به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-can`]" +"(https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates.io/crates/" +"rand_core) به ترتیب." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-" +"embedded-rust#driver-crates) in terms of these traits, e.g. an accelerometer " +"driver might need an I2C or SPI device instance." msgstr "" -"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-" -"embedded-rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به " -"عنوان مثال. یک درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز " -"داشته باشد." +"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-embedded-" +"rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به عنوان مثال. یک " +"درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز داشته باشد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring " -"them, as initialisation and configuration is usually highly platform-" -"specific." +"The traits cover using the peripherals but not initialising or configuring them, " +"as initialisation and configuration is usually highly platform-specific." msgstr "" +"این ویژگی‌ها با استفاده از وسایل جانبی(peripherals) پوشش می‌دهند، اما آنها را " +"مقداردهی اولیه یا پیکربندی نمی‌کنند، زیرا مقداردهی اولیه و پیکربندی معمولاً به " +"پلتفرم خاص بستگی دارد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other " -"platforms such as Linux on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other platforms " +"such as Linux on Raspberry Pi." msgstr "" +"پیاده‌سازی‌هایی برای بسیاری از میکروکنترلرها و همچنین پلتفرم‌های دیگری مانند لینوکس " +"در Raspberry Pi وجود دارد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " -"نسخه‌های async از traitها را ارائه می دهد." +" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) نسخه‌های " +"async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " -"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" -"crates/nb) crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another " +"approach to non-blocking I/O, based on the [`nb`](https://crates.io/crates/nb) " +"crate." msgstr "" -"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد " -"دیگری را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// " -"crates.io/crates/nb) crate است." +"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد دیگری " +"را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// crates.io/" +"crates/nb) crate است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " -"like OpenOCD but better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like " +"OpenOCD but better integrated." msgstr "" -"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی " -"جاسازی شده است، مانند OpenOCD است، اما بهتر یکپارچه شده است." +"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی جاسازی شده " +"است، مانند OpenOCD است، اما بهتر یکپارچه شده است." #: src/bare-metal/microcontrollers/probe-rs.md -msgid "" -"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" -msgstr "" -"SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" +msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgstr "SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" -msgstr "" +msgstr "GDB stub و Microsoft DAP (Debug Adapter Protocol) server" #: src/bare-metal/microcontrollers/probe-rs.md msgid "Cargo integration" @@ -18309,54 +17944,53 @@ msgstr "ادغام Cargo" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " -"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." -"toml` file in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real " +"Time Transfers) output and connect GDB. It's configured by an `Embed.toml` file " +"in your project directory." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " -"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " -"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " +"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " +"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " -"an Arm standard protocol over USB for an in-circuit debugger to access the " -"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " -"on-board debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm " +"standard protocol over USB for an in-circuit debugger to access the CoreSight " +"Debug Access Port of various Arm Cortex processors. It's what the on-board " +"debugger on the BBC micro:bit uses." msgstr "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک " -"پروتکل استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی " -"به پورت CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد " -"استفاده قرار گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از " -"آن استفاده می‌کند." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک پروتکل " +"استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی به پورت " +"CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد استفاده قرار " +"گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از آن استفاده می‌کند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " -"is a range from SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a " +"range from SEGGER." msgstr "" -"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link " -"محدوده ای از SEGGER است." +"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link محدوده ای " +"از SEGGER است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " -"Serial Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial " +"Wire Debug." msgstr "" +"پورت دسترسی Debug معمولا یا یک رابط JTAG 5 پین یا Serial Wire Debug 2 پین است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"probe-rs is a library which you can integrate into your own tools if you " -"want to." +"probe-rs is a library which you can integrate into your own tools if you want to." msgstr "" -"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود " -"ادغام کنید." +"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود ادغام " +"کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" -"adapter-protocol/) lets VSCode and other IDEs debug code running on any " -"supported microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-" +"protocol/) lets VSCode and other IDEs debug code running on any supported " +"microcontroller." msgstr "" "[پروتکل آداپتور Debug مایکروسافت](https://microsoft.github.io/debug-adapter-" "protocol/) به VSCode و سایر IDE‌ها اجازه می‌دهد کدهای موجود در هر میکروکنترلر " @@ -18365,20 +17999,19 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده " -"است." +"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " -"host and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host " +"and the target through a number of ringbuffers." msgstr "" -"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و " -"target از طریق تعدادی بافر حلقه‌ای (ringbuffers) است." +"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و target از " +"طریق تعدادی بافر حلقه‌ای (ringbuffers) است." #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" -msgstr "" +msgstr "_Embed.toml_:" #: src/bare-metal/microcontrollers/debugging.md msgid "In one terminal under `src/bare-metal/microcontrollers/examples/`:" @@ -18410,11 +18043,10 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +msgid "Shared resource management, message passing, task scheduling, timer queue" msgstr "" -"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر " -"(timer queue)" +"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر (timer " +"queue)" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" @@ -18433,8 +18065,7 @@ msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از " -"حافظه" +"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از حافظه" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" @@ -18442,9 +18073,11 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged " +"drivers, IPC" msgstr "" +"یک Microkernel RTOS از شرکت Oxide Computer با protection از حافظه، درایورهای " +"غیرمجاز و IPC" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" @@ -18452,17 +18085,16 @@ msgstr "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." -"github.io/book/overview/using-the-standard-library.html)." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github." +"io/book/overview/using-the-standard-library.html)." msgstr "" -"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-" -"rs.github.io/book/overview/using-the-standard-library.html)." +"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-rs." +"github.io/book/overview/using-the-standard-library.html)." #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر " -"گرفت." +"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر گرفت." #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." @@ -18470,17 +18102,18 @@ msgstr "این شامل هیچ HAL نیست." #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " -"scheduling rather than a proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling " +"rather than a proper kernel." msgstr "" +"از Cortex-M NVIC (کنترل‌کننده وقفه مجازی تودرتو-Nested Virtual Interrupt " +"Controller) برای زمان‌بندی به جای یک هسته مناسب استفاده می‌کند." #: src/bare-metal/microcontrollers/other-projects.md msgid "Cortex-M only." msgstr "Cortex-M فقط." #: src/bare-metal/microcontrollers/other-projects.md -msgid "" -"Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" "گوگل از TockOS در میکروکنترلر Haven برای کلیدهای امنیتی Titan استفاده می‌کند." @@ -18489,31 +18122,32 @@ msgid "" "FreeRTOS is mostly written in C, but there are Rust bindings for writing " "applications." msgstr "" +"در واقع FreeRTOS بیشتر به زبان C نوشته شده است، اما رابط‌های Rust برای نوشتن " +"برنامه‌ها در این حالت وجود دارد." #: src/exercises/bare-metal/morning.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port." -msgstr "" -"ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." +"We will read the direction from an I2C compass, and log the readings to a serial " +"port." +msgstr "ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-" -"morning.md) provided." +"After looking at the exercises, you can look at the [solutions](solutions-morning." +"md) provided." msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " -"نگاه کنید." +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه " +"کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a " -"serial port. If you have time, try displaying it on the LEDs somehow too, or " -"use the buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a serial " +"port. If you have time, try displaying it on the LEDs somehow too, or use the " +"buttons somehow." msgstr "" -"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. " -"اگر وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از " -"دکمه‌ها استفاده کنید." +"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. اگر " +"وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از دکمه‌ها " +"استفاده کنید." #: src/exercises/bare-metal/compass.md msgid "Hints:" @@ -18521,56 +18155,56 @@ msgstr "نکته‌ها:" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" -"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" -"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." -"org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/" +"lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) " +"crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." msgstr "" -"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و " -"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه " -"crateهای آن را بررسی کنید همانطور که [micro:bit hardware](https://tech." -"microbit.org/hardware/) را بررسی می‌کنید." +"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و [`microbit-" +"v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه crateهای آن را بررسی " +"کنید همانطور که [micro:bit hardware](https://tech.microbit.org/hardware/) را " +"بررسی می‌کنید." #: src/exercises/bare-metal/compass.md msgid "" "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." -msgstr "" +msgstr "واحد اندازه‌گیری اینرسی در قطعه LSM303AGR به bus داخلی I2C متصل است." #: src/exercises/bare-metal/compass.md -msgid "" -"TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" "TWI نام دیگری برای I2C است، بنابراین دستگاه جانبی اصلی I2C TWIM نامیده می‌شود." #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" -"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" -"microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` " +"trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/" +"hal/struct.Twim.html) struct implements this." msgstr "" +"درایور LSM303AGR به چیزی نیاز دارد که ویژگی `embedded_hal::i2c::I2c` را اجرا کند. " +"ساختار[`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/hal/" +"struct.Twim.html) این مورد را پیاده‌سازی می‌کند." #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct." +"Board.html) struct with fields for the various pins and peripherals." msgstr "" -"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/" -"microbit/struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف " -"دارید." +"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف دارید." #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " -"this exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/" +"pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this " +"exercise." msgstr "" -"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi." -"com/pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." +"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi.com/" +"pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " +"in the `compass` directory for the following files." msgstr "" "این [الگوی تمرین](../../comprehensive-rust-exercises.zip) را دانلود کنید و " "فایل‌های زیر را در دایرکتوری `compass` جستجو کنید." @@ -18585,7 +18219,7 @@ msgstr "_Cargo.toml_ (نیاز به تغییر ندارد):" #: src/exercises/bare-metal/compass.md msgid "_Embed.toml_ (you shouldn't need to change this):" -msgstr "" +msgstr "_Embed.toml_ (نیازی به تغییر این نیست):" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_.cargo/config.toml_ (you shouldn't need to change this):" @@ -18596,10 +18230,8 @@ msgid "See the serial output on Linux with:" msgstr "مشاهده خروجی سریال در لینوکس با:" #: src/exercises/bare-metal/compass.md -msgid "" -"Or on Mac OS something like (the device name may be slightly different):" -msgstr "" -"یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" +msgid "Or on Mac OS something like (the device name may be slightly different):" +msgstr "یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." @@ -18652,29 +18284,26 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md #, fuzzy msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" msgstr "" -"// If button A is pressed, switch to the next mode and briefly blink all " -"LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" " // on.\n" #: src/bare-metal/aps.md msgid "Application processors" -msgstr "" +msgstr "Application processors" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now " +"let's try writing something for Cortex-A. For simplicity we'll just work with " +"QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " +"board." msgstr "" -"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا " -"بیایید سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's " -"aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " -"کار می‌کنیم." +"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا بیایید " +"سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's aarch64 " +"['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) کار می‌کنیم." #: src/bare-metal/aps.md msgid "" @@ -18692,16 +18321,15 @@ msgid "" "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" -"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی " -"می کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای " -"ماشین‌های مجازی طراحی شده است." +"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی می " +"کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای ماشین‌های " +"مجازی طراحی شده است." #: src/bare-metal/aps/entry-point.md -msgid "" -"Before we can start running Rust code, we need to do some initialisation." +msgid "Before we can start running Rust code, we need to do some initialisation." msgstr "" -"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه " -"را انجام دهیم." +"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه را " +"انجام دهیم." #: src/bare-metal/aps/entry-point.md msgid "" @@ -18710,8 +18338,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU " +"and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18730,8 +18358,7 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18741,8 +18368,7 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18783,8 +18409,8 @@ msgstr "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" +" * Load and apply the memory management configuration, ready to enable MMU " +"and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18803,8 +18429,7 @@ msgstr "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" +" * Ensure everything before this point has completed, then invalidate any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18814,8 +18439,7 @@ msgstr "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18853,60 +18477,73 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, " -"zeroing the BSS, and setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, zeroing " +"the BSS, and setting up the stack pointer." msgstr "" -"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر " -"کردن BSS و تنظیم stack pointer." +"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر کردن " +"BSS و تنظیم stack pointer." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the " -"object file which containing statically allocated variables which are " -"initialised to zero. They are omitted from the image, to avoid wasting space " -"on zeroes. The compiler assumes that the loader will take care of zeroing " -"them." +"The BSS (block starting symbol, for historical reasons) is the part of the object " +"file which containing statically allocated variables which are initialised to " +"zero. They are omitted from the image, to avoid wasting space on zeroes. The " +"compiler assumes that the loader will take care of zeroing them." msgstr "" +"این BSS (نماد شروع بلوک، به دلایل تاریخی) بخشی از object file است که حاوی " +"متغیرهای تخصیص یافته استاتیکی است که مقدار اولیه آنها صفر است. برای جلوگیری از " +"اتلاف فضا روی صفر، آنها از تصویر حذف شده‌اند. کامپایلر فرض می‌کند که لودر از صفر " +"کردن آنها مراقبت می‌کند." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and " -"the image is loaded, but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and the " +"image is loaded, but we zero it to be sure." msgstr "" +"ممکن است BSS قبلاً صفر شده باشد، بسته به اینکه چگونه حافظه مقداردهی اولیه شده و " +"تصویر بارگذاری شده است، اما برای اطمینان آن را صفر می‌کنیم." #: src/bare-metal/aps/entry-point.md msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If " -"we don't:" +"We need to enable the MMU and cache before reading or writing any memory. If we " +"don't:" msgstr "" -"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار " -"را نکنیم:" +"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار را " +"نکنیم:" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-" -"unknown-none` target which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses, so it should be fine in this case, but this " -"is not necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-" +"none` target which sets `+strict-align` to prevent the compiler generating " +"unaligned accesses, so it should be fine in this case, but this is not " +"necessarily the case in general." msgstr "" +"دسترسی‌های بدون تراز خطا خواهند داشت. ما کد Rust را برای هدف`aarch64-unknown-none` " +"می‌سازیم که `+strict-align` را تنظیم می‌کند تا از ایجاد دسترسی‌های بدون تراز توسط " +"کامپایلر جلوگیری کند، بنابراین در این مورد باید خوب باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost when the cache " -"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " -"not VA or IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The problem " +"is that the VM is accessing memory directly with the cache disabled, while the " +"host has cacheable aliases to the same memory. Even if the host doesn't " +"explicitly access the memory, speculative accesses can lead to cache fills, and " +"then changes from one or the other will get lost when the cache is cleaned or the " +"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" msgstr "" +"اگر در VM اجرا می‌شد، این کار می‌تواند منجر به مشکلات انسجام cache شود. مشکل این " +"است که VM مستقیماً با حافظه cache غیرفعال شده به حافظه دسترسی پیدا می‌کند، در حالی " +"که host دارای نام مستعار قابل cache برای همان حافظه است. حتی اگر cache به طور " +"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های گمانه‌زنی می‌تواند منجر به پر شدن حافظه " +"cache شود، و پس از پاک شدن حافظه cache یا فعال کردن حافظه توسط VM، تغییرات از یک " +"یا دیگری از بین می‌رود. (حافظه cache با آدرس فیزیکی کلید می‌خورد، نه VA یا IPA.)" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " -"identity maps the first 1 GiB of address space for devices, the next 1 GiB " -"for DRAM, and another 1 GiB higher up for more devices. This matches the " -"memory layout that QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity " +"maps the first 1 GiB of address space for devices, the next 1 GiB for DRAM, and " +"another 1 GiB higher up for more devices. This matches the memory layout that " +"QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -18914,15 +18551,18 @@ msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" -"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در " -"مورد آن خواهیم دید." +"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در مورد " +"آن خواهیم دید." #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 " -"(EL1). If you need to run at a different exception level you'll need to " -"modify `entry.S` accordingly." +"All examples this afternoon assume we will be running at exception level 1 (EL1). " +"If you need to run at a different exception level you'll need to modify `entry.S` " +"accordingly." msgstr "" +"همه مثال‌ها امروز بعد از ظهر فرض می‌کنند که ما در سطح استثنا 1 (EL1) اجرا خواهیم " +"کرد. اگر نیاز به اجرا در سطح استثنایی متفاوت دارید، باید `entry.S`را بر این اساس " +"تغییر دهید." #: src/bare-metal/aps/inline-assembly.md msgid "Inline assembly" @@ -18930,13 +18570,13 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with " -"Rust code. For example, to make an HVC (hypervisor call) to tell the " -"firmware to power off the system:" +"Sometimes we need to use assembly to do things that aren't possible with Rust " +"code. For example, to make an HVC (hypervisor call) to tell the firmware to power " +"off the system:" msgstr "" "گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " -"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " -"که به firmware بگویید سیستم را خاموش کند:" +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به " +"firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -18994,58 +18634,56 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of " -"functions to manage system and CPU power states, among other things. It is " -"implemented by EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of functions " +"to manage system and CPU power states, among other things. It is implemented by " +"EL3 firmware and hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " -"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " -"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای " +"مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط " +"میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the " -"inline assembly code, and ignore its contents afterwards. We need to use " -"`inout` rather than `in` because the call could potentially clobber the " -"contents of the registers." +"The `0 => _` syntax means initialise the register to 0 before running the inline " +"assembly code, and ignore its contents afterwards. We need to use `inout` rather " +"than `in` because the call could potentially clobber the contents of the " +"registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " -"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " -"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " -"محتویات رجیسترها را مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی " +"به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به " +"جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را " +"مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is " +"called from our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " -"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه " +"ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " -"used by the bootloader to pass things like a pointer to the device tree. " -"According to the standard aarch64 calling convention (which is what `extern " -"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " -"arguments passed to a function, so `entry.S` doesn't need to do anything " -"special except make sure it doesn't change these registers." -msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " -"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " -"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " -"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " -"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " -"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " -"نمی‌دهد." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used " +"by the bootloader to pass things like a pointer to the device tree. According to " +"the standard aarch64 calling convention (which is what `extern \"C\"` specifies " +"to use), registers `x0`–`x7` are used for the first 8 arguments passed to a " +"function, so `entry.S` doesn't need to do anything special except make sure it " +"doesn't change these registers." +msgstr "" +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader " +"برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد " +"فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` برای استفاده مشخص " +"می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده به یک تابع استفاده " +"می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست کار خاصی انجام " +"دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" -"examples`." +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -19064,45 +18702,44 @@ msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " -"ساختارها را دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را " +"دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent " -"the compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent the " +"compiler or hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " -"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " -"حذف آنها جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته " +"باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها " +"جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the " -"compiler may assume that the value read is the same as the value just " -"written, and not bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the compiler " +"may assume that the value read is the same as the value just written, and not " +"bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " -"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " -"است و در واقع خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر " +"ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع " +"خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but " -"this is unsound. Whenever a reference exist, the compiler may choose to " -"dereference it." +"Some existing crates for volatile access to hardware do hold references, but this " +"is unsound. Whenever a reference exist, the compiler may choose to dereference it." msgstr "" "برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " -"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " -"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته " +"باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " -"ساختار استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار " +"استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -19110,11 +18747,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" -"documentation/ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) UART, so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" -"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/" +"g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -19129,10 +18766,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -19140,10 +18775,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the 8 MMIO control registers of a\n" +" /// PL011 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -19177,40 +18810,37 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is " -"because as long as the caller of `Uart::new` guarantees that its safety " -"requirements are met (i.e. that there is only ever one instance of the " -"driver for a given UART, and nothing else aliasing its address space), then " -"it is always safe to call `write_byte` later because we can assume the " -"necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is because " +"as long as the caller of `Uart::new` guarantees that its safety requirements are " +"met (i.e. that there is only ever one instance of the driver for a given UART, " +"and nothing else aliasing its address space), then it is always safe to call " +"`write_byte` later because we can assume the necessary preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " -"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " -"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " -"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " -"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " -"را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن " +"هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که " +"الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص " +"وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس همیشه می‌توان " +"`write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but " -"`write_byte` unsafe), but that would be much less convenient to use as every " -"place that calls `write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but `write_byte` " +"unsafe), but that would be much less convenient to use as every place that calls " +"`write_byte` would need to reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " -"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " -"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " -"استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما " +"`write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر " +"مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving " -"the burden of proof for soundness from a large number of places to a smaller " -"number of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving the " +"burden of proof for soundness from a large number of places to a smaller number " +"of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " -"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت " +"عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" @@ -19218,10 +18848,9 @@ msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more " -"traits too." -msgstr "" -"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +"We derived the `Debug` trait. It would be useful to implement a few more traits " +"too." +msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -19245,8 +18874,8 @@ msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -19257,15 +18886,15 @@ msgstr "یک درایور UART بهتر" msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to " -"read. Plus, some of them are bit fields which would be nice to access in a " -"structured way." +"offsets to construct pointers to access them is error-prone and hard to read. " +"Plus, some of them are bit fields which would be nice to access in a structured " +"way." msgstr "" "‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " -"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " -"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " -"به آنها به روشی ساختاریافته خوب است." +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند خواندن " +"را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی به آنها به " +"روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -19429,8 +19058,8 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " -"working with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working " +"with bitflags." msgstr "" "این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " "bitflags مفید است." @@ -19487,37 +19116,34 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a " +"bunch of method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " -"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی " +"متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "" -"We can use a struct to represent the memory layout of the UART's registers." +msgid "We can use a struct to represent the memory layout of the UART's registers." msgstr "" -"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " -"کنیم." +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to " -"(among other things) reorder fields however it sees fit." +"predictable layout, as default Rust representation allows the compiler to (among " +"other things) reorder fields however it sees fit." msgstr "" "‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " -"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " -"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " -"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " -"کند." +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این " +"پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای داشتن یک طرح " +"قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر اجازه می دهد تا (از " +"جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب کند." #: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." @@ -19563,8 +19189,8 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " -"fields without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields " +"without creating an intermediate reference, which would be unsound." msgstr "" "به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " "جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." @@ -19575,11 +19201,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, " -"and echo incoming bytes." +"Let's write a small program using our driver to write to the serial console, and " +"echo incoming bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " -"بنویسیم و بایت‌های ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم " +"و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -19620,30 +19246,27 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` function " +"is called from our entry point code in `entry.S`. See the speaker notes there for " +"details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " -"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " -"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از " +"کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های " +"سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`]" -"(https://crates.io/crates/log) crate. We can do this by implementing the " -"`Log` trait." +"It would be nice to be able to use the logging macros from the [`log`](https://" +"crates.io/crates/log) crate. We can do this by implementing the `Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" -"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " -"دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/" +"log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -19659,8 +19282,8 @@ msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " -"مقداردهی اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی " +"اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." @@ -19681,40 +19304,39 @@ msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " -"اجرا کنید." +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " -"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " -"We implement this in assembly to save volatile registers to the stack before " -"calling into Rust code:" +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, " +"current EL with SPx, lower EL using AArch64, lower EL using AArch32). We " +"implement this in assembly to save volatile registers to the stack before calling " +"into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " -"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " -"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " -"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " -"فراخوانی Rust در stack ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، " +"IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL " +"using AArch64, lower EL using AArch32) تعریف می‌کند. ما این کار را در اسمبلی " +"پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از فراخوانی Rust در stack " +"ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "" -"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current " -"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current EL " +"exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " -"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 " +"برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't " -"expect any of them to actually happen." +"For this example we just log the exception and power down, as we don't expect any " +"of them to actually happen." msgstr "" "برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " "نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." @@ -19722,20 +19344,19 @@ msgstr "" #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or " -"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." -"md) will control what we can share between them, just like with threads. For " -"example, if we want to share some value between exception handlers and the " -"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " -"it in something like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or less " +"like different threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will " +"control what we can share between them, just like with threads. For example, if " +"we want to share some value between exception handlers and the rest of the " +"program, and it's `Send` but not `Sync`, then we'll need to wrap it in something " +"like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " -"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." -"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " -"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " -"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " -"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " -"قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای " +"مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که " +"می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای " +"مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و بقیه برنامه به اشتراک " +"بگذاریم که بیشتر در مورد `Send` است اما مربوط به `Sync` نیست، باید آن را در چیزی " +"مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -19756,27 +19377,27 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" +"OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" -"raspberrypi-OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" +"OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception " +"handling, page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " -"exception و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception " +"و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " -"برای کپی کردن برای کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای " +"کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -19788,44 +19409,43 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. " +"This will read and write memory (e.g. the stack). However:" msgstr "" "آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " -"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " -"بااین‌حال:" +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-" +"unknown-none` which sets `+strict-align` to prevent the compiler generating " +"unaligned accesses so it should be alright, but this is not necessarily the case " +"in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " -"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " -"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " -"صحیح باشد، اما لزوماً اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-" +"unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های " +"غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً " +"اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." -msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " -"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " -"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " -"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " -"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " -"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " -"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." +"If it were running in a VM, this can lead to cache coherency issues. The problem " +"is that the VM is accessing memory directly with the cache disabled, while the " +"host has cacheable aliases to the same memory. Even if the host doesn't " +"explicitly access the memory, speculative accesses can lead to cache fills, and " +"then changes from one or the other will get lost. Again this is alright in this " +"particular case (running directly on the hardware with no hypervisor), but isn't " +"a good pattern in general." +msgstr "" +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. " +"مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا " +"می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. حتی اگر host به طور " +"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش " +"شود و سپس تغییرات از یکی پس از دیگری از بین می‌رود. باز هم در این مورد خاص درست " +"است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما به‌طورکلی الگوی خوبی " +"نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" @@ -19836,42 +19456,41 @@ msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" -"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " -"را حل می‌کند." +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل " +"می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " -"traits and macros for safely converting between byte sequences and other " -"types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits " +"and macros for safely converting between byte sequences and other types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " -"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی " +"را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " -"but can be useful for working with structures shared with hardware e.g. by " -"DMA, or sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but " +"can be useful for working with structures shared with hardware e.g. by DMA, or " +"sent over some external interface." msgstr "" "این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " -"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " -"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط " +"DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is " -"valid, and so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is valid, and " +"so can safely be converted from an untrusted sequence of bytes." msgstr "" "‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " -"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " -"تبدیل کرد." +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل " +"کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not " -"all byte patterns are valid." +"`RequestType` doesn't use all possible u32 values as discriminants, so not all " +"byte patterns are valid." msgstr "" "تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " "`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " @@ -19879,29 +19498,25 @@ msgstr "" #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "" -"`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"zerocopy-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-" +"example/`. (It won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" -"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا " +"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " -"you create page tables according to the AArch64 Virtual Memory System " -"Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you " +"create page tables according to the AArch64 Virtual Memory System Architecture." msgstr "" "این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " -"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " -"کنید." +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -19920,50 +19535,47 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." +"For now it only supports EL1, but support for other exception levels should be " +"straightforward to add." msgstr "" -"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " -"ساده باشد." +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده " +"باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" -"android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/) استفاده می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/" +"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده " +"می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware or " +"under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " -"یا تحت QEMU اجرا شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت " +"QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a " +"third-party crate implementing a basic buddy system allocator. It can be used " +"both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" "buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " -"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " -"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" -"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " -"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." -"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " -"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " -"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " -"اختصاص دهیم:" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " +"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other " +"address space. For example, we might want to allocate MMIO space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک " +"third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن " +"را هم برای ['LockedHeap'](https://docs.rs/buddy_system_allocator/0.9.0/" +"buddy_system_allocator/struct.LockedHeap.html) در پیاده‌سازی [`GlobalAlloc`]‌" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) استفاده کرد. " +"بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " +"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم " +"فضای MMIO را برای PCI BARها اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -19971,32 +19583,29 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/" -"allocator-example/`. (It won't run in the Playground because of the crate " -"dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-" +"example/`. (It won't run in the Playground because of the crate dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " -"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا " +"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without " -"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " -"this: a vector backed by an array or slice, which could be statically " -"allocated or on the stack, which keeps track of how many elements are used " -"and panics if you try to use more than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without heap " +"allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector " +"backed by an array or slice, which could be statically allocated or on the stack, " +"which keeps track of how many elements are used and panics if you try to use more " +"than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " -"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " -"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " -"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " -"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " -"کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما " +"بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را " +"فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت " +"ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده شده را ردیابی می‌کند و " +"اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"`tinyvec` requires that the element type implement `Default` for " -"initialisation." +"`tinyvec` requires that the element type implement `Default` for initialisation." msgstr "" "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." @@ -20004,14 +19613,14 @@ msgstr "" msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " -"داخلی اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " -"are not available in `core` or `alloc`. How can we manage synchronisation or " -"interior mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are " +"not available in `core` or `alloc`. How can we manage synchronisation or interior " +"mutability, such as for sharing state between different CPUs?" msgstr "" "‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " "`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " @@ -20022,51 +19631,48 @@ msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " -"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، " +"بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" -"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " -"کنید." +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." #: src/bare-metal/useful-crates/spin.md msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " -"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و " +"`Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " -"useful types for late initialisation with a slightly different approach to " -"`spin::once::Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful " +"types for late initialisation with a slightly different approach to `spin::once::" +"Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " -"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" -"once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های " +"مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "" -"The Rust Playground includes `spin`, so this example will run fine inline." +msgid "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" -"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " -"اجرا می‌شود." +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا " +"می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a " -"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " -"with a linker script to produce the binary itself, and then a `raw_binary` " -"to convert the ELF to a raw binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` " +"Soong rule to build your Rust code, then a `cc_binary` with a linker script to " +"produce the binary itself, and then a `raw_binary` to convert the ELF to a raw " +"binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " -"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " -"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " -"ELF به یک raw binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong " +"برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script " +"برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw " +"binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -20076,31 +19682,30 @@ msgstr "vmbase" #, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" -"libs/libvmbase/) library provides a linker script and useful defaults for " -"the build rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/" +"libvmbase/) library provides a linker script and useful defaults for the build " +"rules, along with an entry point, UART console logging and more." msgstr "" "برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" -"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" -"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " -"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " -"موارد دیگر." +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/" +"heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای " +"این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و موارد دیگر." #: src/bare-metal/android/vmbase.md msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` " -"entry point." +"The `main!` macro marks your main function, to be called from the `vmbase` entry " +"point." msgstr "" -"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " -"فراخوانی شود." +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی " +"شود." #: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " -"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main " +"function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -20111,11 +19716,10 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " -"شده نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده " +"نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" @@ -20123,28 +19727,27 @@ msgstr "RTC driver" #, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " -"you should write a driver for it." +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, you " +"should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." -"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " -"برای آن بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/" +"documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن " +"بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the " -"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the [`chrono`]" +"(https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " -"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " -"کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`]" +"(https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given " -"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" -"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given time, " +"e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-" +"lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" "از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " "بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" @@ -20152,14 +19755,13 @@ msgstr "" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by " -"the RTC match. You can use the driver provided in the [`arm-gic`](https://" -"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by the " +"RTC match. You can use the driver provided in the [`arm-gic`](https://docs.rs/arm-" +"gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " -"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" -"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " -"کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را " +"مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/" +"arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -20170,24 +19772,22 @@ msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" -"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " -"به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به " +"حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " -"look in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " +"in the `rtc` directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " -"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های " +"زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " -"the exercise):" -msgstr "" -"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the " +"exercise):" +msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -20362,10 +19962,8 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -20373,10 +19971,8 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" +" /// The given base address must point to the MMIO control registers of a\n" +" /// PL031 device, which must be mapped into the address space of the process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20405,12 +20001,10 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or " -"not\n" +"/// Returns whether the match register matches the RTC value, whether or not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20431,14 +20025,12 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false " -"the\n" +" /// When the mask is true the interrupt is enabled; when it is false the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20461,54 +20053,50 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md msgid "" -"Rust has full support for concurrency using OS threads with mutexes and " -"channels." +"Rust has full support for concurrency using OS threads with mutexes and channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " -"از mutex ها و channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از " +"mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since " -"you can rely on the compiler to ensure correctness at runtime." +"compile time bugs. This is often referred to as _fearless concurrency_ since you " +"can rely on the compiler to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " -"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " -"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " -"زمان اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان " +"کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در زمان " +"اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " -"بکشد. شامل موارد زیر است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. " +"شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "" -"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " -"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: " +"thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." -msgstr "" -"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e." -"g., a called function that might mutate an argument or save references to it " -"to read later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e.g., a " +"called function that might mutate an argument or save references to it to read " +"later) save us from multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " -"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " -"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " -"می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند " +"یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای " +"خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات می‌دهند. " #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -20529,8 +20117,8 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the " -"end of `main`." +"Spawning new threads does not automatically delay program termination at the end " +"of `main`." msgstr "" "ایجاد threadهای جدید به طور خودکار خاتمه برنامه را تا پایان `main` به تاخیر " "نمی‌اندازد." @@ -20542,14 +20130,13 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" -"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " -"کرد." +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" -"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " -"آن‌ها است." +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها " +"است." #: src/concurrency/threads/plain.md msgid "Run the example." @@ -20557,8 +20144,7 @@ msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in " -"lockstep." +"5ms timing is loose enough that main and spawned threads stay mostly in lockstep." msgstr "" "زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " "عمدتاً همگام می‌مانند." @@ -20566,16 +20152,15 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " -"پایان می‌رسد!" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان " +"می‌رسد!" #: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it " -"persist." +"This is because main ends the program and spawned threads do not make it persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " -"تداوم آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم " +"آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -20587,11 +20172,11 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " +"`JoinHandle`. Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " -"returns a `JoinHandle`. به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " +"`JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" @@ -20603,11 +20188,11 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the " +"thread to finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " -"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا " +"منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -20619,26 +20204,25 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " +"returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " -"closure returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " +"returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." -"JoinHandle.html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." +"html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md msgid "" -"Use the `Result` return value from `handle.join()` to get access to the " -"returned value." -msgstr "" -"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +"Use the `Result` return value from `handle.join()` to get access to the returned " +"value." +msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -20646,21 +20230,19 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "" -"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://" -"doc.rust-lang.org/std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://doc." +"rust-lang.org/std/any/index.html)." msgstr "" "دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" "(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "" -"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -20673,8 +20255,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " -"مشتق شده را برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق " +"شده را برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -20682,17 +20264,17 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just " -"return and leave them running." +"Main kills child threads when it returns, but another function would just return " +"and leave them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " -"return می‌شود و آنها را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return " +"می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " -"نقض می‌کند!" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض " +"می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -20704,28 +20286,27 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" -"fn.scope.html) for this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn." +"scope.html) for this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" -"std/thread/fn.scope.html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/" +"thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all " -"the threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all the " +"threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " -"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین " +"می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one " -"thread, or immutably by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, " +"or immutably by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " -"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " -"بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با " +"یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -20733,12 +20314,11 @@ msgstr "این بخش باید حدود ۲۰ دقیقه طول بکشد. این #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts " +"are connected via the channel, but you only see the end-points." msgstr "" -"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از " -"طریق channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را " -"می‌بینید." +"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از طریق " +"channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را می‌بینید." #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" @@ -20747,8 +20327,7 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"implement `Clone` (so you can make multiple producers) but `Receiver` does not." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -20778,32 +20357,30 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +msgid "With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" -"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را " -"مسدود کند:" +"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را مسدود کند:" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the " -"channel for the new message. The thread can be blocked indefinitely if there " -"is nobody who reads from the channel." +"Calling `send` will block the current thread until there is space in the channel " +"for the new message. The thread can be blocked indefinitely if there is nobody " +"who reads from the channel." msgstr "" -"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته " -"باشد، thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread " -"را می‌توان به طور نامحدود مسدود کرد." +"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته باشد، " +"thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread را می‌توان " +"به طور نامحدود مسدود کرد." #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) if " +"the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". Every " +"send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -20816,48 +20393,48 @@ msgstr "همگام‌سازی" #: src/concurrency/send-sync/marker-traits.md msgid "" -"How does Rust know to forbid shared access across threads? The answer is in " -"two traits:" +"How does Rust know to forbid shared access across threads? The answer is in two " +"traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " -"دو trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو " +"trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " -"is `Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is " +"`Send` if it is safe to move a `T` across a thread boundary." msgstr "" "‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " "جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " -"is `Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is " +"`Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" "‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " -"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " -"`Sync` است." +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` " +"است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " -"The compiler will automatically derive them for your types as long as they " -"only contain `Send` and `Sync` types. You can also implement them manually " -"when you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The " +"compiler will automatically derive them for your types as long as they only " +"contain `Send` and `Sync` types. You can also implement them manually when you " +"know it is valid." msgstr "" "‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " -"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " -"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " -"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای " +"انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی پیاده سازی " +"کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-" -"safety properties." +"One can think of these traits as markers that the type has certain thread-safety " +"properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" -"safety خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety " +"خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -20865,39 +20442,37 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " -"if it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if " +"it is safe to move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" -"doc.rust-lang.org/std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc." +"rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will " -"run in that thread. So the question is when you can allocate a value in one " -"thread and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will run " +"in that thread. So the question is when you can allocate a value in one thread " +"and deallocate it in another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " -"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " -"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " -"thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " +"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی " +"می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from " -"a single thread." +"As an example, a connection to the SQLite library must only be accessed from a " +"single thread." msgstr "" -"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " -"باشد." +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " -"if it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if " +"it is safe to access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." -"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " -"همزمان امن باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync." +"html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن " +"باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -20909,27 +20484,26 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is " -"thread-safe for shared use, it is also thread-safe to pass references of it " -"across threads." +"This statement is essentially a shorthand way of saying that if a type is thread-" +"safe for shared use, it is also thread-safe to pass references of it across " +"threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " -"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " -"امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده " +"مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across " -"multiple threads without the risk of data races or other synchronization " -"issues, so it is safe to move it to another thread. A reference to the type " -"is also safe to move to another thread, because the data it references can " -"be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across multiple " +"threads without the risk of data races or other synchronization issues, so it is " +"safe to move it to another thread. A reference to the type is also safe to move " +"to another thread, because the data it references can be accessed from any thread " +"safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " -"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " -"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " -"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " -"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را " +"در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک " +"گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ نیز برای " +"انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع می‌دهد می‌توانند از " +"هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -20957,8 +20531,7 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "" -"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -20966,16 +20539,15 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "" -"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md msgid "" -"The generic types are typically `Send + Sync` when the type parameters are " -"`Send + Sync`." +"The generic types are typically `Send + Sync` when the type parameters are `Send " +"+ Sync`." msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " -"هستند.`Send + Sync`." +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." +"`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -20983,8 +20555,8 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. " -"Typically because of interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. Typically " +"because of interior mutability:" msgstr "" "این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " "معمول به دلیل تغییرپذیری داخلی(interior mutability):" @@ -21008,18 +20580,18 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple " -"threads, but they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple threads, but " +"they cannot be moved to another thread:" msgstr "" -"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " -"منتقل کرد:" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل " +"کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them. However, an already-locked mutex can have its " -"guarded variable read by any thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on the " +"thread which created them. However, an already-locked mutex can have its guarded " +"variable read by any thread with which the guard is shared." msgstr "" "‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " "threadای که آنها را ایجاد کرده است، توزیع شوند." @@ -21031,24 +20603,24 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" -"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " -"منتقل کرد:" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل " +"کرد:" #: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " -"مراجع غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع " +"غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " -"است ملاحظات همزمانی خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است " +"ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -21060,11 +20632,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-" +"only access via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " -"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا " +"دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -21076,33 +20648,32 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " -"that uses atomic operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that " +"uses atomic operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " -"عملیات atomic استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات " +"atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " -"and `Sync` if and only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and " +"`Sync` if and only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " -"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " -"آنها را پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. " +"`Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را " +"پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but " -"after that the use of the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but after " +"that the use of the `T` is free." msgstr "" -"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن " -"استفاده از 'T' آزاد است." +"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن استفاده " +"از 'T' آزاد است." #: src/concurrency/shared-state/arc.md msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect " -"them." +"Beware of reference cycles, `Arc` does not use a garbage collector to detect them." msgstr "" "مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " "استفاده نمی‌کند." @@ -21113,15 +20684,14 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " -"mutual exclusion _and_ allows mutable access to `T` behind a read-only " -"interface (another form of [interior mutability](../../borrowing/interior-" -"mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual " +"exclusion _and_ allows mutable access to `T` behind a read-only interface " +"(another form of [interior mutability](../../borrowing/interior-mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " -"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " -"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" -"borrowing/interior-mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که " +"حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only " +"interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../borrowing/interior-" +"mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -21129,42 +20699,41 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " -"implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " -"کامل آن داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن " +"داریم." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the " -"protected data." +"`Mutex` in Rust looks like a collection with just one element --- the protected " +"data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " -"(protected) به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) " +"به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md msgid "" -"It is not possible to forget to acquire the mutex before accessing the " -"protected data." +"It is not possible to forget to acquire the mutex before accessing the protected " +"data." msgstr "" -"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " -"فراموش کرد." +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش " +"کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The " -"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` " +"ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " -"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین " +"می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements " +"`Send`." msgstr "" "‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " "استفاده‌ می‌کنند." @@ -21179,18 +20748,17 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes " -"\"poisoned\" to signal that the data it protected might be in an " -"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " -"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " -"You can call `into_inner()` on the error to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to " +"signal that the data it protected might be in an inconsistent state. Calling " +"`lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang." +"org/std/sync/struct.PoisonError.html). You can call `into_inner()` on the error " +"to recover the data regardless." msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" -"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " -"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " -"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " -"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " -"فراخوانی کنید." +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» " +"می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. " +"فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang." +"org/std/sync/struct.PoisonError.html) انجام نمی‌شود. می‌توانید `into_inner()` را در " +"مورد خطا برای بازیابی داده‌ها بدون توجه به آن فراخوانی کنید." #: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" @@ -21210,30 +20778,28 @@ msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " -"orthogonal." +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " -"between threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between " +"threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " -"قابل تغییر (mutable) بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل " +"تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " -"منتقل کرد. نکته `move` به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل " +"کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as " -"possible." +"Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -21242,33 +20808,31 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " -"philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " -"down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " -"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " -"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " -"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " -"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " -"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " -"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " -"پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has their own " +"place at the table. There is a fork between each plate. The dish served is a kind " +"of spaghetti which has to be eaten with two forks. Each philosopher can only " +"alternately think and eat. Moreover, a philosopher can only eat their spaghetti " +"when they have both a left and right fork. Thus two forks will only be available " +"when their two nearest neighbors are thinking, not eating. After an individual " +"philosopher finishes eating, they will put down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز " +"دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که " +"باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا " +"بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی بخورد که هم چنگال " +"چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط زمانی در دسترس خواهد بود " +"که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس از اینکه یک " +"فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) " -"for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) for " +"this exercise. Copy the code below to a file called `src/main.rs`, fill out the " +"blanks, and test that `cargo run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " -"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " -"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی " +"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " +"کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -21383,49 +20947,47 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It " -"should start at a webpage and check that links on the page are valid. It " -"should recursively check other pages on the same domain and keep doing this " -"until all pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It should " +"start at a webpage and check that links on the page are valid. It should " +"recursively check other pages on the same domain and keep doing this until all " +"pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " -"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " -"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " -"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. " +"باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. " +"باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این کار را تا زمانی " +"که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`]" -"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " -"we will use [`thiserror`](https://docs.rs/thiserror/)." -msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " -"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " -"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " -"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`](https://" +"docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use " +"[`thiserror`](https://docs.rs/thiserror/)." +msgstr "" +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز " +"دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی برای " +"رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" "thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " -"اعلام کنید:" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام " +"کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." -"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` " +"را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "" -"The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "" -"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -21437,8 +20999,7 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -21451,16 +21012,15 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" -"tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://" -"www.google.org/`." +"You can now download the start page. Try with a small site such as `https://www." +"google.org/`." msgstr "" "اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." "google.org/` امتحان کنید." @@ -21518,19 +21078,18 @@ msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " -"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " -"بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند " +"به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google." -"org` domain. Put an upper limit of 100 pages or so so that you don't end up " -"being blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google.org` " +"domain. Put an upper limit of 100 pages or so so that you don't end up being " +"blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." -"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " -"نهایت توسط سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google." +"org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط " +"سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -21557,10 +21116,8 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "" -"/// Determine whether links within the given page should be extracted.\n" -msgstr "" -"/// Determine whether links within the given page should be extracted.\n" +msgid "/// Determine whether links within the given page should be extracted.\n" +msgstr "/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -21586,57 +21143,57 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed " -"concurrently by executing each task until it would block, then switching to " -"another task that is ready to make progress. The model allows running a " -"larger number of tasks on a limited number of threads. This is because the " -"per-task overhead is typically very low and operating systems provide " -"primitives for efficiently identifying I/O that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " -"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " -"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " -"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " -"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " -"ادامه هستند فراهم می‌کنند." +"\"Async\" is a concurrency model where multiple tasks are executed concurrently " +"by executing each task until it would block, then switching to another task that " +"is ready to make progress. The model allows running a larger number of tasks on a " +"limited number of threads. This is because the per-task overhead is typically " +"very low and operating systems provide primitives for efficiently identifying I/O " +"that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر " +"کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است " +"سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از " +"رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار کم است و " +"سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به ادامه هستند فراهم " +"می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work " -"that may be completed in the future. Futures are \"polled\" until they " -"signal that they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work that " +"may be completed in the future. Futures are \"polled\" until they signal that " +"they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " -"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " -"ندهند، «polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن " +"است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، " +"«polled» می‌شوند." #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " -"دسترس هستند." +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس " +"هستند." #: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", " -"similar to a runtime in Rust." +"callback-based, and not polled. Async Python programs require a \"loop\", similar " +"to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " -"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " -"runtime در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر " +"callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime " +"در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language " -"runtime implements the event loop, so many of the details of Promise " -"resolution are hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language runtime " +"implements the event loop, so many of the details of Promise resolution are " +"hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " -"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " -"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. " +"runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از " +"جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -21645,8 +21202,7 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential " -"code:" +"At a high level, async Rust code looks very much like \"normal\" sequential code:" msgstr "" "در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " "sequential code):" @@ -21661,8 +21217,8 @@ msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " -"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی " +"مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -21671,24 +21227,23 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" -"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " -"کنید." +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return " -"type with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return type " +"with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " -"یک future جایگزین می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک " +"future جایگزین می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the " -"compiler on how to use the returned future." +"You cannot make `main` async, without additional instructions to the compiler on " +"how to use the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " -"future بازگشتی، `main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future " +"بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md msgid "" @@ -21700,8 +21255,8 @@ msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. " -"Unlike `block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. Unlike " +"`block_on`, `.await` doesn't block the current thread." msgstr "" "همیشه `await` به طور ناهمزمان (asyn) منتظر تکمیل یک عملیات دیگر است. برخلاف " "`block_on` یک `await` معمولاً thread فعلی را مسدود نمی‌کند." @@ -21711,102 +21266,101 @@ msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " -"مورد در آینده معرفی می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در " +"آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " -"trait, implemented by objects that represent an operation that may not be " -"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, " +"implemented by objects that represent an operation that may not be complete yet. " +"A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/" +"std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " -"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " -"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" -"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، " +"اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده " +"باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/" +"std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but " -"uncommon) to implement `Future` for your own types. For example, the " -"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " -"joining to it." +"An async function returns an `impl Future`. It's also possible (but uncommon) to " +"implement `Future` for your own types. For example, the `JoinHandle` returned " +"from `tokio::spawn` implements `Future` to allow joining to it." msgstr "" "یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " -"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " -"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " -"امکان پیوستن (joining) به آن را فراهم کند." +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` " +"برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا امکان پیوستن " +"(joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function " -"to pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function to " +"pause until that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " -"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا " +"زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the " -"links to show the implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the links " +"to show the implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " -"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای " +"نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async code, " +"rather than building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " -"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر " +"نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md msgid "" -"`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +"`Context` allows a Future to schedule itself to be polled again when an event " +"occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " -"poll مجدد برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll " +"مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into " -"that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into that " +"future remain valid. This is required to allow references to remain valid after " +"an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " -"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " -"ماندن پس از `.await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future " +"معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `." +"await` لازم است." #: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust " -"does not have a \"built-in\" runtime, but several options are available:" +"_reactor_) and is responsible for executing futures (an _executor_). Rust does " +"not have a \"built-in\" runtime, but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " -"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " -"اما چندین گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و " +"مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین " +"گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" -"github.com/hyperium/tonic) for gRPC." +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github." +"com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " -"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " -"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به " +"خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://" +"github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a " +"basic runtime in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " -"شامل یک runtime اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل " +"یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -21815,8 +21369,8 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" -"async/src/lib.rs) already has one." +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/" +"src/lib.rs) already has one." msgstr "" "چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " "[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" @@ -21824,25 +21378,24 @@ msgstr "" #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust " -"playground. The playground also does not permit any I/O, so most interesting " -"async things can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust playground. " +"The playground also does not permit any I/O, so most interesting async things " +"can't run in the playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " -"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " -"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان " +"Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین " +"بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never " -"used." +"Promises, for example, which will run to completion even if they are never used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " -"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " -"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " -"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/" +"O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling " +"کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند " +"تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21851,8 +21404,7 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "" -"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -21890,8 +21442,8 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " -"until it finishes." +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait until " +"it finishes." msgstr "" "چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " "`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." @@ -21910,17 +21462,16 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make " -"progress. That future may have one or more nested futures that its `poll` " -"method polls, corresponding loosely to a call stack. Concurrency within a " -"task is possible by polling multiple child futures, such as racing a timer " -"and an I/O operation." +"A task has a single top-level future which the executor polls to make progress. " +"That future may have one or more nested futures that its `poll` method polls, " +"corresponding loosely to a call stack. Concurrency within a task is possible by " +"polling multiple child futures, such as racing a timer and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " -"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " -"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " -"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " -"یک تایمر و یک عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را " +"poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` " +"آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده مطابقت دارد. " +"همزمانی در یک task با poll از چندین child future، مانند رقابت یک تایمر و یک " +"عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -21950,53 +21501,47 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"از تماس تلفنی متشکریم، {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "" -"Copy this example into your prepared `src/main.rs` and run it from there." +msgid "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " -"کنید." +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix." -"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" -"telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/" +"man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" -"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/" +"nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with " -"a few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with a " +"few connected clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " -"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه " +"taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a " -"closure, but does not take any arguments. Its return value is a Future, " -"similar to an `async fn`." +"This is the first time we've seen an `async` block. This is similar to a closure, " +"but does not take any arguments. Its return value is a Future, similar to an " +"`async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " -"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ " +"استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md msgid "" -"Refactor the async block into a function, and improve the error handling " -"using `?`." +"Refactor the async block into a function, and improve the error handling using `?" +"`." msgstr "" -"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " -"بخشید." +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "" -"Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "" -"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" @@ -22023,13 +21568,12 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "" -"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](../channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the [morning " +"class](../channels.md)." msgstr "" "به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" "channels.md) دیده می‌شود." @@ -22041,31 +21585,30 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient " -"for complex applications with both IO and heavy CPU processing tasks." +"implement both `sync` and `async` `send` and `recv`. This can be convenient for " +"complex applications with both IO and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " -"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " -"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی " +"است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای " +"برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to " -"combine them with other `future`s to combine them and create complex control " -"flow." +"What makes working with `async` channels preferable is the ability to combine " +"them with other `future`s to combine them and create complex control flow." msgstr "" "چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " "`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns " -"a collection of their results. This is similar to `Promise.all` in " -"JavaScript or `asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns a " +"collection of their results. This is similar to `Promise.all` in JavaScript or " +"`asyncio.gather` in Python." msgstr "" "عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " -"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " -"در JavaScript یا `asyncio.gather` در پایتون است." +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در " +"JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" @@ -22085,62 +21628,59 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but " -"you must know how many futures you will have at compile time. This is " -"currently in the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but you " +"must know how many futures you will have at compile time. This is currently in " +"the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " -"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " -"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " -"می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، " +"اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در " +"جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would " -"cause your program to stall." +"The risk of `join` is that one of the futures may never resolve, this would cause " +"your program to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " -"باعث می‌شود برنامه شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث " +"می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all " -"requests to an http service as well as a database query. Try adding a " -"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " -"timeout (that requires `select!`, explained in the next chapter), but " -"demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all requests to " +"an http service as well as a database query. Try adding a `tokio::time::sleep` to " +"the future, using `futures::join!`. This is not a timeout (that requires `select!" +"`, explained in the next chapter), but demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " -"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " -"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " -"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " -"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن " +"(`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید " +"`tokio::time::sleep` را با استفاده از `futures::join!` به future اضافه کنید. این " +"یک timeout نیست (که به `select!`نیاز دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه " +"`join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and " -"responds to that future's result. In JavaScript, this is similar to `Promise." -"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"A select operation waits until any of a set of futures is ready, and responds to " +"that future's result. In JavaScript, this is similar to `Promise.race`. In " +"Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " -"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " -"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." -"FIRST_COMPLETED)` قابل مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به " +"نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و " +"در پایتون با `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل " +"مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, " -"each of the form `pattern = future => statement`. When a `future` is ready, " -"its return value is destructured by the `pattern`. The `statement` is then " -"run with the resulting variables. The `statement` result becomes the result " -"of the `select!` macro." +"Similar to a match statement, the body of `select!` has a number of arms, each of " +"the form `pattern = future => statement`. When a `future` is ready, its return " +"value is destructured by the `pattern`. The `statement` is then run with the " +"resulting variables. The `statement` result becomes the result of the `select!` " +"macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " -"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " -"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " -"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " -"`select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که " +"هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` " +"آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس `statement` با " +"متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو `select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -22162,32 +21702,30 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, " -"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " -"does the `send` also fail in this situation?" +"The `listener` async block here is a common form: wait for some async event, or " +"for a timeout. Change the `sleep` to sleep longer to see it fail. Why does the " +"`send` also fail in this situation?" msgstr "" -"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async " -"یا به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر " -"دهید تا شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" +"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async یا " +"به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر دهید تا " +"شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a " -"task reacts to events in a loop. That has some pitfalls, which will be " -"discussed in the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a task " +"reacts to events in a loop. That has some pitfalls, which will be discussed in " +"the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes " -"with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter." +"asynchronous programming. However, the async/await model in Rust also comes with " +"its share of pitfalls and footguns. We illustrate some of them in this chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " -"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " -"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " -"می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous " +"فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و " +"pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -22199,15 +21737,14 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that " -"CPU blocking tasks will block the executor and prevent other tasks from " -"being executed. An easy workaround is to use async equivalent methods where " -"possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that CPU " +"blocking tasks will block the executor and prevent other tasks from being " +"executed. An easy workaround is to use async equivalent methods where possible." msgstr "" "اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " -"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " -"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " -"است که در صورت امکان از متدهای معادل async استفاده کنید." +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن " +"executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این است که در صورت " +"امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -22229,73 +21766,69 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This " -"makes the effect more obvious, but the bug is still present in the multi-" -"threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the " +"effect more obvious, but the bug is still present in the multi-threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " -"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " -"دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را " +"آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " -"باشید." +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " -"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و " +"handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, " -"where that library might depend on thread-local storage or map to specific " -"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " -"situations." -msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " -"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " -"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " -"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " -"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " -"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"particularly problematic when interacting with other libraries via FFI, where " +"that library might depend on thread-local storage or map to specific OS threads " +"(e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." +msgstr "" +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ " +"به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک " +"thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از " +"طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به ذخیره‌سازی محلی thread یا " +"نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی داشته باشد. در چنین " +"شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause " -"another task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause another " +"task to block, and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." -"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " -"thread در حال اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` " +"ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال " +"اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The type " +"returned is the result of a compiler transformation which turns local variables " +"into data stored inside the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " -"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " -"ذخیره شده در future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. " +"نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در " +"future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because of " +"that, the future should never be moved to a different memory location, as it " +"would invalidate those pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " -"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " -"این pointerها را باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به " +"همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را " +"باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" @@ -22304,10 +21837,10 @@ msgid "" "operations that would move the instance it points to into a different memory " "location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " -"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " -"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " -"متفاوت منتقل کند را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می " +"توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی " +"را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند " +"را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -22359,154 +21892,147 @@ msgstr "\"نتیجه کار برای تکرار {i}: {resp}\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically " -"call `select!` in a loop." +"You may recognize this as an example of the actor pattern. Actors typically call " +"`select!` in a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " -"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. " +"بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"This serves as a summation of a few of the previous lessons, so take your " -"time with it." +"This serves as a summation of a few of the previous lessons, so take your time " +"with it." msgstr "" -"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " -"آن کنید." +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن " +"کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " -"the `select!`. This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the " +"`select!`. This will never execute. Why?" msgstr "" "به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " "`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "" -"Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::" -"pin`:" +"`timeout_fut` in the `select!` to work around the move, then using `Box::pin`:" msgstr "" "این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " -"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" -"pin` استفاده کنید:" +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` " +"استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires:" +"iteration (a fused future would help with this). Update to reset `timeout_fut` " +"every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " -"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " -"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::" +"Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی " +"`timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, " -"but that is difficult to use for a future that is reassigned." +"stabilized, with older code often using `tokio::pin!`) is also an option, but " +"that is difficult to use for a future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " -"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " -"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " -"دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت " +"شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه " +"است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that " -"will send to a `oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that will " +"send to a `oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " -"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد " +"کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, " -"the Rust borrow checker would prevent self-referential data from being " -"moved, as the references cannot outlive the data they point to. However, the " -"code transformation for async blocks and functions is not verified by the " -"borrow checker." +"Data that contains pointers to itself is called self-referential. Normally, the " +"Rust borrow checker would prevent self-referential data from being moved, as the " +"references cannot outlive the data they point to. However, the code " +"transformation for async blocks and functions is not verified by the borrow " +"checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " -"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " -"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " -"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " -"borrow checker تأیید نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده " +"می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری " +"می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده " +"بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط borrow checker تأیید " +"نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its " -"place using a pinned pointer. However, it can still be moved through an " -"unpinned pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its place " +"using a pinned pointer. However, it can still be moved through an unpinned " +"pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " -"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " -"از طریق یک pointer بدون پین جابجا کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از " +"یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق " +"یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " -"`&mut Self` to refer to the instance. That's why it can only be called on a " -"pinned pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut " +"Self` to refer to the instance. That's why it can only be called on a pinned " +"pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " -"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " -"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به " +"نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک " +"اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 " -"release. This required support for using return-position `impl Trait` (RPIT) " -"in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 release. " +"This required support for using return-position `impl Trait` (RPIT) in traits, as " +"the desugaring for `async fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " -"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " -"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " -"Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی " +"برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا " +"شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +"However, even with the native support today there are some pitfalls around `async " +"fn` and RPIT in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " -"RPIT در ویژگی‌ها وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT " +"در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns of " +"borrowing cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " -"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین " +"برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +"Traits whose methods use return-position `impl trait` or `async` are not `dyn` " +"compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " -"می‌کنند با `dyn` سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند " +"با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) provides a workaround through a macro, with some " -"caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/" +"latest/async_trait/) provides a workaround through a macro, with some caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " -"چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/" +"latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -22523,43 +22049,40 @@ msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " -"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " -"عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف " +"از heap allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"The challenges in language support for `async trait` are deep Rust and probably " +"not worth describing in-depth. Niko Matsakis did a good job of explaining them in " +"[this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-" +"traits-are-hard/) if you are interested in digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " -"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" -"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " -"هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش " +"توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) " +"آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of time and " +"adding it to the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " -"را به Vec اضافه کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به " +"Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to " -"ensure the system works correctly even when futures are cancelled. For " -"example, it shouldn't deadlock or lose data." +"_cancellation_ and it can occur at any `await` point. Care is needed to ensure " +"the system works correctly even when futures are cancelled. For example, it " +"shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " -"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " -"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " -"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این " +"حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از " +"عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، " +"نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -22579,16 +22102,16 @@ msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " -"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و " +"در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " -"error-handling)." +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-" +"handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " -"به خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به " +"خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." @@ -22596,15 +22119,12 @@ msgstr "اسن مثال بخش‌هایی از string را از دست می‌د #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " -"dropped." -msgstr "" -"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." +msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the " -"struct:" +"`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -22615,22 +22135,22 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a " -"tick has been 'delivered'." +"html#method.tick) is cancellation-safe because it keeps track of whether a tick " +"has been 'delivered'." msgstr "" "‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " -"tick تحویل داده شده است." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick " +"تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) is cancellation-safe because it either " -"returns or doesn't read data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." +"html#method.read) is cancellation-safe because it either returns or doesn't read " +"data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " -"برمی‌گرداند یا نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." +"html#method.read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا " +"نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" @@ -22639,8 +22159,8 @@ msgid "" "cancellation-safe. See its documentation for details and alternatives." msgstr "" "‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" -"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-safe " +"نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22653,18 +22173,18 @@ msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" -"philosophers.md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers." +"md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-" -"locally.md) for this exercise. Copy the code below to a file called `src/" -"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-locally." +"md) for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." -"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " -"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) " +"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " +"کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22680,11 +22200,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. " -"You can use the following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. You " +"can use the following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " -"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. " +"می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -22695,8 +22215,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" +"multi-thread\"] }\n" "```" msgstr "" "```toml\n" @@ -22706,14 +22226,14 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " -"\"rt-multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" +"multi-thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module " -"from the `tokio` crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module from " +"the `tokio` crate." msgstr "" "همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " "crate استفاده کنید." @@ -22724,28 +22244,26 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast " -"chat application. We have a chat server that the clients connect to and " -"publish their messages. The client reads user messages from the standard " -"input, and sends them to the server. The chat server broadcasts each message " -"that it receives to all the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast chat " +"application. We have a chat server that the clients connect to and publish their " +"messages. The client reads user messages from the standard input, and sends them " +"to the server. The chat server broadcasts each message that it receives to all " +"the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " -"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " -"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " -"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " -"دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast " +"chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود " +"را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به " +"سرور ارسال می‌کند. سرور چت هر پیامی را که دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/) for the communication between the client " -"and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" +"broadcast/fn.channel.html) on the server, and [`tokio_websockets`](https://docs." +"rs/tokio-websockets/) for the communication between the client and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" -"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" -"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" +"broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/" +"tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -22768,8 +22286,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", " +"\"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22782,8 +22300,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " -"\"fastrand\", \"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", " +"\"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22793,31 +22311,31 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " -"to familiarize yourself with the API." +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes to " +"familiarize yourself with the API." msgstr "" "شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" "websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " -"asynchronously reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait." +"StreamExt.html#method.next) implemented by `WebSocketStream`: for asynchronously " +"reading messages from a Websocket Stream." msgstr "" "‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " -"ناهمزمان پیام‌ها از یک جریان وب سوکت." +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان " +"پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " -"asynchronously sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." +"SinkExt.html#method.send) implemented by `WebSocketStream`: for asynchronously " +"sending messages on a Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" -"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " -"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." +"SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال " +"ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" @@ -22826,16 +22344,15 @@ msgid "" "standard input." msgstr "" "‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " -"استاندارد." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." +"Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" -"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." +"Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -22843,31 +22360,28 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main." -"rs` file. In this project, we need two binaries. One for the client, and one " -"for the server. You could potentially make them two separate Cargo projects, " -"but we are going to put them in a single Cargo project with two binaries. " -"For this to work, the client and the server code should go under `src/bin` " -"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" -"targets.html#binaries))." -msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " -"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " -"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " -"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " -"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " -"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." -"html#binaries) مراجعه کنید )." +"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` " +"file. In this project, we need two binaries. One for the client, and one for the " +"server. You could potentially make them two separate Cargo projects, but we are " +"going to put them in a single Cargo project with two binaries. For this to work, " +"the client and the server code should go under `src/bin` (see the [documentation]" +"(https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." +msgstr "" +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/" +"main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و " +"دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه " +"بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری قرار می‌دهیم. برای این " +"کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند (به[documentation](https://" +"doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/" -"bin/client.rs`, respectively. Your task is to complete these files as " -"described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/bin/" +"client.rs`, respectively. Your task is to complete these files as described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " -"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " -"شده است تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی " +"کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است " +"تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md @@ -22929,14 +22443,13 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a " -"continuous loop. One task receives messages from the client and broadcasts " -"them. The other sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous " +"loop. One task receives messages from the client and broadcasts them. The other " +"sends messages received by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " -"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " -"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " -"می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده " +"کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. " +"دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -22945,21 +22458,21 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and " -"sending them to the server, and (2) receiving messages from the server, and " -"displaying them for the user." +"performing two tasks: (1) reading user messages from standard input and sending " +"them to the server, and (2) receiving messages from the server, and displaying " +"them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " -"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " -"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task " +"استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و " +"(۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " -"جز فرستنده پیام، منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز " +"فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -23025,33 +22538,33 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " -"that it was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it " +"was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " -"برده باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " +"باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not " -"perfect, so if you spotted any mistakes or have ideas for improvements, " -"please get in [contact with us on GitHub](https://github.com/google/" -"comprehensive-rust/discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not perfect, so " +"if you spotted any mistakes or have ideas for improvements, please get in " +"[contact with us on GitHub](https://github.com/google/comprehensive-rust/" +"discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " -"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " -"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " -"شوید. ما دوست داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی " +"را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید]" +"(https://github.com/google/comprehensive-rust/discussions) وارد شوید. ما دوست " +"داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many " -"Rust terms. For translations, this also serves to connect the term back to " -"the English original." +"The following is a glossary which aims to give a short definition of many Rust " +"terms. For translations, this also serves to connect the term back to the English " +"original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " -"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " -"انگلیسی است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان " +"Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی " +"است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -23073,9 +22586,11 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the " -"relationship between types." +"A type associated with a specific trait. Useful for defining the relationship " +"between types." msgstr "" +"نوع مرتبط:\n" +"نوعی که با یک ویژگی خاص مرتبط است. برای تعریف رابطه بین typeها مفید است." #: src/glossary.md msgid "" @@ -23084,8 +22599,8 @@ msgid "" "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " -"[Bare-metal Rust](bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-" +"metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -23124,8 +22639,7 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable " -"program." +"The process of converting source code into executable code or a usable program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -23144,8 +22658,7 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " -"می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." #: src/glossary.md msgid "" @@ -23167,8 +22680,7 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "" -"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -23181,8 +22693,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in " -"a program." +"The order in which the individual statements or instructions are executed in a " +"program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -23202,8 +22714,8 @@ msgid "" "associated tuple or struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " -"ساختار مرتبط، نگه می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار " +"مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" @@ -23241,22 +22753,22 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are " -"no longer in use." +"A mechanism that automatically frees up memory occupied by objects that are no " +"longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " -"نمی‌شوند را آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را " +"آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling " -"code reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling code " +"reuse with different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " -"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده " +"مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -23278,12 +22790,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and " -"cannot be used as an identifier." +"A reserved word in a programming language that has a specific meaning and cannot " +"be used as an identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " -"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به " +"عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -23297,14 +22809,14 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when " -"normal functions are not enough. A typical example is `format!`, which takes " -"a variable number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when normal " +"functions are not enough. A typical example is `format!`, which takes a variable " +"number of arguments, which isn't supported by Rust functions." msgstr "" "macro: \n" "ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " -"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " -"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از " +"آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -23318,22 +22830,22 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the " -"value of an expression." +"A control flow construct in Rust that allows for pattern matching on the value of " +"an expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " -"فراهم می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم " +"می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer " -"needed, leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer needed, " +"leading to a gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " -"منجر به افزایش تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر " +"به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -23346,12 +22858,12 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, " -"to organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, to " +"organize code in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " -"Rust است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust " +"است." #: src/glossary.md msgid "" @@ -23377,14 +22889,14 @@ msgid "" "managing the memory associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " -"مقدار است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار " +"است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of " -"the program." +"An unrecoverable error condition in Rust that results in the termination of the " +"program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -23400,12 +22912,12 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against " -"an expression in Rust." +"A combination of values, literals, or structures that can be matched against an " +"expression in Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " -"مطابقت داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت " +"داده شوند." #: src/glossary.md msgid "" @@ -23418,40 +22930,39 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task " -"or solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task or " +"solve a particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاصی اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " +"مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " -"حل یک مشکل خاص اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " +"مشکل خاص اجرا کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which " -"the method is called." +"The first parameter in a Rust method that represents the instance on which the " +"method is called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " -"می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object " -"is tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object is " +"tracked, and the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " -"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که " +"شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -23500,8 +23011,8 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, " -"preventing memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, preventing " +"memory-related errors." msgstr "" "safe: \n" "به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " @@ -23536,8 +23047,7 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for " -"more." +"A data type storing textual data. See [Strings](references/strings.html) for more." msgstr "" "string: \n" "نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" @@ -23546,18 +23056,16 @@ msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different " -"types under a single name." +"A composite data type in Rust that groups together variables of different types " +"under a single name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " -"می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other " -"functions." +"A Rust module containing functions that test the correctness of other functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -23582,8 +23090,8 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to " -"achieve polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to achieve " +"polymorphism in Rust." msgstr "" "trait: \n" "مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " @@ -23597,34 +23105,33 @@ msgid "" "interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " -"علاقه‌تان به typeها نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان " +"به typeها نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple " -"fields have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple fields " +"have no names, and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " -"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام " +"هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values " -"of a particular kind in Rust." +"A classification that specifies which operations can be performed on values of a " +"particular kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " -"در Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در " +"Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or " -"expression." +"The ability of the Rust compiler to deduce the type of a variable or expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -23632,12 +23139,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading " -"to unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading to " +"unpredictable program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " -"غیرقابل پیش‌بینی برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل " +"پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" @@ -23645,8 +23152,8 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " -"یکی در یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در " +"یک زمان خاص." #: src/glossary.md msgid "" @@ -23655,8 +23162,8 @@ msgid "" "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " -"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر " +"ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -23664,18 +23171,18 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " -"شده است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده " +"است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe " +"Rust](unsafe-rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " -"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. " +"[Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -23691,10 +23198,8 @@ msgstr "سایر منابع برای Rust" #: src/other-resources.md msgid "" -"The Rust community has created a wealth of high-quality and free resources " -"online." -msgstr "" -"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +"The Rust community has created a wealth of high-quality and free resources online." +msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -23703,46 +23208,45 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" -"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " -"می‌دهند:" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " -"canonical free book about Rust. Covers the language in detail and includes a " -"few projects for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical " +"free book about Rust. Covers the language in detail and includes a few projects " +"for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " -"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " -"پروژه برای ساخت نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف " +"در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت " +"نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " -"Rust syntax via a series of examples which showcase different constructs. " -"Sometimes includes small exercises where you are asked to expand on the code " -"in the examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust " +"syntax via a series of examples which showcase different constructs. Sometimes " +"includes small exercises where you are asked to expand on the code in the " +"examples." msgstr "" "‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " "syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " -"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " -"در مثال‌ها گسترش دهید." +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را در " +"مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " -"of the standard library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of " +"the standard library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " -"کتابخانه استاندارد برای Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه " +"استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " -"book which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book " +"which describes the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " -"گرامر و مدل حافظه Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر " +"و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -23751,32 +23255,30 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages " -"(FFI)." +"including working with raw pointers and interfacing with other languages (FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " -"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " -"(FFI) را تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش " +"می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را " +"تشریح می‌کند." #: src/other-resources.md msgid "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the " -"Rust Book was written." +"covers the new asynchronous programming model which was introduced after the Rust " +"Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " -"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " -"پس از نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل " +"برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از " +"نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"an introduction to using Rust on embedded devices without an operating " -"system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an " +"introduction to using Rust on embedded devices without an operating system." msgstr "" "‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " -"شامل می‌شود." +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل " +"می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -23788,115 +23290,113 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " -"from the perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from " +"the perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " -"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را " +"از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): covers Rust from the perspective of developers who " -"write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." +"html): covers Rust from the perspective of developers who write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" -"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " -"زبان C می‌نویسند پوشش می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." +"html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش " +"می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): " -"covers the syntax of Rust using side-by-side comparisons with other " -"languages such as C, C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers " +"the syntax of Rust using side-by-side comparisons with other languages such as C, " +"C++, Java, JavaScript, and Python." msgstr "" "‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " -"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " -"C++، Java، JavaScript و Python پوشش می‌دهد." +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، " +"Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " -"you learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you " +"learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " -"کمک به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک " +"به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): a series of small presentations covering both basic " -"and advanced part of the Rust language. Other topics such as WebAssembly, " -"and async/await are also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" +"index.html): a series of small presentations covering both basic and advanced " +"part of the Rust language. Other topics such as WebAssembly, and async/await are " +"also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" -"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " -"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " -"پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" +"index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را " +"پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" "[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" "testing/): a self-paced workshop that goes beyond Rust's built-in testing " -"framework. It covers `googletest`, snapshot testing, mocking as well as how " -"to write your own custom test harness." +"framework. It covers `googletest`, snapshot testing, mocking as well as how to " +"write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" -"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " -"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " -"تست‌های سفارشی خود را پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-" +"testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این " +"`googletest`، تست snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را " +"پوشش می‌دهد." #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs." -"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " -"new developers. The first is a set of 35 videos and the second is a set of " -"11 modules which covers Rust syntax and basic constructs." +"series-to-rust/) and [Take your first steps with Rust](https://docs.microsoft.com/" +"en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. " +"The first is a set of 35 videos and the second is a set of 11 modules which " +"covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" -"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" -"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " -"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " -"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" +"series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. " +"com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان " +"جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از ۱۱ ماژول است که دستور " +"Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." -"github.io/too-many-lists/): in-depth exploration of Rust's memory management " -"rules, through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github." +"io/too-many-lists/): in-depth exploration of Rust's memory management rules, " +"through implementing a few different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." -"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " -"نوع مختلف list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/" +"too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف " +"list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " -"for even more Rust books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for " +"even more Rust books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " -"کتاب‌های بیشتر در مورد Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های " +"بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust " -"documentation. See the page on [other resources](other-resources.md) for a " -"full list of useful resources." +"The material here builds on top of the many great sources of Rust documentation. " +"See the page on [other resources](other-resources.md) for a full list of useful " +"resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " -"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست " +"کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache " -"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" -"rust/blob/main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 " +"license, please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/" +"main/LICENSE) for details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " -"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" -"LICENSE) مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر " +"به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/LICENSE) " +"مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -23904,14 +23404,13 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by " -"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " -"`third_party/rust-by-example/` directory for details, including the license " -"terms." +"Some examples and exercises have been copied and adapted from [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-" +"example/` directory for details, including the license terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" -"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " -"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-" +"example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به " +"دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -23923,9 +23422,9 @@ msgid "" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " -"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " -"`third_party/rust-on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس " +"شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-" +"on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -23933,13 +23432,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section " -"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " -"directory for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section uses an " +"image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory " +"for details, including the license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " -"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " -"license، دایرکتوری `third_party/cxx/` را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از " +"[CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، " +"دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -23948,31 +23447,27 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` " -#~ "keyword makes them capture by value." +#~ "By default, closures will capture by reference if they can. The `move` keyword " +#~ "makes them capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " -#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " -#~ "value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. " +#~ "کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" -#~ "setup/build/bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction), [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/" +#~ "bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" -#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." -#~ "com/docs/setup/build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" +#~ "bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" +#~ "bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction) به Bazel." -#~ msgid "" -#~ "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "" -#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "" -#~ "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -23997,45 +23492,44 @@ msgstr "" #~ msgid "" #~ "In this example, we have a race between a cat and a dog. " -#~ "`first_animal_to_finish_race` listens to both channels and will pick " -#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " -#~ "cat that take 500ms." +#~ "`first_animal_to_finish_race` listens to both channels and will pick whichever " +#~ "arrives first. Since the dog takes 50ms, it wins against the cat that take " +#~ "500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " -#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." -#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " -#~ "می‌کشد تا پیروز شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر " +#~ "دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین " +#~ "سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز " +#~ "شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are " -#~ "supposed to receive only one `send`." +#~ "You can use `oneshot` channels in this example as the channels are supposed to " +#~ "receive only one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " -#~ "کانال‌ها فقط یک `send` را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها " +#~ "فقط یک `send` را دریافت کنند." #~ msgid "" -#~ "Try adding a deadline to the race, demonstrating selecting different " -#~ "sorts of futures." +#~ "Try adding a deadline to the race, demonstrating selecting different sorts of " +#~ "futures." #~ msgstr "" -#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " -#~ "نشان دهید." +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان " +#~ "دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their " -#~ "futures. It is easiest to use when every execution of `select!` creates " -#~ "new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their futures. It " +#~ "is easiest to use when every execution of `select!` creates new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " -#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " -#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future " +#~ "آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد " +#~ "می‌کند، راحت‌ترین استفاده از آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but " -#~ "this can lead to issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but this " +#~ "can lead to issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " -#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " -#~ "(pinning slide) شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما " +#~ "این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) " +#~ "شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -24071,8 +23565,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " +#~ "اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -24086,11 +23580,11 @@ msgstr "" #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." #~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/" -#~ "* ... */`." +#~ "Line comments are started with `//`, block comments are delimited by `/* ... */" +#~ "`." #~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " -#~ "مشخص می‌شوند." +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " +#~ "می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -24100,21 +23594,20 @@ msgstr "" #~ msgid "" #~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "" -#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; " -#~ "3]" +#~ "[20, 30, 40], [0; 3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), " -#~ "(T1, T2), …" +#~ "(), (T,), (T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" @@ -24135,17 +23628,16 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " -#~ "type, and the only valid value of that type --- that is to say both the " -#~ "type and its 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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, " +#~ "and the only valid value of that type --- that is to say both the type and its " +#~ "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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " -#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " -#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " -#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " -#~ "که در اسلاید بعدی خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " +#~ "این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به " +#~ "صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک " +#~ "تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی " +#~ "خواهیم دید. " #, fuzzy #~ msgid "" @@ -24158,8 +23650,7 @@ msgstr "" #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" #~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " -#~ "کنید." +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -24172,11 +23663,9 @@ msgstr "" #~ "Point out that how `..` will expand to account for different number of " #~ "elements." #~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " -#~ "یافت." +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." -#~ msgid "" -#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" #~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " #~ "`[a@..,b]` را نشان دهید." @@ -24186,9 +23675,8 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-" -#~ "scoped values that cannot be moved or reallocated during the execution of " -#~ "the program." +#~ "Static and constant variables are two different ways to create globally-scoped " +#~ "values that cannot be moved or reallocated during the execution of the program." #~ msgstr "" #~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " #~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " @@ -24224,16 +23712,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " -#~ "Rust اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " +#~ "اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل " -#~ "تغییر به یک برش از رشته‌ است." +#~ "&str یک مرجع غیرقابل تغییر " +#~ "به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -24461,13 +23949,12 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "" -#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." #~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the " -#~ "standard library." +#~ "Day 2: Memory management, ownership, compound data types, and the standard " +#~ "library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -24500,30 +23987,28 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " -#~ "and `continue`." +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " +#~ "`continue`." #~ msgstr "" #~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " #~ "`continue`. " #~ msgid "" #~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a " -#~ "major feature and we should show students this right away." +#~ "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 یک ویژگی مهم است و باید آن را بلافاصله به دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over " -#~ "the schedule. We suggest splitting the day into two parts (following the " -#~ "slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over the " +#~ "schedule. We suggest splitting the day into two parts (following the slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " -#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " -#~ "کنید(اسلاید‌ها را دنبال کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس " +#~ "می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال " +#~ "کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -24535,8 +24020,8 @@ msgstr "" #~ "You can of course adjust this as necessary. Please make sure to include " #~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " -#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را " +#~ "نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -24575,56 +24060,54 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop " -#~ "will always end, but this is not yet proved. Edit the code and play with " -#~ "different inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop will " +#~ "always end, but this is not yet proved. Edit the code and play with different " +#~ "inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " -#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " -#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این " +#~ "است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و " +#~ "با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to " -#~ "trigger type inference. Try with `i8` instead and trigger a runtime " -#~ "integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to trigger " +#~ "type inference. Try with `i8` instead and trigger a runtime integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " -#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " -#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا " +#~ "استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در " +#~ "زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "" -#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match " -#~ "the format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match the " +#~ "format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " -#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها " +#~ "با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " -#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد " +#~ "است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::" -#~ "fmt` which has the rules of the formatting mini-language. It's important " -#~ "that the students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " -#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه `std::" +#~ "fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان " +#~ "با جستجو در کتابخانه استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::" -#~ "fmt documentation" +#~ "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` را توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات محلی " +#~ "‍`std::fmt` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -24636,8 +24119,7 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "" -#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" @@ -24663,8 +24145,8 @@ msgstr "" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" #~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " -#~ "overflow (line 29)" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " +#~ "(line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -24681,12 +24163,12 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning " -#~ "level, even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش فرض " +#~ "کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" @@ -24694,33 +24176,32 @@ msgstr "" #~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " -#~ "شده‌اند. چند نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند " +#~ "نمونه:" #~ msgid "" #~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-" -#~ "backdoor-attempt-of-2003)" +#~ "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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of 2003]" +#~ "(https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-of-2003)" #~ 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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability](https://" +#~ "dwheeler.com/essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" -#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-" -#~ "the-break-that-broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke sudo]" +#~ "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-" +#~ "break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -24742,127 +24223,122 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " -#~ "you can't accidentally forget a `break`." +#~ "`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 را " #~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "" -#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the " -#~ "corresponding `Box` leaves the scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding " +#~ "`Box` leaves the scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " -#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` " +#~ "مورد نظر اسکوپ مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " -#~ "method of a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of " +#~ "a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " -#~ "get یک برش (`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get " +#~ "یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped " -#~ "and 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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped and " +#~ "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]` علامت گذاری شده است را " -#~ "فراموش کنید، کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند و در " +#~ "نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی تابعی که با " +#~ "`#[must_use]` علامت گذاری شده است را فراموش کنید، " +#~ "کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "" -#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "" -#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" #~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get " -#~ "runtime-initialized and runtime-sized static variables" +#~ "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) برای نشت دادن یک اشاره‌گر " -#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " -#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/boxed/" +#~ "struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر استفاده کنید.یک " +#~ "مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی " +#~ "اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." -#~ "forget.html) to make the compiler \"forget\" about a value (meaning the " -#~ "destructor is never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget." +#~ "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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/std/" +#~ "mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را فراموش کند (به " +#~ "این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-" -#~ "lang.org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory " -#~ "leak and Rust does not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory leak " +#~ "and Rust does not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " -#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر " +#~ "می‌گیرند و Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood " -#~ "as \"Pretty much no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood as " +#~ "\"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" #~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " #~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" -#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " -#~ "flag. If enabled, the program will panic (a controlled crash of the " -#~ "program), otherwise you get wrap-around semantics. By default, you get " -#~ "panics in debug mode (`cargo build`) and wrap-around in release mode " -#~ "(`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang." +#~ "org/rustc/codegen-options/index.html#overflow-checks) compile-time flag. If " +#~ "enabled, the program will panic (a controlled crash of the program), otherwise " +#~ "you get wrap-around semantics. By default, you get 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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " -#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " -#~ "you to call functions such as `slice::get_unchecked` which does not do " -#~ "bounds checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be " +#~ "disabled directly with the `unsafe` keyword. However, `unsafe` allows you to " +#~ "call functions such as `slice::get_unchecked` which does not do bounds " +#~ "checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " -#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " -#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " -#~ "محدوده را انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور " +#~ "مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان " +#~ "می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را " +#~ "انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." #~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " -#~ "ساخته شده است." +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده " +#~ "است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -24871,51 +24347,51 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to " -#~ "'pay' for higher-level programming constructs with memory or CPU. For " -#~ "example, writing a loop using `for` should result in roughly the same low " -#~ "level instructions as using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for " +#~ "higher-level programming constructs with memory or CPU. For example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که شما " +#~ "مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU «هزینه»‌ای " +#~ "پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for باید تقریباً به " +#~ "همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار `iter()." +#~ "fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " -#~ "also known as 'sum types', which allow the type system to express things " -#~ "like `Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also " +#~ "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` را " +#~ "بیان کند." #~ msgid "" #~ "Remind people to read the errors --- many developers have gotten used to " #~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with " -#~ "_actionable_ feedback, ready to copy-paste into your code." +#~ "talkative than other compilers. It will often provide you with _actionable_ " +#~ "feedback, ready to copy-paste into your code." #~ msgstr "" #~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " -#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " -#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل " +#~ "توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار " +#~ "شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, " -#~ "Python, and Go. Rust does not come with several things you might consider " -#~ "standard and essential:" +#~ "The Rust standard library is small compared to languages like Java, Python, " +#~ "and Go. Rust does not come with several things you might consider standard and " +#~ "essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " -#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " -#~ "در نظر بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " +#~ "است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " +#~ "بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" -#~ "docs.rs/rand/) را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" +#~ "rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" @@ -24924,44 +24400,44 @@ msgstr "" #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." -#~ "rs/serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/" +#~ "serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library " -#~ "cannot go away, so it has to be very stable. For the examples above, the " -#~ "Rust community is still working on finding the best solution --- and " -#~ "perhaps there isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library cannot " +#~ "go away, so it has to be very stable. For the examples above, the 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 هنوز در تلاش " +#~ "است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این موارد، یک «بهترین " +#~ "راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this " -#~ "makes it trivial to download and compile third-party crates. A " -#~ "consequence of this is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this 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 شخص ثالث را بسیار آسان می کند. یکی " -#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و این " +#~ "امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی از " +#~ "پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " -#~ "to find a good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates to find a " +#~ "good and trusted one." #~ msgstr "" #~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای " -#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "dir=ltr> با اجازه مقایسه معیارهای سلامت برای crates به " +#~ "شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است که " +#~ "در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -24975,12 +24451,12 @@ msgstr "" #~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " #~ "pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " -#~ "اشاره‌گرهای C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای " +#~ "C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values " -#~ "over their lifetime." +#~ "References that are declared as `mut` can be bound to different values over " +#~ "their lifetime." #~ msgstr "" #~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " #~ "مختلفی ارجاع داده شوند." @@ -24992,8 +24468,8 @@ msgstr "" #~ "Rust is tracking the lifetimes of all references to ensure they live long " #~ "enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " -#~ "آنها را رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را " +#~ "رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " @@ -25002,100 +24478,94 @@ msgstr "" #~ "You can borrow `&str` slices from `String` via `&` and optionally range " #~ "selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " -#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و " +#~ "انتخاب محدوده به صورت اختیاری، قرض بگیرید." #~ 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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward " -#~ "declarations nor headers are necessary. " +#~ "We refer in `main` to a function written below. Neither forward declarations " +#~ "nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " -#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " -#~ "در بخش هدر نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " +#~ "می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر " +#~ "نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains " -#~ "`=n`, which causes it to include the upper bound." +#~ "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` است " -#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است که " +#~ "باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "" -#~ "All language items in Rust can be documented using special `///` syntax." +#~ msgid "All language items in Rust can be documented using special `///` syntax." #~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " -#~ "کرد." +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but " -#~ "in real code they should be present." +#~ "This course does not include rustdoc on slides, just to save space, but in " +#~ "real code they should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " -#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما " +#~ "در کدهای دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need " -#~ "not be addressed here." +#~ "Inner doc comments are discussed later (in the page on modules) and need not " +#~ "be addressed here." #~ msgstr "" #~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " #~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" #~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../" -#~ "testing/doc-tests.html)." +#~ "`cargo test`. We will discuss these tests in the [Testing section](../testing/" +#~ "doc-tests.html)." #~ msgstr "" #~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " -#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " -#~ "کرد." +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست " +#~ "نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a " -#~ "method is an instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای از " +#~ "نوعی است که با آن مرتبط است:" #~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's " -#~ "class." +#~ "We will look much more at methods in today's exercise and in tomorrow's class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "" -#~ "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " -#~ "آن را از `main` فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را " +#~ "از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static " -#~ "methods are commonly used to initialize structs (but don't have to). The " -#~ "actual constructor, `Rectangle { width, height }`, could be called " -#~ "directly. See the [Rustnomicon](https://doc.rust-lang.org/nomicon/" -#~ "constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static methods " +#~ "are commonly used to initialize structs (but don't have to). The actual " +#~ "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) را ببینید." #~ msgid "" #~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " #~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " -#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " -#~ "u32)` اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، " +#~ "با ارگمان‌های یک سازنده `Rectangle::square(width: u32)` " +#~ "اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -25119,13 +24589,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind " -#~ "of limited polymorphism on argument types. We will see more details in a " -#~ "later section." +#~ "When using generics, the standard library's `Into` can provide a kind of " +#~ "limited polymorphism on argument types. We will see more details in a later " +#~ "section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " -#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " -#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " +#~ "می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات " +#~ "بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -25144,98 +24614,95 @@ msgstr "" #~ msgid "" #~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo." -#~ "md) for details on installing Rust." +#~ "completion in your editor. See the page about [Using Cargo](../../cargo.md) " +#~ "for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " -#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " -#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل " +#~ "خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه " +#~ "مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets " -#~ "lose their state if you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets lose " +#~ "their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " -#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " -#~ "نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج " +#~ "شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." #~ msgid "" #~ "Rust will not automatically apply _implicit conversions_ between types " #~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " -#~ "`C++`](https://en.cppreference.com/w/cpp/language/" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-" -#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" -#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " -#~ "them. The `From` trait has a single `from()` method and similarly, the " -#~ "`Into` trait has a single `into()` method. Implementing these traits " -#~ "is how a type expresses that it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/" +#~ "std/convert/trait.From.html) and [`Into`](https://doc.rust-lang.org/std/" +#~ "convert/trait.Into.html) traits to let us convert between them. The `From` " +#~ "trait has a single `from()` method and similarly, the `Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " -#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "dir=ltr>`From`](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را پیاده‌سازی می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح را بدهند. " +#~ "با پیاده سازی ویژگی `From` همه انواع به صورت مشترک یک " +#~ "متد `from()` را دارند. با پیاده‌سازی تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان " +#~ "می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which " -#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " -#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " -#~ "for i16` implementation automatically create an implementation of " -#~ "`Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which means " +#~ "that we can convert a variable `x` of type `i8` to an `i16` by calling `i16::" +#~ "from(x)`. Or, simpler, with `x.into()`, because `From for i16` " +#~ "implementation automatically create an implementation of `Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " -#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " -#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " -#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد " +#~ "`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " +#~ "`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." +#~ "into()` ، زیرا پیاده‌سازی `From` برای نوع " +#~ "`i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, " -#~ "so it is sufficient to only implement `From` to get a respective `Into` " +#~ "The same applies for your own `From` implementations for your own types, so it " +#~ "is sufficient to only implement `From` to get a respective `Into` " #~ "implementation automatically." #~ msgstr "" #~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " #~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " -#~ "مربوطه را دریافت کنید." +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه " +#~ "را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " -#~ "برای انجام تبدیل استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای " +#~ "انجام تبدیل استفاده شود." #~ msgid "" #~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " #~ "`i128`) to see which types you can convert to which other types. Try " #~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/" -#~ "trait.From.html) to see if `From` is implemented for the pairs you " -#~ "check." +#~ "[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` برای " -#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) تغییر " +#~ "دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل کنید. سعی کنید " +#~ "انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات کتابخانه استاندارد]" +#~ "(https://doc.rust-lang.org/std/convert/trait.From.html) را بررسی کنید تا " +#~ "ببینید آیا `From` برای تبدیل انواع‌ایی که بررسی می‌کنید " +#~ "پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -25244,11 +24711,10 @@ msgstr "" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " #~ msgid "" -#~ "You can print such an array by asking for its debug representation with " -#~ "`{:?}`:" +#~ "You can print such an array by asking for its debug representation with `{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}" +#~ "` چاپ کنید:" #~ msgid "" #~ "Rust lets you iterate over things like arrays and ranges using the `for` " @@ -25261,36 +24727,36 @@ msgstr "" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " -#~ "your argument and return types? Something like `&[&[i32]]` for a two-" -#~ "dimensional slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your " +#~ "argument and return types? Something like `&[&[i32]]` for a two-dimensional " +#~ "slice-of-slices. Why or why not?" #~ msgstr "" #~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " -#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " -#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" +#~ "dir=ltr>`&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " +#~ "چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان " +#~ "پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " -#~ "quality implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " +#~ "implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-and-for-" +#~ "loops) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " -#~ "بعداً به ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for n in " +#~ "&array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به " +#~ "ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." @@ -25300,80 +24766,77 @@ msgstr "" #~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال ۲۰۲۱ " +#~ "معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-" +#~ "for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, " -#~ "then `[i32; 3]` is also a copy type." +#~ "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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to " -#~ "conditionally evaluate one of two blocks, but the blocks can have a value " -#~ "which then becomes the value of the `if` expression. Other control flow " -#~ "expressions work similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally " +#~ "evaluate one of two blocks, but the blocks can have a value which then becomes " +#~ "the value of the `if` expression. Other control flow expressions work " +#~ "similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " -#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " -#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " -#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود " +#~ "که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این " +#~ "بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته " +#~ "باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is " -#~ "the return value:" +#~ "The same rule is used for functions: the value of the function body is the " +#~ "return value:" #~ msgstr "" #~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " #~ "برگشتی است: " #~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in " -#~ "Rust. " +#~ "The point of this slide is to show that blocks have a type and value in Rust. " #~ msgstr "" #~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " #~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " -#~ "closely related to the [`while let` loop](while-let-expressions.md). It " -#~ "will automatically call `into_iter()` on the expression and then iterate " -#~ "over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely " +#~ "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()` را روی " -#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور نزدیکی به " +#~ "حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. حلقه `for` به " +#~ "طور خودکار `into_iter()` را روی عبارت فراخوانی می‌کند و " +#~ "سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." #~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " -#~ "کنید." +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که " -#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که ویژگی " +#~ "`Iterator` را پیاده‌سازی می‌کند." #~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every " -#~ "other element. " +#~ "`step_by` is a method that returns another `Iterator` that skips every other " +#~ "element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " -#~ "بقیه عناصر را برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه " +#~ "عناصر را برمی‌گرداند." #~ 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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را قابل " +#~ "تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v." +#~ "iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" @@ -25382,60 +24845,58 @@ msgstr "" #~ "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) وجود دارد که یک حلقه بی‌پایان " -#~ "ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/expressions/" +#~ "loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" #~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " -#~ "کنید:" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " -#~ "8` ) و آن را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the " -#~ "types less and less as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the types " +#~ "less and less as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " -#~ "کمتر و کمتر آن را نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و " +#~ "کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic " -#~ "container without the code ever explicitly specifying the contained type, " -#~ "using `_` as a placeholder:" +#~ "The following code tells the compiler to copy into a certain generic container " +#~ "without the code ever explicitly specifying the contained type, using `_` as a " +#~ "placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " -#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " -#~ "عنوان یک جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در " +#~ "یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک " +#~ "جایگزین برای اعلام نوع داده: " #~ msgid "" #~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" -#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" -#~ "lang.org/std/collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-" -#~ "HashSet%3CT,+S%3E) implements." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/std/" +#~ "iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.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) آن را پیاده‌سازی می‌کند." +#~ "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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse " -#~ "memory locations when shadowing an immutable variable in a scope, even if " -#~ "the type does not change." +#~ "The following code demonstrates why the compiler can't simply reuse memory " +#~ "locations when shadowing an immutable variable in a scope, even if the type " +#~ "does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " -#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " -#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که " +#~ "قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل " +#~ "تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" #~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " @@ -25448,19 +24909,18 @@ msgstr "" #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد " -#~ "استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده باشند. سپس " +#~ "می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There " -#~ "is no fall-through like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There is no " +#~ "fall-through like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " -#~ "از بالا به پایین نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از " +#~ "بالا به پایین نمی‌باشد." #~ msgid "" #~ "The match expression has a value. The value is the last expression in the " @@ -25470,17 +24930,17 @@ msgstr "" #~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته باشد، سپس " +#~ "کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه توی match " +#~ "اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " -#~ "را بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را " +#~ "بررسی می کند." #~ msgid "" #~ "It is possible to retrieve the discriminant by calling `std::mem::" @@ -25490,102 +24950,98 @@ msgstr "" #~ "تشخیصی پنهان را دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs " -#~ "where comparing field values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs where " +#~ "comparing field values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " -#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت " +#~ "`PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" -#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " -#~ "version cannot implement traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` " +#~ "with a top level `struct Click { ... }`. The inlined version cannot implement " +#~ "traits, for example." #~ msgstr "" #~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click " -#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " -#~ "را پیاده‌سازی کند." +#~ "dir=ltr>`WebEvent::Click(Click)` با `struct Click { ... }" +#~ "` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را " +#~ "پیاده‌سازی کند." #~ msgid "" #~ "Rust enums are packed tightly, taking constraints due to alignment into " #~ "account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " -#~ "های ناشی از هم ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های " +#~ "ناشی از هم ترازی:" #~ msgid "" #~ "Internally Rust is using a field (discriminant) to keep track of the enum " #~ "variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " -#~ "فیلدهای `enum` استفاده می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای " +#~ "`enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی " -#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی حافظه " +#~ "1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " -#~ "optimization, see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, " +#~ "see below)," #~ msgstr "" -#~ "dbg_size!(Option): " -#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " -#~ "(بهینه‌سازی خاص، در زیر ببینید)" +#~ "dbg_size!(Option): اندازه " +#~ "توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، " +#~ "در زیر ببینید)" -#~ msgid "" -#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی " -#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " -#~ "بیتی)" +#~ "dbg_size!(&i32): اندازه توی حافظه " +#~ "۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" #~ msgid "" #~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " #~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): " -#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " -#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): اندازه " +#~ "توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی " +#~ "اشاره‌گر NULL را در زیر ببینید)" #~ msgid "" #~ "Niche optimization: Rust will merge unused bit patterns for the enum " #~ "discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " -#~ "`Enum` ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` " +#~ "ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain " -#~ "more than 256 `Option`s together." +#~ "More complex example if you want to discuss what happens when we chain more " +#~ "than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " -#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد " +#~ "`Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" -#~ "example/flow_control/let_else.html) construct allows to do a " -#~ "destructuring assignment, or if it fails, execute a block which is " -#~ "required to abort normal control flow (with `panic`/`return`/`break`/" -#~ "`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/" +#~ "flow_control/let_else.html) construct allows to do a destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-lang.org/" +#~ "rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک انتساب به صورت " +#~ "destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا کند که برای خاتمه " +#~ "دادن به جریان کنترل عادی (با panic/return/break/continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" -#~ "match-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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-" +#~ "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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-expr." +#~ "html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از این نظر، " +#~ "مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." #~ msgstr "" @@ -25593,76 +25049,71 @@ msgstr "" #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و " -#~ "خطا را توضیح دهید." +#~ ".as_deref() را حذف کنید و خطا را " +#~ "توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot " -#~ "match against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot match " +#~ "against `String`." #~ msgstr "" -#~ "std::env::args().next() یک " -#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " -#~ "عنوان `String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان " +#~ "`String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our " -#~ "case, this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "dir=ltr>`Option` را به `Option<&T::Target>` " +#~ "تبدیل می‌کند. در مورد ما، این `Option` را به `Option<&str>` تبدیل می‌کند." #~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside " -#~ "`Option`." +#~ "We can now use pattern matching to match against the `&str` inside `Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " -#~ "داخل `Option` استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل " +#~ "`Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "" -#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف `q`، " +#~ "به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable " -#~ "patterns, as the term can show up in error messages." +#~ "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) باشد، زیرا این اصطلاح می تواند در پیام های خطا " -#~ "ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار (irrefutable " +#~ "patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" #~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of " -#~ "fixed length." +#~ "Destructuring of slices of unknown length also works with patterns of fixed " +#~ "length." #~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " -#~ "کار می کند." +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می " +#~ "کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت " -#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت بولین " +#~ "دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "" -#~ "You can use the variables defined in the pattern in your if expression." -#~ msgstr "" -#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "You can use the variables defined in the pattern in your if expression." +#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -25678,41 +25129,36 @@ msgstr "" #~ 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." +#~ "integers. Then, revisit the solution and try to implement it with iterators." #~ msgstr "" -#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " -#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " -#~ "کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح " +#~ "حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based " -#~ "memory management, and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based memory " +#~ "management, and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " -#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت " +#~ "حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "" -#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "" -#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " -#~ "`Rc` and `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` " +#~ "and `Arc`." #~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " -#~ "`Rc` و `Arc`." +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و " +#~ "`Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "" -#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -25727,84 +25173,76 @@ msgstr "" #~ "If not done with care, this can lead to crashes, bugs, security " #~ "vulnerabilities, and memory leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " -#~ "امنیتی و نشتی حافظه شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی " +#~ "و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" #~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " -#~ "کنید:" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and " -#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " -#~ "freeing the pointer twice, or accessing a freed pointer can lead to " -#~ "exploitable security vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and `free`: " +#~ "the pointer is lost and we cannot deallocate the memory. Worse, freeing the " +#~ "pointer twice, or accessing a freed pointer can lead to exploitable security " +#~ "vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " -#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " -#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " -#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه " +#~ "نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، " +#~ "آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر " +#~ "به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "" -#~ "Constructors and destructors let you hook into the lifetime of an object." +#~ msgid "Constructors and destructors let you hook into the lifetime of an object." #~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " -#~ "شوید." +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object " -#~ "is destroyed. The compiler guarantees that this happens, even if an " -#~ "exception is raised." +#~ "By wrapping a pointer in an object, you can free memory when the object is " +#~ "destroyed. The compiler guarantees that this happens, even if an exception is " +#~ "raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " -#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " -#~ "exception ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را " +#~ "آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception " +#~ "ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and " -#~ "gives you smart pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and gives " +#~ "you smart pointers." #~ msgstr "" #~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " #~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to " -#~ "memory allocated on the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory " +#~ "allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " -#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به " +#~ "حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "" -#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." #~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " -#~ "اجرا می‌شود." +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا " +#~ "می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "" -#~ "Special move constructors are used when passing ownership to a function:" -#~ msgstr "" -#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "Special move constructors are used when passing ownership to a function:" +#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic " -#~ "memory management:" +#~ "An alternative to manual and scope-based memory management is automatic memory " +#~ "management:" #~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " -#~ "است:" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." #~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the " -#~ "programmer." +#~ "A garbage collector finds unused memory and deallocates it for the programmer." #~ msgstr "" #~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " #~ "تخصیص‌زدایی (آزاد) می‌کند." @@ -25826,15 +25264,15 @@ msgstr "" #~ msgid "Scope-based like C++, but the compiler enforces full adherence." #~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " -#~ "رعایت می‌کند." +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت " +#~ "می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even " -#~ "have no cost at runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even have " +#~ "no cost at runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " -#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، " +#~ "برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." @@ -25842,26 +25280,25 @@ msgstr "" #~ msgid "" #~ "If asked how at this point, you can mention that in Rust this is usually " #~ "handled by RAII wrapper types such as [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), or [Arc]" -#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " -#~ "ownership and memory allocation via various means, and prevent the " -#~ "potential errors in C." +#~ "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), or [Arc](https://" +#~ "doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate 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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید به " +#~ "این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی [Drop]" +#~ "(https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -25872,18 +25309,17 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "" -#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a " -#~ "way to generate code in Rust at compile time. In this case the default " +#~ "If students ask about `derive`, it is sufficient to say that this is a way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای تولید " +#~ "کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض صفت‌های " +#~ "`Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" diff --git a/src/running-the-course/translations.md b/src/running-the-course/translations.md index 1af0ee5699c..784e3668082 100644 --- a/src/running-the-course/translations.md +++ b/src/running-the-course/translations.md @@ -14,7 +14,8 @@ volunteers: - [Korean][ko] by [@keispace], [@jiyongp], [@jooyunghan], and [@namhyung]. - [Spanish][es] by [@deavid]. - [Ukrainian][uk] by [@git-user-cpp], [@yaremam] and [@reta]. - +- [Farsi][fa] by [@DannyRavi], [@javad-jafari], [@Alix1383], [@moaminsharifi] , [@hamidrezakp] and [@mehrad77]. + . Use the language picker in the top-right corner to switch between languages. ## Incomplete Translations @@ -24,8 +25,6 @@ recently updated translations: - [Arabic][ar] by [@younies] - [Bengali][bn] by [@raselmandol]. -- [Farsi][fa] by [@Alix1383], [@DannyRavi], [@hamidrezakp], [@javad-jafari] and - [@moaminsharifi]. - [French][fr] by [@KookaS], [@vcaen] and [@AdrienBaudemont]. - [German][de] by [@Throvn] and [@ronaldfw]. - [Italian][it] by [@henrythebuilder] and [@detro]. From 007b1adc351041f6052d5ca53746074a9da103c6 Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 13 Oct 2024 23:07:08 +0330 Subject: [PATCH 86/92] fa: try to Complete Farsi part4 fmt --- po/fa.po | 14356 ++++++++++++++++++++++++++++------------------------- 1 file changed, 7556 insertions(+), 6800 deletions(-) diff --git a/po/fa.po b/po/fa.po index 624a328eb16..36236006f39 100644 --- a/po/fa.po +++ b/po/fa.po @@ -52,14 +52,15 @@ msgstr "اجرای کد به صورت لوکال با cargo" msgid "Day 1: Morning" msgstr "روز ۱: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md -#: src/concurrency/welcome-async.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "خوش آمدید" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/hello-world.md src/types-and-values.md src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "سلام, دنیا" @@ -75,8 +76,8 @@ msgstr "مزیت‌های زبان Rust" msgid "Playground" msgstr "Playground" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "تایپ‌ها و مقادیر" @@ -104,16 +105,17 @@ msgstr "تمرین: دنباله فیبوناچی" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md src/std-traits/solution.md -#: src/memory-management/solution.md src/smart-pointers/solution.md -#: src/borrowing/solution.md src/lifetimes/solution.md src/iterators/solution.md -#: src/modules/solution.md src/testing/solution.md src/error-handling/solution.md +#: src/generics/solution.md src/std-types/solution.md +#: src/std-traits/solution.md src/memory-management/solution.md +#: src/smart-pointers/solution.md src/borrowing/solution.md +#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md +#: src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "راه‌حل" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-1.md -#: src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "مبانی پایه کنترل جریان" @@ -150,7 +152,8 @@ msgstr "بلوک‌ها و محدوده‌ها" msgid "Scopes and Shadowing" msgstr "محدوده‌ها و سایه‌گذاری" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "توابع" @@ -158,7 +161,8 @@ msgstr "توابع" msgid "Macros" msgstr "ماکروها" -#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "تمرین: دنباله Collatz" @@ -183,7 +187,8 @@ msgstr "تاپل‌ها" msgid "Array Iteration" msgstr "تکرار ارایه" -#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "الگو‌ها و ضدِ ساختارها" @@ -221,11 +226,13 @@ msgstr "تمرین: هندسه" msgid "User-Defined Types" msgstr "تایپ‌های تعریف شده توسط کاربر" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md msgid "Named Structs" msgstr "ساختارهای نام‌دار" -#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "ساختار‌ تاپل‌ها" @@ -254,8 +261,8 @@ msgstr "تمرین: رویدادهای آسانسور" msgid "Day 2: Morning" msgstr "روز ۲: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "تطبیق" @@ -272,7 +279,8 @@ msgstr "تخریب ساختارها" msgid "Destructuring Enums" msgstr "Enum‌ های تفکیک‌‌پذیر" -#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "کنترل جریان Let" @@ -280,8 +288,8 @@ msgstr "کنترل جریان Let" msgid "Exercise: Expression Evaluation" msgstr "تمرین: ارزیابی عبارت" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-2.md -#: src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "متدها و تریت‌ها" @@ -430,8 +438,8 @@ msgstr "تمرین: ROT13" msgid "Day 3: Morning" msgstr "روز ۳: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "مدیریت حافظه" @@ -467,8 +475,8 @@ msgstr "`Drop`" msgid "Exercise: Builder Type" msgstr "تمرین: تایپ‌های سازنده" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-3.md -#: src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "اشاره‌گرهای هوشمند" @@ -543,8 +551,8 @@ msgstr "تمرین: تجزیه Protobuf" msgid "Day 4: Morning" msgstr "روز چهارم: صبح" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/iterators.md msgid "Iterators" msgstr "Iterators" @@ -564,8 +572,8 @@ msgstr "`FromIterator`" msgid "Exercise: Iterator Method Chaining" msgstr "تمرین: روش Iterator Chaining" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/modules.md src/modules/modules.md msgid "Modules" msgstr "ماژول‌ها" @@ -585,8 +593,8 @@ msgstr "" msgid "Exercise: Modules for a GUI Library" msgstr "تمرین: ماژولهایی برای کتابخانه رابط کاربری گرافیکی" -#: src/SUMMARY.md src/running-the-course/course-structure.md src/welcome-day-4.md -#: src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/testing.md src/chromium/testing.md msgid "Testing" msgstr "تست‌کردن" @@ -960,7 +968,8 @@ msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کن msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." -#: src/SUMMARY.md src/chromium/adding-third-party-crates/depending-on-a-crate.md +#: src/SUMMARY.md +#: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "وابسته به یک Crate" @@ -1048,7 +1057,8 @@ msgid "Compass" msgstr "قطب‌نما" #: src/SUMMARY.md src/concurrency/sync-exercises.md -#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md #: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "راه حل‌ها" @@ -1167,11 +1177,13 @@ msgstr "کانال‌ها" msgid "Senders and Receivers" msgstr "متد دریافتی" -#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "کانال‌های نامحدود" -#: src/SUMMARY.md src/concurrency/channels.md src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "کانال‌های محدود" @@ -1193,7 +1205,8 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync.md src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "مثال‌ها" @@ -1218,7 +1231,8 @@ msgstr "مثال" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/dining-philosophers.md -#: src/concurrency/sync-exercises/solutions.md src/concurrency/async-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "فلسفه Dining" @@ -1331,53 +1345,53 @@ msgstr "اعتبارها" #: src/index.md msgid "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" -"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" -"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " -"contributors](https://img.shields.io/github/contributors/google/comprehensive-" -"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" -"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" -"rust/stargazers)" -msgstr "" -"[![Build workflow](https://img.shields.io/github/actions/workflow/status/google/" -"comprehensive-rust/build.yml?style=flat-square)](https://github.com/google/" -"comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [![GitHub " -"contributors](https://img.shields.io/github/contributors/google/comprehensive-" -"rust?style=flat-square)](https://github.com/google/comprehensive-rust/graphs/" -"contributors) [![GitHub stars](https://img.shields.io/github/stars/google/" -"comprehensive-rust?style=flat-square)](https://github.com/google/comprehensive-" -"rust/stargazers)" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" +"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" +"[GitHub contributors](https://img.shields.io/github/contributors/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/" +"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" +msgstr "" +"[![Build workflow](https://img.shields.io/github/actions/workflow/status/" +"google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" +"google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" +"[GitHub contributors](https://img.shields.io/github/contributors/google/" +"comprehensive-rust?style=flat-square)](https://github.com/google/" +"comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" #: src/index.md msgid "" -"This is a free Rust course developed by the Android team at Google. The course " -"covers the full spectrum of Rust, from basic syntax to advanced topics like " -"generics and error handling." +"This is a free Rust course developed by the Android team at Google. The " +"course covers the full spectrum of Rust, from basic syntax to advanced " +"topics like generics and error handling." msgstr "" -"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این این " -"دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته مانند " -"جنریک و مدیریت خطاها." +"این یک دوره رایگان Rust است که توسط تیم اندروید در گوگل توسعه یافته است. این " +"این دوره طیف کامل‌ای از Rust را پوشش میدهد, از مباحث پایه تا مباحث پیشرفته " +"مانند جنریک و مدیریت خطاها." #: src/index.md msgid "" "The latest version of the course can be found at . If you are reading somewhere else, please check there for " -"updates." +"comprehensive-rust/>. If you are reading somewhere else, please check there " +"for updates." msgstr "" -"آخرین نسخه از دوره را میتوان در " -"پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را نیز " -"بررسی کنید." +"آخرین نسخه از دوره را میتوان در پیدا کنید. اگر از جای دیگری میخوانید, لطفا برای بروز رسانی‌ها منبع اصلی را " +"نیز بررسی کنید." #: src/index.md msgid "" -"The course is available in other languages. Select your preferred language in the " -"top right corner of the page or check the [Translations](running-the-course/" -"translations.md) page for a list of all available translations." +"The course is available in other languages. Select your preferred language " +"in the top right corner of the page or check the [Translations](running-the-" +"course/translations.md) page for a list of all available translations." msgstr "" -"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست بالای " -"صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) را برای " -"فهرستی از تمام ترجمه‌های موجود را بررسی کنید." +"این دوره به زبان های دیگر موجود است. زبان مورد نظر خود را در گوشه سمت راست " +"بالای صفحه انتخاب کنید یا صفحه [ترجمه‌ها](running-the-course/translations.md) " +"را برای فهرستی از تمام ترجمه‌های موجود را بررسی کنید." #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." @@ -1385,11 +1399,11 @@ msgstr "این دوره نیز [به عنوان یک PDF](comprehensive-rust.pd #: src/index.md msgid "" -"The goal of the course is to teach you Rust. We assume you don't know anything " -"about Rust and hope to:" +"The goal of the course is to teach you Rust. We assume you don't know " +"anything about Rust and hope to:" msgstr "" -"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust نمی " -"دانید :" +"هدف از این دوره آموزش Rust به شماست. ما فرض می کنیم شما چیزی از درباره Rust " +"نمی دانید :" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1398,8 +1412,8 @@ msgstr "درک جامعی از syntax و زبان Rust به شما می دهد." #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "" -"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را در " -"Rust بنویسید." +"شما را قادر می سازد تا برنامه های موجود را تغییر دهید و برنامه های جدید را " +"در Rust بنویسید." #: src/index.md msgid "Show you common Rust idioms." @@ -1412,7 +1426,8 @@ msgstr "ما چهار روز اول دوره را اصول Rust می نامیم #: src/index.md msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" +msgstr "" +"با تکیه بر این، از شما دعوت می شود تا به یک یا چند موضوع تخصصی بپردازید:" #: src/index.md msgid "" @@ -1424,13 +1439,13 @@ msgstr "" #: src/index.md msgid "" -"[Chromium](chromium.md): a half-day course on using Rust within Chromium based " -"browsers. This includes interoperability with C++ and how to include third-party " -"crates in Chromium." +"[Chromium](chromium.md): a half-day course on using Rust within Chromium " +"based browsers. This includes interoperability with C++ and how to include " +"third-party crates in Chromium." msgstr "" -"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در مرورگرهای " -"مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن جعبه " -"های(crates) شخص ثالث در کروم است." +"[Chromium](chromium.md): یک دوره نیم روزه در مورد استفاده از Rust در " +"مرورگرهای مبتنی بر Chromium. این شامل قابلیت همکاری با C ++ و نحوه قرار دادن " +"جعبه های(crates) شخص ثالث در کروم است." #: src/index.md msgid "" @@ -1439,20 +1454,21 @@ msgid "" "covered." msgstr "" "[Bare-metal](bare-metal.md): یک کلاس تمام روز در مورد استفاده از Rust برای " -"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش داده " -"شده اند." +"توسعهbare-metal (تعریف شده). هم میکروکنترلرها و هم پردازنده های برنامه پوشش " +"داده شده اند." #: src/index.md #, fuzzy msgid "" -"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in Rust. " -"We cover both classical concurrency (preemptively scheduling using threads and " -"mutexes) and async/await concurrency (cooperative multitasking using futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " +"Rust. We cover both classical concurrency (preemptively scheduling using " +"threads and mutexes) and async/await concurrency (cooperative multitasking " +"using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " -"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از threadها و " -"mutexها ) و async/await concurrency (multitasking مشارکتی) با استفاده از futures " -"را پوشش خواهیم داد." +"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " +"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " +"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " +"استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1460,8 +1476,8 @@ msgstr "اهداف خارج از این دوره" #: src/index.md msgid "" -"Rust is a large language and we won't be able to cover all of it in a few days. " -"Some non-goals of this course are:" +"Rust is a large language and we won't be able to cover all of it in a few " +"days. Some non-goals of this course are:" msgstr "" "زبان Rust, یک زبان بزرگ است و ما نمی‌توانیم طی چند روز همه موارد را پوشش دهیم." "چندتا از اهداف خارج از این دوره عبارتند از:" @@ -1472,9 +1488,9 @@ msgid "" "(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" "(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book](https://" -"doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example](https://doc.rust-" -"lang.org/rust-by-example/macros.html) را برسی کنید." +"برای آموزش چگونه‌گی توسعه Macro ها: لطفا [Chapter 19.5 in the Rust Book]" +"(https://doc.rust-lang.org/book/ch19-06-macros.html) و [Rust by Example]" +"(https://doc.rust-lang.org/rust-by-example/macros.html) را برسی کنید." #: src/index.md msgid "Assumptions" @@ -1482,14 +1498,14 @@ msgstr "فرض میشود" #: src/index.md msgid "" -"The course assumes that you already know how to program. Rust is a statically-" -"typed language and we will sometimes make comparisons with C and C++ to better " -"explain or contrast the Rust approach." +"The course assumes that you already know how to program. Rust is a " +"statically-typed language and we will sometimes make comparisons with C and " +"C++ to better explain or contrast the Rust approach." msgstr "" "این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" " Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم تا " -"رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " +"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." #: src/index.md msgid "" @@ -1502,12 +1518,12 @@ msgstr "" #: src/index.md msgid "" "This is an example of a _speaker note_. We will use these to add additional " -"information to the slides. This could be key points which the instructor should " -"cover as well as answers to typical questions which come up in class." +"information to the slides. This could be key points which the instructor " +"should cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا اطلاعات " -"بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید پوشش دهد و " -"همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " +"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " +"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -1515,22 +1531,24 @@ msgstr "این صفحه برای مدرس دوره است." #: src/running-the-course.md msgid "" -"Here is a bit of background information about how we've been running the course " -"internally at Google." -msgstr "اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." +"Here is a bit of background information about how we've been running the " +"course internally at Google." +msgstr "" +"اینجا بخشی از پیشینه نحوه برگزاری دوره توسط گوگل به صورت درون سازمانی است." #: src/running-the-course.md msgid "" -"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break in " -"the middle. This leaves 3 hours for the morning class and 3 hours for the " -"afternoon class. Both sessions contain multiple breaks and time for students to " -"work on exercises." +"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " +"in the middle. This leaves 3 hours for the morning class and 3 hours for the " +"afternoon class. Both sessions contain multiple breaks and time for students " +"to work on exercises." msgstr "" -"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت استراحت " -"ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت برای کلاس " -"بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: شما می‌توانید ۳ " -"ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته منفی این کار این است که " -"با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از ظهر خیلی خسته میشوند." +"ما معمولا کلاس‌ها را از ساعت ۱۰:۰۰ تا ۱۶:۰۰ برگزار می کنیم، با یک ساعت " +"استراحت ناهار در میانه روز با این رویه ۲.۵ ساعت برای کلاس صبح و ۲.۵ ساعت " +"برای کلاس بعدازظهر باقی می‌گذارد. توجه داشته باشید که این فقط یک توصیه است: " +"شما می‌توانید ۳ ساعت از جلسه صبح را صرف تمرین بیشتر برای افراد کنید. نکته " +"منفی این کار این است که با جلسه طولانی تر افراد بعد از ۶ ساعت کلاس در بعد از " +"ظهر خیلی خسته میشوند." #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1538,100 +1556,103 @@ msgstr "قبل از اجرای دوره، شما می‌خواهید:" #: src/running-the-course.md msgid "" -"Make yourself familiar with the course material. We've included speaker notes to " -"help highlight the key points (please help us by contributing more speaker " -"notes!). When presenting, you should make sure to open the speaker notes in a " -"popup (click the link with a little arrow next to \"Speaker Notes\"). This way " -"you have a clean screen to present to the class." +"Make yourself familiar with the course material. We've included speaker " +"notes to help highlight the key points (please help us by contributing more " +"speaker notes!). When presenting, you should make sure to open the speaker " +"notes in a popup (click the link with a little arrow next to \"Speaker " +"Notes\"). This way you have a clean screen to present to the class." msgstr "" -"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن نکات " -"کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک کنید!). " -"هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره پاپ‌آپ باز کنید " -"(روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک کنید). به این ترتیب یک " -"صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." +"با مطالب دوره آشنا شوید. ما یادداشت های سخنرانی را برای کمک به برجسته کردن " +"نکات کلیدی گنجانده‌ایم (لطفا با مشارکت بیشتر در یادداشت‌های سخنران به ما کمک " +"کنید!). هنگام ارائه، باید مطمئن شوید که یادداشت‌های سخنران را در یک پنجره " +"پاپ‌آپ باز کنید (روی پیوند با یک فلش کوچک در کنار «یادداشت‌های سخنران» کلیک " +"کنید). به این ترتیب یک صفحه نمایش تمیز برای ارائه به کلاس خواهید داشت." #: src/running-the-course.md msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " -"schedule the days over two weeks. Course participants have said that they find it " -"helpful to have a gap in the course since it helps them process all the " -"information we give them." +"schedule the days over two weeks. Course participants have said that they " +"find it helpful to have a gap in the course since it helps them process all " +"the information we give them." msgstr "" "در مورد زمان‌بندی دوره تصمیم بگیرید. از آنجایی که دوره حداقل سه روز کامل طول " -"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در دوره " -"گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا تمام " -"اطلاعاتی را که به آنها می‌دهیم پردازش کنند." +"می‌کشد، توصیه می‌کنیم که دوره را در دو هفته برنامه‌ریزی کنید. شرکت کنندگان در " +"دوره گفته‌اند که داشتن فاصله‌ای در دوره مفید است، زیرا به آنها کمک می‌کند تا " +"تمام اطلاعاتی را که به آنها می‌دهیم پردازش کنند." #: src/running-the-course.md msgid "" -"Find a room large enough for your in-person participants. We recommend a class " -"size of 15-25 people. That's small enough that people are comfortable asking " -"questions --- it's also small enough that one instructor will have time to answer " -"the questions. Make sure the room has _desks_ for yourself and for the students: " -"you will all need to be able to sit and work with your laptops. In particular, " -"you will be doing a lot of live-coding as an instructor, so a lectern won't be " -"very helpful for you." -msgstr "" -"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ نفر " -"را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- همچنین " -"مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که اتاق مورد نظر " -"_میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که بتونید بشنید و با لپتاپ " -"های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-coding انجام خواهید داد پس " -"صرفا یک میز بدون جا برای لپتاپ برای شما مناسب نخواهد بود." +"Find a room large enough for your in-person participants. We recommend a " +"class size of 15-25 people. That's small enough that people are comfortable " +"asking questions --- it's also small enough that one instructor will have " +"time to answer the questions. Make sure the room has _desks_ for yourself " +"and for the students: you will all need to be able to sit and work with your " +"laptops. In particular, you will be doing a lot of live-coding as an " +"instructor, so a lectern won't be very helpful for you." +msgstr "" +"یک اتاق بزرگ برای حضور شرکت کنندگان پیدا کنید. ما کلاسی با گنجایش ۱۵ الی ۲۵ " +"نفر را پیشنهاد می‌کنیم. افراد در این تعداد می‌توانند به راحتی سوال بپرسند --- " +"همچنین مدرس وقت کافی برای پاسخ‌ دادن به سوالات را نیز دارد. مطمئن شوید که " +"اتاق مورد نظر _میز_ برای شما و دانشجویان دارد: شما همگی نیاز دارید که " +"بتونید بشنید و با لپتاپ های خود کار کنید. به خصوص شما به عنوان مدرس کلی live-" +"coding انجام خواهید داد پس صرفا یک میز بدون جا برای لپتاپ برای شما مناسب " +"نخواهد بود." #: src/running-the-course.md msgid "" -"On the day of your course, show up to the room a little early to set things up. " -"We recommend presenting directly using `mdbook serve` running on your laptop (see " -"the [installation instructions](https://github.com/google/comprehensive-" -"rust#building)). This ensures optimal performance with no lag as you change " -"pages. Using your laptop will also allow you to fix typos as you or the course " -"participants spot them." +"On the day of your course, show up to the room a little early to set things " +"up. We recommend presenting directly using `mdbook serve` running on your " +"laptop (see the [installation instructions](https://github.com/google/" +"comprehensive-rust#building)). This ensures optimal performance with no lag " +"as you change pages. Using your laptop will also allow you to fix typos as " +"you or the course participants spot them." msgstr "" -"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما توصیه " -"می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. ([راهنمای " -"نصب](https://github.com/google/comprehensive-rust#building) را ببنیید). با این " -"کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. استفاده از لپ تاپ همچنین " -"به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده شما یا شرکت کنندگان در دوره " -"اصلاح کنید." +"در روز برگزاری دوره، کمی زودتر به کلاس بیایید تا همه چیز را آماده کنید. ما " +"توصیه می کنیم مستقیماً با استفاده از `mdbook serve`را در لپتاپ خود اجرا کنید. " +"([راهنمای نصب](https://github.com/google/comprehensive-rust#building) را " +"ببنیید). با این کار عملکرد بدون تاخیر در هنگام تغییر صفحات تضمین می شود. " +"استفاده از لپ تاپ همچنین به شما امکان می دهد اشتباهات تایپی ا در صورت مشاهده " +"شما یا شرکت کنندگان در دوره اصلاح کنید." #: src/running-the-course.md msgid "" -"Let people solve the exercises by themselves or in small groups. We typically " -"spend 30-45 minutes on exercises in the morning and in the afternoon (including " -"time to review the solutions). Make sure to ask people if they're stuck or if " -"there is anything you can help with. When you see that several people have the " -"same problem, call it out to the class and offer a solution, e.g., by showing " -"people where to find the relevant information in the standard library." -msgstr "" -"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول ۳۰ " -"الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل ها ) " -"صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد که " -"می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, خطاب به " -"کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که می‌توانند اطلاعات " -"مربوطه را در کتابخانه استاندارد (standard library) پیدا کنند." +"Let people solve the exercises by themselves or in small groups. We " +"typically spend 30-45 minutes on exercises in the morning and in the " +"afternoon (including time to review the solutions). Make sure to ask people " +"if they're stuck or if there is anything you can help with. When you see " +"that several people have the same problem, call it out to the class and " +"offer a solution, e.g., by showing people where to find the relevant " +"information in the standard library." +msgstr "" +"بگذارید افراد خودشان یا در گروه های کوچک تمرینات را حل کنند. مابه طور معمول " +"۳۰ الی ۴۵ دقیقه را برای تمرینات در صبح و بعد‌از‌ظهر (از جمله زمان بررسی راه حل " +"ها ) صرف می‌کنیم. حتما از افراد بخواهید که اگر گیر کرده‌اند یا چیزی وجود دارد " +"که می‌توانید به آنها کمک کنید. وقتی که می‌بینید چندین نفر مشکل یکسانی دارند, " +"خطاب به کلاس راه‌حل را پیشنهاد دهید؛ به عنوان مثال، با نشان دادن جایی که " +"می‌توانند اطلاعات مربوطه را در کتابخانه استاندارد (standard library) پیدا " +"کنند." #: src/running-the-course.md msgid "" -"That is all, good luck running the course! We hope it will be as much fun for you " -"as it has been for us!" +"That is all, good luck running the course! We hope it will be as much fun " +"for you as it has been for us!" msgstr "" -"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان اندازه " -"که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" +"همش همین بود! در تدریس دوره موفق باشید! امیدواریم که برای شما هم به همان " +"اندازه که برای ما لذت‌بخش بوده، لذت‌بخش باشد!" #: src/running-the-course.md msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" -"discussions/86) afterwards so that we can keep improving the course. We would " -"love to hear what worked well for you and what can be made better. Your students " -"are also very welcome to [send us feedback](https://github.com/google/" -"comprehensive-rust/discussions/100)!" +"discussions/86) afterwards so that we can keep improving the course. We " +"would love to hear what worked well for you and what can be made better. " +"Your students are also very welcome to [send us feedback](https://github.com/" +"google/comprehensive-rust/discussions/100)!" msgstr "" -"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-rust/" -"discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست داریم " -"بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور شما " -"دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://github.com/" -"google/comprehensive-rust/discussions/100) !" +"لطفاً [بازخورد خود را ارائه دهید](https://github.com/google/comprehensive-" +"rust/discussions/86) تا در آینده بتوانیم به بهبود دوره ادامه دهیم. ما دوست " +"داریم بشنویم چه چیزی برای شما خوب بوده و چه چیزی می تواند بهتر شود. همینطور " +"شما دانش‌آموزان نیز بسیار خوش آمدید [برای ما بازخورد ارسال کنید](https://" +"github.com/google/comprehensive-rust/discussions/100) !" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" @@ -1639,11 +1660,11 @@ msgstr "مبانی Rust" #: src/running-the-course/course-structure.md msgid "" -"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days " -"are fast paced and we cover a lot of ground!" +"The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " +"days are fast paced and we cover a lot of ground!" msgstr "" -"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این سه روز " -"با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" +"سه روز اول دوره را [مبانی Rust ](../welcome-day-1.md)تشکیل میدهند. این این " +"سه روز با سرعت بالایی پیش می‌روند و ما موارد زیادی را پوشش می‌دهیم!" #: src/running-the-course/course-structure.md msgid "Course schedule:" @@ -1667,11 +1688,12 @@ msgstr "بخش" #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md #: src/methods-and-traits.md src/welcome-day-2-afternoon.md src/generics.md -#: src/std-types.md src/std-traits.md src/welcome-day-3.md src/memory-management.md -#: src/smart-pointers.md src/welcome-day-3-afternoon.md src/borrowing.md -#: src/lifetimes.md src/welcome-day-4.md src/iterators.md src/modules.md -#: src/testing.md src/welcome-day-4-afternoon.md src/error-handling.md -#: src/unsafe-rust.md src/concurrency/welcome.md src/concurrency/threads.md +#: src/std-types.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/threads.md #: src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md @@ -1683,10 +1705,10 @@ msgstr "مدت زمان" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/user-defined-types.md src/generics.md src/std-types.md src/std-traits.md -#: src/memory-management.md src/smart-pointers.md src/lifetimes.md src/iterators.md -#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -#: src/concurrency/shared-state.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "5 minutes" msgstr "۵ دقیقه" @@ -1783,7 +1805,8 @@ msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" msgstr "" -"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می دهیم:" +"علاوه بر کلاس 4 روزه Rust Fundamentals، موضوعات تخصصی تری را نیز پوشش می " +"دهیم:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1791,38 +1814,38 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Android](../android.md) deep dive is a half-day course on using Rust " -"for Android platform development. This includes interoperability with C, C++, and " -"Java." +"The [Rust in Android](../android.md) deep dive is a half-day course on using " +"Rust for Android platform development. This includes interoperability with " +"C, C++, and Java." msgstr "" -"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد استفاده " -"از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل با C، C++ و جاوا می‌شود." +"در [Rust در اندروید](../android.md) توی دوره یک دوره نیم روزه در مورد " +"استفاده از Rust برای توسعه پلتفرم اندروید عمیق می‌شیم. این شامل قابلیت تعامل " +"با C، C++ و جاوا می‌شود." #: src/running-the-course/course-structure.md msgid "" -"You will need an [AOSP checkout](https://source.android.com/docs/setup/download/" -"downloading). Make a checkout of the [course repository](https://github.com/" -"google/comprehensive-rust) on the same machine and move the `src/android/` " -"directory into the root of your AOSP checkout. This will ensure that the Android " -"build system sees the `Android.bp` files in `src/android/`." +"You will need an [AOSP checkout](https://source.android.com/docs/setup/" +"download/downloading). Make a checkout of the [course repository](https://" +"github.com/google/comprehensive-rust) on the same machine and move the `src/" +"android/` directory into the root of your AOSP checkout. This will ensure " +"that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" -"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/setup/" -"download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://github.com/" -"google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/android/`مخزن " -"ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build اندروید فایل های " -"`Android.bp` را در `src/android/` می‌بینید." +"شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" +"setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" +"github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" +"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " +"اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md msgid "" -"Ensure that `adb sync` works with your emulator or real device and pre-build all " -"Android examples using `src/android/build_all.sh`. Read the script to see the " -"commands it runs and make sure they work when you run them by hand." +"Ensure that `adb sync` works with your emulator or real device and pre-build " +"all Android examples using `src/android/build_all.sh`. Read the script to " +"see the commands it runs and make sure they work when you run them by hand." msgstr "" -"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و همه " -"نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل بسازید. " -"اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید که وقتی آنها " -"را اجرا می‌کنید به درستی کار می‌کنند." +"اطمینان حاصل کنید که `adb sync` با شبیه‌ساز یا دستگاه واقعی شما کار می‌کند و " +"همه نمونه‌های Android را با استفاده از `src/android/build_all.sh` از قبل " +"بسازید. اسکریپت را بخوانید تا دستوراتی را که اجرا می‌کند ببینید و مطمئن شوید " +"که وقتی آنها را اجرا می‌کنید به درستی کار می‌کنند." #: src/running-the-course/course-structure.md msgid "Rust in Chromium" @@ -1830,24 +1853,25 @@ msgstr "Rust در اندروید" #: src/running-the-course/course-structure.md msgid "" -"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on using " -"Rust as part of the Chromium browser. It includes using Rust in Chromium's `gn` " -"build system, bringing in third-party libraries (\"crates\") and C++ " -"interoperability." +"The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " +"using Rust as part of the Chromium browser. It includes using Rust in " +"Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " +"and C++ interoperability." msgstr "" -"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از Rust به " -"عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم ساخت `gn‍` " -"Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری ++C است." +"عمیق [Rust in Chromium](../chromium.md) یک دوره نیم روزه برای استفاده از " +"Rust به عنوان بخشی از مرورگر Chromium است. این شامل استفاده از Rust در سیستم " +"ساخت `gn‍` Chromium، آوردن کتابخانه‌های شخص ثالث (\"crates\") و قابلیت همکاری +" +"+C است." #: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " -"[recommended](../chromium/setup.md) for speed but any build will work. Ensure " -"that you can run the Chromium browser that you've built." +"[recommended](../chromium/setup.md) for speed but any build will work. " +"Ensure that you can run the Chromium browser that you've built." msgstr "" -"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای سرعت " -"[توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. مطمئن شوید که " -"می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." +"شما باید بتوانید Chromium را بسازید --- یک اشکال زدایی، ساخت کامپوننت برای " +"سرعت [توصیه می شود] (../chromium/setup.md) است، اما هر ساختی کار می کند. " +"مطمئن شوید که می‌توانید مرورگر Chromium را که ساخته‌اید اجرا کنید." #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" @@ -1855,24 +1879,25 @@ msgstr "Rust بر روی سخت افزار بدون سیستم عامل" #: src/running-the-course/course-structure.md msgid "" -"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on using " -"Rust for bare-metal (embedded) development. Both microcontrollers and application " -"processors are covered." +"The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " +"using Rust for bare-metal (embedded) development. Both microcontrollers and " +"application processors are covered." msgstr "" -"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک دوره یک " -"روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون سیستم عامل " -"(embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با کارایی خاص را " -"پوشش می دهد." +"دوره آموزشی [Rust بر روی سخت افزار بدون سیستم عامل](../bare-metal.md) یک " +"دوره یک روزه با تمرکز بر استفاده ازRust برای توسعه بر روی سخت افزار بدون " +"سیستم عامل (embedded) است. این دوره هم میکروکنترلرها و هم پردازشگر هایی با " +"کارایی خاص را پوشش می دهد." #: src/running-the-course/course-structure.md msgid "" -"For the microcontroller part, you will need to buy the [BBC micro:bit](https://" -"microbit.org/) v2 development board ahead of time. Everybody will need to install " -"a number of packages as described on the [welcome page](../bare-metal.md)." +"For the microcontroller part, you will need to buy the [BBC micro:bit]" +"(https://microbit.org/) v2 development board ahead of time. Everybody will " +"need to install a number of packages as described on the [welcome page](../" +"bare-metal.md)." msgstr "" -"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) v2 " -"را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page](../bare-" -"metal.md) توضیح داده شده نصب کنند." +"برای قسمت میکروکنترلر، باید برد توسعه [BBCmicro:bit](https://microbit.org/) " +"v2 را خریداری کنید. همه باید تعدادی بسته را همانطور که در [welcome page]" +"(../bare-metal.md) توضیح داده شده نصب کنند." #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1884,17 +1909,18 @@ msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" -"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که شامل " -"همزمانی کلاسیک و `async`/`await` است." +"دوره [همزمانی در Rust ](../concurrency.md) یک روزه با تمرکز بر همزمانی که " +"شامل همزمانی کلاسیک و `async`/`await` است." #: src/running-the-course/course-structure.md msgid "" -"You will need a fresh crate set up and the dependencies downloaded and ready to " -"go. You can then copy/paste the examples into `src/main.rs` to experiment with " -"them:" +"You will need a fresh crate set up and the dependencies downloaded and ready " +"to go. You can then copy/paste the examples into `src/main.rs` to experiment " +"with them:" msgstr "" -"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده باشند. " -"سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها آزمایش کنید:" +"شما به یک crate جدید نیاز خواهید داشت و وابستگی ها دانلود و آماده استفاده " +"باشند. سپس می‌توانید نمونه‌ها را در `src/main.rs‍` کپی/پیست کنید تا با آنها " +"آزمایش کنید:" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" @@ -1930,11 +1956,11 @@ msgstr "فرمت" #: src/running-the-course/course-structure.md msgid "" -"The course is meant to be very interactive and we recommend letting the questions " -"drive the exploration of Rust!" +"The course is meant to be very interactive and we recommend letting the " +"questions drive the exploration of Rust!" msgstr "" -"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی Rust را " -"هدایت کنند!" +"این دوره قرار است بسیار تعاملی باشد و توصیه می کنیم اجازه دهید حس کنجکاوی " +"Rust را هدایت کنند!" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" @@ -1965,65 +1991,69 @@ msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" msgstr "" -"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده است:" +"این دوره توسط مجموعه ای از داوطلبان فوق العاده به زبان های دیگر ترجمه شده " +"است:" #: src/running-the-course/translations.md msgid "" -"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) by " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" -"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and [@henrif75]" -"(https://github.com/henrif75)." +"[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " +"by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " +"[@henrif75](https://github.com/henrif75)." msgstr "" "[پرتغالی برزیلی](https://google.github.io/comprehensive-rust/pt-BR/) توسط " -"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github.com/" -"hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و [@henrif75]" -"(https://github.com/henrif75)." +"[@rastringer](https://github.com/rastringer), [@hugojacob](https://github." +"com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes) و " +"[@henrif75](https://github.com/henrif75)." #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) by " -"[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " -"[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " -"[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." +"[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " +"by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" +"wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" +"kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" +"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[چینی (ساده‌شده)](https://google.github.io/comprehensive-rust/zh-CN/) توسط " "[@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/wnghl), " "[@anlunx](https://github.com/anlunx), [@kongy](https://github.com/kongy), " "[@noahdragon](https://github.com/noahdragon), [@superwhd](https://github.com/" -"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github.com/" -"nodmp)." +"superwhd), [@SketchK](https://github.com/SketchK) و [@nodmp](https://github." +"com/nodmp)." #: src/running-the-course/translations.md msgid "" -"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) by " -"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " +"by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" "github.com/kuanhungchen), and [@johnathan79717](https://github.com/" "johnathan79717)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" -"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " -"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" -"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md #, fuzzy msgid "" "[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/momotaro1105), " -"[@HidenoriKobayashi](https://github.com/HidenoriKobayashi) and [@kantasv](https://" -"github.com/kantasv)." +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " +"and [@kantasv](https://github.com/kantasv)." msgstr "" "[ژاپنی](https://google.github.io/comprehensive-rust/ja/) توسط [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/momotaro1105)." +"(https://github.com/CoinEZ) و [@momotaro1105](https://github.com/" +"momotaro1105)." #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace](https://" -"github.com/keispace), [@jiyongp](https://github.com/jiyongp), [@jooyunghan]" -"(https://github.com/jooyunghan), and [@namhyung](https://github.com/namhyung)." +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " +"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." +"com/namhyung)." msgstr "" "[کره ای](https://google.github.io/comprehensive-rust/ko/) توسط [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) و " @@ -2031,8 +2061,8 @@ msgstr "" #: src/running-the-course/translations.md msgid "" -"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid](https://" -"github.com/deavid)." +"[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" +"(https://github.com/deavid)." msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2040,15 +2070,16 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-cpp]" -"(https://github.com/git-user-cpp), [@yaremam](https://github.com/yaremam) and " -"[@reta](https://github.com/reta)." +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" +"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) and [@reta](https://github.com/reta)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md -msgid "Use the language picker in the top-right corner to switch between languages." +msgid "" +"Use the language picker in the top-right corner to switch between languages." msgstr "" "از انتخابگر زبان در گوشه بالا سمت راست برای جابه‌جایی بین زبان‌ها استفاده کنید." @@ -2058,17 +2089,17 @@ msgstr "ترجمه‌های ناقص" #: src/running-the-course/translations.md msgid "" -"There is a large number of in-progress translations. We link to the most recently " -"updated translations:" +"There is a large number of in-progress translations. We link to the most " +"recently updated translations:" msgstr "" -"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده پیوند " -"می دهیم:" +"تعداد زیادی ترجمه در حال انجام وجود دارد. ما به آخرین ترجمه های به روز شده " +"پیوند می دهیم:" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies](https://" -"github.com/younies)" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" +"(https://github.com/younies)" msgstr "" "[اسپانیایی](https://google.github.io/comprehensive-rust/es/) توسط [@deavid]" "(https://github.com/deavid)." @@ -2084,77 +2115,81 @@ msgstr "" #: src/running-the-course/translations.md #, fuzzy msgid "" -"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383](https://" -"github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), [@hamidrezakp]" -"(https://github.com/hamidrezakp), [@javad-jafari](https://github.com/javad-" -"jafari) and [@moaminsharifi](https://github.com/moaminsharifi)." +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@Alix1383]" +"(https://github.com/alix1383), [@DannyRavi](https://github.com/DannyRavi), " +"[@hamidrezakp](https://github.com/hamidrezakp), [@javad-jafari](https://" +"github.com/javad-jafari) and [@moaminsharifi](https://github.com/" +"moaminsharifi)." msgstr "" -"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط [@hueich]" -"(https://github.com/hueich), [@victorhsieh](https://github.com/victorhsieh), " -"[@mingyc](https://github.com/mingyc), [@kuanhungchen](https://github.com/" -"kuanhungchen) و [@johnathan79717](https://github.com/johnathan79717)." +"[چینی (سنتی)](https://google.github.io/comprehensive-rust/zh-TW/) توسط " +"[@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" +"victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" +"github.com/kuanhungchen) و [@johnathan79717](https://github.com/" +"johnathan79717)." #: src/running-the-course/translations.md msgid "" -"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS](https://" -"github.com/KookaS), [@vcaen](https://github.com/vcaen) and [@AdrienBaudemont]" -"(https://github.com/AdrienBaudemont)." +"[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" +"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" "[فرانسویی](https://google.github.io/comprehensive-rust/fr/) توسط [@KookaS]" "(https://github.com/KookaS) و [@vcaen](https://github.com/vcaen)." #: src/running-the-course/translations.md msgid "" -"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn](https://" -"github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." +"[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" +"(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn](https://" -"github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." +"[آلمانی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" +"(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"[Italian](https://google.github.io/comprehensive-rust/it/) by [@henrythebuilder]" -"(https://github.com/henrythebuilder) and [@detro](https://github.com/detro)." +"[Italian](https://google.github.io/comprehensive-rust/it/) by " +"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" +"github.com/detro)." msgstr "" "[ایتالیایی](https://google.github.io/comprehensive-rust/de/) توسط [@Throvn]" "(https://github.com/Throvn) و [@ronaldfw](https://github.com/ronaldfw)." #: src/running-the-course/translations.md msgid "" -"The full list of translations with their current status is also available either " -"[as of their last update](https://google.github.io/comprehensive-rust/translation-" -"report.html) or [synced to the latest version of the course](https://google." -"github.io/comprehensive-rust/synced-translation-report.html)." +"The full list of translations with their current status is also available " +"either [as of their last update](https://google.github.io/comprehensive-rust/" +"translation-report.html) or [synced to the latest version of the course]" +"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." msgstr "" "فهرست کامل ترجمه‌ها با وضعیت فعلی‌شان نیز [در آخرین به‌روزرسانی](https://google." -"github.io/comprehensive-rust/translation-report.html) یا [همگام‌سازی شده با آخرین " -"نسخه دوره](https://google.github.io/comprehensive-rust/synced-translation-report." -"html)." +"github.io/comprehensive-rust/translation-report.html) یا [همگام‌سازی شده با " +"آخرین نسخه دوره](https://google.github.io/comprehensive-rust/synced-" +"translation-report.html)." #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" -"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to get " -"going. Translations are coordinated on the [issue tracker](https://github.com/" -"google/comprehensive-rust/issues/282)." +"github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " +"get going. Translations are coordinated on the [issue tracker](https://" +"github.com/google/comprehensive-rust/issues/282)." msgstr "" "اگر می‌خواهید به این کار کمک کنید، لطفاً [دستورالعمل‌های ما](https://github.com/" -"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه کار " -"ببینید. ترجمه ها در [issue tracker](https://github.com/google/comprehensive-rust/" -"issues/282) هماهنگ و کنترل می شوند." +"google/comprehensive-rust/blob/main/TRANSLATIONS.md) را برای چگونگی ادامه " +"کار ببینید. ترجمه ها در [issue tracker](https://github.com/google/" +"comprehensive-rust/issues/282) هماهنگ و کنترل می شوند." #: src/cargo.md msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-" -"lang.org/cargo/), the standard tool used in the Rust ecosystem to build and run " -"Rust applications. Here we want to give a brief overview of what Cargo is and how " -"it fits into the wider ecosystem and how it fits into this training." +"When you start reading about Rust, you will soon meet [Cargo](https://doc." +"rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " +"and run Rust applications. Here we want to give a brief overview of what " +"Cargo is and how it fits into the wider ecosystem and how it fits into this " +"training." msgstr "" -"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc.rust-" -"lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و اجرای برنامه " -"های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک مرور مختصر از در " -"مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن را در این آموزش ارائه " -"دهیم." +"وقتی شروع به خواندن درباره Rust می کنید، خیلی سریع با [Cargo](https://doc." +"rust-lang.org/cargo/) ، ابزار استانداردی که در اکوسیستم Rust برای ساخت و " +"اجرای برنامه های Rust استفاده می شود، آشنا خواهید شد. در اینجا می‌خواهیم یک " +"مرور مختصر از در مورد کارگو و نحوه انطباق آن با اکوسیستم Rust و برنامه‌های آن " +"را در این آموزش ارائه دهیم." #: src/cargo.md msgid "Installation" @@ -2167,8 +2202,8 @@ msgstr "**لطفا دستورالعمل را دنبال کنید , and it will pass them to " -"`rustc` when building your project. Cargo also comes with a built-in test runner " -"which is used to execute unit tests." +"`cargo`: the Rust dependency manager and build tool. Cargo knows how to " +"download dependencies, usually hosted on , and it will " +"pass them to `rustc` when building your project. Cargo also comes with a " +"built-in test runner which is used to execute unit tests." msgstr "" -"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه وابستگی ها " -"را که معمولاً در میزبانی می شوند دانلود کند و هنگام ساخت پروژه " -"آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک دستگاه تست داخلی است که " -"برای اجرای unit test استفاده می شود." +"`cargo`: مدیر وابستگی Rust و build tool آن است. Cargo می داند که چگونه " +"وابستگی ها را که معمولاً در میزبانی می شوند دانلود کند و " +"هنگام ساخت پروژه آنها را به `rustc` منتقل می‌کند. Cargo همچنین دارای یک " +"دستگاه تست داخلی است که برای اجرای unit test استفاده می شود." #: src/cargo/rust-ecosystem.md msgid "" -"`rustup`: the Rust toolchain installer and updater. This tool is used to install " -"and update `rustc` and `cargo` when new versions of Rust are released. In " -"addition, `rustup` can also download documentation for the standard library. You " -"can have multiple versions of Rust installed at once and `rustup` will let you " -"switch between them as needed." +"`rustup`: the Rust toolchain installer and updater. This tool is used to " +"install and update `rustc` and `cargo` when new versions of Rust are " +"released. In addition, `rustup` can also download documentation for the " +"standard library. You can have multiple versions of Rust installed at once " +"and `rustup` will let you switch between them as needed." msgstr "" -"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به روز " -"رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده می شود. " -"علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه استاندارد دانلود " -"کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب کنید و \"rustup\" به شما " -"اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." +"'rustup': نصب کننده و به روز رسانی rustchain ابزار. این ابزار برای نصب و به " +"روز رسانی \"rustc\" و \"cargo\" در هنگام انتشار نسخه های جدید Rust استفاده " +"می شود. علاوه بر این، \"rustup\" همچنین می تواند اسناد را برای کتابخانه " +"استاندارد دانلود کند. شما می توانید چندین نسخه از Rust را در یک زمان نصب " +"کنید و \"rustup\" به شما اجازه می دهد تا در صورت نیاز بین انها تغییر دهید." #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md #: src/references/exclusive.md src/memory-management/move.md @@ -2266,79 +2302,81 @@ msgstr "نکات کلیدی:" #: src/cargo/rust-ecosystem.md msgid "" -"Rust has a rapid release schedule with a new release coming out every six weeks. " -"New releases maintain backwards compatibility with old releases --- plus they " -"enable new functionality." +"Rust has a rapid release schedule with a new release coming out every six " +"weeks. New releases maintain backwards compatibility with old releases --- " +"plus they enable new functionality." msgstr "" -"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید منتشر " -"می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به علاوه " -"قابلیت‌های جدید را فعال می‌کنند." +"Rust یک برنامه سریع برای انتشار نسخه‌های جدید دارد و هر شش هفته یک نسخه جدید " +"منتشر می شود. نسخه‌های جدید سازگاری با نسخه‌های قدیمی را حفظ می‌کنند --- به " +"علاوه قابلیت‌های جدید را فعال می‌کنند." #: src/cargo/rust-ecosystem.md -msgid "There are three release channels: \"stable\", \"beta\", and \"nightly\"." +msgid "" +"There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "سه کانال انتشار وجود دارد: \"stable\"، \"beta\"، و \"nightly\"." #: src/cargo/rust-ecosystem.md msgid "" -"New features are being tested on \"nightly\", \"beta\" is what becomes \"stable\" " -"every six weeks." +"New features are being tested on \"nightly\", \"beta\" is what becomes " +"\"stable\" every six weeks." msgstr "" -"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش هفته " -"\"stable\" می شود." +"ویژگی های جدید در \"nightly\" آزمایش می شوند ، \"beta\" چیزی است که هر شش " +"هفته \"stable\" می شود." #: src/cargo/rust-ecosystem.md msgid "" -"Dependencies can also be resolved from alternative [registries](https://doc.rust-" -"lang.org/cargo/reference/registries.html), git, folders, and more." +"Dependencies can also be resolved from alternative [registries](https://doc." +"rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "همچنین می‌توان وابستگی‌ها را از [registries](https://doc.rust-lang.org/cargo/" "reference/registries.html)، پوشه‌ها و git و موارد دیگر برطرف کرد." #: src/cargo/rust-ecosystem.md msgid "" -"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the current " -"edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " +"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: نسخه " -"فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." +"Rust همچنین نسخه [editions](https://doc.rust-lang.org/edition-guide/) دارد: " +"نسخه فعلی Rust 2021 است. نسخه های قبلی Rust 2015 و Rust 2018 بودند." #: src/cargo/rust-ecosystem.md msgid "" -"The editions are allowed to make backwards incompatible changes to the language." +"The editions are allowed to make backwards incompatible changes to the " +"language." msgstr "نسخه ها مجاز به ایجاد تغییرات backwards incompatible در زبان هستند." #: src/cargo/rust-ecosystem.md msgid "" -"To prevent breaking code, editions are opt-in: you select the edition for your " -"crate via the `Cargo.toml` file." +"To prevent breaking code, editions are opt-in: you select the edition for " +"your crate via the `Cargo.toml` file." msgstr "" -"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ مورد " -"نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." +"برای جلوگیری از breaking code، نسخه‌ها اختیاری انتخاب می‌شوند که: شما نسخه‌ " +"مورد نظر برای crate خود از طریق فایل `Cargo.toml` انتخاب می‌کنید." #: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." msgstr "" -"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده برای " -"نسخه های مختلف را ترکیب کنند." +"برای جلوگیری از شکاف در اکوسیستم، کامپایلرهای Rust می توانند کدهای نوشته شده " +"برای نسخه های مختلف را ترکیب کنند." #: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" -"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق `cargo` " -"بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." +"لازم به ذکر است که استفاده از کامپایلر به طور مستقیم(rustc) و نه از طریق " +"`cargo` بسیار غیرمعمول است (اکثر کاربران هرگز این کار را نمی کنند)." #: src/cargo/rust-ecosystem.md msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " -"comprehensive tool. It is capable of many advanced features including but not " -"limited to:" +"comprehensive tool. It is capable of many advanced features including but " +"not limited to:" msgstr "" -"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. این است " -"که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" +"ممکن است لازم به ذکر باشد که Cargo خود یک ابزار بسیار قدرتمند و جامع است. " +"این است که قادر به بسیاری از ویژگی های پیشرفته از جمله اما نه محدود به:" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" @@ -2346,7 +2384,8 @@ msgstr "ساختار پروژه/بسته" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" +msgstr "" +"[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" @@ -2354,27 +2393,33 @@ msgstr "وابستگی های Dev و وابستگی‌های Runtime Manageme #: src/cargo/rust-ecosystem.md msgid "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" msgstr "" -"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" +"[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." +"html)" #: src/cargo/rust-ecosystem.md msgid "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" msgstr "" -"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" +"[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." +"html)" #: src/cargo/rust-ecosystem.md msgid "" -"It is also extensible with sub command plugins as well (such as [cargo clippy]" -"(https://github.com/rust-lang/rust-clippy))." +"It is also extensible with sub command plugins as well (such as [cargo " +"clippy](https://github.com/rust-lang/rust-clippy))." msgstr "" -"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-lang/" -"rust-clippy)) قابل توسعه است." +"همچنین با command plugin فرعی (مانند [cargo clippy](https://github.com/rust-" +"lang/rust-clippy)) قابل توسعه است." #: src/cargo/rust-ecosystem.md -msgid "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." +msgid "" +"Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" +msgstr "" +"در [official Cargo Book](https://doc.rust-lang.org/cargo/) بیشتر بخوانید." #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2383,22 +2428,22 @@ msgstr "نمونه کد در این آموزش" #: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " -"which can be executed through your browser. This makes the setup much easier and " -"ensures a consistent experience for everyone." +"which can be executed through your browser. This makes the setup much easier " +"and ensures a consistent experience for everyone." msgstr "" -"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق مرورگر " -"شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می کند و تجربه " -"ای ثابت را برای همه تضمین می کند." +"برای این آموزش، بیشتر زبان Rust را از طریق مثال هایی که می توان از طریق " +"مرورگر شما اجرا کرد، بررسی می کنیم. این کار راه اندازی را بسیار ساده تر می " +"کند و تجربه ای ثابت را برای همه تضمین می کند." #: src/cargo/code-samples.md msgid "" -"Installing Cargo is still encouraged: it will make it easier for you to do the " -"exercises. On the last day, we will do a larger exercise which shows you how to " -"work with dependencies and for that you need Cargo." +"Installing Cargo is still encouraged: it will make it easier for you to do " +"the exercises. On the last day, we will do a larger exercise which shows you " +"how to work with dependencies and for that you need Cargo." msgstr "" -"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می کند. " -"در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد چگونه با " -"وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." +"نصب Cargo همچنان پیشنهاد می شود: چونکه انجام تمرینات را برای شما آسان تر می " +"کند. در روز آخر، تمرین بزرگتری را انجام خواهیم داد که به شما نشان می دهد " +"چگونه با وابستگی ها کار کنید و برای این کار شما به Cargo نیاز دارید." #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2411,8 +2456,8 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy msgid "" -"You can use Ctrl + Enter to execute the code when focus is in the text " -"box." +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." msgstr "برای اجرای کد زمانی که focus در text box است." #: src/cargo/code-samples.md @@ -2420,26 +2465,26 @@ msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" -"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه کد به " -"دلایل مختلف قابل ویرایش نیستند:" +"اکثر نمونه های کد مانند نشان داده شده در بالا قابل ویرایش هستند. چند نمونه " +"کد به دلایل مختلف قابل ویرایش نیستند:" #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds cannot execute unit tests. Copy-paste the code and open " -"it in the real Playground to demonstrate unit tests." +"The embedded playgrounds cannot execute unit tests. Copy-paste the code and " +"open it in the real Playground to demonstrate unit tests." msgstr "" -"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی کنید و " -"آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." +"همینطورembedded playground نمی توانند unit tests را اجرا کنند. کد را کپی " +"کنید و آن را در Playground واقعی باز کنید تا unit tests د را نشان دهید." #: src/cargo/code-samples.md msgid "" -"The embedded playgrounds lose their state the moment you navigate away from the " -"page! This is the reason that the students should solve the exercises using a " -"local Rust installation or via the Playground." +"The embedded playgrounds lose their state the moment you navigate away from " +"the page! This is the reason that the students should solve the exercises " +"using a local Rust installation or via the Playground." msgstr "" -"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار خود را " -"از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با استفاده از " -"local Rust installation یا از طریق Playground حل کنند." +"در واقع embedded playgrounds در لحظه ای که از صفحه دور می شوید حالت پایدار " +"خود را از دست می دهند! به همین دلیل است که دانش آموزان باید تمرینات را با " +"استفاده از local Rust installation یا از طریق Playground حل کنند." #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2447,56 +2492,60 @@ msgstr "اجرای کد به صورت لوکال با Cargo" #: src/cargo/running-locally.md msgid "" -"If you want to experiment with the code on your own system, then you will need to " -"first install Rust. Do this by following the [instructions in the Rust Book]" -"(https://doc.rust-lang.org/book/ch01-01-installation.html). This should give you " -"a working `rustc` and `cargo`. At the time of writing, the latest stable Rust " -"release has these version numbers:" +"If you want to experiment with the code on your own system, then you will " +"need to first install Rust. Do this by following the [instructions in the " +"Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " +"should give you a working `rustc` and `cargo`. At the time of writing, the " +"latest stable Rust release has these version numbers:" msgstr "" -"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. این " -"کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-lang.org/" -"book/ch01-01-installation.html) انجام دهید. این باید به شما یک `rustc` و `cargo` " -"کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای این version numberها " -"است:" +"اگر می خواهید کد را روی سیستم خود آزمایش کنید، ابتدا باید Rust را نصب کنید. " +"این کار را با دنبال کردن [instructions in the Rust Book](https://doc.rust-" +"lang.org/book/ch01-01-installation.html) انجام دهید. این باید به شما یک " +"`rustc` و `cargo` کاربردی بدهد. در زمان نگارش، آخرین نسخه پایدار Rust دارای " +"این version numberها است:" #: src/cargo/running-locally.md msgid "" -"You can use any later version too since Rust maintains backwards compatibility." +"You can use any later version too since Rust maintains backwards " +"compatibility." msgstr "" -"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه های " -"قبلی را حفظ می‌کند." +"شما همچنین می توانید از هر نسخه بعدی استفاده کنید، زیرا Rust سازگاری با نسخه " +"های قبلی را حفظ می‌کند." #: src/cargo/running-locally.md msgid "" -"With this in place, follow these steps to build a Rust binary from one of the " -"examples in this training:" +"With this in place, follow these steps to build a Rust binary from one of " +"the examples in this training:" msgstr "" -"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک باینری " -"Rust بسازید:" +"با این کار، این مراحل را دنبال کنید تا از یکی از مثال‌های این آموزش، یک " +"باینری Rust بسازید:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." +msgstr "" +"روی دکمه \"کپی در کلیپ بورد\" در نمونه ای که می خواهید کپی کنید؛ کلیک کنید." #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "" -"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود استفاده " -"کنید:" +"از `cargo new exercise` برای ایجاد دایرکتوری `excerise/` جدید برای کد خود " +"استفاده کنید:" #: src/cargo/running-locally.md -msgid "Navigate into `exercise/` and use `cargo run` to build and run your binary:" +msgid "" +"Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" -"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده کنید:" +"به `exercise/` بروید و از `cargo run` برای ساخت و اجرای باینری خود استفاده " +"کنید:" #: src/cargo/running-locally.md msgid "" -"Replace the boiler-plate code in `src/main.rs` with your own code. For example, " -"using the example on the previous page, make `src/main.rs` look like" +"Replace the boiler-plate code in `src/main.rs` with your own code. For " +"example, using the example on the previous page, make `src/main.rs` look like" msgstr "" -"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با استفاده از " -"مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." +"کد صفحه دیگر را در `src/main.rs` با کد خود جایگزین کنید. برای مثال، با " +"استفاده از مثال در صفحه قبل، `src/main.rs` را شبیه به آن کنید." #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" @@ -2504,35 +2553,35 @@ msgstr "برای ساختن و اجرای باینری به روز شده خود #: src/cargo/running-locally.md msgid "" -"Use `cargo check` to quickly check your project for errors, use `cargo build` to " -"compile it without running it. You will find the output in `target/debug/` for a " -"normal debug build. Use `cargo build --release` to produce an optimized release " -"build in `target/release/`." +"Use `cargo check` to quickly check your project for errors, use `cargo " +"build` to compile it without running it. You will find the output in `target/" +"debug/` for a normal debug build. Use `cargo build --release` to produce an " +"optimized release build in `target/release/`." msgstr "" -"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از `cargo " -"build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/debug/` برای " -"ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی شده در `target/" -"release/` از `cargo build --release` استفاده کنید." +"از `cargo check` برای بررسی سریع پروژه خود برای خطاها استفاده کنید، از " +"`cargo build` برای کامپایل، بدون اجرای آن استفاده کنید. خروجی را در `target/" +"debug/` برای ساخت اشکال زدایی معمولی خواهید یافت. برای تولید نسخه بهینه سازی " +"شده در `target/release/` از `cargo build --release` استفاده کنید." #: src/cargo/running-locally.md msgid "" -"You can add dependencies for your project by editing `Cargo.toml`. When you run " -"`cargo` commands, it will automatically download and compile missing dependencies " -"for you." +"You can add dependencies for your project by editing `Cargo.toml`. When you " +"run `cargo` commands, it will automatically download and compile missing " +"dependencies for you." msgstr "" -"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. هنگامی که " -"دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد نیاز را برای شما " -"دانلود و کامپایل می‌کند." +"با ویرایش `Cargo.toml` می‌توانید وابستگی‌هایی برای پروژه خود اضافه کنید. " +"هنگامی که دستورات `cargo` را اجرا می کنید، به طور خودکار وابستگی های مورد " +"نیاز را برای شما دانلود و کامپایل می‌کند." #: src/cargo/running-locally.md msgid "" -"Try to encourage the class participants to install Cargo and use a local editor. " -"It will make their life easier since they will have a normal development " -"environment." +"Try to encourage the class participants to install Cargo and use a local " +"editor. It will make their life easier since they will have a normal " +"development environment." msgstr "" -"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک ویرایشگر " -"محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک محیط توسعه عادی " -"خواهند داشت." +"سعی کنید شرکت کنندگان کلاس را تشویق کنید تا Cargo را نصب کنند و از یک " +"ویرایشگر محلی استفاده کنند. این زندگی آنها را آسان تر می کند زیرا آنها یک " +"محیط توسعه عادی خواهند داشت." #: src/welcome-day-1.md msgid "Welcome to Day 1" @@ -2540,17 +2589,19 @@ msgstr "به روز اول خوش آمدید" #: src/welcome-day-1.md msgid "" -"This is the first day of Rust Fundamentals. We will cover a lot of ground today:" +"This is the first day of Rust Fundamentals. We will cover a lot of ground " +"today:" msgstr "" -"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم داد:" +"این اولین روز از مبانی Rust است. ما امروز بخش‌های فابل توجه‌ای را پوشش خواهیم " +"داد:" #: src/welcome-day-1.md 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 msgid "Types and type inference." @@ -2569,79 +2620,87 @@ msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "تطابق الگو: تجزیه و تحلیل enums, structs و آرایه‌ها." #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md src/concurrency/welcome.md src/concurrency/welcome-async.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "برنامه زمانی" #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 minutes. " -"It contains:" +"Including 10 minute breaks, this session should take about 2 hours and 5 " +"minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "لطفا به دانشجویان یادآوری کنید:" #: src/welcome-day-1.md -msgid "They should ask questions when they get them, don't save them to the end." -msgstr "آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." +msgid "" +"They should ask questions when they get them, don't save them to the end." +msgstr "" +"آنها باید سؤالاتی را که به دست آوردند بپرسند، آنها را تا انتها ذخیره نکنید." #: src/welcome-day-1.md msgid "" -"The class is meant to be interactive and discussions are very much encouraged!" +"The class is meant to be interactive and discussions are very much " +"encouraged!" msgstr "کلاس قرار است تعاملی باشد و بحث‌ها بسیار مورد تشویق قرار می گیرند!" #: src/welcome-day-1.md msgid "" -"As an instructor, you should try to keep the discussions relevant, i.e., keep the " -"discussions related to how Rust does things vs some other language. It can be " -"hard to find the right balance, but err on the side of allowing discussions since " -"they engage people much more than one-way communication." +"As an instructor, you should try to keep the discussions relevant, i.e., " +"keep the discussions related to how Rust does things vs some other language. " +"It can be hard to find the right balance, but err on the side of allowing " +"discussions since they engage people much more than one-way communication." msgstr "" -"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، بحث‌های " -"مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ کنید. پیدا " -"کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث اشتباه کنید، " -"زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." +"به‌عنوان یک مربی، باید سعی کنید بحث‌ها را مرتبط نگه دارید، به عنوان مثال، " +"بحث‌های مرتبط با نحوه انجام کارها توسط Rust در مقابل برخی زبان‌های دیگر را حفظ " +"کنید. پیدا کردن تعادل مناسب می تواند سخت باشد، اما در مورد اجازه دادن به بحث " +"اشتباه کنید، زیرا آنها بیشتر از ارتباط یک طرفه افراد را درگیر می کنند." #: src/welcome-day-1.md msgid "" "The questions will likely mean that we talk about things ahead of the slides." msgstr "" -"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می کنیم." +"احتمالاً سؤالات به این معنی است که ما در مورد چیزهایی قبل از اسلاید صحبت می " +"کنیم." #: src/welcome-day-1.md msgid "" -"This is perfectly okay! Repetition is an important part of learning. Remember " -"that the slides are just a support and you are free to skip them as you like." +"This is perfectly okay! Repetition is an important part of learning. " +"Remember that the slides are just a support and you are free to skip them as " +"you like." msgstr "" "این اصلاً اشکالی ندارد! تکرار بخش مهمی از یادگیری است. به یاد داشته باشید که " -"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها صرف " -"نظر کنید." +"اسلایدها فقط یک پشتیبان هستند و شما می توانید هر طور که دوست دارید از آنها " +"صرف نظر کنید." #: src/welcome-day-1.md msgid "" -"The idea for the first day is to show the \"basic\" things in Rust that should " -"have immediate parallels in other languages. The more advanced parts of Rust come " -"on the subsequent days." +"The idea for the first day is to show the \"basic\" things in Rust that " +"should have immediate parallels in other languages. The more advanced parts " +"of Rust come on the subsequent days." msgstr "" "ایده روز اول نشان دادن چیزهای \"پایه\" در Rust است که باید در زبان های دیگر " -"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می شوند." +"مشابهت های فوری داشته باشند. قسمت های پیشرفته تر Rust در روزهای بعد عرضه می " +"شوند." #: src/welcome-day-1.md msgid "" "If you're teaching this in a classroom, this is a good place to go over the " -"schedule. Note that there is an exercise at the end of each segment, followed by " -"a break. Plan to cover the exercise solution after the break. The times listed " -"here are a suggestion in order to keep the course on schedule. Feel free to be " -"flexible and adjust as necessary!" +"schedule. Note that there is an exercise at the end of each segment, " +"followed by a break. Plan to cover the exercise solution after the break. " +"The times listed here are a suggestion in order to keep the course on " +"schedule. Feel free to be flexible and adjust as necessary!" msgstr "" -"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. توجه " -"داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. برای پوشاندن " -"محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده در اینجا یک پیشنهاد " -"برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر باشید و در صورت لزوم تنظیم " -"کنید!" +"اگر این را در کلاس درس تدریس می کنید، اینجا مکان خوبی برای مرور برنامه است. " +"توجه داشته باشید که در پایان هر بخش یک تمرین و سپس یک استراحت وجود دارد. " +"برای پوشاندن محلول تمرین بعد از استراحت برنامه ریزی کنید. زمان های ذکر شده " +"در اینجا یک پیشنهاد برای حفظ دوره در برنامه است. با خیال راحت انعطاف پذیر " +"باشید و در صورت لزوم تنظیم کنید!" #: src/hello-world.md src/concurrency/send-sync.md msgid "This segment should take about 15 minutes. It contains:" @@ -2650,44 +2709,46 @@ msgstr "این بخش ۱۵ دقیقه زمان می برد. این بخش شام #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md -#: src/borrowing.md src/lifetimes.md src/iterators.md src/modules.md src/testing.md -#: src/error-handling.md src/unsafe-rust.md src/concurrency/threads.md -#: src/concurrency/channels.md src/concurrency/send-sync.md -#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md -#: src/concurrency/async.md src/concurrency/async-control-flow.md -#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/concurrency/sync-exercises.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md msgid "Slide" msgstr "اسلاید" #: src/hello-world.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md src/smart-pointers.md -#: src/borrowing.md src/lifetimes.md src/modules.md src/unsafe-rust.md -#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md msgid "10 minutes" msgstr "۱۰ دقیقه" #: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md msgid "2 minutes" msgstr "۲ دقیقه" #: src/hello-world/what-is-rust.md msgid "" -"Rust is a new programming language which had its [1.0 release in 2015](https://" -"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"Rust is a new programming language which had its [1.0 release in 2015]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد](https://" -"blog.rust-lang.org/2015/05/15/Rust-1.0.html):" +"‏Rust یک زبان برنامه‌نویسی جدید است که [نسخه 1.0 آن در سال 2015 منتشر شد]" +"(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" -"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ " -"دارد." +"زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2698,8 +2759,8 @@ msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" -" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/rustc/" -"platform-support.html) پشتیبانی می کند :" +" راست از بسیاری از [بسترها و معماری‌ها](https://doc.rust-lang.org/nightly/" +"rustc/platform-support.html) پشتیبانی می کند :" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." @@ -2746,7 +2807,8 @@ msgid "High level of control." msgstr "سطح کنترل بالا." #: src/hello-world/what-is-rust.md -msgid "Can be scaled down to very constrained devices such as microcontrollers." +msgid "" +"Can be scaled down to very constrained devices such as microcontrollers." msgstr "می‌تواند به دستگاه‌های بسیار محدود مانند میکروکنترلرها مقیاس‌بندی شود." #: src/hello-world/what-is-rust.md @@ -2766,7 +2828,8 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری می شود" +"_ایمنی حافظه زمان کامپایل_ - کل کلاس های باگ حافظه در زمان کامپایل جلوگیری " +"می شود" #: src/hello-world/benefits.md msgid "No uninitialized variables." @@ -2801,8 +2864,8 @@ msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" -"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز نامشخص " -"باقی نمی ماند" +"_بدون رفتار زمان اجرا تعریف نشده_ - کاری که دستور Rust انجام می دهد هرگز " +"نامشخص باقی نمی ماند" #: src/hello-world/benefits.md msgid "Array access is bounds checked." @@ -2814,8 +2877,10 @@ msgstr "سرریز عدد صحیح تعریف شده است (پانیک یا `wr #: src/hello-world/benefits.md msgid "" -"_Modern language features_ - as expressive and ergonomic as higher-level languages" -msgstr "_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" +"_Modern language features_ - as expressive and ergonomic as higher-level " +"languages" +msgstr "" +"_ویژگی های زبان مدرن_ - به اندازه زبان های سطح بالاتر گویا و ارگونومیک است" #: src/hello-world/benefits.md msgid "Enums and pattern matching." @@ -2851,93 +2916,98 @@ msgstr "پشتیبانی عالی از LSP‌." #: src/hello-world/benefits.md msgid "" -"Do not spend much time here. All of these points will be covered in more depth " -"later." +"Do not spend much time here. All of these points will be covered in more " +"depth later." msgstr "" -"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده خواهد شد." +"وقت زیادی را اینجا صرف نکنید. تمام این نکات بعداً با عمق بیشتری پوشش داده " +"خواهد شد." #: src/hello-world/benefits.md msgid "" -"Make sure to ask the class which languages they have experience with. Depending " -"on the answer you can highlight different features of Rust:" +"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/hello-world/benefits.md msgid "" -"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ via " -"the borrow checker. You get performance like in C and C++, but you don't have the " -"memory unsafety issues. In addition, you get a modern language with constructs " -"like pattern matching and built-in dependency management." +"Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " +"via the borrow checker. You get performance like in C and C++, but you don't " +"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++ را دارید اما " -"مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن با ساختارهایی " -"مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." +"اجرا_ را از بین می‌برد .t عملکردی مانند C و C++ را " +"دارید اما مشکلات عدم ایمنی حافظه را ندارید. علاوه بر این، شما یک زبان مدرن " +"با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md #, fuzzy msgid "" -"Experience with Java, Go, Python, JavaScript...: You get the same memory safety " -"as in those languages, plus a similar high-level language feeling. In 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)." +"Experience with Java, Go, Python, JavaScript...: You get the same memory " +"safety as in those languages, plus a similar high-level language feeling. In " +"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++ (بدون جمع‌آوری زباله) و " -"همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه را مانند آن " +"زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا مشابه. علاوه بر این، " +"شما عملکرد سریع و قابل پیش‌بینی مانند C و C++ (بدون " +"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " +"می‌کنید." #: src/hello-world/playground.md msgid "" -"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to run " -"short Rust programs, and is the basis for the examples and exercises in this " -"course. Try running the \"hello-world\" program it starts with. It comes with a " -"few handy features:" +"The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " +"run short Rust programs, and is the basis for the examples and exercises in " +"this course. Try running the \"hello-world\" program it starts with. It " +"comes with a few handy features:" msgstr "" -"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه های " -"Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. برنامه " -"\"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی مفید است:" +"[Rust Playground](https://play.rust-lang.org/) یک راه آسان برای اجرای برنامه " +"های Rust کوتاه ارائه می دهد و پایه ای برای مثال ها و تمرین های این دوره است. " +"برنامه \"Hello-world\" را که با آن شروع می شود اجرا کنید. دارای چند ویژگی " +"مفید است:" #: src/hello-world/playground.md msgid "" -"Under \"Tools\", use the `rustfmt` option to format your code in the \"standard\" " -"way." +"Under \"Tools\", use the `rustfmt` option to format your code in the " +"\"standard\" way." msgstr "" "در زیر \"ابزارها\"، از گزینه \"rustfmt\" برای قالب بندی کد خود به روش " "\"استاندارد\" استفاده کنید." #: src/hello-world/playground.md msgid "" -"Rust has two main \"profiles\" for generating code: Debug (extra runtime checks, " -"less optimization) and Release (fewer runtime checks, lots of optimization). " -"These are accessible under \"Debug\" at the top." +"Rust has two main \"profiles\" for generating code: Debug (extra runtime " +"checks, less optimization) and Release (fewer runtime checks, lots of " +"optimization). These are accessible under \"Debug\" at the top." msgstr "" -"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا اضافی، " -"بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی زیاد). اینها در " -"قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." +"Rust دارای دو \"نمایه\" اصلی برای تولید کد است: Debug (بررسی های زمان اجرا " +"اضافی، بهینه سازی کمتر) و Release (بررسی های زمان اجرا کمتر، بهینه سازی " +"زیاد). اینها در قسمت «اشکال‌زدایی» در بالا قابل دسترسی هستند." #: src/hello-world/playground.md msgid "" -"If you're interested, use \"ASM\" under \"...\" to see the generated assembly " -"code." +"If you're interested, use \"ASM\" under \"...\" to see the generated " +"assembly code." msgstr "" "اگر علاقه مند هستید، از \"ASM\" در زیر \"...\" برای دیدن کد اسمبلی تولید شده " "استفاده کنید." #: src/hello-world/playground.md msgid "" -"As students head into the break, encourage them to open up the playground and " -"experiment a little. Encourage them to keep the tab open and try things out " -"during the rest of the course. This is particularly helpful for advanced students " -"who want to know more about Rust's optimizations or generated assembly." +"As students head into the break, encourage them to open up the playground " +"and experiment a little. Encourage them to keep the tab open and try things " +"out during the rest of the course. This is particularly helpful for advanced " +"students who want to know more about Rust's optimizations or generated " +"assembly." msgstr "" -"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا playground " -"را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز نگه دارند و در " -"بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان پیشرفته که می‌خواهند " -"درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر بدانند مفید است." +"هنگامی که دانش آموزان به سمت استراحت می روند، آنها را تشویق کنید تا " +"playground را باز کنند و کمی تجربه کنند. آنها را تشویق کنید که برگه را باز " +"نگه دارند و در بقیه دوره چیزهایی را امتحان کنند. این به ویژه برای دانش‌آموزان " +"پیشرفته که می‌خواهند درباره بهینه‌سازی‌های Rust یا مونتاژ تولید شده بیشتر " +"بدانند مفید است." #: src/types-and-values.md src/control-flow-basics.md src/modules.md msgid "This segment should take about 40 minutes. It contains:" @@ -2948,7 +3018,8 @@ msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" -"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک بپردازیم:" +"بیایید به ساده ترین برنامه Rust ممکن یعنی یک برنامه Hello World کلاسیک " +"بپردازیم:" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" @@ -2965,7 +3036,8 @@ msgstr "توابع با `fn` معرفی می‌شوند." #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" -"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود می‌شوند." +"بلوک‌ها با پرانتزهای باز و بسته مانند C و C++ محدود " +"می‌شوند." #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." @@ -2974,30 +3046,32 @@ msgstr "تابع `main` نقطه ورود برنامه است." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "" -"زبان Rust دارای ماکروهای hygienic است، `println!` یک نمونه " -"از این است." +"زبان Rust دارای ماکروهای hygienic است، `println!` یک " +"نمونه از این است." #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" -"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد باشند." +"رشته‌های Rust دارای انکودینگ UTF-8 هستند و می‌توانند شامل هر کاراکتر یونیکد " +"باشند." #: src/types-and-values/hello-world.md msgid "" -"This slide tries to make the students comfortable with Rust code. They will see a " -"ton of it over the next four days so we start small with something familiar." +"This slide tries to make the students comfortable with Rust code. They will " +"see a ton of it over the next four days so we start small with something " +"familiar." msgstr "" -"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز آینده " -"خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." +"این اسلاید سعی می کند دانشجویان با کد Rust احساس راحتی کنند. آنها در سه روز " +"آینده خیلی از این کدها خواهند دید، بنابراین با یک چیز آشنا شروع می کنیم.." #: src/types-and-values/hello-world.md 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) و سعی نمی‌کند چیزی را مگر اینکه کاملاً ضروری " -"باشد، دوباره اختراع کند." +"زبان Rust, زبان بسیار شبیه به سایر زبان‌های خانواده C/C++/Java است.یک زبان امری است (imperative) و سعی نمی‌کند چیزی را مگر اینکه " +"کاملاً ضروری باشد، دوباره اختراع کند." #: src/types-and-values/hello-world.md msgid "Rust is modern with full support for things like Unicode." @@ -3015,34 +3089,36 @@ msgstr "" #: src/types-and-values/hello-world.md #, fuzzy msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers from " -"the scope they are used in. Rust macros are actually only [partially hygienic]" -"(https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html)." +"Macros being 'hygienic' means they don't accidentally capture identifiers " +"from the scope they are used in. Rust macros are actually only [partially " +"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." +"html)." msgstr "" -"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی شناسه‌ها را " -"از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در واقع فقط [تا " -"حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene.html " -"هستند." +"«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " +"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " +"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html هستند." #: src/types-and-values/hello-world.md msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented programming " -"features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, 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)." +"Rust is multi-paradigm. For example, it has powerful [object-oriented " +"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " +"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) است." +"[برنامه نویسی شی‌گرا](https://doc.rust-lang.org/book/ch17-00-oop.html) است و " +"در حالی که یک زبان فانکشنال(`functional‍`) نیست، شامل طیف وسیعی از [مفاهیم " +"فانکشنال](https://doc.rust-lang.org/book/ch13-00-functional-features.html) " +"است." #: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت پیشفرض " -"تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" +"زبان Rust از طریق سیستم تایپ استاتیک, ایمینی نوع را فراهم می‌کند. به صورت " +"پیشفرض تعریف متغییر ها از نوع «غیر قابل تغییر» (immutable) است:" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md @@ -3059,27 +3135,29 @@ msgstr "" #: src/types-and-values/variables.md msgid "" -"Uncomment the `x = 20` to demonstrate that variables are immutable by default. " -"Add the `mut` keyword to allow changes." +"Uncomment the `x = 20` to demonstrate that variables are immutable by " +"default. Add the `mut` keyword to allow changes." msgstr "" -"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = 20\" را " -"حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." +"برای نشان دادن اینکه متغیرها به طور پیش‌فرض تغییرناپذیر هستند، کامنت \"x = " +"20\" را حذف کنید. برای اجازه دادن به تغییرات، کلمه کلیدی «mut» را اضافه کنید." #: src/types-and-values/variables.md msgid "" -"The `i32` here is the type of the variable. This must be known at compile time, " -"but type inference (covered later) allows the programmer to omit it in many cases." +"The `i32` here is the type of the variable. This must be known at compile " +"time, but type inference (covered later) allows the programmer to omit it in " +"many cases." msgstr "" -"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما استنتاج " -"نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در بسیاری از موارد " -"آن را حذف کند." +"«i32» در اینجا نوع متغیر است. این باید در زمان کامپایل شناخته شود، اما " +"استنتاج نوع (که بعداً پوشش داده می شود) به برنامه نویس اجازه می دهد تا در " +"بسیاری از موارد آن را حذف کند." #: src/types-and-values/values.md msgid "" -"Here are some basic built-in types, and the syntax for literal values of each " -"type." +"Here are some basic built-in types, and the syntax for literal values of " +"each type." msgstr "" -"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده است." +"در اینجا چند نوع پایه داخلی و نحو برای مقادیر تحت اللفظی هر نوع آورده شده " +"است." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3128,8 +3206,8 @@ msgstr "`f32`, `f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "" -"3.14, -10.0e20, " -"2_f32" +"3.14, -10.0e20, 2_f32" #: src/types-and-values/values.md msgid "Unicode scalar values" @@ -3182,13 +3260,13 @@ msgstr "موارد اندکی وجود دارند که در بالا نشان د #: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " -"`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written as " -"`123i64`." +"`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/types-and-values/arithmetic.md msgid "\"result: {}\"" @@ -3196,13 +3274,13 @@ msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" -"This is the first time we've seen a function other than `main`, but the meaning " -"should be clear: it takes three integers, and returns an integer. Functions will " -"be covered in more detail later." +"This is the first time we've seen a function other than `main`, but the " +"meaning should be clear: it takes three integers, and returns an integer. " +"Functions will be covered in more detail later." msgstr "" -"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح باشد: " -"سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات بیشتر پوشش " -"داده خواهد شد." +"این اولین بار است که تابعی غیر از \"main\" می بینیم، اما معنی آن باید واضح " +"باشد: سه عدد صحیح می گیرد و یک عدد صحیح برمی گرداند. توابع بعداً با جزئیات " +"بیشتر پوشش داده خواهد شد." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3212,31 +3290,33 @@ msgstr "حسابی بسیار شبیه به زبان های دیگر است، ب #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do unknown things at runtime. In Rust, it's defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's " +"defined." msgstr "" -"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع تعریف " -"نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای مختلف انجام " -"دهد. در Rust تعریف شده است." +"در مورد سرریز اعداد صحیح چطور؟ در C و++ C سرریز اعداد صحیح _signed_ در واقع " +"تعریف نشده است و ممکن است کارهای متفاوتی را در پلتفرم ها یا کامپایلرهای " +"مختلف انجام دهد. در Rust تعریف شده است." #: src/types-and-values/arithmetic.md msgid "" -"Change the `i32`'s to `i16` to see an integer overflow, which panics (checked) in " -"a debug build and wraps in a release build. There are other options, such as " -"overflowing, saturating, and carrying. These are accessed with method syntax, e." -"g., `(a * b).saturating_add(b * c).saturating_add(c * a)`." +"Change the `i32`'s to `i16` to see an integer overflow, which panics " +"(checked) in a debug build and wraps in a release build. There are other " +"options, such as overflowing, saturating, and carrying. These are accessed " +"with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " +"a)`." msgstr "" "«i32» را به «i16» تغییر دهید تا یک سرریز عدد صحیح را ببینید، که در یک ساخت " -"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های دیگری " -"مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی هستند، به عنوان " -"مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." +"اشکال‌زدایی وحشت می‌کند (بررسی می‌شود) و در یک نسخه انتشار می‌پیچد. گزینه های " +"دیگری مانند سرریز، اشباع و حمل وجود دارد. اینها با نحو متد قابل دسترسی " +"هستند، به عنوان مثال، `(a * b).saturating_add(b * c).saturating_add(c *a)`." #: src/types-and-values/arithmetic.md msgid "" -"In fact, the compiler will detect overflow of constant expressions, which is why " -"the example requires a separate function." +"In fact, the compiler will detect overflow of constant expressions, which is " +"why the example requires a separate function." msgstr "" -"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که مثال به " -"یک تابع جداگانه نیاز دارد." +"در واقع، کامپایلر سرریز عبارات ثابت را تشخیص می دهد، به همین دلیل است که " +"مثال به یک تابع جداگانه نیاز دارد." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3244,34 +3324,35 @@ msgstr "زبان Rust برای تعیین نوع متغیر به نحوه است #: src/types-and-values/inference.md msgid "" -"This slide demonstrates how the Rust compiler infers types based on constraints " -"given by variable declarations and usages." +"This slide demonstrates how the Rust compiler infers types based on " +"constraints given by variable declarations and usages." msgstr "" "این اسلاید نشان می‌دهد که چگونه کامپایلر Rust با توجه به اعلان‌ها و استفاده‌های " "متغیر، انواع را استنتاج می‌کند. " #: src/types-and-values/inference.md msgid "" -"It is very important to emphasize that variables declared like this are not of " -"some sort of dynamic \"any type\" that can hold any data. The machine code " -"generated by such declaration is identical to the explicit declaration of a type. " -"The compiler does the job for us and helps us write more concise code." +"It is very important to emphasize that variables declared like this are not " +"of some sort of dynamic \"any type\" that can hold any data. The machine " +"code generated by such declaration is identical to the explicit declaration " +"of a type. The compiler does the job for us and helps us write more concise " +"code." msgstr "" -"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع داده " -"پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ ضمنی** " -"استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح اعلام میکنیم و " -"کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین تایپ ضمنی میتوانید " -"کد ها رو به صورت مختصرتر بنویسیم. " +"بسیار مهم است که تاکید کنیم متغیرهایی که به این صورت تعریف می‌شوند از «نوع " +"داده پویای `any`» نیستند که بتواند هر نوعی باشند. وقتی که ما از **تعیین تایپ " +"ضمنی** استفاده می‌کنیم در واقع مشابه زمانی هست که نوع داده را به صورت صریح " +"اعلام میکنیم و کد های ماشین آنها دقیقا یکسان هستند. فقط با استفاده از تعیین " +"تایپ ضمنی میتوانید کد ها رو به صورت مختصرتر بنویسیم. " #: src/types-and-values/inference.md msgid "" -"When nothing constrains the type of an integer literal, Rust defaults to `i32`. " -"This sometimes appears as `{integer}` in error messages. Similarly, floating-" -"point literals default to `f64`." +"When nothing constrains the type of an integer literal, Rust defaults to " +"`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " +"floating-point literals default to `f64`." msgstr "" -"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی «i32» " -"قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده می شود. به " -"طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." +"هنگامی که هیچ چیز نوع یک عدد صحیح را محدود نمی کند، Rust به طور پیش فرض روی " +"«i32» قرار می گیرد. گاهی اوقات در پیام های خطا به صورت «{integer}» نشان داده " +"می شود. به طور مشابه، تایپ ممیز شناور پیش‌فرض «f64» است." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3279,19 +3360,20 @@ msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md msgid "" -"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number is " -"calculated recursively as the sum of the n-1'th and n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت بازگشتی " -"به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." +"دنباله فیبوناچی با «[0،1]» شروع می شود. برای n>1، عدد فیبوناچی n به صورت " +"بازگشتی به عنوان مجموع اعداد فیبوناچی n-1 و n-2 محاسبه می شود." #: src/types-and-values/exercise.md msgid "" -"Write a function `fib(n)` that calculates the n'th Fibonacci number. When will " -"this function panic?" +"Write a function `fib(n)` that calculates the n'th Fibonacci number. When " +"will this function panic?" msgstr "" -"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد panic " -"می شود؟" +"یک تابع fib(n) بنویسید که عدد فیبوناچی n را محاسبه کند. چه زمانی این عملکرد " +"panic می شود؟" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3328,11 +3410,11 @@ msgstr "عبارات `if`" #: src/control-flow-basics/if.md msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/if-" -"expr.html#if-expressions) exactly like `if` statements in other languages:" +"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) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" +"شما [عبارت `if`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-expressions) رو به مانند دیگر زبان‌ها استفاده می‌کنید:" #: src/control-flow-basics/if.md msgid "\"zero!\"" @@ -3348,11 +3430,11 @@ msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" -"In addition, you can use `if` as an expression. The last expression of each block " -"becomes the value of the `if` expression:" +"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 اون مقدار و نوع بازگشتی است:" +"در کنار این موضوع, می‌توانید از if به عنوان یک عبارت با قابلیت بازگشت مقدار " +"هم استفاده کنید. آخرین عبارت توی هر بلاک if اون مقدار و نوع بازگشتی است:" #: src/control-flow-basics/if.md msgid "\"small\"" @@ -3368,28 +3450,30 @@ msgstr "\"اندازه عدد: {}\"" #: src/control-flow-basics/if.md msgid "" -"Because `if` is an expression and must have a particular type, both of its branch " -"blocks must have the same type. Show what happens if you add `;` after " -"`\"small\"` in the second example." +"Because `if` is an expression and must have a particular type, both of its " +"branch blocks must have the same type. Show what happens if you add `;` " +"after `\"small\"` in the second example." msgstr "" -"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` و " -"`else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از `x / 2` " -"در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." +"از آنجایی که ‍`if` یک عبارت است و باید نوع خاصی داشته باشد، هر دو بلاک (`if` " +"و `else`) باید از نوع یکسانی را باز گردانند. در نظر بگیرید که اگر بعد از " +"`x / 2` در مثال دوم `;` اضافه کنید، چه اتفاقی می افتد." #: src/control-flow-basics/if.md #, fuzzy msgid "" -"An `if` expression should be used in the same way as the other expressions. For " -"example, when it is used in a `let` statement, the statement must be terminated " -"with a `;` as well. Remove the `;` before `println!` to see the compiler error." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." msgstr "" -"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن را از " -"عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای کامپایلر را " -"ببینید." +"هنگامی که «if» در یک عبارت استفاده می شود، عبارت باید دارای «;» باشد تا آن " +"را از عبارت بعدی جدا کند. \";\" را قبل از \"println!\" حذف کنید تا خطای " +"کامپایلر را ببینید." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" -msgstr "سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" +msgstr "" +"سه کلمه کلیدی حلقه ای در Rust وجود دارد: \"while\"، \"loop\" و \"for\":" #: src/control-flow-basics/loops.md msgid "`while`" @@ -3397,12 +3481,12 @@ msgstr "حلقه‌های `while`" #: src/control-flow-basics/loops.md msgid "" -"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr." -"html#predicate-loops) works much like in other languages, executing the loop body " -"as long as the condition is true." +"The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) works much like in other languages, executing the " +"loop body as long as the condition is true." msgstr "" -"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-expr." -"html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." +"[کلمه‌کلیدی`while` ](https://doc.rust-lang.org/reference/expressions/loop-" +"expr.html#predicate-loops) بسیار شبیه به سایر زبان‌ها عمل می‌کند." #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" @@ -3410,8 +3494,8 @@ msgstr "\"خروجی x: {x}\"" #: src/control-flow-basics/loops/for.md msgid "" -"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over " -"ranges of values or the items in a collection:" +"The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " +"over ranges of values or the items in a collection:" msgstr "" "حلقه [`for`](https://doc.rust-lang.org/std/keyword.for.html) در محدوده‌ای از " "مقادیر یا موارد موجود در یک مجموعه تکرار می‌شود:" @@ -3422,30 +3506,30 @@ msgstr "\"elem: {elem}\"" #: src/control-flow-basics/loops/for.md msgid "" -"Under the hood `for` loops use a concept called \"iterators\" to handle iterating " -"over different kinds of ranges/collections. Iterators will be discussed in more " -"detail later." +"Under the hood `for` loops use a concept called \"iterators\" to handle " +"iterating over different kinds of ranges/collections. Iterators will be " +"discussed in more detail later." msgstr "" "حلقه‌های «for» در از مفهومی به نام «تکرارکننده‌ها» برای مدیریت تکرار در انواع " -"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث قرار " -"خواهند گرفت." +"مختلف محدوده/مجموعه استفاده می‌کنند. Iterators بعداً با جزئیات بیشتر مورد بحث " +"قرار خواهند گرفت." #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" -"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای یک " -"محدوده فراگیر نشان دهید." +"توجه داشته باشید که حلقه `for` فقط تا `4` تکرار می شود. نحو `1..=5` را برای " +"یک محدوده فراگیر نشان دهید." #: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." msgstr "" -"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا زمانی که " -"یک «break» ایجاد شود، حلقه می‌شود." +"[`loop`](https://doc.rust-lang.org/std/keyword.loop.html) برای همیشه، تا " +"زمانی که یک «break» ایجاد شود، حلقه می‌شود." #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" @@ -3453,21 +3537,23 @@ msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" -"If you want to immediately start the next iteration use [`continue`](https://doc." -"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." +"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) استفاده کنید." +"اگر می‌خواهید بلافاصله تکرار بعدی را شروع کنید، از [`continue`](https://doc." +"rust-lang.org/reference/expressions/loop-expr.html#continue-expressions) " +"استفاده کنید." #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"If you want to exit any kind of loop early, use [`break`](https://doc.rust-lang." -"org/reference/expressions/loop-expr.html#break-expressions). With `loop`, this " -"can take an optional expression that becomes the value of the `loop` expression." +"If you want to exit any kind of loop early, use [`break`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " +"`loop`, this can take an optional expression that becomes the value of the " +"`loop` expression." msgstr "" -"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#break-expressions) استفاده کنید." +"اگر می‌خواهید زودتر از یک حلقه خارج شوید، از [`break`](https://doc.rust-lang." +"org/reference/expressions/loop-expr.html#break-expressions) استفاده کنید." #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md @@ -3481,21 +3567,22 @@ msgstr "\"{}\"" #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" -"Note that `loop` is the only looping construct which can return a non-trivial " -"value. This is because it's guaranteed to only return at a `break` statement " -"(unlike `while` and `for` loops, which can also return when the condition fails)." +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." msgstr "" -"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** را " -"برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود (برخلاف " -"حلقه‌های `while` و `for`)." +"توجه داشته باشید که loop تنها ساختار حلقه‌ای است که یک مقدار **non-trivial** " +"را برمی‌گرداند. این به دلیل این است که تضمین می‌شود حداقل یک بار وارد آن شود " +"(برخلاف حلقه‌های `while` و `for`)." #: src/control-flow-basics/break-continue/labels.md msgid "" -"Both `continue` and `break` can optionally take a label argument which is used to " -"break out of nested loops:" +"Both `continue` and `break` can optionally take a label argument which is " +"used to break out of nested loops:" msgstr "" -"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان برچسب " -"(label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" +"کلیدواژه‌های `continue` و `break` هر دو می‌توانند به صورت اختیاری یک آرگومان " +"برچسب (label) بگیرند که میتوان برای خروج از حلقه‌های تو در تو استفاده می‌کرد:" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" @@ -3507,11 +3594,12 @@ msgstr "بلوک‌ها" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. Each " -"block has a value and a type, which are those of the last expression of the block:" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " +"Each block has a value and a type, which are those of the last expression of " +"the block:" msgstr "" -"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده است. " -"هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" +"یک بلوک در Rust حاوی دنباله ای از عبارات است که با پرانتزهای «{}» محصور شده " +"است. هر بلوک دارای یک مقدار و یک نوع است که آخرین عبارت بلوک است:" #: src/control-flow-basics/blocks-and-scopes.md msgid "\"y: {y}\"" @@ -3519,17 +3607,18 @@ msgstr "\"y: {y}\"" #: src/control-flow-basics/blocks-and-scopes.md msgid "" -"If the last expression ends with `;`, then the resulting value and type is `()`." +"If the last expression ends with `;`, then the resulting value and type is " +"`()`." msgstr "اگر آخرین عبارت با `;` پایان یابد، مقدار و نوع بازگشتی `()` است." #: src/control-flow-basics/blocks-and-scopes.md 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`." +"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` تغییرات را اعمال کنید." +"می‌توانید نشان دهید که چگونه با تغییر خط آخر بلاک مقدار و نوع بازگشتی تغییر " +"می‌کند. به عنوان مثال با اضافه کردن یا حذف کردن یک `;` یا با استفاده از کلید " +"واژه `return` تغییرات را اعمال کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." @@ -3537,11 +3626,11 @@ msgstr "‏محدوده (scope) یک متغیر محدود به بلاک محا #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"You can shadow variables, both those from outer scopes and variables from the " -"same scope:" +"You can shadow variables, both those from outer scopes and variables from " +"the same scope:" msgstr "" -"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و هم " -"متغیرهایی که از اسکوپ یکسان هستند:" +"شما می توانید متغیرها را سایه بزنید، هم آنهایی که از اسکوپ‌های بیرونی هستند و " +"هم متغیرهایی که از اسکوپ یکسان هستند:" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" @@ -3566,22 +3655,22 @@ msgstr "\"after: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block in the " -"last example, and then trying to access it outside that block." +"Show that a variable's scope is limited by adding a `b` in the inner block " +"in the last example, and then trying to access it outside that block." msgstr "" -"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن در " -"خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." +"با افزودن یک «b» در بلوک داخلی در آخرین مثال، و سپس تلاش برای دسترسی به آن " +"در خارج از بلوک، نشان دهید که دامنه یک متغیر محدود است." #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" -"Shadowing is different from mutation, because after shadowing both variables' " -"memory locations exist at the same time. Both are available under the same name, " -"depending where you use it in the code." +"Shadowing is different from mutation, because after shadowing both " +"variables' memory locations exist at the same time. Both are available under " +"the same name, depending where you use it in the code." msgstr "" -"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به طور " -"همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در کد " -"استفاده می کنید." +"سایه زدن با جهش متفاوت است، زیرا پس از سایه زدن، هر دو مکان حافظه متغیر به " +"طور همزمان وجود دارند. هر دو با یک نام موجود هستند، بسته به جایی که از آن در " +"کد استفاده می کنید." #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." @@ -3597,21 +3686,22 @@ msgstr "" #: src/control-flow-basics/functions.md msgid "" -"Declaration parameters are followed by a type (the reverse of some programming " -"languages), then a return type." +"Declaration parameters are followed by a type (the reverse of some " +"programming languages), then a return type." msgstr "" -"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف برخی " -"از زبان‌های برنامه‌نویسی)." +"بعد اعلان تابع پارامترهای ورودی و نوع آن و سپس یک نوع برگشتی هستند (برخلاف " +"برخی از زبان‌های برنامه‌نویسی)." #: src/control-flow-basics/functions.md msgid "" -"The last expression in a function body (or any block) becomes the return value. " -"Simply omit the `;` at the end of the expression. The `return` keyword can be " -"used for early return, but the \"bare value\" form is idiomatic at the end of a " -"function (refactor `gcd` to use a `return`)." +"The last expression in a function body (or any block) becomes the return " +"value. Simply omit the `;` at the end of the expression. The `return` " +"keyword can be used for early return, but the \"bare value\" form is " +"idiomatic at the end of a function (refactor `gcd` to use a `return`)." msgstr "" -"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر گرفته " -"می‌شود. به همین سادگی `;` را میتوان در انتهای عبارت حذف کنید." +"آخرین عبارت در بدنه تابع (یا هر بلوک دیگری) به عنوان مقدار برگشتی در نظر " +"گرفته می‌شود. به همین سادگی `;` را میتوان در انتهای " +"عبارت حذف کنید." #: src/control-flow-basics/functions.md #, fuzzy @@ -3619,55 +3709,56 @@ 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/control-flow-basics/functions.md -msgid "Overloading is not supported -- each function has a single implementation." +msgid "" +"Overloading is not supported -- each function has a single implementation." msgstr "" "بارگذاری مجدد (overloading) پشتیبانی نمی‌شود -- هر تابع فقط یک پیاده‌سازی دارد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a fixed number of parameters. Default arguments are not supported. " -"Macros can be used to support variadic functions." +"Always takes a fixed number of parameters. Default arguments are not " +"supported. Macros can be used to support variadic functions." msgstr "" -"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی شوند. " -"ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." +"همیشه تعداد ثابتی از پارامترها را می گیرد. آرگومان های پیش فرض پشتیبانی نمی " +"شوند. ماکروها را می توان برای پشتیبانی از توابع متغیر استفاده کرد." #: src/control-flow-basics/functions.md msgid "" -"Always takes a single set of parameter types. These types can be generic, which " -"will be covered later." +"Always takes a single set of parameter types. These types can be generic, " +"which will be covered later." msgstr "همیشه یک مجموعه واحد از انواع آرگومان‌ها را می‌گیرد." #: src/control-flow-basics/macros.md msgid "" -"Macros are expanded into Rust code during compilation, and can take a variable " -"number of arguments. They are distinguished by a `!` at the end. The Rust " -"standard library includes an assortment of useful macros." +"Macros are expanded into Rust code during compilation, and can take a " +"variable number of arguments. They are distinguished by a `!` at the end. " +"The Rust standard library includes an assortment of useful macros." msgstr "" "ماکروها در طول کامپایل به کد Rust گسترش می‌یابند و می‌توانند تعداد متغیری از " -"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه استاندارد " -"Rust شامل مجموعه ای از ماکروهای مفید است." +"آرگومان‌ها را بگیرند. آنها در پایان با یک «!» متمایز می شوند. کتابخانه " +"استاندارد Rust شامل مجموعه ای از ماکروهای مفید است." #: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" -"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی شرح " -"داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) را اعمال " -"می کند. ." +"`println!(format, ..)` یک خط را در خروجی استاندارد چاپ می کند و قالب بندی " +"شرح داده شده در [`std::fmt`] (https://doc.rust-lang.org/std/fmt/index.html) " +"را اعمال می کند. ." #: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" -"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت یک " -"رشته برمی گرداند." +"`format!(format, ..)` درست مانند `println!` کار می کند، اما نتیجه را به صورت " +"یک رشته برمی گرداند." #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." @@ -3675,17 +3766,19 @@ msgstr "`dbg!(expression)` مقدار عبارت را ثبت کرده و آن ر #: src/control-flow-basics/macros.md msgid "" -"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will panic." +"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " +"panic." msgstr "" -"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. panic می " -"کند." +"`todo!()` مقداری از کد را به عنوان هنوز پیاده‌سازی نشده علامت‌گذاری می‌کند. " +"panic می کند." #: src/control-flow-basics/macros.md msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will panic." +"`unreachable!()` marks a bit of code as unreachable. If executed, it will " +"panic." msgstr "" -"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر اعدام شود " -"وحشت می کند." +"`unreachable!()` مقداری از کد را غیرقابل دسترسی علامت گذاری می کند. اگر " +"اعدام شود وحشت می کند." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3693,21 +3786,21 @@ msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" -"The takeaway from this section is that these common conveniences exist, and how " -"to use them. Why they are defined as macros, and what they expand to, is not " -"especially critical." +"The takeaway from this section is that these common conveniences exist, and " +"how to use them. Why they are defined as macros, and what they expand to, is " +"not especially critical." msgstr "" -"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود دارد. " -"اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می یابند، بسیار " -"مهم نیست." +"نکته مهم این بخش این است که این امکانات مشترک و نحوه استفاده از آنها وجود " +"دارد. اینکه چرا آنها به عنوان ماکرو تعریف می شوند و به چه چیزی گسترش می " +"یابند، بسیار مهم نیست." #: src/control-flow-basics/macros.md msgid "" -"The course does not cover defining macros, but a later section will describe use " -"of derive macros." +"The course does not cover defining macros, but a later section will describe " +"use of derive macros." msgstr "" -"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای مشتق شده " -"توضیح داده خواهد شد." +"این دوره شامل تعریف ماکروها نمی شود، اما در بخش بعدی استفاده از ماکروهای " +"مشتق شده توضیح داده خواهد شد." #: src/control-flow-basics/exercise.md #, fuzzy @@ -3715,22 +3808,27 @@ msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح زیر " -"تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" +"‏[Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) به شرح " +"زیر تعریف می‌شود، برای هر n۱ دلخواه بزرگتر از صفر:" #: src/control-flow-basics/exercise.md -msgid "If _ni_ is 1, then the sequence terminates at _ni_." +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." msgstr "" -"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان می‌یابد." +"اگر _ni_ = ۱ باشد، دنباله (sequence) در _ni_ پایان " +"می‌یابد." #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." -msgstr "اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." +msgstr "" +"اگر _ni_ زوج باشد، آنگاه _ni+۱_ = _ni_/۲." #: src/control-flow-basics/exercise.md -msgid "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" -"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ + ۱." +"اگر _ni_ فرد باشد، آنگاه _ni+۱_ = ۳ * _ni_ " +"+ ۱." #: src/control-flow-basics/exercise.md msgid "For example, beginning with _n1_ = 3:" @@ -3793,8 +3891,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 35 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. آن " -"شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 35 دقیقه طول بکشد. " +"آن شامل:" #: src/tuples-and-arrays.md msgid "This segment should take about 35 minutes. It contains:" @@ -3802,26 +3900,27 @@ msgstr "این بخش باید حدود 35 دقیقه طول بکشد. این ش #: src/tuples-and-arrays/arrays.md msgid "" -"A value of the array type `[T; N]` holds `N` (a compile-time constant) elements " -"of the same type `T`. Note that the length of the array is _part of its type_, " -"which means that `[u8; 3]` and `[u8; 4]` are considered two different types. " -"Slices, which have a size determined at runtime, are covered later." +"A value of the array type `[T; N]` holds `N` (a compile-time constant) " +"elements of the same type `T`. Note that the length of the array is _part of " +"its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " +"different types. Slices, which have a size determined at runtime, are " +"covered later." msgstr "" "یک مقدار از نوع آرایه `[T; N]` دارای `N` (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` است. " -"توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در نظر " -"گرفته می‌شوند." +"span> (یک ثابت زمان کامپایل) عنصر از نوع یکسان `T` " +"است. توجه داشته باشید که طول آرایه بخشی از نوع آن است، به این معنی که `[u8; 3]` و `[u8; 4]` دو نوع متفاوت در " +"نظر گرفته می‌شوند." #: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be avoided " -"using unsafe Rust." +"runtime. Rust can usually optimize these checks away, and they can be " +"avoided using unsafe Rust." msgstr "" -"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های آرایه در " -"زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین ببرد و با " -"استفاده از Rust ناایمن از آنها جلوگیری کرد." +"سعی کنید به یک عنصر آرایه خارج از محدوده دسترسی داشته باشید. دسترسی های " +"آرایه در زمان اجرا بررسی می شود. زنگ معمولاً می‌تواند این بررسی‌ها را از بین " +"ببرد و با استفاده از Rust ناایمن از آنها جلوگیری کرد." #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." @@ -3830,23 +3929,25 @@ msgstr "ما می‌توانیم از مقادیر ثابت برای انتسا #: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " -"parameter: `{}` gives the default output, `{:?}` gives the debug output. Types " -"such as integers and strings implement the default output, but arrays only " -"implement the debug output. This means that we must use debug output here." -msgstr "" -"ماکرو `println!` با پارامتر فرمت `?` " -"نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش فرض را می‌دهد، " -"`{:?}` خروجی دیباگ را می‌دهد. انواع‌ای مانند اعداد صحیح و " -"رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها فقط خروجی دیباگ را پیاده " -"سازی می‌کنند. این بدان معناست که ما باید در اینجا از خروجی دیباگ استفاده کنیم." +"parameter: `{}` gives the default output, `{:?}` gives the debug output. " +"Types such as integers and strings implement the default output, but arrays " +"only implement the debug output. This means that we must use debug output " +"here." +msgstr "" +"ماکرو `println!` با پارامتر فرمت `?` نیازمند پیاده سازی دیباگ است: `{}` خروجی پیش " +"فرض را می‌دهد، `{:?}` خروجی دیباگ را می‌دهد. انواع‌ای " +"مانند اعداد صحیح و رشته‌ها خروجی پیش فرض را پیاده سازی می‌کنند، اما آرایه‌ها " +"فقط خروجی دیباگ را پیاده سازی می‌کنند. این بدان معناست که ما باید در اینجا از " +"خروجی دیباگ استفاده کنیم." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -"اضافه کردن `#`، مانند `{a:#?}`، یک فرمت " -"«چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." +"اضافه کردن `#`، مانند `{a:#?}`، یک " +"فرمت «چاپ زیبا» را فراخوانی می‌کند که می‌تواند خواندن آن را آسان تر کند." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." @@ -3858,16 +3959,16 @@ msgstr "تاپل‌ها مقادیر انواع مختلف را در یک نوع #: src/tuples-and-arrays/tuples.md msgid "" -"Fields of a tuple can be accessed by the period and the index of the value, e.g. " -"`t.0`, `t.1`." +"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` دسترسی پیدا کرد." +"می‌توان به فیلدهای یک تاپل با استفاده از نقطه و شماره اندیس مقدار، مانند " +"`t.0`، `t.1` دسترسی پیدا کرد." #: src/tuples-and-arrays/tuples.md msgid "" -"The empty tuple `()` is referred to as the \"unit type\" and signifies absence of " -"a return value, akin to `void` in other languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies " +"absence of a return value, akin to `void` in other languages." msgstr "" "تاپل خالی `()` به عنوان `unit type` نامیده می‌شود و نشان‌دهنده عدم وجود مقدار " "بازگشتی است، مشابه `void` در زبان‌های دیگر." @@ -3878,20 +3979,22 @@ msgstr "عبارت `for` از تکرار روی آرایه ها (اما نه ت #: src/tuples-and-arrays/iteration.md msgid "" -"This functionality uses the `IntoIterator` trait, but we haven't covered that yet." +"This functionality uses the `IntoIterator` trait, but we haven't covered " +"that yet." msgstr "" -"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن پرداخته‌ایم." +"این قابلیت از ویژگی `IntoIterator` استفاده می‌کند، اما ما هنوز به آن " +"پرداخته‌ایم." #: src/tuples-and-arrays/iteration.md #, fuzzy msgid "" -"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!` " -"macros. These are always checked, while debug-only variants like `debug_assert!` " -"compile to nothing in release builds." +"The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" +"` macros. These are always checked, while debug-only variants like " +"`debug_assert!` compile to nothing in release builds." msgstr "" -"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!` " -"وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی مانند " -"`debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." +"ماکرو `assert_ne!` در اینجا جدید است. همچنین ماکروهای `assert_eq!` و `assert!" +"` وجود دارد. این‌ها همیشه بررسی می‌شوند، در حالی که، گونه‌های فقط اشکال‌زدایی " +"مانند `debug_assert!` در نسخه‌های ریلیز کامپایل نمی‌شوند." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -3899,9 +4002,9 @@ msgid "" "extract the inner values into local variables. This can be done manually by " "directly accessing the inner values:" msgstr "" -"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر داخلی " -"را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با دسترسی مستقیم به " -"مقادیر داخلی انجام داد:" +"هنگام کار با تاپل ها و سایر مقادیر ساختاریافته، معمول است که بخواهید مقادیر " +"داخلی را در متغیرهای محلی استخراج کنید. این را می توان به صورت دستی با " +"دسترسی مستقیم به مقادیر داخلی انجام داد:" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" @@ -3909,46 +4012,47 @@ msgstr "\"left: {left}, right: {right}\"" #: src/tuples-and-arrays/destructuring.md msgid "" -"However, Rust also supports using pattern matching to destructure a larger value " -"into its constituent parts:" +"However, Rust also supports using pattern matching to destructure a larger " +"value into its constituent parts:" msgstr "" -"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر در " -"بخش های تشکیل دهنده آن پشتیبانی می کند:" +"با این حال، Rust همچنین از استفاده از تطبیق الگو برای تخریب یک مقدار بزرگتر " +"در بخش های تشکیل دهنده آن پشتیبانی می کند:" #: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " -"statically verify that the value on the right of `=` has the same structure as " -"the pattern." +"statically verify that the value on the right of `=` has the same structure " +"as the pattern." msgstr "" -"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر می " -"تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو دارد." +"الگوهای استفاده شده در اینجا \"irrefutable\" هستند، به این معنی که کامپایلر " +"می تواند به طور ایستا تأیید کند که مقدار سمت راست `=` ساختاری مشابه الگو " +"دارد." #: src/tuples-and-arrays/destructuring.md msgid "" -"A variable name is an irrefutable pattern that always matches any value, hence " -"why we can also use `let` to declare a single variable." +"A variable name is an irrefutable pattern that always matches any value, " +"hence why we can also use `let` to declare a single variable." msgstr "" -"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این رو " -"می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." +"نام متغیر یک الگوی انکارناپذیر است که همیشه با هر مقداری مطابقت دارد، از این " +"رو می‌توانیم از «let» برای اعلام یک متغیر استفاده کنیم." #: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " -"comparison and destructuring to happen at the same time. This form of pattern " -"matching will be discussed in more detail later." +"comparison and destructuring to happen at the same time. This form of " +"pattern matching will be discussed in more detail later." msgstr "" -"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه برابری و " -"تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو بعداً با جزئیات " -"بیشتری مورد بحث قرار خواهد گرفت." +"Rust همچنین از استفاده از الگوها در شرطی‌ها پشتیبانی می‌کند و امکان مقایسه " +"برابری و تخریب ساختار را در همان زمان فراهم می‌کند. این شکل از تطبیق الگو " +"بعداً با جزئیات بیشتری مورد بحث قرار خواهد گرفت." #: src/tuples-and-arrays/destructuring.md msgid "" -"Edit the examples above to show the compiler error when the pattern doesn't match " -"the value being matched on." +"Edit the examples above to show the compiler error when the pattern doesn't " +"match the value being matched on." msgstr "" -"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار مطابقت‌شده " -"مطابقت ندارد نشان داده شود." +"مثال‌های بالا را ویرایش کنید تا خطای کامپایلر در زمانی که الگو با مقدار " +"مطابقت‌شده مطابقت ندارد نشان داده شود." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" @@ -3968,11 +4072,11 @@ msgstr "" #: src/tuples-and-arrays/exercise.md msgid "" -"Copy the code below to and implement the function. " -"This function only operates on 3x3 matrices." +"Copy the code below to and implement the " +"function. This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و توابع " -"را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و " +"توابع را پیاده‌سازی کنید:" #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md @@ -4003,22 +4107,23 @@ msgstr "این بخش باید حدود ۵۵ دقیقه طول بکشد. آن ش #: src/references/shared.md #, fuzzy msgid "" -"A reference provides a way to access another value without taking ownership of " -"the value, and is also called \"borrowing\". Shared references are read-only, and " -"the referenced data cannot change." +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" -"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به آن " -"«قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده نمی توانند " -"تغییر کنند." +"یک مرجع راهی برای دسترسی به مقدار دیگری بدون مسئولیت ارزش فراهم می کند و به " +"آن «قرض» نیز می گویند. مراجع مشترک فقط خواندنی هستند و داده های ارجاع شده " +"نمی توانند تغییر کنند." #: src/references/shared.md msgid "" -"A shared reference to a type `T` has type `&T`. A reference value is made with " -"the `&` operator. The `*` operator \"dereferences\" a reference, yielding its " -"value." +"A shared reference to a type `T` has type `&T`. A reference value is made " +"with the `&` operator. The `*` operator \"dereferences\" a reference, " +"yielding its value." msgstr "" -"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` ساخته " -"می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به دست می دهد." +"یک مرجع مشترک به یک نوع `T` دارای نوع `&T` است. یک مقدار مرجع با عملگر `&` " +"ساخته می شود. عملگر `*` یک مرجع را \"ارجاع مجدد\" می کند و مقدار آن را به " +"دست می دهد." #: src/references/shared.md msgid "Rust will statically forbid dangling references:" @@ -4028,107 +4133,114 @@ msgstr "راست بطور استاتیک مراجع تعلیق شده (dangling) msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " -"access the value, but is still \"owned\" by the original variable. The course " -"will get into more detail on ownership in day 3." +"access the value, but is still \"owned\" by the original variable. The " +"course will get into more detail on ownership in day 3." msgstr "" -"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، و " -"این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند از مرجع " -"برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی است. این دوره در " -"روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." +"گفته می‌شود که یک مرجع مقداری را که به آن ارجاع می‌دهد \"borrow\" (قرض) می‌کند، " +"و این مدل خوبی برای دانش‌آموزانی است که با اشاره‌گرها آشنا نیستند: کد می‌تواند " +"از مرجع برای دسترسی به مقدار استفاده کند، اما همچنان متعلق به متغیر اصلی " +"است. این دوره در روز 3 به جزئیات بیشتری در مورد مالکیت خواهد پرداخت." #: src/references/shared.md msgid "" -"References are implemented as pointers, and a key advantage is that they can be " -"much smaller than the thing they point to. Students familiar with C or C++ will " -"recognize references as pointers. Later parts of the course will cover how Rust " -"prevents the memory-safety bugs that come from using raw pointers." +"References are implemented as pointers, and a key advantage is that they can " +"be much smaller than the thing they point to. Students familiar with C or C+" +"+ will recognize references as pointers. Later parts of the course will " +"cover how Rust prevents the memory-safety bugs that come from using raw " +"pointers." msgstr "" -"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می توانند " -"بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با C یا C++ " -"آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی دوره به این " -"موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از استفاده از نشانگرهای " -"خام جلوگیری می‌کند." +"مراجع به عنوان اشاره گر پیاده سازی می شوند و یک مزیت کلیدی این است که می " +"توانند بسیار کوچکتر از چیزی باشند که به آن اشاره می کنند. دانش آموزانی که با " +"C یا C++ آشنا هستند، مراجع را به عنوان اشاره گر تشخیص می دهند. بخش‌های بعدی " +"دوره به این موضوع می‌پردازد که چگونه Rust از اشکالات ایمنی حافظه ناشی از " +"استفاده از نشانگرهای خام جلوگیری می‌کند." #: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." -msgstr "Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." +msgstr "" +"Rust به طور خودکار برای شما مراجع ایجاد نمی کند - `&` همیشه مورد نیاز است." #: src/references/shared.md msgid "" -"Rust will auto-dereference in some cases, in particular when invoking methods " -"(try `r.is_ascii()`). There is no need for an `->` operator like in C++." +"Rust will auto-dereference in some cases, in particular when invoking " +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" -"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی متدها " -"(`ref_x.count_ones()` را امتحان کنید)." +"راست در برخی موارد به‌طور خودکار از Dereference می‌کند، به‌ویژه هنگام فراخوانی " +"متدها (`ref_x.count_ones()` را امتحان کنید)." #: src/references/shared.md msgid "" -"In this example, `r` is mutable so that it can be reassigned (`r = &b`). Note " -"that this re-binds `r`, so that it refers to something else. This is different " -"from C++, where assignment to a reference changes the referenced value." +"In this example, `r` is mutable so that it can be reassigned (`r = &b`). " +"Note that this re-binds `r`, so that it refers to something else. This is " +"different from C++, where assignment to a reference changes the referenced " +"value." msgstr "" -"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). توجه " -"داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری اشاره می " -"کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را تغییر می دهد." +"در این مثال، `r` قابل تغییر است تا بتوان آن را مجدداً اختصاص داد (`r = &b`). " +"توجه داشته باشید که این `r` را دوباره متصل می کند، به طوری که به چیز دیگری " +"اشاره می کند. این با C++ متفاوت است، جایی که انتساب به یک مرجع مقدار مرجع را " +"تغییر می دهد." #: src/references/shared.md msgid "" -"A shared reference does not allow modifying the value it refers to, even if that " -"value was mutable. Try `*r = 'X'`." +"A shared reference does not allow modifying the value it refers to, even if " +"that value was mutable. Try `*r = 'X'`." msgstr "" -"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی اگر آن " -"مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." +"یک مرجع مشترک اجازه تغییر مقداری را که به آن ارجاع می دهد را نمی دهد، حتی " +"اگر آن مقدار قابل تغییر باشد. \"*r = \"X\" را امتحان کنید." #: src/references/shared.md msgid "" -"Rust is tracking the lifetimes of all references to ensure they live long enough. " -"Dangling references cannot occur in safe Rust. `x_axis` would return a reference " -"to `point`, but `point` will be deallocated when the function returns, so this " -"will not compile." +"Rust is tracking the lifetimes of all references to ensure they live long " +"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " +"a reference to `point`, but `point` will be deallocated when the function " +"returns, so this will not compile." msgstr "" -"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به اندازه " -"کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. `x_axis` یک " -"ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، تخصیص داده می‌شود، " -"بنابراین کامپایل نمی‌شود." +"Rust طول عمر همه مراجع را ردیابی می کند تا اطمینان حاصل شود که آنها به " +"اندازه کافی عمر می کنند. ارجاعات آویزان نمی توانند در Rust ایمن رخ دهند. " +"`x_axis` یک ارجاع به `point` برمی‌گرداند، اما «نقطه» زمانی که تابع برمی‌گردد، " +"تخصیص داده می‌شود، بنابراین کامپایل نمی‌شود." #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "" -"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت خواهیم کرد." +"هنگامی که به مالکیت در زبان راست رسیدیم، بیشتر در مورد «قرض دادن» صحبت " +"خواهیم کرد." #: src/references/exclusive.md msgid "" -"Exclusive references, also known as mutable references, allow changing the value " -"they refer to. They have type `&mut T`." +"Exclusive references, also known as mutable references, allow changing the " +"value they refer to. They have type `&mut T`." msgstr "" -"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می دهند " -"مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." +"مراجع انحصاری، همچنین به عنوان مراجع قابل تغییر شناخته می شوند، اجازه می " +"دهند مقداری را که به آن ارجاع می دهند تغییر دهند. آنها نوع `mut &T` دارند." #: src/references/exclusive.md msgid "" -"\"Exclusive\" means that only this reference can be used to access the value. No " -"other references (shared or exclusive) can exist at the same time, and the " -"referenced value cannot be accessed while the exclusive reference exists. Try " -"making an `&point.0` or changing `point.0` while `x_coord` is alive." +"\"Exclusive\" means that only this reference can be used to access the " +"value. No other references (shared or exclusive) can exist at the same time, " +"and the referenced value cannot be accessed while the exclusive reference " +"exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " +"alive." msgstr "" "\"انحصاری\" به این معنی است که فقط از این مرجع می توان برای دسترسی به مقدار " -"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان وجود " -"داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار ارجاع‌شده " -"دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا `point.0` را تغییر " -"دهید." +"استفاده کرد. هیچ مرجع دیگری (اشتراک‌گذاری شده یا انحصاری) نمی‌تواند همزمان " +"وجود داشته باشد، و تا زمانی که مرجع انحصاری وجود دارد، نمی‌توان به مقدار " +"ارجاع‌شده دسترسی داشت. زمانی که `x_coord` زنده است، `&point.0` بسازید یا " +"`point.0` را تغییر دهید." #: src/references/exclusive.md msgid "" -"Be sure to note the difference between `let mut x_coord: &i32` and `let x_coord: " -"&mut i32`. The first one represents a shared reference which can be bound to " -"different values, while the second represents an exclusive reference to a mutable " -"value." +"Be sure to note the difference between `let mut x_coord: &i32` and `let " +"x_coord: &mut i32`. The first one represents a shared reference which can be " +"bound to different values, while the second represents an exclusive " +"reference to a mutable value." msgstr "" -"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت کنید. " -"مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل شود، در " -"حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." +"حتماً تفاوت بین «let mut x_coord: &i32» و «let x_coord: &mut i32» را یادداشت " +"کنید. مورد اول یک مرجع مشترک را نشان می دهد که می تواند به مقادیر مختلف متصل " +"شود، در حالی که دومی نشان دهنده یک مرجع انحصاری به یک مقدار قابل تغییر است." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" @@ -4141,13 +4253,13 @@ msgstr "برش‌ها داده‌ها را از نوع برش‌شده قرض م #: src/references/slices.md msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -"پرسش: اگر `a[3]` را درست قبل از چاپ `s` " -"تغییر دهید چه اتفاقی می‌افتد؟" +"پرسش: اگر `a[3]` را درست قبل از چاپ `s` تغییر دهید چه اتفاقی می‌افتد؟" #: src/references/slices.md msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending indexes " -"in brackets." +"We create a slice by borrowing `a` and specifying the starting and ending " +"indexes in brackets." msgstr "" "ما با قرض گرفتن `a` و مشخص کردن شاخص‌های شروع و پایان در " "براکت‌ها، برش (slice) ایجاد می‌کنیم." @@ -4155,59 +4267,62 @@ msgstr "" #: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are identical." +"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/references/slices.md 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/references/slices.md -msgid "To easily create a slice of the full array, we can therefore use `&a[..]`." +msgid "" +"To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "یک روش ساده برای برش کل آرایه، این است که از `&a[..]` " "استفاده کنیم." #: src/references/slices.md msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) " -"no longer mentions the array length. This allows us to perform computation on " -"slices of different sizes." +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " +"(`&[i32]`) no longer mentions the array length. This allows us to perform " +"computation on slices of different sizes." msgstr "" -"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع `s` (`&[i32]`) دیگر طول آرایه را ذکر نمی‌شود. " -"این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف انجام دهیم." +"`s` یک مرجع به برش i32 است. توجه داشته باشید که نوع " +"`s` (`&[i32]`) دیگر طول آرایه را " +"ذکر نمی‌شود. این به ما امکان می‌دهد محاسباتی را روی برش‌هایی با اندازه‌های مختلف " +"انجام دهیم." #: src/references/slices.md 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/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but the " -"answer is that for memory safety reasons you cannot do it through `a` at this " -"point in the execution, but you can read the data from both `a` and `s` safely. " -"It works before you created the slice, and again after the `println`, when the " -"slice is no longer used." +"The question about modifying `a[3]` can spark an interesting discussion, but " +"the answer is that for memory safety reasons you cannot do it through `a` at " +"this point in the execution, but you can read the data from both `a` and `s` " +"safely. It works before you created the slice, and again after the " +"`println`, when the slice is no longer used." msgstr "" -"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع کند، " -"اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید داده‌ها را از هر " -"دو `a` و `s` به طور ایمن بخوانید. این " -"کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، " -"زمانی که برش دیگر استفاده نمی شود. جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow " -"checker) توضیح خواهیم داد." +"پرسش در مورد تغییر `a[3]` می تواند یک بحث جالب را شروع " +"کند، اما پاسخ‌اش این است که به دلایل ایمنی حافظه، نمی‌توانید این کار را از " +"طریق `a` در این مرحله از اجرا انجام دهید، اما می‌توانید " +"داده‌ها را از هر دو `a` و `s` به " +"طور ایمن بخوانید. این کار قبل از ایجاد برش و دوباره بعد از `println!` کار میکند، زمانی که برش دیگر استفاده نمی شود. " +"جزئیات بیشتری در بخش بررسی‌کننده‌قرض (the borrow checker) توضیح خواهیم داد." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" @@ -4219,7 +4334,8 @@ msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UT #: src/references/strings.md #, fuzzy -msgid "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "`str&` تکه‌ای از بایت‌های رمزگذاری‌شده UTF-8، شبیه به `[u8]&` است." #: src/references/strings.md src/std-traits/read-and-write.md @@ -4245,31 +4361,31 @@ msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals (`\"Hello\"`), " -"are stored in the program’s binary." +"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/references/strings.md msgid "" -"Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, " -"it is owned." +"Rust's `String` type is a wrapper around a vector of bytes. As with a " +"`Vec`, it is owned." msgstr "" -"در راست نوع ‍`String` یک wrapper بر روی یک بردار از بایت‌هاست. " -"مانند `Vec`، یک نوع Owned است." +"در راست نوع ‍`String` یک wrapper بر روی یک بردار از " +"بایت‌هاست. مانند `Vec`، یک نوع Owned است." #: src/references/strings.md msgid "" -"As with many other types `String::from()` creates a string from a string literal; " -"`String::new()` creates a new empty string, to which string data can be added " -"using the `push()` and `push_str()` methods." +"As with many other types `String::from()` creates a string from a string " +"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()` که رشته خالی جدید " -"ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `String::from()` یک رشته از " +"یک لیترال رشته ایجاد می‌کند. `String::new()` که رشته " +"خالی جدید ایجاد می‌کند که داده های رشته‌ای می‌توانند با استفاده از متدهای `push()` و `push_str()` به آن اضافه شوند." #: src/references/strings.md @@ -4277,9 +4393,9 @@ 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!()` یک راه راحت برای ایجاد یک رشته Owned از " -"مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!()` " -"است." +"ماکرو `format!()` یک راه راحت برای ایجاد یک رشته Owned " +"از مقادیر پویا است. مثل فرمت قابل پذیرش توسط ماکرو `println!" +"()` است." #: src/references/strings.md msgid "" @@ -4288,60 +4404,63 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" -"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب کنید. " -"اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت وحشت می کند. " -"تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای درست کردن مرزهای " -"کاراکتر ترجیح داده می شود." +"می‌توانید برش‌های `&str` را از `String` از طریق `&` و انتخابی محدوده انتخاب " +"کنید. اگر محدوده بایتی را انتخاب کنید که با مرزهای نویسه تراز نباشد، عبارت " +"وحشت می کند. تکرار کننده `chars` روی کاراکترها تکرار می شود و بر تلاش برای " +"درست کردن مرزهای کاراکتر ترجیح داده می شود." #: src/references/strings.md msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the one " -"that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain UTF-8 " -"encoded bytes and will never use a small-string optimization)." +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " +"one that always points to a valid string in memory. Rust `String` is a rough " +"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/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" -"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` " -"ایجاد کنید:" +"رشته‌های بایت به شما امکان می‌دهند مستقیماً یک مقدار `&[u8]` ایجاد کنید:" #: src/references/strings.md msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: `r\"\\n\" " -"== \"\\\\n\"`. You can embed double-quotes by using an equal amount of `#` on " -"either side of the quotes:" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`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\"`.شما " -"می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت دابل‌کوت‌ها، دابل‌کوت‌ها را " -"جاسازی کنید:" +"رشته‌های خام به شما امکان می دهند یک مقدار &str با غیرفعال کردن فرارها ایجاد کنید: `r\"\\n\" " +"== \"\\\\n\"`.شما می‌توانید با استفاده از تعداد برابر `#` در دو طرف دابل‌کوت " +"دابل‌کوت‌ها، دابل‌کوت‌ها را جاسازی کنید:" #: src/references/exercise.md msgid "" -"We will create a few utility functions for 3-dimensional geometry, representing a " -"point as `[f64;3]`. It is up to you to determine the function signatures." +"We will create a few utility functions for 3-dimensional geometry, " +"representing a point as `[f64;3]`. It is up to you to determine the function " +"signatures." msgstr "" -"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به عنوان " -"`[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." +"ما چند توابع کاربردی برای هندسه سه بعدی ایجاد خواهیم کرد که نقطه ای را به " +"عنوان `[f64;3]` نشان می دهد. تعیین امضاهای عملکرد به عهده شماست." #: src/references/exercise.md msgid "" -"// Calculate the magnitude of a vector by summing the squares of its coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the square\n" +"// Calculate the magnitude of a vector by summing the squares of its " +"coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the " +"square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// اندازه یک بردار را با جمع مربعات مختصات آن محاسبه کنید\n" -"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل `v." -"sqrt()`.\n" +"// و سپس جذر آن را بگیرید. از متد `sqrt()` برای محاسبه جذر استفاده کنید، مثل " +"`v.sqrt()`.\n" #: src/references/exercise.md msgid "" @@ -4373,7 +4492,8 @@ msgstr "/// اندازه‌ی بردار داده شده را محاسبه کن #: src/references/solution.md msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its direction.\n" +"/// Change the magnitude of the vector to 1.0 without changing its " +"direction.\n" msgstr "/// اندازه‌ی بردار را به 1.0 تغییر دهید بدون اینکه جهت آن تغییر کند.\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md @@ -4420,43 +4540,46 @@ msgstr "‏برخلاف C++، در Rust بین ساختارها ارث‌بری #: src/user-defined-types/named-structs.md msgid "" -"This may be a good time to let people know there are different types of structs." +"This may be a good time to let people know there are different types of " +"structs." msgstr "" -"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود دارد." +"این زمان مناسبی است تا به مردمان اطلاع دهیم که انواع مختلفی از ساختارها وجود " +"دارد." #: src/user-defined-types/named-structs.md msgid "" -"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a trait " -"on some type but don’t have any data that you want to store in the value itself." +"Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " +"trait on some type but don’t have any data that you want to store in the " +"value itself." msgstr "" "ساختارهای بدون اندازه (مانند `struct Foo;`) ممکن است زمانی استفاده شوند که " -"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید که " -"بخواهید در خود مقدار ذخیره کنید." +"می‌خواهید یک صفت (trait) را بر روی یک نوع پیاده‌سازی کنید، اما داده‌ای ندارید " +"که بخواهید در خود مقدار ذخیره کنید." #: src/user-defined-types/named-structs.md msgid "" -"The next slide will introduce Tuple structs, used when the field names are not " -"important." +"The next slide will introduce Tuple structs, used when the field names are " +"not important." msgstr "" -"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی استفاده " -"می‌شوند که نام فیلدها مهم نیستند." +"اسلاید بعدی ساختارهای تاپل (Tuple structs) را معرفی خواهد کرد، که زمانی " +"استفاده می‌شوند که نام فیلدها مهم نیستند." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" -"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از یک " -"روش میانبر ایجاد کنید." +"اگر از قبل متغیرهایی با نام‌های مناسب دارید، می‌توانید ساختار را با استفاده از " +"یک روش میانبر ایجاد کنید." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the old " -"struct without having to explicitly type it all out. It must always be the last " -"element." +"The syntax `..avery` allows us to copy the majority of the fields from the " +"old struct without having to explicitly type it all out. It must always be " +"the last element." msgstr "" -"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی کنیم " -"بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." +"سینتکس `..avery` به ما اجازه می‌دهد که اکثر فیلدها را از ساختار قدیمی کپی " +"کنیم بدون اینکه همه آن‌ها را صریحاً تایپ کنیم. این باید همیشه آخرین عنصر باشد." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" @@ -4484,11 +4607,11 @@ msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" -"Newtypes are a great way to encode additional information about the value in a " -"primitive type, for example:" +"Newtypes are a great way to encode additional information about the value in " +"a primitive type, for example:" msgstr "" -"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع اولیه " -"(primitive type) است، به عنوان مثال:" +"Newtypes یک راه مناسب برای رمزگذاری اطلاعات اضافی در مورد مقدار در یک نوع " +"اولیه (primitive type) است، به عنوان مثال:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." @@ -4496,25 +4619,25 @@ msgstr "این عدد در برخی واحدها اندازه گیری می‌ش #: src/user-defined-types/tuple-structs.md msgid "" -"The value passed some validation when it was created, so you no longer have to " -"validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." +"The value passed some validation when it was created, so you no longer have " +"to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" -"مقدار زمانی که ایجاد شد مقداری اعتبارسنجی را دریافت کرد، بنابراین دیگر لازم نیست " -"در هر بار استفاده دوباره آن را تأیید کنید: `PhoneNumber(String)` یا " +"مقدار زمانی که ایجاد شد مقداری اعتبارسنجی را دریافت کرد، بنابراین دیگر لازم " +"نیست در هر بار استفاده دوباره آن را تأیید کنید: `PhoneNumber(String)` یا " "`OddNumber(u32)`." #: src/user-defined-types/tuple-structs.md msgid "" -"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single " -"field in the newtype." +"Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " +"single field in the newtype." msgstr "" -"نحوه افزودن مقدار `f64` به نوع `Newtons` را با دسترسی به single field در نوع جدید " -"نشان دهید." +"نحوه افزودن مقدار `f64` به نوع `Newtons` را با دسترسی به single field در نوع " +"جدید نشان دهید." #: src/user-defined-types/tuple-structs.md msgid "" -"Rust generally doesn’t like inexplicit things, like automatic unwrapping or for " -"instance using booleans as integers." +"Rust generally doesn’t like inexplicit things, like automatic unwrapping or " +"for instance using booleans as integers." msgstr "" "Rust معمولاً چیزهای غیر واضح را دوست ندارد، مانند automatic unwrapping یا " "به‌عنوان‌مثال استفاده از booleanها به عنوان اعداد صحیح." @@ -4528,15 +4651,16 @@ msgid "" "The example is a subtle reference to the [Mars Climate Orbiter](https://en." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" -"این مثال، اشاره ظریفی به شکست [مدارگَرد آب‌و‌هوای مریخ](https://en.wikipedia.org/" -"wiki/Mars_Climate_Orbiter) است." +"این مثال، اشاره ظریفی به شکست [مدارگَرد آب‌و‌هوای مریخ](https://en.wikipedia." +"org/wiki/Mars_Climate_Orbiter) است." #: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" -"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف است:" +"کلمه کلیدی `enum` اجازه ایجاد نوع داده‌ای را می دهد که دارای چندین گونه مختلف " +"است:" #: src/user-defined-types/enums.md #, fuzzy @@ -4560,8 +4684,8 @@ msgstr "\"در این پیچ: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" -"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را تحت یک " -"نوع جمع آوری کنید." +"`Enum`ها به شما امکان می دهند مجموعه‌ای از مقادیر مختلف با نوع‌های مختلف را " +"تحت یک نوع جمع آوری کنید." #: src/user-defined-types/enums.md msgid "" @@ -4573,9 +4697,9 @@ msgstr "" #: src/user-defined-types/enums.md msgid "" -"`PlayerMove` is a type with three variants. In addition to the payloads, Rust " -"will store a discriminant so that it knows at runtime which variant is in a " -"`PlayerMove` value." +"`PlayerMove` is a type with three variants. In addition to the payloads, " +"Rust will store a discriminant so that it knows at runtime which variant is " +"in a `PlayerMove` value." msgstr "" #: src/user-defined-types/enums.md @@ -4584,24 +4708,26 @@ msgstr "الان زمان خوبی برای مقایسه ساختارها و `En #: src/user-defined-types/enums.md msgid "" -"In both, you can have a simple version without fields (unit struct) or one with " -"different types of fields (variant payloads)." +"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) داشته باشید." +"در هر دو، می توانید یک نسخه ساده بدون فیلد (unit struct) یا یکی با انواع " +"مختلف فیلد (variant payloads) داشته باشید." #: src/user-defined-types/enums.md msgid "" -"You could even implement the different variants of an enum with separate structs " -"but then they wouldn’t be the same type as they would if they were all defined in " -"an enum." +"You could even implement the different variants of an enum with separate " +"structs but then they wouldn’t be the same type as they would if they were " +"all defined in an enum." msgstr "" -"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی کنید، " -"اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` نخواهند بود." +"شما حتی می توانید انواع مختلف یک `Enum` را با ساختارهای جداگانه پیاده سازی " +"کنید، اما در آن صورت آنها از همان نوعی که در ابتدا تعریف کردید یعنی `Enum` " +"نخواهند بود." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." +msgstr "" +"Rust از حداقل فضا برای ذخیره‌سازی متمایز‌کننده (discriminant) استفاده می‌کند." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" @@ -4609,27 +4735,30 @@ msgstr "در صورت لزوم، یک عدد صحیح با کوچکترین ان #: src/user-defined-types/enums.md msgid "" -"If the allowed variant values do not cover all bit patterns, it will use invalid " -"bit patterns to encode the discriminant (the \"niche optimization\"). For " -"example, `Option<&u8>` stores either a pointer to an integer or `NULL` for the " -"`None` variant." +"If the allowed variant values do not cover all bit patterns, it will use " +"invalid bit patterns to encode the discriminant (the \"niche " +"optimization\"). For example, `Option<&u8>` stores either a pointer to an " +"integer or `NULL` for the `None` variant." msgstr "" -"اگر مقادیر متغیر مجاز همه الگوهای bit را پوشش ندهند، از الگوهای bit نامعتبر برای " -"رمزگذاری متمایز کننده (یک \"niche optimization\") استفاده می‌کند. برای مثال، " -"`Option<&u8>` یک اشاره‌گر به یک عدد صحیح یا `NULL` را برای نوع `None` ذخیره می‌کند." +"اگر مقادیر متغیر مجاز همه الگوهای bit را پوشش ندهند، از الگوهای bit نامعتبر " +"برای رمزگذاری متمایز کننده (یک \"niche optimization\") استفاده می‌کند. برای " +"مثال، `Option<&u8>` یک اشاره‌گر به یک عدد صحیح یا `NULL` را برای نوع `None` " +"ذخیره می‌کند." #: src/user-defined-types/enums.md -msgid "You can control the discriminant if needed (e.g., for compatibility with C):" +msgid "" +"You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" -"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant را " -"کنترل کنید:" +"شما می توانید در صورت نیاز (به عنوان مثال، برای سازگاری با C) discriminant " +"را کنترل کنید:" #: src/user-defined-types/enums.md msgid "" -"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 bytes." +"Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " +"bytes." msgstr "" -"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 بایت جا " -"می‌شود." +"بدون `repr`، نوع discriminant دو بایت حافظه اشغال میکند، زیرا 10001 در 2 " +"بایت جا می‌شود." #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md @@ -4640,30 +4769,31 @@ msgstr "برای کاوش بیشتر" #: src/user-defined-types/enums.md msgid "" -"Rust has several optimizations it can employ to make enums take up less space." +"Rust has several optimizations it can employ to make enums take up less " +"space." msgstr "" "زبان Rust دارای چندین بهینه‌سازی دارد که می‌تواند برای کاهش فضای اشغال شده " "توسط`Enum`ها استفاده کند." #: src/user-defined-types/enums.md msgid "" -"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/option/" -"#representation), Rust guarantees that `size_of::()` equals `size_of::" -">()`." +"Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" +"option/#representation), Rust guarantees that `size_of::()` equals " +"`size_of::>()`." msgstr "" "بهینه‌سازی اشاره‌گر `NULL`: برای برخی از انواع، Rust تضمین می‌کند که `size_of::()` برابر با `size_of::>()` است." +"dir=ltr>`size_of::()` برابر با `size_of::" +">()` است." #: src/user-defined-types/enums.md msgid "" -"Example code if you want to show how the bitwise representation _may_ look like " -"in practice. It's important to note that the compiler provides no guarantees " -"regarding this representation, therefore this is totally unsafe." +"Example code if you want to show how the bitwise representation _may_ look " +"like in practice. It's important to note that the compiler provides no " +"guarantees regarding this representation, therefore this is totally unsafe." msgstr "" -"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است به نظر " -"برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این نمایش نمی‌دهد، " -"بنابراین این کاملاً ناایمن است." +"کد نمونه, اگر می‌خواهید نشان دهید که نمایش بیت به بیت در عمل چگونه ممکن است " +"به نظر برسد. مهم است توجه داشته باشید که کامپایلر هیچ تضمینی در مورد این " +"نمایش نمی‌دهد، بنابراین این کاملاً ناایمن است." #: src/user-defined-types/const.md msgid "`const`" @@ -4672,43 +4802,44 @@ msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy msgid "" -"Constants are evaluated at compile time and their values are inlined wherever " -"they are used:" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" msgstr "" -"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که استفاده " -"می شوند، درج می شوند:" +"متغیرهای ثابت در زمان کامپایل ارزیابی می شوند و مقادیر آنها در هر جایی که " +"استفاده می شوند، درج می شوند:" #: src/user-defined-types/const.md msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" -"static.html) these are inlined upon use." +"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)، " -"این موارد هنگام استفاده درج می شوند." +"طبق [کتاب Rust RFC](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html)، این موارد هنگام استفاده درج می شوند." #: src/user-defined-types/const.md msgid "" -"Only functions marked `const` can be called at compile time to generate `const` " -"values. `const` functions can however be called at runtime." +"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` را می توان در زمان اجرا " -"فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" +"فقط توابعی که با `const` علامت گذاری شده اند می توانند در زمان کامپایل برای " +"تولید مقادیر `const` فراخوانی شوند. با این حال، توابع `const` را می توان در " +"زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" -"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` " -"عمل می کند." +"به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." #: src/user-defined-types/const.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but it is " -"helpful and safer than using a static." +"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`ها هستند." +"با اینکه خیلی رایج نیست که اگر کسی به یک یک مقدار ثابت که در زمان اجرا " +"ارزیابی می‌شود از `const` استفاده کند اما مفید تر و ایمن تر از استفاده " +"`static`ها هستند." #: src/user-defined-types/static.md msgid "`static`" @@ -4719,7 +4850,8 @@ msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل نمی‌شوند:" +"متغیرهای ایستا در طول عمر کل اجرای برنامه خواهند ماند و بنابراین منتقل " +"نمی‌شوند:" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4732,29 +4864,30 @@ msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md #, fuzzy msgid "" -"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-" -"static.html), these are not inlined upon use and have an actual associated memory " -"location. This is useful for unsafe and embedded code, and the variable lives " -"through the entirety of the program execution. When a globally-scoped value does " -"not have a reason to need object identity, `const` is generally preferred." +"As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html), these are not inlined upon use and have an actual " +"associated memory location. This is useful for unsafe and embedded code, and " +"the variable lives through the entirety of the program execution. When a " +"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` ترجیح داده می‌شود." +"static.html) ذکر شده، این موارد هنگام استفاده درج نمی شوند و دارای یک مکان " +"حافظه واقعی هستند. این برای کدهای ناایمن و `embedded` مفید است و متغیر در کل " +"اجرای برنامه زنده می ماند. هنگامی که یک مقدار با اسکوپ گلوبال نیاز نیست, " +"استفاده از `const` ترجیح داده می‌شود." #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" -"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در `C++` هستند." +"از سوی دیگر، `static` بسیار شبیه به یک متغیر سراسری `const` یا `mutable` در " +"`C++` هستند." #: src/user-defined-types/static.md msgid "" -"`static` provides object identity: an address in memory and state as required by " -"types with interior mutability such as `Mutex`." +"`static` provides object identity: an address in memory and state as " +"required by types with interior mutability such as `Mutex`." msgstr "" "`static` هویت شی را فراهم می‌کند: آدرسی در حافظه و حالتی که توسط انواع با " "تغییرپذیری داخلی مانند `Mutex` را نیاز دارد." @@ -4762,17 +4895,17 @@ msgstr "" #: src/user-defined-types/static.md #, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be `Sync`. " -"Interior mutability is possible through a [`Mutex`](https://doc.rust-lang.org/std/" -"sync/struct.Mutex.html), atomic or similar." +"Because `static` variables are accessible from any thread, they must be " +"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html), atomic or similar." 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) نگاه خواهیم کرد." +"`Sync` باشند. تغییرپذیری داخلی از طریق یک [`Mutex`](https://doc.rust-lang." +"org/std/sync/struct.Mutex.html)، اتمی یا مشابه امکان پذیر است. البته که " +"داشتن متغییر های استاتیک قابل تغییر هم امکان پذیر هست اما برای این کار نیاز " +"به همگام سازی دستی دارند. بنابراین هر دسترسی به آنها نیاز به کد `unsafe` " +"دارد. ما در فصل Unsafe Rust به استاتیک های قابل تغییر [mutable statics](../" +"unsafe/mutable-static-variables.md) نگاه خواهیم کرد." #: src/user-defined-types/static.md #, fuzzy @@ -4799,27 +4932,30 @@ msgstr "برنامه‌نویسان C این را شبیه به `typedef` تشخ #: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " -"system. It is up to you to define the types and functions to construct various " -"events. Use `#[derive(Debug)]` to allow the types to be formatted with `{:?}`." +"system. It is up to you to define the types and functions to construct " +"various events. Use `#[derive(Debug)]` to allow the types to be formatted " +"with `{:?}`." msgstr "" -"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد خواهیم " -"کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای مختلف تعریف " -"کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با `{:?}` قالببندی " -"شوند." +"ما یک ساختار داده برای نمایش یک رویداد در یک سیستم کنترل آسانسور ایجاد " +"خواهیم کرد. این به شما بستگی دارد که انواع و عملکردها را برای ساخت رویدادهای " +"مختلف تعریف کنید. از `#[derive(Debug)]` استفاده کنید تا اجازه دهید انواع با " +"`{:?}` قالببندی شوند." #: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " -"`main` runs without errors. The next part of the course will cover getting data " -"out of these structures." +"`main` runs without errors. The next part of the course will cover getting " +"data out of these structures." msgstr "" -"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا اجرا " -"شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." +"این تمرین فقط به ایجاد و پر کردن ساختارهای داده نیاز دارد تا `main` بدون خطا " +"اجرا شود. بخش بعدی این دوره دریافت داده‌ها از این ساختارها را پوشش می‌دهد." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy -msgid "/// An event in the elevator system that the controller must react to.\n" -msgstr "/// An event in the elevator system that the controller must react to.\n" +msgid "" +"/// An event in the elevator system that the controller must react to.\n" +msgstr "" +"/// An event in the elevator system that the controller must react to.\n" #: src/user-defined-types/exercise.md #, fuzzy @@ -4849,9 +4985,11 @@ msgstr "/// The car doors have closed.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy msgid "" -"/// A directional button was pressed in an elevator lobby on the given floor.\n" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" msgstr "" -"/// A directional button was pressed in an elevator lobby on the given floor.\n" +"/// A directional button was pressed in an elevator lobby on the given " +"floor.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md #, fuzzy @@ -4952,16 +5090,18 @@ msgid "Generics: parameterizing types on other types." msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تایپ‌های دیگر." #: src/welcome-day-2.md -msgid "Standard library types and traits: a tour of Rust's rich standard library." -msgstr "کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +msgid "" +"Standard library types and traits: a tour of Rust's rich standard library." +msgstr "" +"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" #: src/welcome-day-2.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. این " -"شامل:" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۱۰ دقیقه طول بکشد. " +"این شامل:" #: src/pattern-matching.md src/std-types.md src/memory-management.md #: src/error-handling.md @@ -4970,8 +5110,8 @@ msgstr "این بخش باید حدود ۱ ساعت طول بکشد. این شا #: src/pattern-matching/match.md 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." +"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` به شما اجازه می‌دهد یک مقدار را با یک یا چند _الگو_ مطابقت " "دهید. مقایسه‌ها از بالا به پایین انجام می‌شوند و اولین تطابق انتخاب می‌شود." @@ -4992,9 +5132,9 @@ msgstr "'q'" msgid "\"Quitting\"" msgstr "\"ترک کردن\"" -#: src/pattern-matching/match.md src/generics/exercise.md src/generics/solution.md -#: src/std-traits/solution.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'a'" msgstr "'a'" @@ -5038,42 +5178,44 @@ msgstr "\"یک چیز دیگر\"" #: src/pattern-matching/match.md msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The expressions " -"_must_ be exhaustive, meaning that it covers every possibility, so `_` is often " -"used as the final catch-all case." +"The `_` pattern is a wildcard pattern which matches any value. The " +"expressions _must_ be exhaustive, meaning that it covers every possibility, " +"so `_` is often used as the final catch-all case." msgstr "" -"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها باید " -"جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب به عنوان " -"آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." +"الگوی `_` یک الگوی عام (Wildcard) است که با هر مقداری مطابقت دارد. عبارت‌ها " +"باید جامع باشند، به این معنی که همه احتمالات را پوشش دهند، بنابراین `_` اغلب " +"به عنوان آخرین حالت برای پوشش تمامی موارد استفاده می‌شود." #: src/pattern-matching/match.md msgid "" -"Match can be used as an expression. Just like `if`, 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 `()`." +"Match can be used as an expression. Just like `if`, 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 "" -"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه match " -"باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر وجود داشته " -"باشد. در مثال بالا، تایپ بازگشتی `()` است." +"`match` می‌تواند به عنوان یک عبارت استفاده شود. دقیقاً مانند `if`، هر شاخه " +"match باید از یک تایپ باشد. تایپ بازگشتی، تایپ آخرین عبارت در بلاک است، اگر " +"وجود داشته باشد. در مثال بالا، تایپ بازگشتی `()` است." #: src/pattern-matching/match.md msgid "" -"A variable in the pattern (`key` in this example) will create a binding that can " -"be used within the match arm." +"A variable in the pattern (`key` in this example) will create a binding that " +"can be used within the match arm." msgstr "" -"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در بخش " -"مطابقت استفاده کرد." +"یک متغیر در الگو (`key` در این مثال) یک اتصال ایجاد می‌کند که می‌توان از آن در " +"بخش مطابقت استفاده کرد." #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "" -"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته باشد " -"که شرط برقرار باشد." +"یک guard در عبارت `match` باعث می‌شود که آن شاخه تنها در صورتی مطابقت داشته " +"باشد که شرط برقرار باشد." #: src/pattern-matching/match.md msgid "" -"You might point out how some specific characters are being used when in a pattern" -msgstr "بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +"You might point out how some specific characters are being used when in a " +"pattern" +msgstr "" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -5094,28 +5236,29 @@ msgstr "`_` نمایانگر هر حالتی است" #: src/pattern-matching/match.md msgid "" -"Match guards as a separate syntax feature are important and necessary when we " -"wish to concisely express more complex ideas than patterns alone would allow." +"Match guards as a separate syntax feature are important and necessary when " +"we wish to concisely express more complex ideas than patterns alone would " +"allow." msgstr "" -"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم و " -"ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." +"guard های تطبیق به عنوان یک ویژگی سینتکس جداگانه دسته بندی می‌شوند, زمانی مهم " +"و ضروری هستند که بخواهیم ایده های پیچیده تر از الگوهای ساده بیان کنیم." #: src/pattern-matching/match.md msgid "" -"They are not the same as separate `if` expression inside of the match arm. An " -"`if` expression inside of the branch block (after `=>`) happens after the 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." +"They are not the same as separate `if` expression inside of the match arm. " +"An `if` expression inside of the branch block (after `=>`) happens after the " +"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` " -"اصلی ندارد." +"آنها با عبارت `if` جداگانه ای در داخل یک شاخه تطبیق هستند یکسان نیستند. یک " +"عبارت `if` در داخل بلاک شاخه (پس از `=>`) پس از ورود به " +"اون شاخه خاص صدا زده میشود. اگر شرط `if` برقرار نباشد کاری به سایر شاخه های " +"عبارت `match` اصلی ندارد." #: src/pattern-matching/match.md msgid "" -"The condition defined in the guard applies to every expression in a pattern with " -"an `|`." +"The condition defined in the guard applies to every expression in a pattern " +"with an `|`." msgstr "شرط تعریف شده در guard با کمک `|` به شرط های تطبیق الگو اضافه می‌شود." #: src/pattern-matching/destructuring-structs.md @@ -5148,13 +5291,13 @@ msgstr "اضافه کردن یک فیلد جدید به Foo و ایجاد تغی #: src/pattern-matching/destructuring-structs.md msgid "" -"The distinction between a capture and a constant expression can be hard to 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." +"The distinction between a capture and a constant expression can be hard to " +"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` تغییر دهید و خواهید دید که دوباره کار می‌کند." +"تشخیص تفاوت بین یک گرفتن متغییر و یک عبارت ثابت می‌تواند دشوار باشد. سعی کنید " +"‍`2` را در شاخه دوم به یک متغیر تغییر دهید و خواهید دید که کار نمی‌کند. آن را " +"به یک `const` تغییر دهید و خواهید دید که دوباره کار می‌کند." #: src/pattern-matching/destructuring-enums.md msgid "Like tuples, enums can also be destructured by matching:" @@ -5162,12 +5305,13 @@ msgstr "مانند tuple ها، enum ها را نیز می توان با تطب #: src/pattern-matching/destructuring-enums.md msgid "" -"Patterns can also be used to bind variables to parts of your values. This is how " -"you inspect the structure of your types. Let us start with a simple `enum` type:" +"Patterns can also be used to bind variables to parts of your values. This is " +"how you inspect the structure of your types. Let us start with a simple " +"`enum` type:" msgstr "" -"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما استفاده " -"شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. بیایید با یک نوع " -"ساده `enum` شروع کنیم:" +"الگوها همچنین می‌توانند برای متصل کردن متغیرها به بخش‌هایی از مقادیر شما " +"استفاده شوند. این روش به شما اجازه می‌دهد ساختار انواع خود را بررسی کنید. " +"بیایید با یک نوع ساده `enum` شروع کنیم:" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" @@ -5183,21 +5327,21 @@ msgstr "\"با عرض‌پوزش، خطایی رخ داده است: {msg}\"" #: src/pattern-matching/destructuring-enums.md msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first arm, " -"`half` is bound to the value inside the `Ok` variant. In the second arm, `msg` is " -"bound to the error message." +"Here we have used the arms to _destructure_ the `Result` value. In the first " +"arm, `half` is bound to the value inside the `Ok` variant. In the second " +"arm, `msg` is bound to the error message." msgstr "" -"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، `half` " -"به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، `msg` به پیام " -"خطا متصل شده است." +"اینجا از شاخه‌ها برای _تجزیه_ مقدار `Result` استفاده کرده‌ایم. در شاخه‌ی اول، " +"`half` به مقداری که درون حالت `Ok` قرار دارد متصل شده است. در شاخه‌ی دوم، " +"`msg` به پیام خطا متصل شده است." #: src/pattern-matching/destructuring-enums.md msgid "" -"The `if`/`else` expression is returning an enum that is later unpacked with a " -"`match`." +"The `if`/`else` expression is returning an enum that is later unpacked with " +"a `match`." msgstr "" -"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از هم باز " -"می‌شود." +"عبارت `if`/`else` یک نوع enum بازمی‌گرداند که بعداً با استفاده از `match` از " +"هم باز می‌شود." #: src/pattern-matching/destructuring-enums.md msgid "" @@ -5205,47 +5349,50 @@ 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` اضافه کنید و نمایش خطاها " -"هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و نحوه تلاش " -"کامپایلر برای ارائه نکاتی به شما را نشان دهید." +"می توانید با اضافه کردن یک فیلد دیگر `None` به `enum` اضافه کنید و نمایش " +"خطاها هنگام اجرای کد، را تست کنید. مکان هایی را که کد شما اکنون ناقص است و " +"نحوه تلاش کامپایلر برای ارائه نکاتی به شما را نشان دهید." #: src/pattern-matching/destructuring-enums.md msgid "" -"The values in the enum variants can only be accessed after being pattern matched." +"The values in the enum variants can only be accessed after being pattern " +"matched." msgstr "مقادیر در حالات enum تنها پس از تطبیق الگو قابل دسترسی هستند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Demonstrate what happens when the search is inexhaustive. Note the advantage the " -"Rust compiler provides by confirming when all cases are handled." +"Demonstrate what happens when the search is inexhaustive. Note the advantage " +"the Rust compiler provides by confirming when all cases are handled." msgstr "" -"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که کامپایلر " -"Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده شده‌اند." +"نشان دهید چه اتفاقی می‌افتد وقتی جستجو (مطابقت) ناقص است. به مزیتی که " +"کامپایلر Rust فراهم می‌کند، اشاره کنید که تأیید می‌کند همه حالات پوشش داده " +"شده‌اند." #: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it in a " -"loop. That won't compile because `msg` is consumed when matched. To fix it, match " -"`&result` instead of `result`. That will make `msg` a reference so it won't be " -"consumed. This [\"match ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-" -"ergonomics.html) appeared in Rust 2018. If you want to support older Rust, " -"replace `msg` with `ref msg` in the pattern." -msgstr "" -"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک حلقه با " -"استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` هنگام مطابقت مصرف " -"می‌شود. برای رفع این مشکل، به جای `result` از `result&` استفاده کنید. این کار باعث " -"می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. این ویژگی که به نام [\"match " -"ergonomics\"](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) شناخته " -"می‌شود، در Rust 2018 معرفی شده است. اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی " -"کنید، به جای `msg` از `ref msg` در الگو استفاده کنید." +"Save the result of `divide_in_two` in the `result` variable and `match` it " +"in a loop. That won't compile because `msg` is consumed when matched. To fix " +"it, match `&result` instead of `result`. That will make `msg` a reference so " +"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." +"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " +"support older Rust, replace `msg` with `ref msg` in the pattern." +msgstr "" +"نتیجه‌ی تابع `divide_in_two` را در متغیر `result` ذخیره کنید و آن را در یک " +"حلقه با استفاده از `match` بررسی کنید. این کد کامپایل نمی‌شود زیرا `msg` " +"هنگام مطابقت مصرف می‌شود. برای رفع این مشکل، به جای `result` از `result&` " +"استفاده کنید. این کار باعث می‌شود `msg` به صورت یک ارجاع باشد و مصرف نشود. " +"این ویژگی که به نام [\"match ergonomics\"](https://rust-lang.github.io/" +"rfcs/2005-match-ergonomics.html) شناخته می‌شود، در Rust 2018 معرفی شده است. " +"اگر می‌خواهید از نسخه‌های قدیمی‌تر Rust پشتیبانی کنید، به جای `msg` از `ref " +"msg` در الگو استفاده کنید." #: src/pattern-matching/let-control-flow.md msgid "" -"Rust has a few control flow constructs which differ from other languages. They " -"are used for pattern matching:" +"Rust has a few control flow constructs which differ from other languages. " +"They are used for pattern matching:" msgstr "" -"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این ساختارها " -"برای مطابقت الگو استفاده می‌شوند:" +"زبان Rust چند ساختار کنترل جریان دارد که با سایر زبان‌ها متفاوت است. این " +"ساختارها برای مطابقت الگو استفاده می‌شوند:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5261,13 +5408,13 @@ msgstr "عبارت `while let`" #: src/pattern-matching/let-control-flow.md msgid "" -"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-expr." -"html#if-let-expressions) lets you execute different code depending on whether a " -"value matches a pattern:" +"The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" +"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) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با یک الگو مطابقت " -"دارد، کدهای مختلفی را اجرا کنید:" +"[عبارت `if let`](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-let-expressions) به شما امکان می‌دهد بسته به اینکه آیا یک مقدار با " +"یک الگو مطابقت دارد، کدهای مختلفی را اجرا کنید:" #: src/pattern-matching/let-control-flow.md #, fuzzy @@ -5276,15 +5423,15 @@ msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.md msgid "" -"For the common case of matching a pattern and returning from the function, use " -"[`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else." -"html). The \"else\" case must diverge (`return`, `break`, or panic - anything but " -"falling off the end of the block)." +"For the common case of matching a pattern and returning from the function, " +"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" +"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"- anything but falling off the end of the block)." msgstr "" -"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://doc." -"rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. در اینجا، " -"حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` - به غیر از " -"اینکه از انتهای بلوک خارج شود)." +"برای حالت رایج مطابقت با یک الگو و بازگشت از تابع، از [`let else`](https://" +"doc.rust-lang.org/rust-by-example/flow_control/let_else.html) استفاده کنید. " +"در اینجا، حالت \"else\" باید منحرف شود (مانند `return`، `break`، یا `panic` " +"- به غیر از اینکه از انتهای بلوک خارج شود)." #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" @@ -5303,31 +5450,32 @@ msgid "\"result: {:?}\"" msgstr "\"نتیجه: {:?}\"" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md src/android/testing.md -#: src/android/testing/googletest.md +#: src/smart-pointers/solution.md src/testing/solution.md +#: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.md msgid "" -"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/reference/" -"expressions/loop-expr.html#predicate-pattern-loops) variant which repeatedly " -"tests a value against a pattern:" +"Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" +"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) وجود دارد که مقادیر مقابل " -"الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" +"expressions/loop-expr.html#predicate-pattern-loops) وجود دارد که مقادیر " +"مقابل الگو به طور مکرر (تکرار شونده‌ای) بررسی می‌کند:" #: src/pattern-matching/let-control-flow.md msgid "" -"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct.String." -"html#method.pop) returns `Some(c)` until the string is empty, after which it will " -"return `None`. The `while let` lets us keep iterating through all items." +"Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) returns `Some(c)` until the string is empty, after " +"which it will return `None`. The `while let` lets us keep iterating through " +"all items." msgstr "" "در اینجا [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را برمی‌گرداند و " -"پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما این امکان را می‌دهد " -"که به طور مداوم از میان همه موارد عبور کنیم." +"String.html#method.pop) تا زمانی که رشته خالی نشده است، `Some(c)` را " +"برمی‌گرداند و پس از آن `None` را باز می‌گرداند. استفاده از `while let` به ما " +"این امکان را می‌دهد که به طور مداوم از میان همه موارد عبور کنیم." #: src/pattern-matching/let-control-flow.md msgid "if-let" @@ -5335,24 +5483,25 @@ msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make it " -"more concise than `match`." +"Unlike `match`, `if let` does not have to cover all branches. This can make " +"it more concise than `match`." msgstr "" -"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو پشتیبانی " -"نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده کنید." +"برخلاف دستور `match` دستور `if let` همه حالت های ممکن را برای تطبیق الگو " +"پشتیبانی نمیکند. اگر می‌خواهید همه حالت را پوشش دهید از دستور `match` استفاده " +"کنید." #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" -"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با `Option` " -"است:" +"یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " +"`Option` است:" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق الگو " -"استفاده نمیکند." +"برخلاف دستور `match` دستور `if let` از `=>` برای تطبیق " +"الگو استفاده نمیکند." #: src/pattern-matching/let-control-flow.md msgid "let-else" @@ -5360,13 +5509,14 @@ msgstr "let-else" #: src/pattern-matching/let-control-flow.md msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports flattening " -"this nested code. Rewrite the awkward version for students, so they can see the " -"transformation." +"`if-let`s can pile up, as shown. The `let-else` construct supports " +"flattening this nested code. Rewrite the awkward version for students, so " +"they can see the transformation." msgstr "" -"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان داده " -"شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی می‌کند. نسخه‌ی " -"پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را مشاهده کنند." +"`if-let` ها می‌توانند به صورت تو در تو انباشته شوند، همان‌طور که در اینجا نشان " +"داده شده است. ساختار `let-else` از فلت کردن این کدهای تو در تو پشتیبانی " +"می‌کند. نسخه‌ی پیچیده را برای دانش‌آموزان بازنویسی کنید تا بتوانند تبدیل آن را " +"مشاهده کنند." #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" @@ -5378,21 +5528,22 @@ msgstr "while-let" #: src/pattern-matching/let-control-flow.md msgid "" -"Point out that the `while let` loop will keep going as long as the value matches " -"the pattern." +"Point out that the `while let` loop will keep going as long as the value " +"matches the pattern." msgstr "" -"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق داشته " -"باشد (شرط برقرار باشد)، ادامه خواهد داشت." +"توجه داشته باشید که حلقه `while let` تا زمانی که مقادیر مقابل الگو طبیق " +"داشته باشد (شرط برقرار باشد)، ادامه خواهد داشت." #: src/pattern-matching/let-control-flow.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if statement " -"that breaks when there is no value to unwrap for `name.pop()`. The `while let` " -"provides syntactic sugar for the above scenario." +"You could rewrite the `while let` loop as an infinite loop with an if " +"statement that breaks when there is no value to unwrap for `name.pop()`. The " +"`while let` provides syntactic sugar for the above scenario." msgstr "" "شما می‌توانید حلقه‌ی `while let` را به صورت یک حلقه بی‌پایان با یک دستور `if` " -"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name.pop`، " -"شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه می‌دهد." +"بازنویسی کنید که در صورت عدم وجود مقداری برای باز کردن (unwrap) از `()name." +"pop`، شکسته می‌شود. `while let` یک Syntactic sugar برای این سناریو ارائه " +"می‌دهد." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." @@ -5400,48 +5551,49 @@ msgstr "بیایید یک ارزیاب ساده بازگشتی برای عبار #: src/pattern-matching/exercise.md msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later in " -"the course. An expression can be \"boxed\" with `Box::new` as seen in the tests. " -"To evaluate a boxed expression, use the deref operator (`*`) to \"unbox\" it: " -"`eval(*boxed_expr)`." +"The `Box` type here is a smart pointer, and will be covered in detail later " +"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " +"tests. To evaluate a boxed expression, use the deref operator (`*`) to " +"\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد بررسی " -"قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" شود، همان‌طور " -"که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از عملگر deref (`*`) " -"برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." +"نوع `Box` در اینجا یک اشاره‌گر هوشمند است و در ادامه دوره به طور مفصل مورد " +"بررسی قرار خواهد گرفت. یک عبارت می‌تواند با استفاده از `Box::new` \"باکس\" " +"شود، همان‌طور که در تست‌ها مشاهده می‌شود. برای ارزیابی یک عبارت باکس‌شده، از " +"عملگر deref (`*`) برای \"باز کردن باکس\" استفاده کنید: `eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" "Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " -"type is an enum that represents either a successful value (`Ok(Value)`) or an " -"error (`Err(String)`). We will cover this type in detail later." +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) type is an enum that represents either a successful value " +"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " +"later." msgstr "" "برخی از عبارات نمی‌توانند ارزیابی شوند و خطا برمی‌گردانند. نوع استاندارد " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) " -"یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " +"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." +"html) یک enum است که یا نمایانگر یک مقدار موفقیت‌آمیز (`Ok(Value)`) یا یک خطا " "(`Err(String)`) است. ما این نوع را به‌طور مفصل‌تر در آینده پوشش خواهیم داد." #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing `eval`. " -"The final product should pass the tests. It may be helpful to use `todo!()` and " -"get the tests to pass one-by-one. You can also skip a test temporarily with " -"`#[ignore]`:" +"Copy and paste the code into the Rust playground, and begin implementing " +"`eval`. The final product should pass the tests. It may be helpful to use " +"`todo!()` and get the tests to pass one-by-one. You can also skip a test " +"temporarily with `#[ignore]`:" msgstr "" -"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز کنید. " -"محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و گذراندن تست‌ها " -"به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست را با استفاده از " -"`[ignore]#` نادیده بگیرید:" +"کد را کپی و در Rust Playground پیست کنید و پیاده‌سازی تابع `eval` را آغاز " +"کنید. محصول نهایی باید تست‌ها را پاس کند. ممکن است استفاده از `()!todo` و " +"گذراندن تست‌ها به صورت تک به تک مفید باشد. همچنین می‌توانید به طور موقت یک تست " +"را با استفاده از `[ignore]#` نادیده بگیرید:" #: src/pattern-matching/exercise.md msgid "" "If you finish early, try writing a test that results in division by zero or " "integer overflow. How could you handle this with `Result` instead of a panic?" msgstr "" -"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا سرریز " -"عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای panic مدیریت " -"کنید؟" +"اگر زودتر تمام کردید، سعی کنید یک تست بنویسید که منجر به تقسیم بر صفر یا " +"سرریز عدد صحیح شود. چگونه می‌توانید این را با استفاده از `Result` به جای " +"panic مدیریت کنید؟" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md #, fuzzy @@ -5473,11 +5625,11 @@ msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" -"Rust allows you to associate functions with your new types. You do this with an " -"`impl` block:" +"Rust allows you to associate functions with your new types. You do this with " +"an `impl` block:" msgstr "" -"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این کار " -"را با استفاده از بلوک `impl` انجام می‌دهید:" +"Rust به شما این امکان را می‌دهد که توابعی را با تایپ جدید خود مرتبط کنید. این " +"کار را با استفاده از بلوک `impl` انجام می‌دهید:" #: src/methods-and-traits/methods.md #, fuzzy @@ -5521,39 +5673,39 @@ msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" -"The `self` arguments specify the \"receiver\" - the object the method acts on. " -"There are several common receivers for a method:" +"The `self` arguments specify the \"receiver\" - the object the method acts " +"on. There are several common receivers for a method:" msgstr "" -"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل می‌کند. " -"چندین گیرنده رایج برای یک متد وجود دارد:" +"آرگومان‌های `self` \"گیرنده\" را مشخص می‌کنند - شیئی که متد بر روی آن عمل " +"می‌کند. چندین گیرنده رایج برای یک متد وجود دارد:" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" -"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر قرض " -"می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." +"`self&`: شیئی را از فراخواننده با استفاده از یک مرجع مشترک و غیرقابل تغییر " +"قرض می‌گیرد. شیء می‌تواند بعداً دوباره استفاده شود." #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" -"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل تغییر " -"قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع به پایان " -"برسد." +"`mut self&`: شیء را از فراخواننده با استفاده از یک مرجع منحصر به فرد و قابل " +"تغییر قرض می‌گیرد. شی پس از آن نمی‌تواند دوباره استفاده شود تا زمانی که مرجع " +"به پایان برسد." #: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " -"method becomes the owner of the object. The object will be dropped (deallocated) " -"when the method returns, unless its ownership is explicitly transmitted. Complete " -"ownership does not automatically mean mutability." +"method becomes the owner of the object. The object will be dropped " +"(deallocated) when the method returns, unless its ownership is explicitly " +"transmitted. Complete ownership does not automatically mean mutability." msgstr "" -"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد مالک " -"شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت آن به‌طور " -"صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." +"`self`: مالکیت شیء را به عهده می‌گیرد و آن را از فراخواننده منتقل می‌کند. متد " +"مالک شیء می‌شود. شیء هنگامی که متد باز می‌گردد حذف خواهد شد، مگر اینکه مالکیت " +"آن به‌طور صریح منتقل شود. مالکیت کامل به‌طور خودکار به معنای قابلیت تغییر نیست." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." @@ -5561,8 +5713,8 @@ msgstr "`mut self`: مشابه مورد بالا، اما متد می‌توان #: src/methods-and-traits/methods.md msgid "" -"No receiver: this becomes a static method on the struct. Typically used to create " -"constructors which are called `new` by convention." +"No receiver: this becomes a static method on the struct. Typically used to " +"create constructors which are called `new` by convention." msgstr "" "بدون گیرنده: این تبدیل به یک متد استاتیک در ساختار می‌شود. معمولاً برای ایجاد " "سازنده‌ها استفاده می‌شود که به‌طور معمول `new` نامیده می‌شوند." @@ -5573,21 +5725,21 @@ msgstr "مفید است که متدها را با مقایسه آنها با ت #: src/methods-and-traits/methods.md msgid "" -"Methods are called on an instance of a type (such as a struct or enum), the first " -"parameter represents the instance as `self`." +"Methods are called on an instance of a type (such as a struct or enum), the " +"first parameter represents the instance as `self`." msgstr "" -"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و پارامتر " -"اول نمونه را به‌عنوان نمونه `self`." +"متدها بر روی یک نمونه از تایپی (مانند struct یا enum) فراخوانی می‌شوند، و " +"پارامتر اول نمونه را به‌عنوان نمونه `self`." #: src/methods-and-traits/methods.md msgid "" -"Developers may choose to use methods to take advantage of method receiver syntax " -"and to help keep them more organized. By using methods we can keep all the " -"implementation code in one predictable place." +"Developers may choose to use methods to take advantage of method receiver " +"syntax and to help keep them more organized. By using methods we can keep " +"all the implementation code in one predictable place." msgstr "" -"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده متد " -"بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، می‌توانیم " -"تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." +"توسعه‌دهندگان ممکن است تصمیم بگیرند از متدها استفاده کنند تا از نحو گیرنده " +"متد بهره‌برداری کنند و به سازمان‌دهی بهتر کد کمک کنند. با استفاده از متدها، " +"می‌توانیم تمامی کدهای پیاده‌سازی را در یک مکان قابل پیش‌بینی نگه داریم." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." @@ -5596,53 +5748,53 @@ msgstr "" #: src/methods-and-traits/methods.md msgid "" -"Show that it is an abbreviated term for `self: Self` and perhaps show how the " -"struct name could also be used." +"Show that it is an abbreviated term for `self: Self` and perhaps show how " +"the struct name could also be used." msgstr "" -"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان دهید که " -"چگونه نام struct نیز می‌تواند استفاده شود." +"نشان دهید که `self` یک اصطلاح کوتاه‌شده برای `self: Self` است و شاید نشان " +"دهید که چگونه نام struct نیز می‌تواند استفاده شود." #: src/methods-and-traits/methods.md msgid "" -"Explain that `Self` is a type alias for the type the `impl` block is in and can " -"be used elsewhere in the block." +"Explain that `Self` is a type alias for the type the `impl` block is in and " +"can be used elsewhere in the block." msgstr "" -"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن قرار " -"دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." +"توضیح دهید که `Self` یک نام مستعار نوع برای تایپ است که بلوک `impl` در آن " +"قرار دارد و می‌تواند در سایر بخش‌های بلوک استفاده شود." #: src/methods-and-traits/methods.md #, fuzzy msgid "" -"Note how `self` is used like other structs and dot notation can be used to refer " -"to individual fields." +"Note how `self` is used like other structs and dot notation can be used to " +"refer to individual fields." msgstr "" "توجه کنید که چگونه `self` مانند سایر ساختارها استفاده می‌شود و dot notation " "می‌تواند برای ارجاع به فیلدهای فردی به کار رود." #: src/methods-and-traits/methods.md msgid "" -"This might be a good time to demonstrate how the `&self` differs from `self` by " -"trying to run `finish` twice." +"This might be a good time to demonstrate how the `&self` differs from `self` " +"by trying to run `finish` twice." msgstr "" -"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با تلاش " -"برای اجرای متد `finish` دو بار." +"این ممکن است زمان مناسبی باشد برای نشان دادن تفاوت بین `self&` و `self` با " +"تلاش برای اجرای متد `finish` دو بار." #: src/methods-and-traits/methods.md msgid "" -"Beyond variants on `self`, there are also [special wrapper types](https://doc." -"rust-lang.org/reference/special-types-and-traits.html) allowed to be receiver " -"types, such as `Box`." +"Beyond variants on `self`, there are also [special wrapper types](https://" +"doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " +"receiver types, such as `Box`." msgstr "" -"فراتر از حالت‌های مختلف `self`، تایپ‌های [special wrapper types](https://doc.rust-" -"lang.org/reference/special-types-and-traits.html) نیز وجود دارند که به‌عنوان " -"تایپ‌های گیرنده مجاز هستند، مانند ` Point {}`? Isn't that redundant?" +"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " +"redundant?" msgstr "" -"_سوال:_ چرا `T` در عبارت `{} Point Point`, but methods in this block " -"will only be available for `Point`." +"`Point` is still generic and you can use `Point`, but methods in this " +"block will only be available for `Point`." msgstr "" -"`Point` هنوز هم generic است و می‌توانید از `` " -"implementation for `Foo`." +"Implementations of the trait do not need to cover all possible type " +"parameters. Here, `Foo::from(\"hello\")` would not compile because there is " +"no `From<&str>` implementation for `Foo`." msgstr "" "پیاده‌سازی‌های trait نیازی به پوشش تمام پارامترهای تایپ ممکن ندارند. در اینجا، " -"`Foo::from(\"hello\")` کامپایل نخواهد شد زیرا پیاده‌سازی ``." +"If someone asks, the extra feature is that the type on the left of \":\" can " +"be arbitrary, like `Option`." msgstr "" -"اگر کسی بپرسد، ویژگی اضافی این است که تایپ در سمت چپ `:` می‌تواند دلخواه باشد، " -"مانند `() -> B` can return any type satisfying " -"`B`, and the caller may need to choose one, such as with `let x: Vec<_> = foo." -"collect()` or with the turbofish, `foo.collect::>()`." +"Inference is hard in return position. A function returning `impl Foo` picks " +"the concrete type it returns, without writing it out in the source. A " +"function returning a generic type like `collect() -> B` can return any " +"type satisfying `B`, and the caller may need to choose one, such as with " +"`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" +">()`." msgstr "" -"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، تایپ " -"مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در منبع بنویسد. " -"تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، می‌تواند هر تایپ که " -"`B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده نیاز به انتخاب یکی از " -"آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` یا با استفاده از " -"()`." +"Inference در موقعیت بازگشتی دشوار است. تابعی که `impl Foo` را برمی‌گرداند، " +"تایپ مشخصی را که برمی‌گرداند انتخاب می‌کند، بدون اینکه آن را به طور صریح در " +"منبع بنویسد. تابعی که تایپ generic مانند `collect() -> B` را برمی‌گرداند، " +"می‌تواند هر تایپ که `B` را برآورده می‌کند بازگرداند، و ممکن است فراخوانی‌کننده " +"نیاز به انتخاب یکی از آن‌ها داشته باشد، مانند `let x: Vec<_> = foo.collect()` " +"یا با استفاده از ()`." #: src/generics/impl-trait.md msgid "" -"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what the " -"error message shows." +"What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " +"the error message shows." msgstr "" -"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا ببینید " -"پیام خطا چه چیزی را نشان می‌دهد." +"نوع `debuggable` چیست؟ سعی کنید .. = () :let debuggable` را امتحان کنید تا " +"ببینید پیام خطا چه چیزی را نشان می‌دهد." #: src/generics/dyn-trait.md msgid "" -"In addition to using traits for static dispatch via generics, Rust also supports " -"using them for type-erased, dynamic dispatch via trait objects:" +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" msgstr "" -"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust همچنین " -"از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق اشیاء trait " -"پشتیبانی می‌کند:" +"علاوه بر استفاده از تریدها برای فراخوانی استاتیک از طریق generic‌ها، Rust " +"همچنین از استفاده از آن‌ها برای فراخوانی داینامیک با تایپ‌های حذف‌شده از طریق " +"اشیاء trait پشتیبانی می‌کند:" #: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md msgid "\"Miau!\"" @@ -6238,82 +6400,87 @@ msgstr "// Uses type-erasure and dynamic dispatch.\n" #: src/generics/dyn-trait.md msgid "" -"Generics, including `impl Trait`, use monomorphization to create a specialized " -"instance of the function for each different type that the generic is instantiated " -"with. This means that calling a trait method from within a generic function still " -"uses static dispatch, as the compiler has full type information and can resolve " -"which type's trait implementation to use." +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." msgstr "" -"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه تخصصی از " -"تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این بدان معناست " -"که فراخوانی یک متد trait از درون یک تابع generic همچنان از فراخوانی استاتیک " -"استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و می‌تواند پیاده‌سازی trait " -"مربوط به تایپ را مشخص کند." +"Generic‌ها، از جمله `impl Trait`، از monomorphization برای ایجاد یک نمونه " +"تخصصی از تابع برای هر تایپ مختلفی که با آن نمونه‌سازی شده استفاده می‌کنند. این " +"بدان معناست که فراخوانی یک متد trait از درون یک تابع generic همچنان از " +"فراخوانی استاتیک استفاده می‌کند، زیرا کامپایلر اطلاعات کامل تایپ را دارد و " +"می‌تواند پیاده‌سازی trait مربوط به تایپ را مشخص کند." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " -"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). This " -"means that there's a single version of `fn dynamic` that is used regardless of " -"what type of `Pet` is passed in." -msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق یک " -"[virtual method table](https://en.wikipedia.org/wiki/Virtual_method_table) " -"(vtable) استفاده می‌کند. این بدان معناست که یک نسخه واحد از `fn dynamic` وجود دارد " -"که بدون توجه به تایپ `Pet` که وارد می‌شود، استفاده می‌شود." +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " +"This means that there's a single version of `fn dynamic` that is used " +"regardless of what type of `Pet` is passed in." +msgstr "" +"زمانی که از `dyn Trait` استفاده می‌شود، به‌جای آن از فراخوانی داینامیک از طریق " +"یک [virtual method table](https://en.wikipedia.org/wiki/" +"Virtual_method_table) (vtable) استفاده می‌کند. این بدان معناست که یک نسخه " +"واحد از `fn dynamic` وجود دارد که بدون توجه به تایپ `Pet` که وارد می‌شود، " +"استفاده می‌شود." #: src/generics/dyn-trait.md msgid "" "When using `dyn Trait`, the trait object needs to be behind some kind of " -"indirection. In this case it's a reference, though smart pointer types like `Box` " -"can also be used (this will be demonstrated on day 3)." +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." msgstr "" -"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار داشته " -"باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های اشاره‌گرهای هوشمند " -"مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز سوم نشان داده خواهد شد)." +"زمانی که از `dyn Trait` استفاده می‌شود، شی trait باید پشت یک تایپ واسط قرار " +"داشته باشد. در این مورد، این تایپ واسط یک ارجاع است، اگرچه تایپ‌های " +"اشاره‌گرهای هوشمند مانند `Box` نیز می‌توانند استفاده شوند (این موضوع در روز " +"سوم نشان داده خواهد شد)." #: src/generics/dyn-trait.md msgid "" -"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of two " -"pointers: One pointer points to the concrete object that implements `Pet`, and " -"the other points to the vtable for the trait implementation for that type. When " -"calling the `talk` method on `&dyn Pet` the compiler looks up the function " -"pointer for `talk` in the vtable and then invokes the function, passing the " -"pointer to the `Dog` or `Cat` into that function. The compiler doesn't need to " -"know the concrete type of the `Pet` in order to do this." -msgstr "" -"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان می‌شود، " -"یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را پیاده‌سازی " -"می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع اشاره می‌کند. هنگام " -"فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع `talk` را در vtable " -"جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به `Dog` یا `Cat` را به آن تابع " -"پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص `Pet` برای انجام این کار ندارد." +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." +msgstr "" +"در زمان اجرا، یک `dyn Pet&` به‌صورت یک \"اشاره‌گر چاق\" (fat pointer) نمایان " +"می‌شود، یعنی یک جفت از دو اشاره‌گر: یکی از اشاره‌گرها به شیء مشخصی که `Pet` را " +"پیاده‌سازی می‌کند اشاره دارد و دیگری به vtable برای پیاده‌سازی ترید آن نوع " +"اشاره می‌کند. هنگام فراخوانی متد `talk` بر روی `dyn Pet&`، کامپایلر آدرس تابع " +"`talk` را در vtable جستجو کرده و سپس تابع را فراخوانی می‌کند و اشاره‌گر به " +"`Dog` یا `Cat` را به آن تابع پاس می‌دهد. کامپایلر نیازی به دانستن تایپ مشخص " +"`Pet` برای انجام این کار ندارد." #: src/generics/dyn-trait.md msgid "" "A `dyn Trait` is considered to be \"type-erased\", because we no longer have " "compile-time knowledge of what the concrete type is." msgstr "" -"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، زیرا " -"دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." +"یک `dyn Trait` به‌عنوان \"تایپ ‌حذف‌ شده\" (type-erased) در نظر گرفته می‌شود، " +"زیرا دیگر در زمان کامپایل اطلاعاتی درباره تایپ مشخص نداریم." #: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using the [`Ord`](https://doc.rust-lang.org/" -"stable/std/cmp/trait.Ord.html) trait." +"determines the minimum of two values, using the [`Ord`](https://doc.rust-" +"lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" -"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که حداقل از " -"دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc.rust-lang.org/" -"stable/std/cmp/trait.Ord.html)." +"در این تمرین کوتاه، شما یک تابع `min`generic را پیاده‌سازی خواهید کرد که " +"حداقل از دو مقدار را تعیین می‌کند، با استفاده از trait [`Ord`](https://doc." +"rust-lang.org/stable/std/cmp/trait.Ord.html)." #: src/generics/exercise.md #, fuzzy msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "// TODO: implement the `min` function used in `main`.\n" -#: src/generics/exercise.md src/generics/solution.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/generics/exercise.md src/generics/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "'z'" @@ -6344,8 +6511,8 @@ msgid "" "Ordering.html) enum." msgstr "" "[`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) trait و " -"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) enum را " -"به دانش‌آموزان نشان دهید." +"[`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum.Ordering.html) " +"enum را به دانش‌آموزان نشان دهید." #: src/std-types.md src/std-types/option.md msgid "Option" @@ -6372,33 +6539,35 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" -"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی از " -"متدهای رایج‌تر را برجسته کنید." +"برای هر یک از اسلایدهای این بخش، کمی زمان صرف مرور صفحات مستندات کنید و برخی " +"از متدهای رایج‌تر را برجسته کنید." #: src/std-types/std.md msgid "" -"Rust comes with a standard library which helps establish a set of common types " -"used by Rust libraries and programs. This way, two libraries can work together " -"smoothly because they both use the same `String` type." +"Rust comes with a standard library which helps establish a set of common " +"types used by Rust libraries and programs. This way, two libraries can work " +"together smoothly because they both use the same `String` type." msgstr "" "Rust دارای یک کتابخانه استاندارد است که به ایجاد مجموعه‌ای از تایپ‌های رایج " -"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو کتابخانه " -"می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی استفاده می‌کنند." +"استفاده‌شده توسط کتابخانه‌ها و برنامه‌های Rust کمک می‌کند. به این ترتیب، دو " +"کتابخانه می‌توانند به‌راحتی با هم کار کنند زیرا هر دو از تایپ `String` یکسانی " +"استفاده می‌کنند." #: src/std-types/std.md msgid "" -"In fact, Rust contains several layers of the Standard Library: `core`, `alloc` " -"and `std`." +"In fact, Rust contains several layers of the Standard Library: `core`, " +"`alloc` and `std`." msgstr "" -"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و `std`." +"در واقع، Rust شامل چندین لایه از کتابخانه استاندارد است: `core`، `alloc` و " +"`std`." #: src/std-types/std.md msgid "" -"`core` includes the most basic types and functions that don't depend on `libc`, " -"allocator or even the presence of an operating system." +"`core` includes the most basic types and functions that don't depend on " +"`libc`, allocator or even the presence of an operating system." msgstr "" -"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا حتی " -"وجود یک سیستم‌عامل وابسته نیستند." +"`core` شامل ابتدایی‌ترین تایپ‌ها و توابع است که به `libc`، تخصیص‌دهنده حافظه یا " +"حتی وجود یک سیستم‌عامل وابسته نیستند." #: src/std-types/std.md msgid "" @@ -6409,7 +6578,8 @@ msgstr "" "`Vec`، `Box` و `Arc`." #: src/std-types/std.md -msgid "Embedded Rust applications often only use `core`, and sometimes `alloc`." +msgid "" +"Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "برنامه‌های Rust تعبیه‌شده اغلب تنها از `core` و گاهی اوقات از `alloc` استفاده " "می‌کنند." @@ -6428,21 +6598,21 @@ msgstr "" #: src/std-types/docs.md msgid "" -"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." -"html)." +"Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." msgstr "" -"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive.u8." -"html)." +"تایپ‌های ابتدایی مانند [`u8`](https://doc.rust-lang.org/stable/std/primitive." +"u8.html)." #: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" -"collections/struct.BinaryHeap.html)." +"option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" +"std/collections/struct.BinaryHeap.html)." msgstr "" -"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/std/" -"option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/stable/std/" -"collections/struct.BinaryHeap.html)." +"تایپ‌های کتابخانه استاندارد مانند [`Option`](https://doc.rust-lang.org/stable/" +"std/option/enum.Option.html) یا [`BinaryHeap`](https://doc.rust-lang.org/" +"stable/std/collections/struct.BinaryHeap.html)." #: src/std-types/docs.md msgid "In fact, you can document your own code:" @@ -6451,11 +6621,13 @@ msgstr "در واقع، شما می‌توانید کد خود را مستند #: src/std-types/docs.md #, fuzzy msgid "" -"/// Determine whether the first argument is divisible by the second argument.\n" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" -"/// Determine whether the first argument is divisible by the second argument.\n" +"/// Determine whether the first argument is divisible by the second " +"argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" @@ -6463,46 +6635,50 @@ msgstr "" msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is idiomatic to " -"document all public items in an API using this pattern." +"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " +"idiomatic to document all public items in an API using this pattern." msgstr "" -"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده Rust " -"به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار [rustdoc]" -"(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند می‌شوند. مستند کردن " -"تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور رایج مرسوم است." +"محتویات به‌عنوان Markdown پردازش می‌شوند. تمام crate‌های کتابخانه‌ای منتشرشده " +"Rust به‌طور خودکار در [`docs.rs`](https://docs.rs) با استفاده از ابزار " +"[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) مستند " +"می‌شوند. مستند کردن تمام آیتم‌های عمومی در یک API با استفاده از این الگو به‌طور " +"رایج مرسوم است." #: src/std-types/docs.md msgid "" -"To document an item from inside the item (such as inside a module), use `//!` or " -"`/*! .. */`, called \"inner doc comments\":" +"To document an item from inside the item (such as inside a module), use `//!" +"` or `/*! .. */`, called \"inner doc comments\":" msgstr "" -"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا `/" -"* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" +"برای مستند کردن یک آیتم از درون خود آیتم (مانند درون یک ماژول)، از `!//` یا " +"`/* .. !*/` استفاده کنید که به آن \"کامنت‌های مستندات داخلی\" می‌گویند:" #: src/std-types/docs.md #, fuzzy msgid "" -"//! This module contains functionality relating to divisibility of integers.\n" +"//! This module contains functionality relating to divisibility of " +"integers.\n" msgstr "" -"//! This module contains functionality relating to divisibility of integers.\n" +"//! This module contains functionality relating to divisibility of " +"integers.\n" #: src/std-types/docs.md msgid "" -"Show students the generated docs for the `rand` crate at ." +"Show students the generated docs for the `rand` crate at ." msgstr "" -"مستندات تولیدشده برای `rand` crate را در به دانش‌آموزان " -"نشان دهید." +"مستندات تولیدشده برای `rand` crate را در به " +"دانش‌آموزان نشان دهید." #: src/std-types/option.md msgid "" -"We have already seen some use of `Option`. It stores either a value of type " -"`T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/stable/" -"std/string/struct.String.html#method.find) returns an `Option`." +"We have already seen some use of `Option`. It stores either a value of " +"type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" +"stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" -"ما قبلاً برخی استفاده‌ها از `` often has the same size in memory " -"as `T`." +"The niche optimization means that `Option` often has the same size in " +"memory as `T`." msgstr "" -"بهینه‌سازی niche به این معناست که `` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -"`Result` مشابه `Option` است، اما موفقیت یا شکست یک عملیات را نشان می‌دهد، هرکدام " -"با یک نوع متغیر enum متفاوت. این نوع جنریک است: ``](https://doc.rust-lang.org/std/string/" -"struct.String.html#deref-methods-str), which means that you can call all `str` " -"methods on a `String`." +"`String` implements [`Deref`](https://doc.rust-lang.org/std/" +"string/struct.String.html#deref-methods-str), which means that you can call " +"all `str` methods on a `String`." msgstr "" -"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" -"string/struct.String.html#deref-methods-str) است، که به این معناست که می‌توانید " -"تمام متدهای `str` را بر روی `String` فراخوانی کنید." +"`String` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/" +"std/string/struct.String.html#deref-methods-str) است، که به این معناست که " +"می‌توانید تمام متدهای `str` را بر روی `String` فراخوانی کنید." #: src/std-types/string.md msgid "" -"`String::new` returns a new empty string, use `String::with_capacity` when you " -"know how much data you want to push to the string." +"`String::new` returns a new empty string, use `String::with_capacity` when " +"you know how much data you want to push to the string." msgstr "" -"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` استفاده " -"کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." +"`String::new` یک رشته جدید خالی برمی‌گرداند. از `String::with_capacity` " +"استفاده کنید زمانی که می‌دانید چقدر داده می‌خواهید به رشته اضافه کنید." #: src/std-types/string.md msgid "" -"`String::len` returns the size of the `String` in bytes (which can be different " -"from its length in characters)." +"`String::len` returns the size of the `String` in bytes (which can be " +"different from its length in characters)." msgstr "" -"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با طول " -"آن به‌صورت کاراکتر متفاوت باشد)." +"`String::len` اندازه رشته `String` را به‌صورت بایت برمی‌گرداند (که ممکن است با " +"طول آن به‌صورت کاراکتر متفاوت باشد)." #: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " -"`char` can be different from what a human will consider a \"character\" due to " -"[grapheme clusters](https://docs.rs/unicode-segmentation/latest/" +"`char` can be different from what a human will consider a \"character\" due " +"to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" -"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. توجه " -"داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان \"کاراکتر\" در نظر " -"می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://docs.rs/unicode-" -"segmentation/latest/unicode_segmentation/struct.Graphemes.html)." +"`String::chars` یک تکرارگر (iterator) از روی کاراکترهای واقعی برمی‌گرداند. " +"توجه داشته باشید که یک `char` ممکن است با آنچه که یک انسان به عنوان " +"\"کاراکتر\" در نظر می‌گیرد، متفاوت باشد به دلیل [grapheme clusters](https://" +"docs.rs/unicode-segmentation/latest/unicode_segmentation/struct.Graphemes." +"html)." #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" -"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` باشد." +"زمانی که مردم به رشته‌ها اشاره می‌کنند، ممکن است منظورشان `str&` یا `String` " +"باشد." #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" -"زمانی که یک تایپ، `` which transparently gives it access to " -"`str`'s methods." +"`String` implements `Deref` which transparently gives it " +"access to `str`'s methods." msgstr "" -"`String` پیاده‌سازی‌کننده ``](https://doc.rust-lang.org/std/vec/struct." -"Vec.html#deref-methods-%5BT%5D), which means that you can call slice methods on a " -"`Vec`." +"`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/" +"struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " +"methods on a `Vec`." msgstr "" -"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/vec/" -"struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید متدهای برش را " -"بر روی یک `Vec` فراخوانی کنید." +"`Vec` پیاده‌سازی‌کننده [`Deref`](https://doc.rust-lang.org/std/" +"vec/struct.Vec.html#deref-methods-%5BT%5D) است، به این معنی که می‌توانید " +"متدهای برش را بر روی یک `Vec` فراخوانی کنید." #: src/std-types/vec.md msgid "" -"`Vec` is a type of collection, along with `String` and `HashMap`. The data it " -"contains is stored on the heap. This means the amount of data doesn't need to be " -"known at compile time. It can grow or shrink at runtime." +"`Vec` is a type of collection, along with `String` and `HashMap`. The data " +"it contains is stored on the heap. This means the amount of data doesn't " +"need to be known at compile time. It can grow or shrink at runtime." msgstr "" -"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه heap " -"ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان کامپایل ندارد و " -"می‌تواند در زمان اجرا رشد یا کوچک شود." +"`Vec` نوعی مجموعه است، به همراه `String` و `HashMap`. داده‌های آن در حافظه " +"heap ذخیره می‌شود. به این معنی که مقدار داده‌ها نیازی به دانستن در زمان " +"کامپایل ندارد و می‌تواند در زمان اجرا رشد یا کوچک شود." #: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " -"explicitly. As always with Rust type inference, the `T` was established during " -"the first `push` call." +"explicitly. As always with Rust type inference, the `T` was established " +"during the first `push` call." msgstr "" -"توجه داشته باشید که ``](https://doc." -"rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);" -"+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows us to easily " -"initialize a hash map from a literal array:" +"Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" +"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " +"us to easily initialize a hash map from a literal array:" msgstr "" -"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`](https://" -"doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K," -"+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما اجازه می‌دهد به‌راحتی " -"یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" +"از نسخه 1.56 Rust به بعد، `HashMap` پیاده‌سازی‌کننده [`From<[(K, V); N]>`]" +"(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" +"From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) است که به ما " +"اجازه می‌دهد به‌راحتی یک `HashMap` را از یک آرایه مقداردهی اولیه کنیم:" #: src/std-types/hashmap.md msgid "" -"Alternatively HashMap can be built from any `Iterator` which yields key-value " -"tuples." +"Alternatively HashMap can be built from any `Iterator` which yields key-" +"value tuples." msgstr "" -"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را تولید " -"می‌کند، ساخته شود." +"به‌طور جایگزین، `HashMap` می‌تواند از هر `Iterator` که جفت‌های key-value را " +"تولید می‌کند، ساخته شود." #: src/std-types/hashmap.md msgid "" "We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, but it " -"can lead into complications with the borrow checker." +"examples easier. Using references in collections can, of course, be done, " +"but it can lead into complications with the borrow checker." msgstr "" -"ما `=`, and `>` operators." +"`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " +"used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" "`PartialOrd` یک ترتیب جزئی را تعریف می‌کند و دارای متد `partial_cmp` است. این " "ویژگی برای پیاده‌سازی عملگرهای `<`، `<=`، `>=` و `>` استفاده می‌شود." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." +msgstr "" +"`Ord` یک ترتیب کامل است که در آن متد `cmp` مقدار `Ordering` را برمی‌گرداند." #: src/std-traits/comparisons.md msgid "" -"`PartialEq` can be implemented between different types, but `Eq` cannot, because " -"it is reflexive:" +"`PartialEq` can be implemented between different types, but `Eq` cannot, " +"because it is reflexive:" msgstr "" "`PartialEq` می‌تواند بین تایپ‌های مختلف پیاده‌سازی شود، اما `Eq` نمی‌تواند، زیرا " "بازتابی است:" #: src/std-traits/comparisons.md msgid "" -"In practice, it's common to derive these traits, but uncommon to implement them." +"In practice, it's common to derive these traits, but uncommon to implement " +"them." msgstr "" -"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که آن‌ها " -"به‌طور دستی پیاده‌سازی شوند." +"در عمل، معمولاً این trait‌ها به‌طور خودکار به‌دست می‌آیند، اما کمتر پیش می‌آید که " +"آن‌ها به‌طور دستی پیاده‌سازی شوند." #: src/std-traits/operators.md msgid "" -"Operator overloading is implemented via traits in [`std::ops`](https://doc.rust-" -"lang.org/std/ops/index.html):" +"Operator overloading is implemented via traits in [`std::ops`](https://doc." +"rust-lang.org/std/ops/index.html):" msgstr "" -"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang.org/" -"std/ops/index.html) پیاده‌سازی شده است:" +"بارگذاری مجدد عملگرها از طریق traits در [`std::ops`](https://doc.rust-lang." +"org/std/ops/index.html) پیاده‌سازی شده است:" #: src/std-traits/operators.md msgid "\"{:?} + {:?} = {:?}\"" @@ -7148,15 +7338,17 @@ msgid "Discussion points:" msgstr "نکات بحث:" #: src/std-traits/operators.md -msgid "You could implement `Add` for `&Point`. In which situations is that useful?" +msgid "" +"You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" -"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار مفید است؟" +"می‌توانید `Add` را برای `Point&` پیاده‌سازی کنید. در چه موقعیت‌هایی این کار " +"مفید است؟" #: src/std-traits/operators.md msgid "" -"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading the " -"operator is not `Copy`, you should consider overloading the operator for `&T` as " -"well. This avoids unnecessary cloning on the call site." +"Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " +"the operator is not `Copy`, you should consider overloading the operator for " +"`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" "پاسخ: `Add:add` خود `self` را مصرف می‌کند. اگر تایپ `T` که برای آن عملگر را " "بارگذاری می‌کنید، `Copy` نباشد، باید پیاده‌سازی عملگر را برای `T&` نیز در نظر " @@ -7167,21 +7359,22 @@ msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" -"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای متد " -"تعریف کرد؟" +"چرا `Output` یک تایپ مرتبط است؟ آیا می‌توان آن را به‌عنوان یک پارامترتایپ برای " +"متد تعریف کرد؟" #: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " -"associated types (like `Output`) are controlled by the implementer of a trait." +"associated types (like `Output`) are controlled by the implementer of a " +"trait." msgstr "" -"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما تایپ‌های " -"مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." +"پاسخ کوتاه: پارامترهای تایپ تابع توسط فراخوانی‌کننده کنترل می‌شوند، اما " +"تایپ‌های مرتبط (مانند `Output`) توسط پیاده‌ساز trait کنترل می‌شوند." #: src/std-traits/operators.md msgid "" -"You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for " -"Point` would add a tuple to a `Point`." +"You could implement `Add` for two different types, e.g. `impl Add<(i32, " +"i32)> for Point` would add a tuple to a `Point`." msgstr "" "شما می‌توانید `Add` را برای دو تایپ مختلف پیاده‌سازی کنید، به‌عنوان مثال `impl " "Add<(i32, i32)> for Point` می‌تواند یک tuple را به یک `Point` اضافه کند." @@ -7189,26 +7382,27 @@ msgstr "" #: src/std-traits/operators.md #, fuzzy msgid "" -"The `Not` trait (`!` operator) is notable because it does not \"boolify\" like " -"the same operator in C-family languages; instead, for integer types it negates " -"each bit of the number, which arithmetically is equivalent to subtracting it from " -"-1: `!5 == -6`." +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." msgstr "" -"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در زبان‌های " -"خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، هر بیت از عدد " -"را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == -6` است." +"عملگر `Not` یک ویژگی(`!` operator) قابل توجه است زیرا مانند همان عملگر در " +"زبان‌های خانواده C هرگز \"boolify\" نمی شود. در عوض، برای انواع عدد صحیح، " +"هر بیت از عدد را نفی می‌کند، که از نظر حسابی معادل کم کردن آن از -1: `!5 == " +"-6` است." #: src/std-traits/from-and-into.md #, fuzzy msgid "" -"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " -"and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to facilitate " -"type conversions. Unlike `as`, these traits correspond to lossless, infallible " -"conversions." +"Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." +"html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" -"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait.From." -"html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) را برای " -"تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" +"تایپ‌های مختلف ویژگی‌های [`From`](https://doc.rust-lang.org/std/convert/trait." +"From.html) و [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) " +"را برای تسهیل تبدیل تایپ پیاده‌سازی می‌کنند:" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" @@ -7216,18 +7410,18 @@ msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" -"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is automatically " -"implemented when [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " -"is implemented:" +"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " +"automatically implemented when [`From`](https://doc.rust-lang.org/std/" +"convert/trait.From.html) is implemented:" msgstr "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) به‌طور خودکار " -"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/trait." -"From.html) پیاده‌سازی شده باشد:" +"زمانی پیاده‌سازی می‌شود که [`From`](https://doc.rust-lang.org/std/convert/" +"trait.From.html) پیاده‌سازی شده باشد:" #: src/std-traits/from-and-into.md msgid "" -"That's why it is common to only implement `From`, as your type will get `Into` " -"implementation too." +"That's why it is common to only implement `From`, as your type will get " +"`Into` implementation too." msgstr "" "به همین دلیل معمولاً تنها `From` پیاده‌سازی می‌شود، زیرا تایپ شما به‌طور خودکار " "پیاده‌سازی `Into` را نیز دریافت می‌کند." @@ -7235,19 +7429,19 @@ msgstr "" #: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " -"converted into a `String`\", the rule is opposite, you should use `Into`. Your " -"function will accept types that implement `From` and those that _only_ implement " -"`Into`." +"converted into a `String`\", the rule is opposite, you should use `Into`. " +"Your function will accept types that implement `From` and those that _only_ " +"implement `Into`." msgstr "" "هنگام اعلام تایپ ورودی تابعی مانند \"هر چیزی که می‌تواند به یک `String` تبدیل " -"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را قبول " -"می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را پیاده‌سازی " -"کرده‌اند." +"شود\"، قاعده برعکس است، باید از `Into` استفاده کنید. تابع شما تایپ‌های را " +"قبول می‌کند که پیاده‌سازی `From` دارند و همچنین تاید‌هایی که فقط `Into` را " +"پیاده‌سازی کرده‌اند." #: src/std-traits/casting.md msgid "" -"Rust has no _implicit_ type conversions, but does support explicit casts with " -"`as`. These generally follow C semantics where those are defined." +"Rust has no _implicit_ type conversions, but does support explicit casts " +"with `as`. These generally follow C semantics where those are defined." msgstr "" "Rust هیچ _implicit_ ندارد، اما از تبدیل‌های صریح با استفاده از `as` پشتیبانی " "می‌کند. این تبدیل‌ها معمولاً پیرو معنای C هستند که در آنجا تعریف شده‌اند." @@ -7266,39 +7460,42 @@ msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" -"The results of `as` are _always_ defined in Rust and consistent across platforms. " -"This might not match your intuition for changing sign or casting to a smaller " -"type -- check the docs, and comment for clarity." +"The results of `as` are _always_ defined in Rust and consistent across " +"platforms. This might not match your intuition for changing sign or casting " +"to a smaller type -- check the docs, and comment for clarity." msgstr "" -"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت هستند. " -"این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر مطابقت نداشته " -"باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." +"نتایج استفاده از `as` _همیشه_ در Rust تعریف شده و در تمامی پلتفرم‌ها ثابت " +"هستند. این ممکن است با شهود شما برای تغییر علامت یا تبدیل به تایپ کوچکتر " +"مطابقت نداشته باشد -- مستندات را بررسی کنید و برای وضوح بیشتر نظر دهید." #: src/std-traits/casting.md msgid "" -"Casting with `as` is a relatively sharp tool that is easy to use incorrectly, and " -"can be a source of subtle bugs as future maintenance work changes the types that " -"are used or the ranges of values in types. Casts are best used only when the " -"intent is to indicate unconditional truncation (e.g. selecting the bottom 32 bits " -"of a `u64` with `as u32`, regardless of what was in the high bits)." +"Casting with `as` is a relatively sharp tool that is easy to use " +"incorrectly, and can be a source of subtle bugs as future maintenance work " +"changes the types that are used or the ranges of values in types. Casts are " +"best used only when the intent is to indicate unconditional truncation (e.g. " +"selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " +"was in the high bits)." msgstr "" -"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن آسان " -"است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری آینده باعث " -"تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها بهتر است تنها " -"زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط باشد (مثلاً انتخاب 32 " -"بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در بیت‌های بالا وجود دارد)." +"تبدیل تایپ با استفاده از `as` ابزاری نسبتاً حساس است که استفاده نادرست از آن " +"آسان است و می‌تواند منبعی از اشکالات ظریف باشد، به خصوص زمانی که کار نگهداری " +"آینده باعث تغییر تایپ‌های مورد استفاده یا دامنه مقادیر در تایپ‌ها شود. تبدیل‌ها " +"بهتر است تنها زمانی استفاده شوند که قصد شما نشان دادن برش بدون قید و شرط " +"باشد (مثلاً انتخاب 32 بیت پایین از یک `u64` با `as u32`، بدون توجه به آنچه در " +"بیت‌های بالا وجود دارد)." #: src/std-traits/casting.md msgid "" -"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` over " -"`as` to confirm that the cast is in fact infallible. For fallible casts, " -"`TryFrom` and `TryInto` are available when you want to handle casts that fit " -"differently from those that don't." +"For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " +"over `as` to confirm that the cast is in fact infallible. For fallible " +"casts, `TryFrom` and `TryInto` are available when you want to handle casts " +"that fit differently from those that don't." msgstr "" -"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا `Into` " -"بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای تبدیل‌های با " -"احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که می‌خواهید تبدیل‌هایی را که " -"به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت کنید." +"برای تبدیل‌های بدون خطا (مانند تبدیل `u32` به `u64`)، استفاده از `From` یا " +"`Into` بر `as` ارجح است تا تأیید شود که تبدیل در واقع بدون خطا است. برای " +"تبدیل‌های با احتمال خطا، `TryFrom` و `TryInto` در دسترس هستند وقتی که " +"می‌خواهید تبدیل‌هایی را که به شیوه‌ای متفاوت از آن‌هایی که مطابقت ندارند، مدیریت " +"کنید." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." @@ -7306,26 +7503,29 @@ msgstr "در نظر داشته باشید که پس از این اسلاید ا #: src/std-traits/casting.md msgid "" -"`as` is similar to a C++ static cast. Use of `as` in cases where data might be " -"lost is generally discouraged, or at least deserves an explanatory comment." +"`as` is similar to a C++ static cast. Use of `as` in cases where data might " +"be lost is generally discouraged, or at least deserves an explanatory " +"comment." msgstr "" -"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن است " -"داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی دارد." +"`as` مشابه به `static_cast` در ++C است. استفاده از `as` در مواردی که ممکن " +"است داده‌ها از دست برود، معمولاً توصیه نمی‌شود یا حداقل نیاز به توضیحی کامنتی " +"دارد." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" -"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج است." +"این موضوع در تبدیل اعداد صحیح به `usize` برای استفاده به عنوان ایندکس رایج " +"است." #: src/std-traits/read-and-write.md msgid "" -"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and [`BufRead`]" -"(https://doc.rust-lang.org/std/io/trait.BufRead.html), you can abstract over `u8` " -"sources:" +"Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " +"abstract over `u8` sources:" msgstr "" "با استفاده از [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) و " -"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید بر روی " -"منابع `u8` انتزاع کنید:" +"[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html)، می‌توانید " +"بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" @@ -7341,11 +7541,11 @@ msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" -"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets you " -"abstract over `u8` sinks:" +"Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " +"you abstract over `u8` sinks:" msgstr "" -"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) به شما " -"امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" +"به طور مشابه، [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " +"به شما امکان می‌دهد که بر روی منابع `u8` انتزاع کنید:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" @@ -7364,8 +7564,8 @@ msgid "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "produces a default value for a type." msgstr "" -"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) یک " -"مقدار پیش‌فرض برای یک تایپ تولید می‌کند." +"ویژگی [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"یک مقدار پیش‌فرض برای یک تایپ تولید می‌کند." #: src/std-traits/default.md msgid "\"John Smith\"" @@ -7384,7 +7584,8 @@ msgstr "\" مقدار Y وارد شده است!\"" msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" -#: src/std-traits/default.md src/lifetimes/exercise.md src/lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md +#: src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "\"{:#?}\"" @@ -7397,25 +7598,25 @@ msgstr "" #: src/std-traits/default.md msgid "" -"A derived implementation will produce a value where all fields are set to their " -"default values." +"A derived implementation will produce a value where all fields are set to " +"their default values." msgstr "" -"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر پیش‌فرض " -"خود تنظیم شده‌اند." +"یک پیاده‌سازی خودکار، مقداری تولید می‌کند که در آن تمامی فیلدها به مقادیر " +"پیش‌فرض خود تنظیم شده‌اند." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" -"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را پیاده‌سازی " -"کنند." +"این بدان معناست که تمام تایپ‌های موجود در ساختار نیز باید `Default` را " +"پیاده‌سازی کنند." #: src/std-traits/default.md msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. `0`, " -"`\"\"`, etc)." +"Standard Rust types often implement `Default` with reasonable values (e.g. " +"`0`, `\"\"`, etc)." msgstr "" -"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند (مثل " -"`0`، `\"\"` و غیره)." +"نوع‌های استاندارد Rust اغلب `Default` را با مقادیر معقول پیاده‌سازی می‌کنند " +"(مثل `0`، `\"\"` و غیره)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." @@ -7426,30 +7627,31 @@ msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" -"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را پیاده‌سازی " -"کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." +"کتابخانه استاندارد Rust آگاه است که تایپ‌های مختلف می‌توانند `Default` را " +"پیاده‌سازی کنند و روش‌های کمکی را فراهم می‌کند که از آن استفاده می‌کنند." #: src/std-traits/default.md msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" -"update-syntax)." +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" +"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" +"with-struct-update-syntax)." msgstr "" "سینتکس `..` به نام [سینتکس به‌روزرسانی ساختار](https://doc.rust-lang.org/book/" -"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-" -"update-syntax) شناخته می‌شود." +"ch05-01-defining-structs.html#creating-instances-from-other-instances-with-" +"struct-update-syntax) شناخته می‌شود." #: src/std-traits/closures.md msgid "" -"Closures or lambda expressions have types which cannot be named. However, they " -"implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), " -"[`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`]" -"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" msgstr "" -"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، آن‌ها " -"پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html) و [`FnOnce`]" -"(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) هستند:" +"بسته‌ها یا عبارات لامبدا تایپ‌هایی دارند که نمی‌توان نام‌گذاری کرد. با این حال، " +"آن‌ها پیاده‌سازی‌های ویژه از traits [`Fn`](https://doc.rust-lang.org/std/ops/" +"trait.Fn.html)، [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut." +"html) و [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " +"هستند:" #: src/std-traits/closures.md msgid "\"Calling {func_name}({input}): {}\"" @@ -7472,63 +7674,65 @@ msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can be " -"called needing only a shared reference to the closure, which means the closure " -"can be executed repeatedly and even concurrently." +"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values. It can " +"be called needing only a shared reference to the closure, which means the " +"closure can be executed repeatedly and even concurrently." msgstr "" -"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را تغییر " -"می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان چندین بار " -"فراخوانی شود." +"یک `Fn` (برای مثال `add_3`) نه مقادیر گرفته شده را مصرف می‌کند و نه آن‌ها را " +"تغییر می‌دهد، یا شاید اصلاً چیزی را نمی‌گیرد. این تایپ می‌تواند به‌طور همزمان " +"چندین بار فراخوانی شود." #: src/std-traits/closures.md #, fuzzy msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure object " -"is accessed via exclusive reference, so it can be called repeatedly but not " -"concurrently." +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." msgstr "" -"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. شما " -"می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." +"یک `FnMut` (برای مثال `accumulate`) ممکن است مقادیر گرفته شده را تغییر دهد. " +"شما می‌توانید آن را چندین بار فراخوانی کنید، اما نه به‌طور همزمان." #: src/std-traits/closures.md #, fuzzy msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. Doing " -"so consumes the closure and any values captured by move." +"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " +"Doing so consumes the closure and any values captured by move." msgstr "" -"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را یک‌بار " -"فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." +"اگر یک `FnOnce` (برای مثال `multiply_sum`) داشته باشید، تنها می‌توانید آن را " +"یک‌بار فراخوانی کنید. ممکن است مقادیر گرفته شده را مصرف کند." #: src/std-traits/closures.md msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. " -"you can use an `FnMut` wherever an `FnOnce` is called for, and you can use an " -"`Fn` wherever an `FnMut` or `FnOnce` is called for." +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." msgstr "" -"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و `FnOnce` " -"است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز است استفاده کنید " -"و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده کنید." +"`FnMut` یک زیرتایپ از `FnOnce` است. `Fn` نیز یک زیرتایپ از `FnMut` و " +"`FnOnce` است. به عبارت دیگر، می‌توانید از `FnMut` در جایی که `FnOnce` نیاز " +"است استفاده کنید و از `Fn` در جایی که `FnMut` یا `FnOnce` نیاز است استفاده " +"کنید." #: src/std-traits/closures.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if you " -"can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most " -"flexibility for the caller." +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." msgstr "" -"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` استفاده " -"کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده می‌شود)، یا از " -"`FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین انعطاف‌پذیری را برای " -"فراخوانی‌کننده فراهم می‌کند." +"زمانی که تابعی تعریف می‌کنید که یک closure را می‌گیرد، باید از `FnOnce` " +"استفاده کنید اگر فقط یک بار آن را فراخوانی می‌کنید (یعنی یک بار استفاده " +"می‌شود)، یا از `FnMut` در غیر این صورت، و در نهایت از `Fn`. این کار بیشترین " +"انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md #, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then `FnMut`, " -"and lastly `FnOnce`." +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." msgstr "" -"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته باشید " -"`Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت `FnOnce`." +"در مقابل، زمانی که یک closure دارید، بیشترین انعطاف‌پذیری که می‌توانید داشته " +"باشید `Fn` است (که می‌تواند در هر جایی استفاده شود)، سپس `FnMut` و در نهایت " +"`FnOnce`." #: src/std-traits/closures.md #, fuzzy @@ -7542,13 +7746,15 @@ msgstr "" #: src/std-traits/closures.md msgid "" -"By default, closures will capture each variable from an outer scope by the least " -"demanding form of access they can (by shared reference if possible, then " -"exclusive reference, then by move). The `move` keyword forces capture by value." +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." msgstr "" -"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با کمترین " -"سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس با انتقال) " -"capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت value اجباری می‌کند." +"به صورت پیش‌فرض، بسته‌بندی‌ها (closures) هر متغیر از یک دامنه بیرونی را با " +"کمترین سطح دسترسی ممکن (با ارجاع مشترک اگر ممکن باشد، سپس ارجاع انحصاری، سپس " +"با انتقال) capture می‌کنند. کلیدواژه `move` یا انتقال، capture را به صورت " +"value اجباری می‌کند." #: src/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" @@ -7564,15 +7770,15 @@ msgstr "\"Greg\"" #: src/std-traits/exercise.md msgid "" -"In this example, you will implement the classic [\"ROT13\" cipher](https://en." -"wikipedia.org/wiki/ROT13). Copy this code to the playground, and implement the " -"missing bits. Only rotate ASCII alphabetic characters, to ensure the result is " -"still valid UTF-8." +"In this example, you will implement the classic [\"ROT13\" cipher](https://" +"en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " +"implement the missing bits. Only rotate ASCII alphabetic characters, to " +"ensure the result is still valid UTF-8." msgstr "" -"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia.org/" -"wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی کرده و " -"بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید تا نتیجه " -"همچنان UTF-8 معتبر باقی بماند." +"در این مثال، شما الگوریتم کلاسیک [رمزگذاری \"ROT13\"](https://en.wikipedia." +"org/wiki/ROT13) را پیاده‌سازی خواهید کرد. این کد را به محیط Playground کپی " +"کرده و بخش‌های ناقص آن را پیاده‌سازی کنید. تنها حروف الفبای ASCII را بچرخانید " +"تا نتیجه همچنان UTF-8 معتبر باقی بماند." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" @@ -7588,11 +7794,11 @@ msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" -"What happens if you chain two `RotDecoder` instances together, each rotating by " -"13 characters?" +"What happens if you chain two `RotDecoder` instances together, each rotating " +"by 13 characters?" msgstr "" -"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام ۱۳ " -"کاراکتر را بچرخانند؟" +"چه اتفاقی می‌افتد اگر دو نمونه از `RotDecoder` را به‌هم متصل کنید که هر کدام " +"۱۳ کاراکتر را بچرخانند؟" #: src/std-traits/solution.md msgid "'A'" @@ -7608,11 +7814,11 @@ msgstr "امروز، ما به بررسی خواهیم پرداخت:" #: src/welcome-day-3.md msgid "" -"Memory management, lifetimes, and the borrow checker: how Rust ensures memory " -"safety." +"Memory management, lifetimes, and the borrow checker: how Rust ensures " +"memory safety." msgstr "" -"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان Rust از " -"ایمنی حافظه اطمینان حاصل می‌کند." +"مدیریت حافظه، طول عمرها و بررسی‌کننده قرض‌گیری (borrow checker): چگونه زبان " +"Rust از ایمنی حافظه اطمینان حاصل می‌کند." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." @@ -7623,8 +7829,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول بکشد. " -"این جلسه شامل:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۲ ساعت و ۲۰ دقیقه طول " +"بکشد. این جلسه شامل:" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" @@ -7641,7 +7847,8 @@ msgstr "برنامه‌ها حافظه را به دو روش تخصیص می‌ #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "" -"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده می‌شود." +"Stack: بلوک پیوسته‌ای از حافظه که برای متغیرهای محلی (داخل یک تابع) استفاده " +"می‌شود." #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." @@ -7677,39 +7884,41 @@ msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه #: src/memory-management/review.md msgid "" -"Creating a `String` puts fixed-sized metadata on the stack and dynamically sized " -"data, the actual string, on the heap:" +"Creating a `String` puts fixed-sized metadata on the stack and dynamically " +"sized data, the actual string, on the heap:" msgstr "" -"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه پویا، " -"یعنی رشته واقعی، را روی heap قرار می‌دهد:" +"ساختن یک `String` metadata با اندازه ثابت را روی stack و داده با اندازه " +"پویا، یعنی رشته واقعی، را روی heap قرار می‌دهد:" #: src/memory-management/review.md 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." +"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` پشتیبانی می‌شود، بنابراین دارای ظرفیت و طول " -"است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد کند." +"ذکر کنید که یک `String` توسط یک `Vec` پشتیبانی می‌شود، بنابراین دارای ظرفیت و " +"طول است و در صورت تغییرپذیری، می‌تواند از طریق اختصاص مجدد حافظه روی heap رشد " +"کند." #: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " -"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/struct." -"System.html) and custom allocators can be implemented using the [Allocator API]" -"(https://doc.rust-lang.org/std/alloc/index.html)" +"allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" +"struct.System.html) and custom allocators can be implemented using the " +"[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" -"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با استفاده " -"از [System Allocator](https://doc.rust-lang.org/std/alloc/struct.System.html) بر " -"روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با استفاده از [Allocator " -"API](https://doc.rust-lang.org/std/alloc/index.html) پیاده‌سازی شوند" +"اگر دانش‌آموزان درباره آن سوال کنند، می‌توانید اشاره کنید که حافظه زیرین با " +"استفاده از [System Allocator](https://doc.rust-lang.org/std/alloc/struct." +"System.html) بر روی heap اختصاص داده شده و تخصیص‌دهنده‌های سفارشی می‌توانند با " +"استفاده از [Allocator API](https://doc.rust-lang.org/std/alloc/index.html) " +"پیاده‌سازی شوند" #: src/memory-management/review.md msgid "" -"We can inspect the memory layout with `unsafe` Rust. However, you should point " -"out that this is rightfully unsafe!" +"We can inspect the memory layout with `unsafe` Rust. However, you should " +"point out that this is rightfully unsafe!" msgstr "" -"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. با " -"این حال، باید اشاره کنید که این کار به درستی ناامن است!" +"می‌توانیم با استفاده از Rust ناامن (unsafe) نحوه چیدمان حافظه را بررسی کنیم. " +"با این حال، باید اشاره کنید که این کار به درستی ناامن است!" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" @@ -7722,11 +7931,13 @@ msgstr "\"دنیا\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" msgstr "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead to\n" +" // String provides no guarantees about its layout, so this could lead " +"to\n" " // undefined behavior.\n" #: src/memory-management/review.md @@ -7746,9 +7957,11 @@ msgid "Programmer decides when to allocate or free heap memory." msgstr "برنامه‌نویس تصمیم می‌گیرد که چه زمانی حافظه heap را تخصیص یا آزاد کند." #: src/memory-management/approaches.md -msgid "Programmer must determine whether a pointer still points to valid memory." +msgid "" +"Programmer must determine whether a pointer still points to valid memory." msgstr "" -"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند یا نه." +"برنامه‌نویس باید تعیین کند که آیا یک اشاره‌گر هنوز به حافظه معتبر اشاره می‌کند " +"یا نه." #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." @@ -7759,20 +7972,22 @@ msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" -"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، هسکل، ..." +"ایمنی کامل از طریق مدیریت خودکار حافظه در زمان اجرا: جاوا، پایتون، گو، " +"هسکل، ..." #: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" -"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن ارجاع " -"داده شود، آزاد نمی‌شود." +"یک سیستم زمان اجرا اطمینان می‌یابد که حافظه تا زمانی که دیگر نتواند به آن " +"ارجاع داده شود، آزاد نمی‌شود." #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." -msgstr "معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." +msgstr "" +"معمولاً با استفاده از شمارش ارجاع، جمع‌آوری زباله، یا RAII پیاده‌سازی می‌شود." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7790,78 +8005,80 @@ msgstr "این کار را با استفاده از مفهوم مالکیت صر #: src/memory-management/approaches.md msgid "" -"This slide is intended to help students coming from other languages to put Rust " -"in context." +"This slide is intended to help students coming from other languages to put " +"Rust in context." msgstr "" -"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust را " -"در زمینه مناسب قرار دهند." +"این اسلاید به منظور کمک به دانش‌آموزانی است که از زبان‌های دیگر می‌آیند تا Rust " +"را در زمینه مناسب قرار دهند." #: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " -"forgetting to call `free`, calling it multiple times for the same pointer, or " -"dereferencing a pointer after the memory it points to has been freed." +"forgetting to call `free`, calling it multiple times for the same pointer, " +"or dereferencing a pointer after the memory it points to has been freed." msgstr "" "C باید حافظه heap را به‌طور دستی با استفاده از `malloc` و `free` مدیریت کند. " "خطاهای رایج شامل فراموش کردن فراخوانی `free`، فراخوانی آن چندین بار برای یک " -"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن اشاره " -"می‌کند." +"اشاره‌گر، یا dereference کردن یک اشاره‌گر پس از آزاد شدن حافظه‌ای است که به آن " +"اشاره می‌کند." #: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " -"advantage of language guarantees about calling destructors to ensure memory is " -"freed when a function returns. It is still quite easy to mis-use these tools and " -"create similar bugs to C." +"advantage of language guarantees about calling destructors to ensure memory " +"is freed when a function returns. It is still quite easy to mis-use these " +"tools and create similar bugs to C." msgstr "" -"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که از " -"تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از آزاد شدن " -"حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم بسیار آسان است که " -"از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C ایجاد کرد." +"++C ابزارهایی مانند اشاره‌گرهای هوشمند (`unique_ptr`, `shared_ptr`) دارد که " +"از تضمین‌های زبانی درباره فراخوانی ویرایشگرها (destructor) برای اطمینان از " +"آزاد شدن حافظه هنگام بازگشت از تابع استفاده می‌کنند. با این حال، هنوز هم " +"بسیار آسان است که از این ابزارها به اشتباه استفاده کرده و باگ‌هایی مشابه به C " +"ایجاد کرد." #: src/memory-management/approaches.md msgid "" -"Java, Go, and Python rely on the garbage collector to identify memory that is no " -"longer reachable and discard it. This guarantees that any pointer can be " -"dereferenced, eliminating use-after-free and other classes of bugs. But, GC has a " -"runtime cost and is difficult to tune properly." +"Java, Go, and Python rely on the garbage collector to identify memory that " +"is no longer reachable and discard it. This guarantees that any pointer can " +"be dereferenced, eliminating use-after-free and other classes of bugs. But, " +"GC has a runtime cost and is difficult to tune properly." msgstr "" -"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی حافظه‌ای " -"که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند که هر " -"اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از آزادسازی (use-" -"after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای در زمان اجرا دارد و " -"تنظیم مناسب آن دشوار است." +"جاوا، گو و پایتون به جمع‌آوری‌کننده زباله (garbage collector) برای شناسایی " +"حافظه‌ای که دیگر در دسترس نیست و دور ریختن آن متکی هستند. این امر تضمین می‌کند " +"که هر اشاره‌گری می‌تواند dereference شود و از بروز خطاهای استفاده پس از " +"آزادسازی (use-after-free) و سایر دسته‌های باگ جلوگیری می‌کند. اما، GC هزینه‌ای " +"در زمان اجرا دارد و تنظیم مناسب آن دشوار است." #: src/memory-management/approaches.md msgid "" -"Rust's ownership and borrowing model can, in many cases, get the performance of " -"C, with alloc and free operations precisely where they are required -- zero cost. " -"It also provides tools similar to C++'s smart pointers. When required, other " -"options such as reference counting are available, and there are even third-party " -"crates available to support runtime garbage collection (not covered in this " -"class)." +"Rust's ownership and borrowing model can, in many cases, get the performance " +"of C, with alloc and free operations precisely where they are required -- " +"zero cost. It also provides tools similar to C++'s smart pointers. When " +"required, other options such as reference counting are available, and there " +"are even third-party crates available to support runtime garbage collection " +"(not covered in this class)." msgstr "" -"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از موارد " -"عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز -- با هزینه " -"صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند ++C را فراهم " -"می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در دسترس هستند و حتی " -"crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان اجرا موجود است (که در این " -"کلاس پوشش داده نمی‌شود)." +"مدل مالکیت و قرض‌گیری Rust (ownership and borrowing) می‌تواند در بسیاری از " +"موارد عملکرد C را با عملیات‌های تخصیص و آزادسازی دقیقاً در مکان‌های مورد نیاز " +"-- با هزینه صفر -- به دست آورد. همچنین ابزارهایی مشابه به اشاره‌گرهای هوشمند +" +"+C را فراهم می‌کند. در صورت نیاز، گزینه‌های دیگری مانند شمارش ارجاع نیز در " +"دسترس هستند و حتی crates شخص ثالثی برای پشتیبانی از جمع‌آوری زباله در زمان " +"اجرا موجود است (که در این کلاس پوشش داده نمی‌شود)." #: src/memory-management/ownership.md msgid "" -"All variable bindings have a _scope_ where they are valid and it is an error to " -"use a variable outside its scope:" +"All variable bindings have a _scope_ where they are valid and it is an error " +"to use a variable outside its scope:" msgstr "" -"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده از " -"متغیر خارج از دامنه‌اش یک خطاست:" +"تمام پیوندهای متغیر دارای یک **دامنه** هستند که در آن معتبر هستند و استفاده " +"از متغیر خارج از دامنه‌اش یک خطاست:" #: src/memory-management/ownership.md msgid "" -"We say that the variable _owns_ the value. Every Rust value has precisely one " -"owner at all times." +"We say that the variable _owns_ the value. Every Rust value has precisely " +"one owner at all times." msgstr "" -"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک دارد." +"می‌گوییم که متغیر _مالک_ مقدار است. هر مقدار در Rust در هر لحظه دقیقاً یک مالک " +"دارد." #: src/memory-management/ownership.md msgid "" @@ -7874,12 +8091,12 @@ msgstr "" #: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " -"garbage collector starts with a set of \"roots\" to find all reachable memory. " -"Rust's \"single owner\" principle is a similar idea." +"garbage collector starts with a set of \"roots\" to find all reachable " +"memory. Rust's \"single owner\" principle is a similar idea." msgstr "" "دانش‌آموزانی که با پیاده‌سازی‌های جمع‌آوری زباله آشنا هستند، خواهند دانست که یک " -"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل دسترسی " -"شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." +"جمع‌آوری‌کننده زباله با مجموعه‌ای از \"ریشه‌ها\" برای یافتن تمام حافظه‌های قابل " +"دسترسی شروع می‌کند. اصول \"مالکیت تک‌گانه\" Rust ایده مشابهی است." #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" @@ -7900,7 +8117,8 @@ msgstr "انتساب `s1`به `s2` مالکیت را منتقل می‌کند." #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" -"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی نیست." +"زمانی که دیگر در اسکوپ `s1` نیستیم, هیچ اتفاقی نمی‌افتد: چون `s1` مالک چیزی " +"نیست." #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." @@ -7963,8 +8181,8 @@ msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" -"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص داده " -"می‌شود. به این شکل مالکیت را منتقل می‌کند:" +"هنگامی که یک مقدار را به یک تابع منتقل می‌کنید، مقدار به آرگمان تابع اختصاص " +"داده می‌شود. به این شکل مالکیت را منتقل می‌کند:" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" @@ -7981,27 +8199,29 @@ msgstr "// say_hello(name);\n" #: src/memory-management/move.md 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!)." +"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` استفاده کنیم " -"( تا یک مقدار را جا به جا کنیم!)" +"اشاره کنید که این رویه راست بر خلاف پیش‌فرض زبان C++ " +"است که در ان مقدار کپی میشود مگر که از `std::move` " +"استفاده کنیم ( تا یک مقدار را جا به جا کنیم!)" #: src/memory-management/move.md msgid "" -"It is only the ownership that moves. Whether any machine code is generated to " -"manipulate the data itself is a matter of optimization, and such copies are " -"aggressively optimized away." +"It is only the ownership that moves. Whether any machine code is generated " +"to manipulate the data itself is a matter of optimization, and such copies " +"are aggressively optimized away." msgstr "" -"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری خود " -"داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی به‌طور تهاجمی " -"(aggressively) بهینه‌سازی می‌شوند." +"این رویه فقط برای انتقال مالکیت است. اینکه آیا هیچ کد ماشینی برای دستکاری " +"خود داده‌ها تولید می‌شود یا خیر، موضوعی برای بهینه‌سازی است و چنین کپی‌هایی " +"به‌طور تهاجمی (aggressively) بهینه‌سازی می‌شوند." #: src/memory-management/move.md -msgid "Simple values (such as integers) can be marked `Copy` (see later slides)." +msgid "" +"Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" -"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را ببینید)." +"مقادیر ساده (مانند اعداد صحیح) را می‌توان `Copy` کرد (اسلایدهای بعدی را " +"ببینید)." #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." @@ -8016,41 +8236,42 @@ 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` استفاده شود." +"با اولین فراخوانی `say_hello`، تابع `main` مالکیت `name` را انتقال می‌دهد. پس " +"از آن، `name` دیگر نمی‌تواند در `main` استفاده شود." #: src/memory-management/move.md msgid "" -"The heap memory allocated for `name` will be freed at the end of the `say_hello` " -"function." +"The heap memory allocated for `name` will be freed at the end of the " +"`say_hello` function." msgstr "" -"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد خواهد شد." +"حافظه انباشت اختصاص داده شده برای `name` در انتهای تابع `say_hello` آزاد " +"خواهد شد." #: src/memory-management/move.md msgid "" -"`main` can retain ownership if it passes `name` as a reference (`&name`) and if " -"`say_hello` accepts a reference as a parameter." +"`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` یک مرجع را به عنوان " -"پارامتر باید بپذیرد." +"تابع `main` می‌تواند مالکیت `name` را حفظ کند اگر آن را به عنوان یک مرجع " +"(`&name`) منتقل کند و صد البته که `say_hello` یک مرجع " +"را به عنوان پارامتر باید بپذیرد." #: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" -"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه تابع " -"ای که در نظر داریم (`name.clone()`) منتقل کند." +"به عنوان گزینه دیگر، `main` می‌تواند یک کلون از `name` را در فراخوانی اولیه " +"تابع ای که در نظر داریم (`name.clone()`) منتقل کند." #: src/memory-management/move.md 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++ است که سهوا کپی ایجاد کنیم, زیر به " -"صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است هر جا که " -"لازم هست به صورت صریح کلون را ایجاد کند." +"در زبان Rust سخت‌تر از C++ است که سهوا کپی ایجاد کنیم, " +"زیر به صورت پیش‌فرض از مفهوم «انتقال» استفاده میکنیم و برنامه نویس مجبور است " +"هر جا که لازم هست به صورت صریح کلون را ایجاد کند." #: src/memory-management/move.md msgid "Defensive Copies in Modern C++" @@ -8072,14 +8293,14 @@ msgstr "// Duplicate the data in s1.\n" msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" -"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که این " -"کپی به صورت مستقل است." +"داده‌های انباشت از داده‌های `s1` یک کپی برابر اصل برای `s2` گرفته می‌شود که " +"این کپی به صورت مستقل است." #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت جداگانه‌ای " -"حافظه خود را آزاد میکنند." +"حالا هر موقع `s1` یا `s2` از اسکوپ موردنظرشون خارج شوند هر کدام به صورت " +"جداگانه‌ای حافظه خود را آزاد میکنند." #: src/memory-management/move.md msgid "Before copy-assignment:" @@ -8091,83 +8312,84 @@ msgstr "بعد از انتساب همراه کپی:" #: src/memory-management/move.md msgid "" -"C++ has made a slightly different choice than Rust. Because `=` copies data, the " -"string data has to be cloned. Otherwise we would get a double-free when either " -"string goes out of scope." +"C++ has made a slightly different choice than Rust. Because `=` copies data, " +"the string data has to be cloned. Otherwise we would get a double-free when " +"either string goes out of scope." msgstr "" -"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام داده " -"است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر این صورت، " -"هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه آزادسازی مجدد " -"حافظه رخ دهد." +"زبان C++ انتخاب کمی متفاوت نسبت به زبان Rust انجام " +"داده است. زیرا `=` داده‌ها را کپی می‌کند، داده‌های رشته باید کلون شوند. در غیر " +"این صورت، هر موقع از اسکوپ یکی از آنها خارج شویم امکان به وجود آمدن اشتباه " +"آزادسازی مجدد حافظه رخ دهد." #: src/memory-management/move.md msgid "" -"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), which " -"is used to indicate when a value may be moved from. If the example had been `s2 = " -"std::move(s1)`, no heap allocation would take place. After the move, `s1` would " -"be in a valid but unspecified state. Unlike Rust, the programmer is allowed to " -"keep using `s1`." +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " +"which is used to indicate when a value may be moved from. If the example had " +"been `s2 = std::move(s1)`, no heap allocation would take place. After the " +"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` استفاده کند." +"البته که زبان C++ دارای [`std::move`](https://en.cppreference.com/w/cpp/utility/move) است که برای انتقال " +"یک متغییر استفاده میشود. اگر مثال ما `s2 = std::move(s1)` بود هیچ تخصیص انباشتی صورت نمیگرفت بلکه `s1` در یک وضعیت معتبر البته " +"نامشخص قرار میگرفت و برخلاف زبان Rust, توی زبان C++ " +"برنامه‌نویس مجاز است که دوباره از `s1` استفاده کند." #: src/memory-management/move.md msgid "" -"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which is " -"being copied or moved." +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " +"which is being copied or moved." msgstr "" -"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم انتقال " -"دادن استفاده شود." +"بر خلاف Rust، `=` در C++ می‌تواند برای کپی کردن و هم " +"انتقال دادن استفاده شود." #: src/memory-management/clone.md msgid "" -"Sometimes you _want_ to make a copy of a value. The `Clone` trait accomplishes " -"this." +"Sometimes you _want_ to make a copy of a value. The `Clone` trait " +"accomplishes this." msgstr "" -"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را انجام " -"می‌دهد." +"گاهی اوقات شما _می‌خواهید_ یک نسخه از مقدار بسازید. ویژگی `Clone` این کار را " +"انجام می‌دهد." #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " "occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" -"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به دنبال " -"`()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." +"ایده‌ی `Clone` این است که شناسایی مکان‌های تخصیص حافظه heap آسان‌تر شود. به " +"دنبال `()clone.` و چند مورد دیگر مانند `!vec` یا `Box::new` بگردید." #: src/memory-management/clone.md msgid "" -"It's common to \"clone your way out\" of problems with the borrow checker, and " -"return later to try to optimize those clones away." +"It's common to \"clone your way out\" of problems with the borrow checker, " +"and return later to try to optimize those clones away." msgstr "" -"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی کردن " -"استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." +"معمولاً برای حل مشکلات مربوط به بررسی‌کننده قرض‌گیری (borrow checker) از کپی " +"کردن استفاده می‌شود و سپس در آینده تلاش می‌شود تا آن کپی‌ها بهینه‌سازی شوند." #: src/memory-management/clone.md msgid "" -"`clone` generally performs a deep copy of the value, meaning that if you e.g. " -"clone an array, all of the elements of the array are cloned as well." +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." msgstr "" -"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به عنوان " -"مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." +"`clone` معمولاً یک کپی عمیق از مقدار را انجام می‌دهد، به این معنی که اگر به " +"عنوان مثال یک آرایه را کپی کنید، تمام عناصر آن آرایه نیز کپی خواهند شد." #: src/memory-management/clone.md msgid "" -"The behavior for `clone` is user-defined, so it can perform custom cloning logic " -"if needed." +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." msgstr "" "رفتار `clone` توسط کاربر تعریف می‌شود، بنابراین می‌تواند در صورت نیاز، منطق " "کپی‌برداری سفارشی را اجرا کند." #: src/memory-management/copy-types.md -msgid "While move semantics are the default, certain types are copied by default:" +msgid "" +"While move semantics are the default, certain types are copied by default:" msgstr "" -"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به صورت " -"پیش‌فرض کپی می‌شوند:" +"در حالی که مفهوم انتقال به صورت پیش‌فرض است، در زبان راست چند نوع خاص به " +"صورت پیش‌فرض کپی می‌شوند:" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." @@ -8193,14 +8415,15 @@ msgstr "کپی‌برداری و کلون‌سازی یکسان نیستند:" #: src/memory-management/copy-types.md msgid "" -"Copying refers to bitwise copies of memory regions and does not work on arbitrary " -"objects." +"Copying refers to bitwise copies of memory regions and does not work on " +"arbitrary objects." msgstr "" -"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع تعریف " -"شده توسط شما کار نمی‌کند." +"کپی‌برداری به کپی‌های بیت به بیت از مناطق حافظه اشاره دارد و روی همه انواع " +"تعریف شده توسط شما کار نمی‌کند." #: src/memory-management/copy-types.md -msgid "Copying does not allow for custom logic (unlike copy constructors in C++)." +msgid "" +"Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "کپی‌برداری اجازه منطق سفارشی را نمی‌دهد (بر خلاف کپی constructors در C++)." @@ -8210,12 +8433,13 @@ msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" -"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان رفتار " -"سفارشی را فراهم می‌کند." +"کلون‌سازی یک عملیات عمومی‌تر است و همچنین با پیاده‌سازی ویژگی `Clone` امکان " +"رفتار سفارشی را فراهم می‌کند." #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." -msgstr "کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." +msgstr "" +"کپی‌برداری روی انواع داده‌ای که ویژگی Drop را پیاده سازی کرده اند کار نمی‌کند." #: src/memory-management/copy-types.md msgid "In the above example, try the following:" @@ -8223,19 +8447,19 @@ msgstr "در مثال بالا، موارد زیر را امتحان کنید:" #: src/memory-management/copy-types.md msgid "" -"Add a `String` field to `struct Point`. It will not compile because `String` is " -"not a `Copy` type." +"Add a `String` field to `struct Point`. It will not compile because `String` " +"is not a `Copy` type." msgstr "" -"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` یک " -"نوع `Copy` نیست." +"یک فیلد `String` به `struct Point` اضافه کنید. کامپایل نمی‌شود زیرا `String` " +"یک نوع `Copy` نیست." #: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" -"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` برای " -"`p1` قرار دارد." +"ویژگی `Copy` را از صفت `derive` حذف کنید. اکنون خطای کامپایلر در `!println` " +"برای `p1` قرار دارد." #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." @@ -8243,16 +8467,16 @@ msgstr "نشان دهید که اگر `p1` را به جای کپی آن کلون #: src/memory-management/copy-types.md msgid "" -"Shared references are `Copy`/`Clone`, mutable references are not. This is because " -"rust requires that mutable references be exclusive, so while it's valid to make a " -"copy of a shared reference, creating a copy of a mutable reference would violate " -"Rust's borrowing rules." +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." msgstr "" -"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما ارجاعات " -"قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است که Rust نیاز " -"دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی که کپی کردن یک " -"ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر قوانین قرض‌گیری Rust را " -"نقض می‌کند." +"ارجاعات مشترک (`shared references`) دارای ویژگی `Copy`/`Clone` هستند، اما " +"ارجاعات قابل تغییر (`mutable references`) این‌طور نیستند. این به این دلیل است " +"که Rust نیاز دارد که ارجاعات قابل تغییر منحصر به فرد باشند، بنابراین در حالی " +"که کپی کردن یک ارجاع مشترک معتبر است، ایجاد یک کپی از یک ارجاع قابل تغییر " +"قوانین قرض‌گیری Rust را نقض می‌کند." #: src/memory-management/drop.md msgid "The `Drop` Trait" @@ -8263,8 +8487,9 @@ msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" msgstr "" -"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) را " -"پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا شود:" +"مقادیر که ویژگی [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) " +"را پیاده‌سازی می‌کنند می‌توانند کدی را مشخص کنند که هنگام خروج از دامنه اجرا " +"شود:" #: src/memory-management/drop.md msgid "\"Dropping {}\"" @@ -8301,7 +8526,8 @@ msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." -msgstr "توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." +msgstr "" +"توجه داشته باشید که `std::mem::drop` با `std::ops::Drop::drop` یکسان نیست." #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." @@ -8309,38 +8535,38 @@ msgstr "مقادیر به طور خودکار زمانی که از دامنه خ #: src/memory-management/drop.md msgid "" -"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::drop` " -"implementation will be called." +"When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" +"drop` implementation will be called." msgstr "" -"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را پیاده‌سازی " -"کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." +"زمانی که یک مقدار حذف می‌شود، اگر آن مقدار ویژگی `std::ops::Drop` را " +"پیاده‌سازی کرده باشد، پیاده‌سازی `Drop::drop` آن فراخوانی خواهد شد." #: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" -"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی کرده " -"باشد یا نه." +"تمام فیلدهای آن نیز سپس حذف خواهند شد، چه آن مقدار ویژگی `Drop` را پیاده‌سازی " +"کرده باشد یا نه." #: src/memory-management/drop.md msgid "" -"`std::mem::drop` is just an empty function that takes any value. The significance " -"is that it takes ownership of the value, so at the end of its scope it gets " -"dropped. This makes it a convenient way to explicitly drop values earlier than " -"they would otherwise go out of scope." +"`std::mem::drop` is just an empty function that takes any value. The " +"significance is that it takes ownership of the value, so at the end of its " +"scope it gets dropped. This makes it a convenient way to explicitly drop " +"values earlier than they would otherwise go out of scope." msgstr "" -"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این است که " -"مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. این ویژگی آن " -"را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از دامنه خارج می‌شوند، " -"تبدیل می‌کند." +"`std::mem::drop` یک تابع خالی است که هر مقداری را می‌پذیرد. اهمیت آن در این " +"است که مالکیت مقدار را به عهده می‌گیرد، بنابراین در پایان دامنه‌اش حذف می‌شود. " +"این ویژگی آن را به روشی مناسب برای حذف صریح مقادیر پیش از آنچه که معمولاً از " +"دامنه خارج می‌شوند، تبدیل می‌کند." #: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" -"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد کردن " -"قفل‌ها، بستن فایل‌ها و غیره." +"این می‌تواند برای اشیائی که در هنگام `drop` کاری انجام می‌دهند مفید باشد: آزاد " +"کردن قفل‌ها، بستن فایل‌ها و غیره." #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" @@ -8351,8 +8577,9 @@ msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" -"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که منجر " -"به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack می‌شد!" +"پاسخ کوتاه: اگر این‌طور بود، `std::mem::drop` در پایان بلوک فراخوانی می‌شد که " +"منجر به فراخوانی مجدد `Drop::drop` و ایجاد خطای سرریز (stack overflow) stack " +"می‌شد!" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." @@ -8360,13 +8587,13 @@ msgstr "سعی کنید `drop(a)` را با `()a.drop` جایگزین کنید." #: src/memory-management/exercise.md msgid "" -"In this example, we will implement a complex data type that owns all of its data. " -"We will use the \"builder pattern\" to support building a new value piece-by-" -"piece, using convenience functions." +"In this example, we will implement a complex data type that owns all of its " +"data. We will use the \"builder pattern\" to support building a new value " +"piece-by-piece, using convenience functions." msgstr "" -"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام داده‌های " -"خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید به صورت " -"قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." +"در این مثال، ما یک نوع داده پیچیده را پیاده‌سازی خواهیم کرد که مالک تمام " +"داده‌های خود است. ما از \"الگوی سازنده\" برای پشتیبانی از ساخت یک مقدار جدید " +"به صورت قطعه‌قطعه، با استفاده از توابع کمکی، استفاده خواهیم کرد." #: src/memory-management/exercise.md msgid "Fill in the missing pieces." @@ -8392,7 +8619,8 @@ msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md #, fuzzy -msgid "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" +msgid "" +"/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" @@ -8486,11 +8714,11 @@ msgstr "Rc" #: src/smart-pointers/box.md msgid "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned pointer " -"to data on the heap:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " +"pointer to data on the heap:" msgstr "" -"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک به " -"داده‌های روی heap است:" +"[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) یک اشاره‌گر مالک " +"به داده‌های روی heap است:" #: src/smart-pointers/box.md msgid "\"five: {}\"" @@ -8498,22 +8726,22 @@ msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" -"`Box` implements `Deref`, which means that you can [call methods " -"from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/trait.Deref." -"html#more-on-deref-coercion)." +"`Box` implements `Deref`, which means that you can [call " +"methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" +"trait.Deref.html#more-on-deref-coercion)." msgstr "" "`| Element | 2 | o--+--->| Nil | // | // " -"| :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - - - - " -"- -.\n" +".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " +"- - - - -.\n" ": : : :\n" ": " "list : : :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // | // " -"| :\n" -": +---------+----+----+ : : +---------+----+----+ +------+----+----" -"+ :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" +": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " +"| // | :\n" +": +---------+----+----+ : : +---------+----+----+ +------+----" +"+----+ :\n" ": : : :\n" ": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " +"- - - - -'\n" "```" #: src/smart-pointers/box.md msgid "" -"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be not " -"null." +"`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " +"not null." msgstr "" -"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که هیچ‌گاه " -"تهی (null) نخواهد بود." +"`Box` مانند `std::unique_ptr` در ++C است، با این تفاوت که تضمین شده است که " +"هیچ‌گاه تهی (null) نخواهد بود." #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" @@ -8583,51 +8811,51 @@ msgstr "`Box` می‌تواند زمانی مفید باشد که شما:" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust compiler " -"wants to know an exact size." +"have a type whose size that can't be known at compile time, but the Rust " +"compiler wants to know an exact size." msgstr "" -"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز به " -"دانستن اندازه دقیق آن دارد." +"یک تایپ دارید که اندازه آن در زمان کامپایل مشخص نیست، اما کامپایلر Rust نیاز " +"به دانستن اندازه دقیق آن دارد." #: src/smart-pointers/box.md msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " -"amounts of data on the stack, instead store the data on the heap in a `Box` so " -"only the pointer is moved." +"amounts of data on the stack, instead store the data on the heap in a `Box` " +"so only the pointer is moved." msgstr "" -"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن حجم " -"زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره کنید تا " -"فقط اشاره‌گر منتقل شود." +"می‌خواهید مالکیت مقدار زیادی داده را انتقال دهید. برای جلوگیری از کپی کردن " +"حجم زیادی از داده‌ها در پشته، به جای آن داده‌ها را در heap در یک `Box` ذخیره " +"کنید تا فقط اشاره‌گر منتقل شود." #: src/smart-pointers/box.md msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not be able to compute a fixed size for the struct in " -"memory (the `List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the " +"struct in memory (the `List` would be of infinite size)." msgstr "" -"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل `List` " -"قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه محاسبه کند (زیرا " -"`List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." +"اگر از `Box` استفاده نمی‌کردیم و سعی می‌کردیم یک `List` را مستقیماً در داخل " +"`List` قرار دهیم، کامپایلر نمی‌توانست اندازه ثابتی برای ساختار در حافظه " +"محاسبه کند (زیرا `List` اندازه‌ای بی‌نهایت پیدا می‌کرد)." #: src/smart-pointers/box.md msgid "" -"`Box` solves this problem as it has the same size as a regular pointer and just " -"points at the next element of the `List` in the heap." +"`Box` solves this problem as it has the same size as a regular pointer and " +"just points at the next element of the `List` in the heap." msgstr "" -"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط به " -"عنصر بعدی `List` در heap اشاره می‌کند." +"`Box` این مشکل را حل می‌کند زیرا اندازه‌ای برابر با یک اشاره‌گر عادی دارد و فقط " +"به عنصر بعدی `List` در heap اشاره می‌کند." #: src/smart-pointers/box.md msgid "" -"Remove the `Box` in the List definition and show the compiler error. We get the " -"message \"recursive without indirection\", because for data recursion, we have to " -"use indirection, a `Box` or reference of some kind, instead of storing the value " -"directly." +"Remove the `Box` in the List definition and show the compiler error. We get " +"the message \"recursive without indirection\", because for data recursion, " +"we have to use indirection, a `Box` or reference of some kind, instead of " +"storing the value directly." msgstr "" "`Box` را از تعریف `List` حذف کنید و خطای کامپایلر را نمایش دهید. پیام خطا " -"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون داده‌ها " -"باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره مستقیم " -"مقدار استفاده کنیم." +"\"recursive without indirection\" را دریافت خواهیم کرد، زیرا برای رکورسیون " +"داده‌ها باید از یک روش غیرمستقیم، مانند `Box` یا ارجاعی از نوعی، به جای ذخیره " +"مستقیم مقدار استفاده کنیم." #: src/smart-pointers/box.md msgid "Niche Optimization" @@ -8635,24 +8863,24 @@ msgstr "بهینه سازی Niche" #: src/smart-pointers/box.md msgid "" -"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. This " -"makes `Box` one of the types that allow the compiler to optimize storage of some " -"enums." +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " +"This makes `Box` one of the types that allow the compiler to optimize " +"storage of some enums." msgstr "" -"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/null " -"باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر اجازه " -"می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." +"اگرچه `Box` مشابه `std::unique_ptr` در ++C به نظر می‌رسد، اما نمی‌تواند خالی/" +"null باشد. این ویژگی باعث می‌شود که `Box` یکی از تایپ‌هایی باشد که به کامپایلر " +"اجازه می‌دهد ذخیره‌سازی برخی از `enum`ها را بهینه‌سازی کند." #: src/smart-pointers/box.md msgid "" "For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit tag " -"([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"compiler uses NULL-value to discriminate variants instead of using explicit " +"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" "#representation)):" msgstr "" -"برای مثال، `<`." +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." msgstr "" -"پیش‌تر دیدیم که چگونه می‌توان ازویژگی اشیاء (trait objects) با ارجاعات استفاده کرد، " -"مثلاً `dyn Pet&`. با این حال، می‌توانیم از اشیاء ویژگی با اشاره‌گرهای هوشمند مانند " -"`Box` نیز استفاده کنیم تا یک شیء ویژگی مالک (owned trait object) ایجاد کنیم: " -"`\" : : \"data: Cat\" +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | o " -"| :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" -"+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -8799,45 +9029,45 @@ msgid "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - - " -"-'\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" " | |\n" -" | | \"Program " -"text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - - " -"-.\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk\" " -"| :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk\" " -"| :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " -"-.\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " +"- -.\n" ": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | o " -"| :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----+----" -"+ :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " @@ -8856,32 +9086,32 @@ msgstr "" "+ :\n" " : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - - " -"-'\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" " | |\n" -" | | \"Program " -"text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - - " -"-.\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" -" : | `----->| \"::talk\" " -"| :\n" +" : | `----->| \"::" +"talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" -" : '----------->| \"::talk\" " -"| :\n" +" : '----------->| \"::" +"talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" -" '- - - - - - - - - - - - - - - - - - - - - - " -"-'\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" "```" #: src/smart-pointers/trait-objects.md @@ -8889,44 +9119,45 @@ msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." msgstr "" -"تایپ‌هایی که ویژگی معین را پیاده‌سازی می‌کنند ممکن است اندازه‌های مختلفی داشته باشند. " -"این موضوع باعث می‌شود که داشتن مواردی مانند ` and fill in the missing " "method:" msgstr "" -"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل کنید:" +"کد زیر را به کپی کنید و متد‌های ناقص را تکمیل " +"کنید:" #: src/borrowing/exercise.md msgid "" -"\"Update a user's statistics based on measurements from a visit to the doctor\"" +"\"Update a user's statistics based on measurements from a visit to the " +"doctor\"" msgstr "\"به‌روزرسانی آمار یک کاربر بر اساس اندازه‌گیری معبار بازدید از پزشک\"" #: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md src/android/aidl/example-service/client.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" @@ -9339,23 +9583,23 @@ msgstr "\"من {} هستم و سن من {} است\"" #: src/lifetimes/lifetime-annotations.md msgid "" -"A reference has a _lifetime_, which must not \"outlive\" the value it refers to. " -"This is verified by the borrow checker." +"A reference has a _lifetime_, which must not \"outlive\" the value it refers " +"to. This is verified by the borrow checker." msgstr "" -"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این موضوع " -"توسط بررسی‌کننده قرض‌ها تایید می‌شود." +"یک مرجع دارای _طول عمر_ است که نباید از ارزش مورد اشاره بیشتر باشد. این " +"موضوع توسط بررسی‌کننده قرض‌ها تایید می‌شود." #: src/lifetimes/lifetime-annotations.md msgid "" -"The lifetime can be implicit - this is what we have seen so far. Lifetimes can " -"also be explicit: `&'a Point`, `&'document str`. Lifetimes start with `'` and " -"`'a` is a typical default name. Read `&'a Point` as \"a borrowed `Point` which is " -"valid for at least the lifetime `a`\"." +"The lifetime can be implicit - this is what we have seen so far. Lifetimes " +"can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " +"`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " +"`Point` which is valid for at least the lifetime `a`\"." msgstr "" "طول عمر می‌تواند ضمنی باشد - این همان چیزی است که تا کنون مشاهده کرده‌ایم. طول " -"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با `'` " -"شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک `Point` " -"قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." +"عمرها می‌توانند صریح نیز باشند: `&'a Point`، `&'document str`. طول عمرها با " +"`'` شروع می‌شوند و `'a` نام پیش‌فرض معمولی است. `&'a Point` را به عنوان \"یک " +"`Point` قرضی که برای حداقل طول عمر `a` معتبر است\" بخوانید." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9363,9 +9607,9 @@ msgid "" "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" -"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول عمر " -"را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در صورت وجود " -"ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." +"طول عمرها همیشه توسط کامپایلر استنتاج می‌شوند: شما نمی‌توانید به طور دستی طول " +"عمر را اختصاص دهید. انتساب‌های صریح طول عمر محدودیت‌هایی ایجاد می‌کنند که در " +"صورت وجود ابهام است؛ کامپایلر تأیید می‌کند که یک راه‌حل معتبر وجود دارد." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -9387,14 +9631,15 @@ msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " -"Looking inside the function body shows that it can only safely assume that `p3`'s " -"lifetime is the shorter of `p1` and `p2`. But just like types, Rust requires " -"explicit annotations of lifetimes on function arguments and return values." +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." msgstr "" -"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه کردن به " -"بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر `p3` کوتاه‌تر " -"از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح طول عمرها در " -"آرگومان‌های تابع و مقادیر بازگشتی دارد." +"در این مثال، کامپایلر نمی‌داند که طول عمر `p3` را چگونه استنباط کند. نگاه " +"کردن به بدنه تابع نشان می‌دهد که تنها به‌طور ایمن می‌تواند فرض کند که طول عمر " +"`p3` کوتاه‌تر از `p1` و `p2` است. اما مانند تایپ‌ها، راست نیاز به توضیحات صریح " +"طول عمرها در آرگومان‌های تابع و مقادیر بازگشتی دارد." #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" @@ -9402,17 +9647,18 @@ msgstr "به تابع `left_most` به صورت مناسب `'a` را اضافه #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives for " -"at least `'a`." +"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " +"for at least `'a`." msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " "می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" #: src/lifetimes/lifetime-annotations.md -msgid "In common cases, lifetimes can be elided, as described on the next slide." +msgid "" +"In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید بعدی " -"توضیح داده شده است." +"در موارد معمول، عمر متغیرها می‌تواند نادیده گرفته شود، همانطور که در اسلاید " +"بعدی توضیح داده شده است." #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" @@ -9420,36 +9666,37 @@ msgstr "طول عمر در فراخوانی‌ توابع" #: src/lifetimes/lifetime-elision.md msgid "" -"Lifetimes for function arguments and return values must be fully specified, but " -"Rust allows lifetimes to be elided in most cases with [a few simple rules]" -"(https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not inference " -"-- it is just a syntactic shorthand." +"Lifetimes for function arguments and return values must be fully specified, " +"but Rust allows lifetimes to be elided in most cases with [a few simple " +"rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " +"inference -- it is just a syntactic shorthand." msgstr "" -"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، اما " -"Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc.rust-lang." -"org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله استنتاج نیست -- " -"بلکه تنها یک اصطلاح نوشتاری کوتاه است." +"عمرهای مربوط به آرگومان‌های تابع و مقادیر بازگشتی باید به طور کامل مشخص شوند، " +"اما Rust اجازه می‌دهد عمرها در بیشتر موارد با [چند قانون ساده](https://doc." +"rust-lang.org/nomicon/lifetime-elision.html) نادیده گرفته شوند. این مسئله " +"استنتاج نیست -- بلکه تنها یک اصطلاح نوشتاری کوتاه است." #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" -"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده می‌شود." +"هر آرگومان که فاقد یک lifetime annotation است، یک عمر به آن اختصاص داده " +"می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there is only one argument lifetime, it is given to all un-annotated return " -"values." +"If there is only one argument lifetime, it is given to all un-annotated " +"return values." msgstr "" "اگر تنها یک عمر برای آرگومان وجود داشته باشد، به تمام مقادیر بازگشتی که " "حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "" -"If there are multiple argument lifetimes, but the first one is for `self`, that " -"lifetime is given to all un-annotated return values." +"If there are multiple argument lifetimes, but the first one is for `self`, " +"that lifetime is given to all un-annotated return values." msgstr "" -"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به تمام " -"مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." +"اگر چندین عمر آرگومان وجود داشته باشد و اولین آن برای `self` باشد، آن عمر به " +"تمام مقادیر بازگشتی که حاشیه‌نویسی نشده‌اند، اختصاص داده می‌شود." #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." @@ -9460,46 +9707,50 @@ msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" -"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش نیاز به " -"حاشیه‌نویسی صریح دارد." +"تابع `nearest` مثال دیگری از تابعی است که با ارجاعات متعدد در آرگومان‌هایش " +"نیاز به حاشیه‌نویسی صریح دارد." #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" -"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت داده " -"می‌شوند:" +"امضا را طوری تنظیم کنید که \"دروغ\" بگوید درباره طول عمر مقادیری که برگشت " +"داده می‌شوند:" #: src/lifetimes/lifetime-elision.md msgid "" -"This won't compile, demonstrating that the annotations are checked for validity " -"by the compiler. Note that this is not the case for raw pointers (unsafe), and " -"this is a common source of errors with unsafe Rust." +"This won't compile, demonstrating that the annotations are checked for " +"validity by the compiler. Note that this is not the case for raw pointers " +"(unsafe), and this is a common source of errors with unsafe Rust." msgstr "" -"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط کامپایلر " -"برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای اشاره‌گرهای خام " -"(ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust ناامن است." +"این کد کامپایل نخواهد شد، که نشان‌دهنده این است که برچسب‌های طول عمر توسط " +"کامپایلر برای اعتبارسنجی بررسی می‌شوند. توجه داشته باشید که این وضعیت برای " +"اشاره‌گرهای خام (ناامن) صدق نمی‌کند و این یکی از منابع رایج خطاها در Rust " +"ناامن است." #: src/lifetimes/lifetime-elision.md msgid "" -"Students may ask when to use lifetimes. Rust borrows _always_ have lifetimes. " -"Most of the time, elision and type inference mean these don't need to be written " -"out. In more complicated cases, lifetime annotations can help resolve ambiguity. " -"Often, especially when prototyping, it's easier to just work with owned data by " -"cloning values where necessary." +"Students may ask when to use lifetimes. Rust borrows _always_ have " +"lifetimes. Most of the time, elision and type inference mean these don't " +"need to be written out. In more complicated cases, lifetime annotations can " +"help resolve ambiguity. Often, especially when prototyping, it's easier to " +"just work with owned data by cloning values where necessary." msgstr "" -"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در Rust، " -"_همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ به این معنی " -"است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، برچسب‌های طول عمر " -"می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام پروتوتایپ‌سازی، راحت‌تر است که " -"با داده‌های مالکیت‌شده کار کنید و مقادیر را در صورت لزوم کلون کنید." +"دانش‌آموزان ممکن است بپرسند که چه زمانی باید از طول عمرها استفاده کرد. در " +"Rust، _همیشه_ برای قرض‌ها طول عمر وجود دارد. بیشتر مواقع، حذف و استنباط تایپ " +"به این معنی است که نیازی به نوشتن این طول عمرها نیست. در موارد پیچیده‌تر، " +"برچسب‌های طول عمر می‌توانند به حل ابهام کمک کنند. اغلب، به‌ویژه در هنگام " +"پروتوتایپ‌سازی، راحت‌تر است که با داده‌های مالکیت‌شده کار کنید و مقادیر را در " +"صورت لزوم کلون کنید." #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "Lifetimes in Data Structures" #: src/lifetimes/struct-lifetimes.md -msgid "If a data type stores borrowed data, it must be annotated with a lifetime:" -msgstr "اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" +msgid "" +"If a data type stores borrowed data, it must be annotated with a lifetime:" +msgstr "" +"اگر یک تایپ داده داده‌های قرضی را ذخیره کند، باید با یک طول عمر مشخص شود:" #: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" @@ -9528,27 +9779,27 @@ msgid "" "underlying the contained `&str` lives at least as long as any instance of " "`Highlight` that uses that data." msgstr "" -"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین `str&` " -"به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده می‌کند، زنده " -"بماند." +"در مثال بالا، حاشیه‌نویسی بر روی `Highlight` تضمین می‌کند که داده‌های زیرین " +"`str&` به مدت حداقل برابر با هر نمونه از `Highlight` که از آن داده استفاده " +"می‌کند، زنده بماند." #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the " -"borrow checker throws an error." +"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " +"the borrow checker throws an error." msgstr "" -"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض (borrow " -"checker) خطا می‌دهد." +"اگر `text` قبل از پایان عمر `fox` (یا `dog`) مصرف شود، بررسی‌کننده‌ی قرض " +"(borrow checker) خطا می‌دهد." #: src/lifetimes/struct-lifetimes.md msgid "" -"Types with borrowed data force users to hold on to the original data. This can be " -"useful for creating lightweight views, but it generally makes them somewhat " -"harder to use." +"Types with borrowed data force users to hold on to the original data. This " +"can be useful for creating lightweight views, but it generally makes them " +"somewhat harder to use." msgstr "" -"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا داده‌های " -"اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، اما معمولاً " -"استفاده از آنها را تا حدی دشوارتر می‌کند." +"تایپ‌های دارای داده‌های قرضی (borrowed data) کاربران را مجبور می‌کنند تا " +"داده‌های اصلی را نگه دارند. این می‌تواند برای ایجاد نمایه‌های سبک مفید باشد، " +"اما معمولاً استفاده از آنها را تا حدی دشوارتر می‌کند." #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." @@ -9558,37 +9809,37 @@ msgstr "در صورت امکان، داده‌های ساختارها را به msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " -"relationships between the references themselves, in addition to the lifetime of " -"the struct itself. Those are very advanced use cases." +"relationships between the references themselves, in addition to the lifetime " +"of the struct itself. Those are very advanced use cases." msgstr "" "برخی از ساختارهای داده که شامل چندین ارجاع هستند، ممکن است نیاز به چندین " -"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط عمری بین " -"ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد بسیار پیشرفته " -"هستند." +"نشانه‌گذاری عمر داشته باشند. این امر می‌تواند ضروری باشد اگر بخواهید روابط " +"عمری بین ارجاعات مختلف را به علاوه عمر ساختار خود توصیف کنید. این موارد " +"بسیار پیشرفته هستند." #: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" -"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's simpler " -"than it seems! This illustrates a common parsing pattern, passing slices of data. " -"The underlying data itself is never copied." +"(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " +"simpler than it seems! This illustrates a common parsing pattern, passing " +"slices of data. The underlying data itself is never copied." msgstr "" -"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://protobuf." -"dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این کار ساده‌تر از آن " -"است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در تجزیه داده‌ها است که شامل " -"عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." +"در این تمرین، شما یک تجزیه‌کننده برای [رمزگذاری باینری پروتوباف](https://" +"protobuf.dev/programming-guides/encoding/) خواهید ساخت. نگران نباشید، این " +"کار ساده‌تر از آن است که به نظر می‌رسد! این الگو نشان‌دهنده یک الگوی رایج در " +"تجزیه داده‌ها است که شامل عبور برش‌های داده است. داده‌های اصلی هرگز کپی نمی‌شوند." #: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " -"indexed by their field numbers. That is typically provided in a `proto` file. In " -"this exercise, we'll encode that information into `match` statements in functions " -"that get called for each field." +"indexed by their field numbers. That is typically provided in a `proto` " +"file. In this exercise, we'll encode that information into `match` " +"statements in functions that get called for each field." msgstr "" -"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر اساس " -"شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` ارائه می‌شود. " -"در این تمرین، ما این اطلاعات را به صورت عبارات `match` در توابعی که برای هر فیلد " -"فراخوانی می‌شوند، کدگذاری خواهیم کرد." +"تجزیه کامل یک پیام پروتوباف نیاز به دانستن تایپ‌های این فیلدها دارد که بر " +"اساس شماره‌های فیلد ایندکس شده‌اند. این اطلاعات معمولاً در یک فایل `proto` " +"ارائه می‌شود. در این تمرین، ما این اطلاعات را به صورت عبارات `match` در " +"توابعی که برای هر فیلد فراخوانی می‌شوند، کدگذاری خواهیم کرد." #: src/lifetimes/exercise.md msgid "We'll use the following proto:" @@ -9596,27 +9847,27 @@ msgstr "ما از پروتوباف زیر استفاده خواهیم کرد:" #: src/lifetimes/exercise.md msgid "" -"A proto message is encoded as a series of fields, one after the next. Each is " -"implemented as a \"tag\" followed by the value. The tag contains a field number " -"(e.g., `2` for the `id` field of a `Person` message) and a wire type defining how " -"the payload should be determined from the byte stream." +"A proto message is encoded as a series of fields, one after the next. Each " +"is implemented as a \"tag\" followed by the value. The tag contains a field " +"number (e.g., `2` for the `id` field of a `Person` message) and a wire type " +"defining how the payload should be determined from the byte stream." msgstr "" -"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری می‌شود. هر " -"فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ شامل شماره فیلد " -"(مانند `2` برای فیلد `id` در پیام `Person`) و wire type است که نحوه تعیین بار را " -"از جریان بایت مشخص می‌کند." +"یک پیام پروتوباف به عنوان مجموعه‌ای از فیلدها، یکی پس از دیگری، کدگذاری " +"می‌شود. هر فیلد به صورت یک \"تگ\" به همراه مقدار آن پیاده‌سازی شده است. تگ " +"شامل شماره فیلد (مانند `2` برای فیلد `id` در پیام `Person`) و wire type است " +"که نحوه تعیین بار را از جریان بایت مشخص می‌کند." #: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given code " -"also defines callbacks to handle `Person` and `PhoneNumber` fields, and to parse " -"a message into a series of calls to those callbacks." +"called VARINT. Luckily, `parse_varint` is defined for you below. The given " +"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " +"to parse a message into a series of calls to those callbacks." msgstr "" "اعداد، از جمله تگ، با استفاده از کدگذاری با طول متغیر به نام VARINT نمایندگی " -"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده همچنین " -"بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک پیام به " -"مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." +"می‌شوند. خوشبختانه، تابع `parse_varint` برای شما تعریف شده است. کد داده شده " +"همچنین بازخوانی‌هایی برای مدیریت فیلدهای `Person` و `PhoneNumber` و تجزیه یک " +"پیام به مجموعه‌ای از فراخوانی‌ها به آن بازخوانی‌ها را تعریف می‌کند." #: src/lifetimes/exercise.md msgid "" @@ -9640,26 +9891,32 @@ msgstr "/// The Varint WireType indicates the value is a single VARINT.\n" #, fuzzy msgid "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double type.\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" "/// The I64 WireType indicates that the value is precisely 8 bytes in\n" -" /// little-endian order containing a 64-bit signed integer or double type.\n" +" /// little-endian order containing a 64-bit signed integer or double " +"type.\n" " //I64, -- not needed for this exercise\n" -" /// The Len WireType indicates that the value is a length represented as a\n" +" /// The Len WireType indicates that the value is a length represented as " +"a\n" " /// VARINT followed by exactly that number of bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float type.\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" " //I32, -- not needed for this exercise\n" msgstr "" "// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" // little-endian order containing a 32-bit signed integer or float type.\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" " //I32, -- not needed for this exercise\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -9714,8 +9971,10 @@ msgstr "\"انتظار می‌رود `u64` یک فیلد `Varint` باشد\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy -msgid "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" -msgstr "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgid "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" +msgstr "" +"/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Not enough bytes for varint\"" @@ -9751,8 +10010,10 @@ msgstr "/// Parse a field, returning the remaining bytes\n" #: src/lifetimes/exercise.md msgid "" -"\"Based on the wire type, build a Field, consuming as many bytes as necessary.\"" -msgstr "\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" +"\"Based on the wire type, build a Field, consuming as many bytes as " +"necessary.\"" +msgstr "" +"\"بر اساس نوع سیم، یک فیلد بسازید، با مصرف هر تعداد بایت که لازم است.\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" @@ -9761,12 +10022,14 @@ msgstr "\"فیلد و هر بایت مصرف نشده را برگردانید.\" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" msgstr "" -"/// Parse a message in the given data, calling `T::add_field` for each field in\n" +"/// Parse a message in the given data, calling `T::add_field` for each field " +"in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" @@ -9778,18 +10041,18 @@ msgstr "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" #: src/lifetimes/exercise.md msgid "" -"In this exercise there are various cases where protobuf parsing might fail, e.g. " -"if you try to parse an `i32` when there are fewer than 4 bytes left in the data " -"buffer. In normal Rust code we'd handle this with the `Result` enum, but for " -"simplicity in this exercise we panic if any errors are encountered. On day 4 " -"we'll cover error handling in Rust in more detail." +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." msgstr "" -"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه شود، " -"مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده باقی‌مانده است، " -"تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` مدیریت می‌کنیم، اما " -"برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به جای آن که با `Result` " -"برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، به بررسی دقیق‌تر مدیریت خطا " -"در Rust خواهیم پرداخت." +"در این تمرین موارد مختلفی وجود دارد که ممکن است تجزیه protobuf با شکست مواجه " +"شود، مثلاً اگر بخواهید یک `i32` را هنگامی که کمتر از ۴ بایت در بافر داده " +"باقی‌مانده است، تجزیه کنید. در کد Rust معمولاً این را با استفاده از `Result` " +"مدیریت می‌کنیم، اما برای سادگی در این تمرین، اگر با هرگونه خطا مواجه شویم، به " +"جای آن که با `Result` برخورد کنیم، برنامه را متوقف خواهیم کرد. در روز چهارم، " +"به بررسی دقیق‌تر مدیریت خطا در Rust خواهیم پرداخت." #: src/lifetimes/solution.md msgid "\"len not a valid `usize`\"" @@ -9835,7 +10098,8 @@ msgstr "به روز ۱ خوش آمدید" msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" -"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش خواهیم داد:" +"امروز ما موضوعات مربوط به ساخت نرم افزار در مقیاس بزرگ در Rust را پوشش " +"خواهیم داد:" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." @@ -9854,17 +10118,19 @@ msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "رسیدگی به خطا: panics در `Result` و اپراتور تلاش مجدد `?`." #: src/welcome-day-4.md -msgid "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." +msgid "" +"Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" -"با Unsafe Rust: پنجره فرار مبتنی بر زمان که نمی‌توانید خود را در safe Rust بیان " -"کنید." +"با Unsafe Rust: پنجره فرار مبتنی بر زمان که نمی‌توانید خود را در safe Rust " +"بیان کنید." #: src/welcome-day-4.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 40 " "minutes. It contains:" msgstr "" -"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۴۰ دقیقه طول بکشد. شامل:" +"با احتساب ۱۰ دقیقه استراحت، این جلسه باید حدود ۲ ساعت و ۴۰ دقیقه طول بکشد. " +"شامل:" #: src/iterators.md msgid "Iterator" @@ -9880,15 +10146,16 @@ msgstr "FromIterator" #: src/iterators/iterator.md msgid "" -"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait " -"supports iterating over values in a collection. It requires a `next` method and " -"provides lots of methods. Many standard library types implement `Iterator`, and " -"you can implement it yourself, too:" +"The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait supports iterating over values in a collection. It requires a `next` " +"method and provides lots of methods. Many standard library types implement " +"`Iterator`, and you can implement it yourself, too:" msgstr "" -"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) از " -"تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` نیاز دارد و " -"متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد `Iterator` را " -"پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی کنید:" +"ویژگی ['Iterator'](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"از تکرار بیش از مقادیر در یک مجموعه پشتیبانی می‌کند. این به یک متد `next` " +"نیاز دارد و متدهای زیادی را ارائه می‌کند. بسیاری از انواع کتابخانه استاندارد " +"`Iterator` را پیاده‌سازی می‌کنند و شما نیز می‌توانید آن را خودتان پیاده‌سازی " +"کنید:" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" @@ -9896,40 +10163,41 @@ msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.md msgid "" -"The `Iterator` trait implements many common functional programming operations " -"over collections (e.g. `map`, `filter`, `reduce`, etc). This is the trait where " -"you can find all the documentation about them. In Rust these functions should " -"produce the code as efficient as equivalent imperative implementations." +"The `Iterator` trait implements many common functional programming " +"operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " +"the trait where you can find all the documentation about them. In Rust these " +"functions should produce the code as efficient as equivalent imperative " +"implementations." msgstr "" "ویژگی `Iterator` بسیاری از عملیات برنامه‌نویسی تابعی رایج را روی collectionها " -"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که در آن " -"می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع باید کد را به " -"اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." +"پیاده‌سازی می‌کند (مانند `map`, `filter`, `reduce`,و غیره). این ویژگی است که " +"در آن می‌توانید تمام اسناد مربوط به آنها را پیدا کنید. در Rust، این توابع " +"باید کد را به اندازه پیاده‌سازی‌های ضروری معادل تولید کنند." #: src/iterators/iterator.md msgid "" "`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` and " -"`&[T]`. Ranges also implement it. This is why you can iterate over a vector with " -"`for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." msgstr "" -"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه (collection) " -"توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند `&Vec` و `&[T]` " -"پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین دلیل است که می‌توانید روی " -"یک بردار با `برای i در some_vec { .. }` تکرار کنید، اما درنهایت `some_vec." -"next()`وجود ندارد." +"`IntoIterator` ویژگی است که باعث می‌شود حلقه‌ها کار کنند. این مجموعه " +"(collection) توسط تایپ‌های مجموعه مانند `Vec` و ارجاعاتی به آنها مانند " +"`&Vec` و `&[T]` پیاده‌سازی می‌شود. Ranges نیز آن ‌هارا اجرا می‌کند. به همین " +"دلیل است که می‌توانید روی یک بردار با `برای i در some_vec { .. }` تکرار کنید، " +"اما درنهایت `some_vec.next()`وجود ندارد." #: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/iter/" -"trait.IntoIterator.html) defines how to create an iterator for a type. It is used " -"automatically by the `for` loop." +"iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) defines how to create an iterator for a type. " +"It is used automatically by the `for` loop." msgstr "" -"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، _iterate_ " -"کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait." -"IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص می‌کند. به طور " -"خودکار توسط حلقه `for` استفاده می‌شود." +"ویژگی `Iterator` به شما می‌گوید که چگونه پس از ایجاد یک تکرار کننده، " +"_iterate_ کنید. ویژگی مرتبط [`IntoIterator`](https://doc.rust-lang.org/std/" +"iter/trait.IntoIterator.html) نحوه ایجاد یک تکرار کننده برای یک نوع را مشخص " +"می‌کند. به طور خودکار توسط حلقه `for` استفاده می‌شود." #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" @@ -9940,8 +10208,8 @@ msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" -"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع را " -"اعلام کند:" +"روی مستندات`IntoIterator` کلیک کنید. هر پیاده‌سازی `IntoIterator` باید دو نوع " +"را اعلام کند:" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," @@ -9957,8 +10225,9 @@ msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" -"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده (iterator) " -"باید همان `Item` type را داشته باشد، به این معنی که `Option` را برمی‌گرداند." +"توجه داشته باشید که `IntoIter` و`Item` به هم link شده‌اند: تکرار‌کننده " +"(iterator) باید همان `Item` type را داشته باشد، به این معنی که " +"`Option` را برمی‌گرداند." #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." @@ -9969,36 +10238,36 @@ msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" -"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ توجه " -"داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." +"سعی کنید دو بار روی شبکه در `main` تکرار کنید. چرا این گزینه شکست می‌خورد؟ " +"توجه داشته باشید که `IntoIterator::into_iter` مالکیت `self` را می‌گیرد." #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a reference " -"to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " +"reference to the `Grid` in `GridIter`." msgstr "" #: src/iterators/intoiterator.md msgid "" -"The same problem can occur for standard library types: `for e in some_vector` " -"will take ownership of `some_vector` and iterate over owned elements from that " -"vector. Use `for e in &some_vector` instead, to iterate over references to " -"elements of `some_vector`." +"The same problem can occur for standard library types: `for e in " +"some_vector` will take ownership of `some_vector` and iterate over owned " +"elements from that vector. Use `for e in &some_vector` instead, to iterate " +"over references to elements of `some_vector`." msgstr "" -"همین مشکل می‌تواند برای انواع کتابخانه استاندارد رخ دهد: `برای e در some_vector` " -"مالکیت `some_vector` را در اختیار می‌گیرد و روی عناصر متعلق به آن بردار تکرار " -"می‌شود. به جای آن از `e در &some_vector` برای تکرار بر روی ارجاعات به عناصر " -"`some_vector` استفاده کنید." +"همین مشکل می‌تواند برای انواع کتابخانه استاندارد رخ دهد: `برای e در " +"some_vector` مالکیت `some_vector` را در اختیار می‌گیرد و روی عناصر متعلق به " +"آن بردار تکرار می‌شود. به جای آن از `e در &some_vector` برای تکرار بر روی " +"ارجاعات به عناصر `some_vector` استفاده کنید." #: src/iterators/fromiterator.md msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) lets " -"you build a collection from an [`Iterator`](https://doc.rust-lang.org/std/iter/" -"trait.Iterator.html)." +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" +"std/iter/trait.Iterator.html)." msgstr "" "گزینه [`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator." -"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/iter/" -"trait.Iterator.html) یک مجموعه یا collection بسازید." +"html) به شما امکان می دهد از یک [`Iterator`](https://doc.rust-lang .org/std/" +"iter/trait.Iterator.html) یک مجموعه یا collection بسازید." #: src/iterators/fromiterator.md #, fuzzy @@ -10015,59 +10284,64 @@ msgstr "دو راه برای تعیین`B` برای این روش وجود دا #: src/iterators/fromiterator.md msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as shown. " -"The `_` shorthand used here lets Rust infer the type of the `Vec` elements." +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." msgstr "" -"با کمک \"turbofish\": `some_iterator.collect::()`، همانطور که " -"نشان داده شده است و به طور خلاصه `_` استفاده شده در اینجا به Rust امکان می‌دهد نوع " -"عناصر \"Vec\" را استنتاج کند." +"با کمک \"turbofish\": `some_iterator.collect::()`، همانطور " +"که نشان داده شده است و به طور خلاصه `_` استفاده شده در اینجا به Rust امکان " +"می‌دهد نوع عناصر \"Vec\" را استنتاج کند." #: src/iterators/fromiterator.md msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" -"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. این " -"مثال را برای استفاده از این فرم بازنویسی کنید." +"با نوع inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"این مثال را برای استفاده از این فرم بازنویسی کنید." #: src/iterators/fromiterator.md msgid "" "There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things like " -"convert an `Iterator>` into a `Result, E>`." +"There are also more specialized implementations which let you do cool things " +"like convert an `Iterator>` into a `Result, E>`." msgstr "" -"پیاده‌سازی‌های اولیه `FromIterator` برای`Vec`, `HashMap` و غیره وجود دارد. همچنین " -"پیاده‌سازی‌های تخصصی‌تری وجود دارد که به شما امکان می‌دهد کارهای جالبی مانند تبدیل " -"`Iterator>` به یک `Result, E>` انجام دهید." +"پیاده‌سازی‌های اولیه `FromIterator` برای`Vec`, `HashMap` و غیره وجود دارد. " +"همچنین پیاده‌سازی‌های تخصصی‌تری وجود دارد که به شما امکان می‌دهد کارهای جالبی " +"مانند تبدیل `Iterator>` به یک `Result, E>` انجام " +"دهید." #: src/iterators/exercise.md msgid "" -"In this exercise, you will need to find and use some of the provided methods in " -"the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) trait to " -"implement a complex calculation." +"In this exercise, you will need to find and use some of the provided methods " +"in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " +"trait to implement a complex calculation." msgstr "" -"در این تمرین، باید برخی از روش های ارائه شده در [`Iterator`](https://doc.rust-" -"lang.org/std/iter/trait.Iterator.html) را برای پیاده‌سازی یک ویژگی پیدا کنید و از " -"آنها برای محاسبه پیچیده استفاده کنید." +"در این تمرین، باید برخی از روش های ارائه شده در [`Iterator`](https://doc." +"rust-lang.org/std/iter/trait.Iterator.html) را برای پیاده‌سازی یک ویژگی پیدا " +"کنید و از آنها برای محاسبه پیچیده استفاده کنید." #: src/iterators/exercise.md msgid "" -"Copy the following code to and make the tests pass. " -"Use an iterator expression and `collect` the result to construct the return value." +"Copy the following code to and make the tests " +"pass. Use an iterator expression and `collect` the result to construct the " +"return value." msgstr "" -"کد زیر را در کپی کنید و تست ها را قبول کنید. از یک " -"عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) کنید تا " -"مقدار بازگشتی را بسازید." +"کد زیر را در کپی کنید و تست ها را قبول کنید. از " +"یک عبارت تکرارکننده (iterator) استفاده کنید و نتیجه را جمع‌آوری (`collect`) " +"کنید تا مقدار بازگشتی را بسازید." #: src/iterators/exercise.md src/iterators/solution.md #, fuzzy msgid "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -"/// Calculate the differences between elements of `values` offset by `offset`,\n" +"/// Calculate the differences between elements of `values` offset by " +"`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" @@ -10079,14 +10353,14 @@ msgstr "use, super, self" #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" -"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را به " -"یک type تبدیل کنیم." +"دیده‌ایم که چگونه بلوک‌های `impl` به ما اجازه می‌دهند تا namespace functions را " +"به یک type تبدیل کنیم." #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "" -"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت داشته " -"باشیم:" +"به طور مشابه، `mod` به ما اجازه می‌دهد تا توابع و namespace type به این صورت " +"داشته باشیم:" #: src/modules/modules.md msgid "\"In the foo module\"" @@ -10098,36 +10372,38 @@ msgstr "\"در ماژول نواری\"" #: src/modules/modules.md msgid "" -"Packages provide functionality and include a `Cargo.toml` file that describes how " -"to build a bundle of 1+ crates." +"Packages provide functionality and include a `Cargo.toml` file that " +"describes how to build a bundle of 1+ crates." msgstr "" -"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` می‌شوند که " -"نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." +"بسته‌ها یا Packageهای عملکردی را ارائه می‌کنند و شامل یک فایل`Cargo.toml` " +"می‌شوند که نحوه ساخت بسته‌ای از crateهای 1+ را شرح می‌دهد." #: src/modules/modules.md msgid "" -"Crates are a tree of modules, where a binary crate creates an executable and a " -"library crate compiles to a library." +"Crates are a tree of modules, where a binary crate creates an executable and " +"a library crate compiles to a library." msgstr "" -"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل اجرایی " -"ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." +"در واقع Crateها درختی از ماژول‌ها هستند که در آن یک crate باینری یک فایل " +"اجرایی ایجاد می‌کند و یک crate کتابخانه در یک کتابخانه کامپایل می‌شود." #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." msgstr "ماژول‌های organization، scope، و تمرکز این بخش را تعریف می‌کنند." #: src/modules/filesystem.md -msgid "Omitting the module content will tell Rust to look for it in another file:" +msgid "" +"Omitting the module content will tell Rust to look for it in another file:" msgstr "حذف محتوای ماژول به Rust می‌گوید که آن را در فایل دیگری جستجو کند:" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden.rs`. " -"Similarly, a `garden::vegetables` module can be found at `src/garden/vegetables." -"rs`." +"This tells rust that the `garden` module content is found at `src/garden." +"rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" +"vegetables.rs`." msgstr "" -"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به طور " -"مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables.rs` یافت." +"این به rust می‌گوید که محتوای ماژول `garden` در`src/garden.rs`یافت می‌شود. به " +"طور مشابه، ماژول `garden::vegetables` را می‌توان در `src/garden/vegetables." +"rs` یافت." #: src/modules/filesystem.md msgid "The `crate` root is in:" @@ -10143,19 +10419,23 @@ msgstr "`src/main.rs` (for a binary crate)" #: src/modules/filesystem.md msgid "" -"Modules defined in files can be documented, too, using \"inner doc comments\". " -"These document the item that contains them -- in this case, a module." +"Modules defined in files can be documented, too, using \"inner doc " +"comments\". These document the item that contains them -- in this case, a " +"module." msgstr "" -"ماژول‌های تعریف‌شده در فایل‌ها را نیز می‌توان با استفاده از «کامنت‌های مستند داخلی» " -"مستند کرد. اینها موردی را که حاوی آنها است - در این مورد، یک ماژول مستند می‌کنند." +"ماژول‌های تعریف‌شده در فایل‌ها را نیز می‌توان با استفاده از «کامنت‌های مستند " +"داخلی» مستند کرد. اینها موردی را که حاوی آنها است - در این مورد، یک ماژول " +"مستند می‌کنند." #: src/modules/filesystem.md #, fuzzy msgid "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" msgstr "" -"//! This module implements the garden, including a highly performant germination\n" +"//! This module implements the garden, including a highly performant " +"germination\n" "//! implementation.\n" #: src/modules/filesystem.md @@ -10183,21 +10463,22 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"The main reason to introduce `filename.rs` as alternative to `filename/mod.rs` " -"was because many files named `mod.rs` can be hard to distinguish in IDEs." +"The main reason to introduce `filename.rs` as alternative to `filename/mod." +"rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" -"دلیل اصلی معرفی `filename.rs` به‌عنوان جایگزین `filename/mod.rs` این بود که تشخیص " -"بسیاری از فایل‌ها با نام `mod.rs` در IDE‌ها دشوار است." +"دلیل اصلی معرفی `filename.rs` به‌عنوان جایگزین `filename/mod.rs` این بود که " +"تشخیص بسیاری از فایل‌ها با نام `mod.rs` در IDE‌ها دشوار است." #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" -"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول اصلی یک " -"فایل باشد:" +"لانه‌گزینی(nesting) عمیق‌تر می‌تواند از folderها استفاده کند، حتی اگر ماژول " +"اصلی یک فایل باشد:" #: src/modules/filesystem.md msgid "" -"The place rust will look for modules can be changed with a compiler directive:" +"The place rust will look for modules can be changed with a compiler " +"directive:" msgstr "" "مکانی که rust به دنبال ماژول‌ها می‌گردد را می‌توان با دستور کامپایلر تغییر داد:" @@ -10207,11 +10488,12 @@ msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" -"This is useful, for example, if you would like to place tests for a module in a " -"file named `some_module_test.rs`, similar to the convention in Go." +"This is useful, for example, if you would like to place tests for a module " +"in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" "برای مثال، اگر می‌خواهید تست‌هایی را برای یک ماژول در فایلی به نام " -"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در Go." +"`some_module_test.rs` قرار دهید، مفید است، شبیه به قرارداد (convention) در " +"Go." #: src/modules/visibility.md msgid "Modules are a privacy boundary:" @@ -10220,7 +10502,8 @@ msgstr "ماژول‌ها یک مرز حریم خصوصی هستند:" #: src/modules/visibility.md msgid "Module items are private by default (hides implementation details)." msgstr "" -"گزینه‌های ماژول به طور پیش‌فرض private هستند (جزئیات پیاده سازی را پنهان می‌کند)." +"گزینه‌های ماژول به طور پیش‌فرض private هستند (جزئیات پیاده سازی را پنهان " +"می‌کند)." #: src/modules/visibility.md msgid "Parent and sibling items are always visible." @@ -10228,11 +10511,11 @@ msgstr "کزینه‌های sibling و sibling همیشه قابل مشاهده #: src/modules/visibility.md msgid "" -"In other words, if an item is visible in module `foo`, it's visible in all the " -"descendants of `foo`." +"In other words, if an item is visible in module `foo`, it's visible in all " +"the descendants of `foo`." msgstr "" -"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه فرزندان`foo` " -"قابل مشاهده است." +"به عبارت دیگر، اگر یک مورد در ماژول `foo` قابل مشاهده باشد، در همه " +"فرزندان`foo` قابل مشاهده است." #: src/modules/visibility.md msgid "\"outer::private\"" @@ -10256,11 +10539,11 @@ msgstr "از کلمه کلیدی `pub` برای public کردن ماژول‌ه #: src/modules/visibility.md msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of " -"public visibility." +"Additionally, there are advanced `pub(...)` specifiers to restrict the scope " +"of public visibility." msgstr "" -"علاوه بر این، مشخص‌کننده‌های پیشرفته `pub(...)` برای محدود کردن دامنه دید عمومی " -"وجود دارد." +"علاوه بر این، مشخص‌کننده‌های پیشرفته `pub(...)` برای محدود کردن دامنه دید " +"عمومی وجود دارد." #: src/modules/visibility.md msgid "" @@ -10280,14 +10563,15 @@ msgstr "این مورد کمتر متداول است، شما می‌توانی #: src/modules/visibility.md msgid "" -"In any case, visibility must be granted to an ancestor module (and all of its " -"descendants)." -msgstr "در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." +"In any case, visibility must be granted to an ancestor module (and all of " +"its descendants)." +msgstr "" +"در هر صورت، قابلیت دیدن باید به یک ماژول والد (و همه فرزندان آن) داده شود." #: src/modules/paths.md msgid "" -"A module can bring symbols from another module into scope with `use`. You will " -"typically see something like this at the top of each module:" +"A module can bring symbols from another module into scope with `use`. You " +"will typically see something like this at the top of each module:" msgstr "" #: src/modules/paths.md @@ -10324,55 +10608,56 @@ msgstr "یک `bar::foo` به `foo` در `bar` crate اشاره دارد." #: src/modules/paths.md msgid "" -"It is common to \"re-export\" symbols at a shorter path. For example, the top-" -"level `lib.rs` in a crate might have" +"It is common to \"re-export\" symbols at a shorter path. For example, the " +"top-level `lib.rs` in a crate might have" msgstr "" -"این\"re-export\" نمادها در مسیر کوتاه‌تری معمول است. برای مثال، `lib.rs` سطح بالا " -"در یک crate ممکن است داشته باشد" +"این\"re-export\" نمادها در مسیر کوتاه‌تری معمول است. برای مثال، `lib.rs` سطح " +"بالا در یک crate ممکن است داشته باشد" #: src/modules/paths.md msgid "" "making `DiskStorage` and `NetworkStorage` available to other crates with a " "convenient, short path." msgstr "" -"در دسترس قرار دادن `DiskStorage` و `NetworkStorage` برای سایر crateها با یک مسیر " -"راحت و کوتاه." +"در دسترس قرار دادن `DiskStorage` و `NetworkStorage` برای سایر crateها با یک " +"مسیر راحت و کوتاه." #: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " -"However, a trait must be in scope to call any methods on that trait, even if a " -"type implementing that trait is already in scope. For example, to use the " -"`read_to_string` method on a type implementing the `Read` trait, you need to `use " -"std::io::Read`." +"However, a trait must be in scope to call any methods on that trait, even if " +"a type implementing that trait is already in scope. For example, to use the " +"`read_to_string` method on a type implementing the `Read` trait, you need to " +"`use std::io::Read`." msgstr "" #: src/modules/paths.md msgid "" -"The `use` statement can have a wildcard: `use std::io::*`. This is discouraged " -"because it is not clear which items are imported, and those might change over " -"time." +"The `use` statement can have a wildcard: `use std::io::*`. This is " +"discouraged because it is not clear which items are imported, and those " +"might change over time." msgstr "" -"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع شده " -"است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر کنند." +"عبارت `use` می‌تواند دارای علامت عام باشد: `use std::io::*`. از این کار منع " +"شده است زیرا مشخص نیست کدام موارد import می‌شوند و ممکن است در طول زمان تغییر " +"کنند." #: src/modules/exercise.md msgid "" -"In this exercise, you will reorganize a small GUI Library implementation. This " -"library defines a `Widget` trait and a few implementations of that trait, as well " -"as a `main` function." +"In this exercise, you will reorganize a small GUI Library implementation. " +"This library defines a `Widget` trait and a few implementations of that " +"trait, as well as a `main` function." msgstr "" -"در این تمرین، یک پیاده‌سازی کتابخانه GUI کوچک را دوباره سازماندهی خواهید کرد. این " -"کتابخانه یک ویژگی`Widget` و چند پیاده‌سازی از آن ویژگی و همچنین یک تابع `main` را " -"تعریف می‌کند." +"در این تمرین، یک پیاده‌سازی کتابخانه GUI کوچک را دوباره سازماندهی خواهید کرد. " +"این کتابخانه یک ویژگی`Widget` و چند پیاده‌سازی از آن ویژگی و همچنین یک تابع " +"`main` را تعریف می‌کند." #: src/modules/exercise.md msgid "" "It is typical to put each type or set of closely-related types into its own " "module, so each widget type should get its own module." msgstr "" -"معمول است که هر نوع یا مجموعه‌ای از انواع مرتبط نزدیک را در ماژول خود قرار دهید، " -"بنابراین هر نوع ویجت باید ماژول خاص خود را داشته باشد." +"معمول است که هر نوع یا مجموعه‌ای از انواع مرتبط نزدیک را در ماژول خود قرار " +"دهید، بنابراین هر نوع ویجت باید ماژول خاص خود را داشته باشد." #: src/modules/exercise.md #, fuzzy @@ -10384,16 +10669,16 @@ msgid "" "The Rust playground only supports one file, so you will need to make a Cargo " "project on your local filesystem:" msgstr "" -"یک Rust playground فقط از یک فایل پشتیبانی می‌کند، بنابراین باید یک پروژه Cargo " -"را در سیستم فایل محلی خود ایجاد کنید:" +"یک Rust playground فقط از یک فایل پشتیبانی می‌کند، بنابراین باید یک پروژه " +"Cargo را در سیستم فایل محلی خود ایجاد کنید:" #: src/modules/exercise.md msgid "" "Edit the resulting `src/main.rs` to add `mod` statements, and add additional " "files in the `src` directory." msgstr "" -"این `src/main.rs` حاصل را ویرایش کنید تا عبارات `mod` را اضافه کنید و فایل‌های " -"اضافی را در دایرکتوری `src` اضافه کنید." +"این `src/main.rs` حاصل را ویرایش کنید تا عبارات `mod` را اضافه کنید و " +"فایل‌های اضافی را در دایرکتوری `src` اضافه کنید." #: src/modules/exercise.md msgid "Source" @@ -10430,10 +10715,12 @@ msgstr "// Add 4 paddings for borders\n" #: src/modules/exercise.md #, fuzzy msgid "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" -"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use the\n" +"// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " +"the\n" " // ?-operator here instead of .unwrap().\n" #: src/modules/exercise.md src/modules/solution.md @@ -10479,12 +10766,12 @@ msgstr "\"Click me!\"" #: src/modules/exercise.md msgid "" -"Encourage students to divide the code in a way that feels natural for them, and " -"get accustomed to the required `mod`, `use`, and `pub` declarations. Afterward, " -"discuss what organizations are most idiomatic." +"Encourage students to divide the code in a way that feels natural for them, " +"and get accustomed to the required `mod`, `use`, and `pub` declarations. " +"Afterward, discuss what organizations are most idiomatic." msgstr "" -"دانش‌آموزان را تشویق کنید تا کد را به‌گونه‌ای تقسیم کنند که برایشان طبیعی است و به " -"اعلان‌های `mod`, `use` و `pub`عادت کنند. پس از آن، در مورد اینکه چه " +"دانش‌آموزان را تشویق کنید تا کد را به‌گونه‌ای تقسیم کنند که برایشان طبیعی است و " +"به اعلان‌های `mod`, `use` و `pub`عادت کنند. پس از آن، در مورد اینکه چه " "organizationهایی idiomatic هستند بحث کنید." #: src/modules/solution.md @@ -10581,13 +10868,13 @@ msgstr "تست‌های یکپارچه‌سازی از طریق دایرکتور #: src/testing/unit-tests.md msgid "" -"Tests are marked with `#[test]`. Unit tests are often put in a nested `tests` " -"module, using `#[cfg(test)]` to conditionally compile them only when building " -"tests." +"Tests are marked with `#[test]`. Unit tests are often put in a nested " +"`tests` module, using `#[cfg(test)]` to conditionally compile them only when " +"building tests." msgstr "" -"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` تودرتو " -"قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت مشروط تنها در " -"هنگام build تست‌ها کامپایل کنند." +"تست‌ها با `#[test]`علامت‌گذاری شده‌اند. تست‌های واحد اغلب در یک ماژول `tests` " +"تودرتو قرار می‌گیرند و از `#[cfg(test)]` استفاده می‌کنند تا آنها را به صورت " +"مشروط تنها در هنگام build تست‌ها کامپایل کنند." #: src/testing/unit-tests.md msgid "\"Hello World\"" @@ -10599,7 +10886,8 @@ msgstr "این به شما امکان می‌دهد تا private helper را آ #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." -msgstr "ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." +msgstr "" +"ویژگی `#[cfg(test)]` تنها زمانی فعال است که `cargo test` را اجرا کنید." #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." @@ -10657,7 +10945,8 @@ msgstr "" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." -msgstr "بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." +msgstr "" +"بلوک‌های کد در commentها `///` به طور خودکار به عنوان کد Rust دیده می‌شوند." #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." @@ -10665,7 +10954,8 @@ msgstr "این کد به عنوان بخشی از `cargo test` کامپایل و #: src/testing/other.md msgid "" -"Adding `#` in the code will hide it from the docs, but will still compile/run it." +"Adding `#` in the code will hide it from the docs, but will still compile/" +"run it." msgstr "" #: src/testing/other.md @@ -10674,49 +10964,49 @@ msgid "" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" "کد بالا را در [Rust Playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) تست " -"کنید." +"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " +"تست کنید." #: src/testing/lints.md msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful built-in " -"lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even more lints, " -"organized into groups that can be enabled per-project." +"The Rust compiler produces fantastic error messages, as well as helpful " +"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " +"more lints, organized into groups that can be enabled per-project." msgstr "" "کامپایلر Rust پیام‌های خطای جالب و همچنین built-in lint مناسبی تولید می‌کند. " -"[Clippy](https://doc.rust-lang.org/clippy/) که lintهای بیشتری را ارائه می‌دهد، که " -"در گروه‌هایی سازماندهی شده‌اند که می‌توانند در هر پروژه فعال شوند." +"[Clippy](https://doc.rust-lang.org/clippy/) که lintهای بیشتری را ارائه " +"می‌دهد، که در گروه‌هایی سازماندهی شده‌اند که می‌توانند در هر پروژه فعال شوند." #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب است، " -"درست است؟ {}\"" +"\"\"X احتمالاً در یک u16 مناسب است، درست است؟ {}\"X احتمالاً در یک u16 مناسب " +"است، درست است؟ {}\"" #: src/testing/lints.md msgid "" -"Run the code sample and examine the error message. There are also lints visible " -"here, but those will not be shown once the code compiles. Switch to the " -"Playground site to show those lints." +"Run the code sample and examine the error message. There are also lints " +"visible here, but those will not be shown once the code compiles. Switch to " +"the Playground site to show those lints." msgstr "" -"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل مشاهده " -"هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن lintها به " -"سایت Playground بروید." +"نمونه کد را اجرا کنید و پیام خطا را بررسی کنید. lintهایی نیز در اینجا قابل " +"مشاهده هستند، اما پس از کامپایل شدن کد، آن‌ها نشان‌داده نمی‌شوند. برای نمایش آن " +"lintها به سایت Playground بروید." #: src/testing/lints.md msgid "" -"After resolving the lints, run `clippy` on the playground site to show clippy " -"warnings. Clippy has extensive documentation of its lints, and adds new lints " -"(including default-deny lints) all the time." +"After resolving the lints, run `clippy` on the playground site to show " +"clippy warnings. Clippy has extensive documentation of its lints, and adds " +"new lints (including default-deny lints) all the time." msgstr "" #: src/testing/lints.md msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` or " -"via your editor." +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " +"or via your editor." msgstr "" -"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با `cargo " -"fix` یا از طریق ویرایشگر خود برطرف کرد." +"توجه داشته باشید که خطاها یا هشدارهای مربوط به `help: ...` را می‌توان با " +"`cargo fix` یا از طریق ویرایشگر خود برطرف کرد." #: src/testing/exercise.md msgid "Luhn Algorithm" @@ -10724,13 +11014,14 @@ msgstr "الگوریتم Luhn" #: src/testing/exercise.md msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used to " -"validate credit card numbers. The algorithm takes a string as input and does the " -"following to validate the credit card number:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " +"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) برای اعتبارسنجی " -"شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به عنوان ورودی " -"دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را انجام می‌دهد:" +"[الگوریتم Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) برای " +"اعتبارسنجی شماره‌های کارت اعتباری استفاده می‌شود. این الگوریتم یک رشته را به " +"عنوان ورودی دریافت می‌کند و برای اعتبارسنجی شماره کارت اعتباری مراحل زیر را " +"انجام می‌دهد:" #: src/testing/exercise.md #, fuzzy @@ -10739,11 +11030,12 @@ msgstr "تمام فضاها را نادیده بگیرید.شماره‌هایی #: src/testing/exercise.md 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`." +"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` را دوبل می‌کنیم." +"با حرکت از سمت راست رشته به چپ، هر دومین رقم را دوبل کنید: برای شماره " +"`1234`، `3` و `1` را دوبل می‌کنیم. برای شماره `98765`، `6` و `8` را دوبل " +"می‌کنیم." #: src/testing/exercise.md msgid "" @@ -10764,9 +11056,9 @@ msgstr "اگر مجموع با ‍`0` خاتمه یابد، شماره کارت #: src/testing/exercise.md msgid "" -"The provided code provides a buggy implementation of the luhn algorithm, along " -"with two basic unit tests that confirm that most of the algorithm is implemented " -"correctly." +"The provided code provides a buggy implementation of the luhn algorithm, " +"along with two basic unit tests that confirm that most of the algorithm is " +"implemented correctly." msgstr "" "کد ارائه شده یک پیاده‌سازی باگ از الگوریتم luhn را به همراه دو unit test پایه " "ارائه می‌کند که تأیید می‌کند بیشتر الگوریتم به درستی پیاده‌سازی شده است." @@ -10774,11 +11066,12 @@ msgstr "" #: src/testing/exercise.md #, fuzzy msgid "" -"Copy the code below to and write additional tests " -"to uncover bugs in the provided implementation, fixing any bugs you find." +"Copy the code below to and write additional " +"tests to uncover bugs in the provided implementation, fixing any bugs you " +"find." msgstr "" -"کد زیر را به کپی کنید و تابع " -"را پیاده‌سازی کنید." +"کد زیر را به کپی کنید و " +"تابع را پیاده‌سازی کنید." #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" @@ -10860,7 +11153,8 @@ msgid "" "Including 10 minute breaks, this session should take about 2 hours and 15 " "minutes. It contains:" msgstr "" -"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن شامل:" +"با احتساب 10 دقیقه استراحت، این جلسه باید حدود 2 ساعت و 5 دقیقه طول بکشد. آن " +"شامل:" #: src/error-handling.md #, fuzzy @@ -10909,21 +11203,24 @@ msgstr "پنیک‌های خاص می‌توانند از ماکرو `panic!` ا #: src/error-handling/panics.md msgid "" -"A panic will \"unwind\" the stack, dropping values just as if the functions had " -"returned." +"A panic will \"unwind\" the stack, dropping values just as if the functions " +"had returned." msgstr "" #: src/error-handling/panics.md -msgid "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." +msgid "" +"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" -"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده کنید." +"اگر خرابی قابل قبول نیست، از APIهای بدون panic (مانند `Vec::get`) استفاده " +"کنید." #: src/error-handling/panics.md msgid "" -"By default, a panic will cause the stack to unwind. The unwinding can be caught:" +"By default, a panic will cause the stack to unwind. The unwinding can be " +"caught:" msgstr "" -"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان گرفت( در " -"واقع منظور این است که می‌توان آن را caught کرد):" +"به طور پیش‌فرض، panic باعث unwind شدن stack می‌شود. unwinding را می‌توان " +"گرفت( در واقع منظور این است که می‌توان آن را caught کرد):" #: src/error-handling/panics.md msgid "\"No problem here!\"" @@ -10939,86 +11236,92 @@ msgstr "\"oh no!\"" #: src/error-handling/panics.md msgid "" -"Catching is unusual; do not attempt to implement exceptions with `catch_unwind`!" +"Catching is unusual; do not attempt to implement exceptions with " +"`catch_unwind`!" msgstr "" "گرفتن (Catching) غیر معمول است. سعی نکنید exceptionها را با `catch_unwind` " "پیاده‌سازی کنید!" #: src/error-handling/panics.md msgid "" -"This can be useful in servers which should keep running even if a single request " -"crashes." +"This can be useful in servers which should keep running even if a single " +"request crashes." msgstr "" -"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، باید به " -"کار خود ادامه دهند." +"این کار می‌تواند در سرورهایی مفید باشد که حتی در صورت خراب شدن یک درخواست، " +"باید به کار خود ادامه دهند." #: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" -"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار نمی‌کند." +"اگر `panic = 'abort'` در `Cargo.toml`» شما تنظیم شده باشد، این مورد کار " +"نمی‌کند." #: src/error-handling/result.md msgid "" -"Our primary mechanism for error handling in Rust is the [`Result`](https://doc." -"rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly saw when " -"discussing standard library types." +"Our primary mechanism for error handling in Rust is the [`Result`](https://" +"doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " +"saw when discussing standard library types." msgstr "" -"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-lang." -"org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث در مورد " -"تایپ‌های کتابخانه استاندارد مشاهده کردیم." +"مکانیسم اصلی ما برای مدیریت خطا در Rust، فهرست [`Result`](https://doc.rust-" +"lang.org/stable/std/result/enum.Result.html) است، که به طور خلاصه هنگام بحث " +"در مورد تایپ‌های کتابخانه استاندارد مشاهده کردیم." #: src/error-handling/result.md msgid "" -"`Result` has two variants: `Ok` which contains the success value, and `Err` which " -"contains an error value of some kind." +"`Result` has two variants: `Ok` which contains the success value, and `Err` " +"which contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" -"Whether or not a function can produce an error is encoded in the function's type " -"signature by having the function return a `Result` value." +"Whether or not a function can produce an error is encoded in the function's " +"type signature by having the function return a `Result` value." msgstr "" -"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با برگرداندن " -"تابع مقدار `Result` کدگذاری می‌شود." +"اینکه آیا یک تابع می‌تواند خطا ایجاد کند یا نه، در signature نوع تابع با " +"برگرداندن تابع مقدار `Result` کدگذاری می‌شود." #: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " -"access either the success value or the error value without first pattern matching " -"on the `Result` to check which variant you have. Methods like `unwrap` make it " -"easier to write quick-and-dirty code that doesn't do robust error handling, but " -"means that you can always see in your source code where proper error handling is " -"being skipped." -msgstr "" -"مانند `Option`، هیچ راهی برای فراموش کردن خطا وجود ندارد: شما نمی‌توانید به مقدار " -"موفقیت یا مقدار خطا بدون تطبیق الگوی اولیه در `Result` دسترسی پیدا کنید تا بررسی " -"کنید کدام نوع را دارید. روش‌هایی مانند`unwrap` نوشتن کدهای سریع و کثیف را آسان‌تر " -"می‌کنند که مدیریت خطا را به خوبی انجام نمی‌دهد، اما به این معنی است که همیشه " -"می‌توانید در کد منبع خود ببینید که در کجا مدیریت صحیح خطا نادیده گرفته می‌شود." +"access either the success value or the error value without first pattern " +"matching on the `Result` to check which variant you have. Methods like " +"`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " +"error handling, but means that you can always see in your source code where " +"proper error handling is being skipped." +msgstr "" +"مانند `Option`، هیچ راهی برای فراموش کردن خطا وجود ندارد: شما نمی‌توانید به " +"مقدار موفقیت یا مقدار خطا بدون تطبیق الگوی اولیه در `Result` دسترسی پیدا " +"کنید تا بررسی کنید کدام نوع را دارید. روش‌هایی مانند`unwrap` نوشتن کدهای " +"سریع و کثیف را آسان‌تر می‌کنند که مدیریت خطا را به خوبی انجام نمی‌دهد، اما به " +"این معنی است که همیشه می‌توانید در کد منبع خود ببینید که در کجا مدیریت صحیح " +"خطا نادیده گرفته می‌شود." #: src/error-handling/result.md msgid "" -"It may be helpful to compare error handling in Rust to error handling conventions " -"that students may be familiar with from other programming languages." +"It may be helpful to compare error handling in Rust to error handling " +"conventions that students may be familiar with from other programming " +"languages." msgstr "" -"مقایسه مدیریت خطا در Rust با قراردادهای مدیریت خطا که دانش‌آموزان ممکن است با سایر " -"زبان‌های برنامه‌نویسی آشنا باشند، ممکن است مفید باشد." +"مقایسه مدیریت خطا در Rust با قراردادهای مدیریت خطا که دانش‌آموزان ممکن است با " +"سایر زبان‌های برنامه‌نویسی آشنا باشند، ممکن است مفید باشد." #: src/error-handling/result.md msgid "Many languages use exceptions, e.g. C++, Java, Python." msgstr "" -"بسیاری از زبان‌ها از exceptionها استفاده می‌کنند، به عنوان مثال. ++C، جاوا، پایتون." +"بسیاری از زبان‌ها از exceptionها استفاده می‌کنند، به عنوان مثال. ++C، جاوا، " +"پایتون." #: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " -"exception is not visible as part of its type signature. This generally means that " -"you can't tell when calling a function if it may throw an exception or not." +"exception is not visible as part of its type signature. This generally means " +"that you can't tell when calling a function if it may throw an exception or " +"not." msgstr "" -"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند یا " -"نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور کلی به " -"این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن است یک " -"exception ایجاد کند یا خیر." +"در اکثر زبان‌های دارای exception، این که آیا یک تابع می‌تواند استثنا ایجاد کند " +"یا نه، به عنوان بخشی از نوع امضای(signature) آن قابل مشاهده نیست. این به طور " +"کلی به این معنی است که هنگام فراخوانی یک تابع نمی‌توانید بگویید که آیا ممکن " +"است یک exception ایجاد کند یا خیر." #: src/error-handling/result.md msgid "" @@ -11026,9 +11329,9 @@ msgid "" "block is reached. An error originating deep in the call stack may impact an " "unrelated function further up." msgstr "" -"استثناها معمولاً call stack را باز می‌کنند و تا رسیدن به بلوک `try` به سمت بالا " -"منتشر می‌شوند. خطایی که در اعماق call stack ایجاد می‌شود ممکن است بر عملکرد نامرتبط " -"بیشتر تأثیر بگذارد." +"استثناها معمولاً call stack را باز می‌کنند و تا رسیدن به بلوک `try` به سمت " +"بالا منتشر می‌شوند. خطایی که در اعماق call stack ایجاد می‌شود ممکن است بر " +"عملکرد نامرتبط بیشتر تأثیر بگذارد." #: src/error-handling/result.md msgid "Error Numbers" @@ -11036,33 +11339,34 @@ msgstr "شماره‌های خطا" #: src/error-handling/result.md msgid "" -"Some languages have functions return an error number (or some other error value) " -"separately from the successful return value of the function. Examples include C " -"and Go." +"Some languages have functions return an error number (or some other error " +"value) separately from the successful return value of the function. Examples " +"include C and Go." msgstr "" -"برخی از زبان‌ها دارای توابعی هستند که یک عدد خطا (یا مقداری خطای دیگر) را جدا از " -"مقدار بازگشت موفقیت‌آمیز تابع برمی‌گردانند. به عنوان مثال می توان به C و Go اشاره " -"کرد." +"برخی از زبان‌ها دارای توابعی هستند که یک عدد خطا (یا مقداری خطای دیگر) را جدا " +"از مقدار بازگشت موفقیت‌آمیز تابع برمی‌گردانند. به عنوان مثال می توان به C و Go " +"اشاره کرد." #: src/error-handling/result.md msgid "" -"Depending on the language it may be possible to forget to check the error value, " -"in which case you may be accessing an uninitialized or otherwise invalid success " -"value." +"Depending on the language it may be possible to forget to check the error " +"value, in which case you may be accessing an uninitialized or otherwise " +"invalid success value." msgstr "" -"بسته به زبان ممکن است فراموش کنید مقدار خطا را بررسی کنید، در این صورت ممکن است " -"به یک مقدار موفقیت نامعتبر یا نامعتبر دسترسی داشته باشید." +"بسته به زبان ممکن است فراموش کنید مقدار خطا را بررسی کنید، در این صورت ممکن " +"است به یک مقدار موفقیت نامعتبر یا نامعتبر دسترسی داشته باشید." #: src/error-handling/try.md msgid "" -"Runtime errors like connection-refused or file-not-found are handled with the " -"`Result` type, but matching this type on every call can be cumbersome. The try-" -"operator `?` is used to return errors to the caller. It lets you turn the common" +"Runtime errors like connection-refused or file-not-found are handled with " +"the `Result` type, but matching this type on every call can be cumbersome. " +"The try-operator `?` is used to return errors to the caller. It lets you " +"turn the common" msgstr "" -"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» مدیریت " -"می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` برای " -"برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا موارد " -"مشترک را بازگردانید." +"خطاهای زمان اجرا مانند connection-refused یا file-not-found با نوع «نتیجه» " +"مدیریت می‌شوند، اما تطبیق این نوع در هر تماس می‌تواند دشوار باشد. اپراتور `?` " +"برای برگرداندن خطاها به تماس گیرنده استفاده می‌شود. این به شما امکان می‌دهد تا " +"موارد مشترک را بازگردانید." #: src/error-handling/try.md msgid "into the much simpler" @@ -11099,19 +11403,20 @@ msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" -"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، فایل " -"خالی، فایل با نام کاربری." +"از فراخوانی `fs::write` برای آزمایش سناریوهای مختلف استفاده کنید: بدون فایل، " +"فایل خالی، فایل با نام کاربری." #: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process::Termination`. In practice, this means that `E` implements `Debug`. The " -"executable will print the `Err` variant and return a nonzero exit status on error." +"process::Termination`. In practice, this means that `E` implements `Debug`. " +"The executable will print the `Err` variant and return a nonzero exit status " +"on error." msgstr "" -"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را پیاده‌سازی " -"کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است که `E` " -"پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند و در صورت " -"خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." +"توجه داشته باشید که `main` تا زمانی که `std::process::Termination` را " +"پیاده‌سازی کند، می‌تواند `نتیجه<(), E>` را برگرداند. در عمل، این بدان معنی است " +"که `E` پیاده‌سازی `Debug` را انجام‌می‌دهد. فایل اجرایی، نوع `Err` را چاپ می‌کند " +"و در صورت خطا، وضعیت خروج غیر صفر (nonzero) را برمی‌گرداند." #: src/error-handling/try-conversions.md msgid "" @@ -11125,13 +11430,13 @@ msgstr "به طو مشابه کار می‌کند" #: src/error-handling/try-conversions.md msgid "" -"The `From::from` call here means we attempt to convert the error type to the type " -"returned by the function. This makes it easy to encapsulate errors into higher-" -"level errors." +"The `From::from` call here means we attempt to convert the error type to the " +"type returned by the function. This makes it easy to encapsulate errors into " +"higher-level errors." msgstr "" -"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را به " -"نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح بالاتر " -"کپسوله شوند." +"فراخوانی `From::from` در اینجا به این معنی است که ما سعی می کنیم نوع خطا را " +"به نوع بازگشتی توسط تابع تبدیل کنیم. این باعث می‌شود که خطاها به خطاهای سطح " +"بالاتر کپسوله شوند." #: src/error-handling/try-conversions.md msgid "\"IO error: {e}\"" @@ -11149,37 +11454,38 @@ msgstr "//std::fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " -"function. For `Result`, it means that the error types have to be compatible. A " -"function that returns `Result` can only use `?` on a value of type " -"`Result` if `ErrorOuter` and `ErrorInner` are the same type or if " -"`ErrorOuter` implements `From`." +"function. For `Result`, it means that the error types have to be compatible. " +"A function that returns `Result` can only use `?` on a value " +"of type `Result` if `ErrorOuter` and `ErrorInner` are the " +"same type or if `ErrorOuter` implements `From`." msgstr "" -"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به این " -"معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` را " -"برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` " -"استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا اگر `ErrorOuter` " -"از` را پیاده‌سازی کند." +"عملگر `?` باید مقداری سازگار با نوع بازگشتی تابع برگرداند. برای `Result`، به " +"این معنی است که انواع خطا باید سازگار باشند. تابعی که`Result` " +"را برمی‌گرداند، تنها می‌تواند از `?` در مقداری از تایپ‌های `Result` استفاده کند اگر `ErrorOuter` و `ErrorInner` یک نوع باشند یا " +"اگر `ErrorOuter` از` را پیاده‌سازی کند." #: src/error-handling/try-conversions.md msgid "" -"A common alternative to a `From` implementation is `Result::map_err`, especially " -"when the conversion only happens in one place." +"A common alternative to a `From` implementation is `Result::map_err`, " +"especially when the conversion only happens in one place." msgstr "" #: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " -"`Option` can use the `?` operator on `Option` for arbitrary `T` and `U` " -"types." +"`Option` can use the `?` operator on `Option` for arbitrary `T` and " +"`U` types." msgstr "" -"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی گرداند " -"می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` استفاده کند." +"هیچ الزامی برای سازگاری `Option` وجود ندارد. تابعی که `Option` را برمی " +"گرداند می تواند از عملگر `?` در `Option` برای انواع دلخواه `T` و `U` " +"استفاده کند." #: src/error-handling/try-conversions.md msgid "" "A function that returns `Result` cannot use `?` on `Option` and vice versa. " -"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` turns " -"`Result` into `Option`." +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" #: src/error-handling/error.md @@ -11188,13 +11494,14 @@ msgstr "انواع خطاهای Dynamic" #: src/error-handling/error.md msgid "" -"Sometimes we want to allow any type of error to be returned without writing our " -"own enum covering all the different possibilities. The `std::error::Error` trait " -"makes it easy to create a trait object that can contain any error." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" "گاهی اوقات می‌خواهیم اجازه دهیم هر نوع خطای بدون نوشتن enum خودمان که تمام " -"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد یک " -"object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." +"احتمالات مختلف را پوشش می‌دهد، برگردانده شود. ویژگی `std::error::Error` ایجاد " +"یک object مشخ استه که می‌تواند حاوی هر خطایی باشد را آسان می‌کند." #: src/error-handling/error.md msgid "\"count.dat\"" @@ -11214,35 +11521,37 @@ msgstr "\"Error: {err}\"" #: src/error-handling/error.md msgid "" -"The `read_count` function can return `std::io::Error` (from file operations) or " -"`std::num::ParseIntError` (from `String::parse`)." +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" "تابع `read_count`می‌تواند `std::io::Error` (از عملیات فایل) یا `std::num::" "ParseIntError` (از `String::parse`) را برگرداند." #: src/error-handling/error.md msgid "" -"Boxing errors saves on code, but gives up the ability to cleanly handle different " -"error cases differently in the program. As such it's generally not a good idea to " -"use `Box` in the public API of a library, but it can be a good option " -"in a program where you just want to display the error message somewhere." +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" -"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای مختلف " -"را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از `Box` " -"در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه خوبی در برنامه‌ای باشد " -"که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." +"خطاهای Boxing باعث صرفه‌جویی در کد می شود، اما توانایی رسیدگی به موارد خطای " +"مختلف را به طور متفاوت در برنامه از بین می‌برد. به این ترتیب استفاده از " +"`Box` در public API یک کتابخانه ایده خوبی نیست، اما می‌تواند گزینه " +"خوبی در برنامه‌ای باشد که فقط می‌خواهید پیام خطا را در جایی نمایش دهید." #: src/error-handling/error.md msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom error " -"type so it can be boxed. But if you need to support the `no_std` attribute, keep " -"in mind that the `std::error::Error` trait is currently compatible with `no_std` " -"in [nightly](https://github.com/rust-lang/rust/issues/103765) only." +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed. But if you need to support the `no_std` " +"attribute, keep in mind that the `std::error::Error` trait is currently " +"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" +"issues/103765) only." msgstr "" -"هنگام تعریف یک نوع خطای سفارشی، مطمئن شوید که ویژگی `std::error::Error` را اجرا " -"کنید تا بتوان آن را در جعبه قرار داد. اما اگر نیاز به پشتیبانی از ویژگی `no_std` " -"دارید، به خاطر داشته باشید که ویژگی `std::error::Error` در حال حاضر با `no_std` " -"در [nightly](https://github.com/rust-lang) سازگار است." +"هنگام تعریف یک نوع خطای سفارشی، مطمئن شوید که ویژگی `std::error::Error` را " +"اجرا کنید تا بتوان آن را در جعبه قرار داد. اما اگر نیاز به پشتیبانی از ویژگی " +"`no_std` دارید، به خاطر داشته باشید که ویژگی `std::error::Error` در حال حاضر " +"با `no_std` در [nightly](https://github.com/rust-lang) سازگار است." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11250,7 +11559,8 @@ msgid "" "anyhow/) crates are widely used to simplify error handling." msgstr "" "این [`thiserror`](https://docs.rs/thiserror/) و [`anyhow`](https://docs.rs/" -"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده می‌شوند." +"anyhow/) crateها به طور گسترده ای برای ساده کردن رسیدگی به خطا استفاده " +"می‌شوند." #: src/error-handling/thiserror-and-anyhow.md msgid "" @@ -11260,8 +11570,8 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow` is often used by applications to help with error handling in functions, " -"including adding contextual information to your errors." +"`anyhow` is often used by applications to help with error handling in " +"functions, including adding contextual information to your errors." msgstr "" " اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " "اطلاعات متنی به خطاهای شما، استفاده می‌شود." @@ -11300,8 +11610,8 @@ msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید زیادی " -"برای کمک به تعریف انواع خطا به روشی فشرده است." +"ماکرو استخراج `Error` توسط `thiserror` ارائه می‌شود و دارای ویژگی‌های مفید " +"زیادی برای کمک به تعریف انواع خطا به روشی فشرده است." #: src/error-handling/thiserror-and-anyhow.md msgid "The `std::error::Error` trait is derived automatically." @@ -11317,13 +11627,13 @@ msgstr "`anyhow`" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such it's " -"again generally not a good choice for the public API of a library, but is widely " -"used in applications." +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" -" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این ترتیب " -"معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده در " -"برنامه‌های مختلف استفاده می‌شود." +" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " +"ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " +"در برنامه‌های مختلف استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." @@ -11336,39 +11646,41 @@ msgstr "" #: src/error-handling/thiserror-and-anyhow.md msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go developers, " -"as it provides similar usage patterns and ergonomics to `(T, error)` from Go." +"Functionality provided by `anyhow::Result` may be familiar to Go " +"developers, as it provides similar usage patterns and ergonomics to `(T, " +"error)` from Go." msgstr "" "عملکرد ارائه شده توسط `anyhow::Result` ممکن است برای توسعه‌دهندگان Go آشنا " -"باشد، زیرا الگوهای استفاده و ارگونومی مشابهی را با `(T, error)` از Go ارائه می‌دهد." +"باشد، زیرا الگوهای استفاده و ارگونومی مشابهی را با `(T, error)` از Go ارائه " +"می‌دهد." #: src/error-handling/thiserror-and-anyhow.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and `Option` " -"types. `use anyhow::Context` is necessary to enable `.context()` and `." -"with_context()` on those types." +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" -"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و `Option` " -"پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `.context()` و `." -"with_context()` در آن typeها ضروری است." +"`anyhow::Context` یک ویژگی است که برای typeهای استاندارد `Result` و " +"`Option` پیاده‌سازی شده است. `use anyhow::Context` برای فعال کردن `." +"context()` و `.with_context()` در آن typeها ضروری است." #: src/error-handling/exercise.md msgid "" "The following implements a very simple parser for an expression language. " "However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to use " -"`thiserror` and `anyhow`." +"error handling and propagate errors to a return from `main`. Feel free to " +"use `thiserror` and `anyhow`." msgstr "" -"در زیر یک تجزیه‌کننده بسیار ساده برای یک زبان عبارت پیاده‌سازی می‌کند. با این حال، " -"با panic خطاها را کنترل می‌کند. آن را بازنویسی کنید تا به جای آن از مدیریت خطای " -"اصطلاحی استفاده کنید و خطاها را به بازگشت از `main` منتشر کنید. با خیال راحت از " -"`thiserror` و `anyhow` استفاده کنید." +"در زیر یک تجزیه‌کننده بسیار ساده برای یک زبان عبارت پیاده‌سازی می‌کند. با این " +"حال، با panic خطاها را کنترل می‌کند. آن را بازنویسی کنید تا به جای آن از " +"مدیریت خطای اصطلاحی استفاده کنید و خطاها را به بازگشت از `main` منتشر کنید. " +"با خیال راحت از `thiserror` و `anyhow` استفاده کنید." #: src/error-handling/exercise.md msgid "" "HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement `Iterator>` and handle that in the parser." +"working correctly, update `Tokenizer` to implement " +"`Iterator>` and handle that in the parser." msgstr "" "نکته: با رفع خطا در عملکرد `parse` شروع کنید. هنگامی که به درستی کار کرد، " "`Tokenizer` را برای پیاده‌سازی `Iterator>` " @@ -11472,28 +11784,31 @@ msgstr "زبان Rust دو بخش دارد:" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "" -"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان پذیر " -"نیست." +"در **Safe Rust:** حافظه ایمن یا memory safe، هیچ رفتار تعریف نشده‌ای امکان " +"پذیر نیست." #: src/unsafe-rust/unsafe.md msgid "" -"**Unsafe Rust:** can trigger undefined behavior if preconditions are violated." -msgstr "در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." +"**Unsafe Rust:** can trigger undefined behavior if preconditions are " +"violated." +msgstr "" +"در **Unsafe Rust:** در صورت نقض پیش‌شرط‌ها، می‌تواند باعث رفتار نامشخص شود." #: src/unsafe-rust/unsafe.md msgid "" -"We saw mostly safe Rust in this course, but it's important to know what Unsafe " -"Rust is." +"We saw mostly safe Rust in this course, but it's important to know what " +"Unsafe Rust is." msgstr "" -"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust چیست." +"ما عمدتاً safe Rust را در این دوره دیدیم، اما مهم است که بدانیم Unsafe Rust " +"چیست." #: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" -"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در یک " -"لایه انتزاعی ایمن پیچیده می‌شود." +"کد ناامن معمولا کوچک و ایزوله است و صحت آن باید به دقت مستند شود. معمولاً در " +"یک لایه انتزاعی ایمن پیچیده می‌شود." #: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" @@ -11522,22 +11837,24 @@ msgstr "ویژگی‌های `unsafe` را اجرا کنید." #: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" -"rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" -"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً به " -"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-" -"rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." +"در ادامه به طور خلاصه به قابلیت‌های unsafe می‌پردازیم. برای جزئیات کامل، لطفاً " +"به [Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" +"unsafe-rust.html) و [Rustonomicon](https://doc.rust-lang.org/nomicon/)." #: src/unsafe-rust/unsafe.md msgid "" -"Unsafe Rust does not mean the code is incorrect. It means that developers have " -"turned off some compiler safety features and have to write correct code by " -"themselves. It means the compiler no longer enforces Rust's memory-safety rules." +"Unsafe Rust does not mean the code is incorrect. It means that developers " +"have turned off some compiler safety features and have to write correct code " +"by themselves. It means the compiler no longer enforces Rust's memory-safety " +"rules." msgstr "" "همینطور Unsafe Rust به این معنی نیست که کد نادرست است. این بدان معنی است که " -"توسعه‌دهندگان برخی از ویژگی‌های ایمنی کامپایلر را خاموش کرده‌اند و باید کد صحیح را " -"خودشان بنویسند. این بدان معناست که کامپایلر دیگر قواعد ایمنی Rust را اجرا نمی‌کند." +"توسعه‌دهندگان برخی از ویژگی‌های ایمنی کامپایلر را خاموش کرده‌اند و باید کد صحیح " +"را خودشان بنویسند. این بدان معناست که کامپایلر دیگر قواعد ایمنی Rust را اجرا " +"نمی‌کند." #: src/unsafe-rust/dereferencing.md msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" @@ -11551,13 +11868,15 @@ msgstr "\"مراقب باش!\"" #, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" -" // be non-null and properly aligned, the objects underlying the references\n" +" // be non-null and properly aligned, the objects underlying the " +"references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" @@ -11592,9 +11911,9 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"It is good practice (and required by the Android Rust style guide) to write a " -"comment for each `unsafe` block explaining how the code inside it satisfies the " -"safety requirements of the unsafe operations it is doing." +"It is good practice (and required by the Android Rust style guide) to write " +"a comment for each `unsafe` block explaining how the code inside it " +"satisfies the safety requirements of the unsafe operations it is doing." msgstr "" "این تمرین خوبی است (و طبق راهنمای سبک Android Rust لازم است) برای هر بلوک " "`unsafe` یک نظر بنویسید و توضیح دهد که چگونه کد داخل آن الزامات ایمنی عملیات " @@ -11605,8 +11924,8 @@ msgid "" "In the case of pointer dereferences, this means that the pointers must be " "[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" -"در مورد عدم ارجاع اشاره‌گر، این بدان معنی است که نشانگرها باید [_valid_](https://" -"doc.rust-lang.org/std/ptr/index.html#safety) باشند، یعنی:" +"در مورد عدم ارجاع اشاره‌گر، این بدان معنی است که نشانگرها باید [_valid_]" +"(https://doc.rust-lang.org/std/ptr/index.html#safety) باشند، یعنی:" #: src/unsafe-rust/dereferencing.md msgid "The pointer must be non-null." @@ -11614,9 +11933,10 @@ msgstr "اشاره‌گر باید غیر تهی یا non-null باشد." #: src/unsafe-rust/dereferencing.md msgid "" -"The pointer must be _dereferenceable_ (within the bounds of a single allocated " -"object)." -msgstr "اشاره‌گر باید _dereferenceable_ باشد (در محدوده یک object اختصاص داده شده)." +"The pointer must be _dereferenceable_ (within the bounds of a single " +"allocated object)." +msgstr "" +"اشاره‌گر باید _dereferenceable_ باشد (در محدوده یک object اختصاص داده شده)." #: src/unsafe-rust/dereferencing.md msgid "The object must not have been deallocated." @@ -11628,11 +11948,11 @@ msgstr "دسترسی همزمان به یک مکان نباید وجود داش #: src/unsafe-rust/dereferencing.md msgid "" -"If the pointer was obtained by casting a reference, the underlying object must be " -"live and no reference may be used to access the memory." +"If the pointer was obtained by casting a reference, the underlying object " +"must be live and no reference may be used to access the memory." msgstr "" -"اگر اشاره‌گر با فرستادن یک reference به دست آمده باشد، object زیرین باید live باشد " -"و نمی‌توان از هیچ مرجعی برای دسترسی به حافظه استفاده کرد." +"اگر اشاره‌گر با فرستادن یک reference به دست آمده باشد، object زیرین باید live " +"باشد و نمی‌توان از هیچ مرجعی برای دسترسی به حافظه استفاده کرد." #: src/unsafe-rust/dereferencing.md msgid "In most cases the pointer must also be properly aligned." @@ -11640,13 +11960,14 @@ msgstr "در بیشتر موارد، اشاره‌گر نیز باید به در #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` has " -"the `'static` lifetime, so `r3` has type `&'static String`, and thus outlives " -"`s`. Creating a reference from a pointer requires _great care_." +"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " +"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " +"outlives `s`. Creating a reference from a pointer requires _great care_." msgstr "" -"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` دارای " -"طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است و بنابراین " -"عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت بسیار دارد." +"بخش «NOT SAFE» نمونه‌ای از یک نوع رایج از اشکال UB را ارائه می‌کند: `*r1` " +"دارای طول عمر `'static` است، بنابراین `r3` دارای نوع `&'static String` است " +"و بنابراین عمر `s` بیشتر می‌شود. ایجاد یک مرجع از یک اشاره گر نیاز به دقت " +"بسیار دارد." #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" @@ -11670,8 +11991,10 @@ msgstr "" #: src/unsafe-rust/mutable-static.md #, fuzzy -msgid "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" -msgstr "// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" #: src/unsafe-rust/mutable-static.md msgid "\"COUNTER: {COUNTER}\"" @@ -11680,29 +12003,30 @@ msgstr "\"COUNTER: {COUNTER}\"" #: src/unsafe-rust/mutable-static.md msgid "" "The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the `unsafe` and " -"see how the compiler explains that it is undefined behavior to mutate a static " -"from multiple threads." +"compiler is conservative and will assume the worst. Try removing the " +"`unsafe` and see how the compiler explains that it is undefined behavior to " +"mutate a static from multiple threads." msgstr "" -"برنامه در اینجا امن است زیرا single-thread است. با این حال، کامپایلر Rust محافظه " -"کار است و بدترین‌ها را در نظر می‌گیرد. `unsafe` را حذف کنید و ببینید چگونه " -"کامپایلر توضیح می‌دهد که جهش یک static از چندین thread یک رفتار تعریف نشده است." +"برنامه در اینجا امن است زیرا single-thread است. با این حال، کامپایلر Rust " +"محافظه کار است و بدترین‌ها را در نظر می‌گیرد. `unsafe` را حذف کنید و ببینید " +"چگونه کامپایلر توضیح می‌دهد که جهش یک static از چندین thread یک رفتار تعریف " +"نشده است." #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases where it " -"might make sense in low-level `no_std` code, such as implementing a heap " -"allocator or working with some C APIs." +"Using a mutable static is generally a bad idea, but there are some cases " +"where it might make sense in low-level `no_std` code, such as implementing a " +"heap allocator or working with some C APIs." msgstr "" -"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما مواردی " -"وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند اجرای یک heap " -"allocator یا کار با برخی از APIهای مربوط به زبان C." +"استفاده از یک static قابل تغییر (mutable) به طور کلی ایده بدی است، اما " +"مواردی وجود دارد که ممکن است در کدهای سطح پایین `no_std` منطقی باشد، مانند " +"اجرای یک heap allocator یا کار با برخی از APIهای مربوط به زبان C." #: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" msgstr "" -"همینطور Unionها مانند enum‌ها هستند، اما شما باید خودتان active field را ردیابی " -"کنید:" +"همینطور Unionها مانند enum‌ها هستند، اما شما باید خودتان active field را " +"ردیابی کنید:" #: src/unsafe-rust/unions.md msgid "\"int: {}\"" @@ -11719,23 +12043,24 @@ msgstr "هیچ رفتار تعریف نشده‌ای در زمان اجرا:" #: src/unsafe-rust/unions.md msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They are " -"occasionally needed for interacting with C library APIs." +"Unions are very rarely needed in Rust as you can usually use an enum. They " +"are occasionally needed for interacting with C library APIs." msgstr "" -"به طور کلی Unionها در Rust به ندرت مورد نیاز هستند زیرا معمولاً می‌توانید از enum " -"استفاده کنید. آنها گاهی اوقات برای تعامل با APIهای کتابخانه C مورد نیاز هستند." +"به طور کلی Unionها در Rust به ندرت مورد نیاز هستند زیرا معمولاً می‌توانید از " +"enum استفاده کنید. آنها گاهی اوقات برای تعامل با APIهای کتابخانه C مورد نیاز " +"هستند." #: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " -"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute." -"html) or a safe wrapper such as the [`zerocopy`](https://crates.io/crates/" -"zerocopy) crate." +"[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." +"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" +"crates/zerocopy) crate." msgstr "" -"اگر فقط می‌خواهید بایت‌ها را به‌عنوان نوع متفاوتی تفسیر کنید، احتمالاً [`std::mem::" -"transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute.html را " -"می‌خواهید ) یا یک safe wrapper مانند جعبه [`zerocopy`(https://crates.io/crates/" -"zerocopy)." +"اگر فقط می‌خواهید بایت‌ها را به‌عنوان نوع متفاوتی تفسیر کنید، احتمالاً [`std::" +"mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn.transmute.html " +"را می‌خواهید ) یا یک safe wrapper مانند جعبه [`zerocopy`(https://crates.io/" +"crates/zerocopy)." #: src/unsafe-rust/unsafe-functions.md msgid "Calling Unsafe Functions" @@ -11743,8 +12068,8 @@ msgstr "فراخوانی متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"A function or method can be marked `unsafe` if it has extra preconditions you " -"must uphold to avoid undefined behaviour:" +"A function or method can be marked `unsafe` if it has extra preconditions " +"you must uphold to avoid undefined behaviour:" msgstr "" #: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md @@ -11809,8 +12134,8 @@ msgstr "نوشتن متدهای ناامن" #: src/unsafe-rust/unsafe-functions.md msgid "" -"You can mark your own functions as `unsafe` if they require particular conditions " -"to avoid undefined behaviour." +"You can mark your own functions as `unsafe` if they require particular " +"conditions to avoid undefined behaviour." msgstr "" "اگر عملکردهای خود را برای جلوگیری از رفتار نامشخص به شرایط خاصی نیاز دارند، " "می‌توانید به‌عنوان`unsafe` علامت‌گذاری کنید." @@ -11842,45 +12167,46 @@ msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different reason: " -"it is an external function (FFI). Calling external functions is usually only a " -"problem when those functions do things with pointers which might violate Rust's " -"memory model, but in general any C function might have undefined behaviour under " -"any arbitrary circumstances." +"create UB if the range is incorrect. `abs` is incorrect for a different " +"reason: it is an external function (FFI). Calling external functions is " +"usually only a problem when those functions do things with pointers which " +"might violate Rust's memory model, but in general any C function might have " +"undefined behaviour under any arbitrary circumstances." msgstr "" "تابع `get_unchecked`، مانند اکثر توابع `_unchecked`، ناامن است، زیرا اگر در " -"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: این " -"یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است که آن " -"توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه Rust را نقض " -"کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه رفتار نامشخصی داشته " -"باشد." +"محدوده نادرست باشد، می‌تواند یک UB ایجاد کند. `abs` به دلیل دیگری نادرست است: " +"این یک تابع خارجی (FFI) است. فراخوانی توابع خارجی معمولاً زمانی مشکل‌ساز است " +"که آن توابع کارهایی را با اشاره‌گرهایی انجام می‌دهند که ممکن است مدل حافظه " +"Rust را نقض کنند، اما به طور کلی هر تابع C ممکن است تحت هر شرایط دلخواه " +"رفتار نامشخصی داشته باشد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"The `\"C\"` in this example is the ABI; [other ABIs are available too](https://" -"doc.rust-lang.org/reference/items/external-blocks.html)." -msgstr "" -"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس هستند]" +"The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." +msgstr "" +"زبان برنامه‌نویسی `\"C\"` در این مثال ABI است. [ABIهای دیگر نیز در دسترس " +"هستند](https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe-rust/unsafe-functions.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done safely " -"with references." +"We wouldn't actually use pointers for a `swap` function - it can be done " +"safely with references." msgstr "" -"ما در واقع از pointerها برای یک تابع`swap` استفاده نمی‌کنیم - این کار را می‌توان " -"به‌طور ایمن با referenceها انجام داد." +"ما در واقع از pointerها برای یک تابع`swap` استفاده نمی‌کنیم - این کار را " +"می‌توان به‌طور ایمن با referenceها انجام داد." #: src/unsafe-rust/unsafe-functions.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an `unsafe` " -"block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " -"and see what happens. This will likely change in a future Rust edition." +"Note that unsafe code is allowed within an unsafe function without an " +"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " +"Try adding it and see what happens. This will likely change in a future Rust " +"edition." msgstr "" -"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. ما " -"می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. سعی کنید " -"آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه بعدی Rust تغییر " -"خواهد کرد." +"توجه داشته باشید که کد ناامن در یک تابع ناامن بدون بلوک `unsafe` مجاز است. " +"ما می‌توانیم این کار را با `#[deny(unsafe_op_in_unsafe_fn)]` غیرمجاز کنیم. " +"سعی کنید آن را اضافه کنید و ببینید چه اتفاقی می افتد. این احتمالاً در نسخه " +"بعدی Rust تغییر خواهد کرد." #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" @@ -11888,16 +12214,16 @@ msgstr "پیاده سازی صفات (Traits) ناامن" #: src/unsafe-rust/unsafe-traits.md msgid "" -"Like with functions, you can mark a trait as `unsafe` if the implementation must " -"guarantee particular conditions to avoid undefined behaviour." +"Like with functions, you can mark a trait as `unsafe` if the implementation " +"must guarantee particular conditions to avoid undefined behaviour." msgstr "" "مانند توابع، اگر پیاده‌سازی باید شرایط خاصی را تضمین کند تا از رفتار نامشخص " "جلوگیری شود، می‌توانید یک ویژگی را به‌عنوان `unsafe` علامت‌گذاری کنید." #: src/unsafe-rust/unsafe-traits.md msgid "" -"For example, the `zerocopy` crate has an unsafe trait that looks [something like " -"this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"For example, the `zerocopy` crate has an unsafe trait that looks [something " +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -11918,15 +12244,16 @@ msgstr "// SAFETY: `u32` has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md msgid "" -"There should be a `# Safety` section on the Rustdoc for the trait explaining the " -"requirements for the trait to be safely implemented." +"There should be a `# Safety` section on the Rustdoc for the trait explaining " +"the requirements for the trait to be safely implemented." msgstr "" -"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که شرایط " -"لازم برای اجرای ایمن این trait را توضیح دهد." +"باید یک بخش `# Safety` در Rustdoc برای این صفت (trait) وجود داشته باشد که " +"شرایط لازم برای اجرای ایمن این trait را توضیح دهد." #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more complicated." +"The actual safety section for `AsBytes` is rather longer and more " +"complicated." msgstr "بخش ایمنی واقعی برای `AsBytes` نسبتا طولانی‌تر و پیچیده‌تر است." #: src/unsafe-rust/unsafe-traits.md @@ -11944,9 +12271,9 @@ msgid "" "functions you would use from C to read the names of files in a directory." msgstr "" "زبان Rust پشتیبانی بسیار خوبی برای فراخوانی توابع از طریق رابط تابع خارجی " -"_foreign function interface_ (FFI) دارد. ما از آن برای ساختن یک پوشش امن برای " -"توابع `libc` استفاده می‌کنیم که از C برای خواندن نام فایل ها در یک فهرست استفاده " -"می کنید." +"_foreign function interface_ (FFI) دارد. ما از آن برای ساختن یک پوشش امن " +"برای توابع `libc` استفاده می‌کنیم که از C برای خواندن نام فایل ها در یک فهرست " +"استفاده می کنید." #: src/unsafe-rust/exercise.md msgid "You will want to consult the manual pages:" @@ -11966,8 +12293,9 @@ msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" -"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/ffi/) " -"module. There you find a number of string types which you need for the exercise:" +"You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" +"ffi/) module. There you find a number of string types which you need for the " +"exercise:" msgstr "همچنین می‌خواهید [`std::ffi`](https://doc.rust-lang.or) را مرور کنید" #: src/unsafe-rust/exercise.md @@ -11980,11 +12308,11 @@ msgstr "استفاده" #: src/unsafe-rust/exercise.md msgid "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`](https://" -"doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" -"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`](https://" -"doc.rust-lang.org/std/string/struct.String.html)" +"[`str`](https://doc.rust-lang.org/std/primitive.str.html) و [`String`]" +"(https://doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" @@ -12012,8 +12340,8 @@ msgstr "ارتباط با توابع C" #: src/unsafe-rust/exercise.md msgid "" -"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and [`OsString`]" -"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" +"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " +"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) و [`OsString`]" "(https://doc.rust-lang.org/std/ffi/struct.OsString.html)" @@ -12032,7 +12360,8 @@ msgstr "شما بین تمام این typeها تبدیل خواهید کرد:" #: src/unsafe-rust/exercise.md msgid "" -"`&str` to `CString`: you need to allocate space for a trailing `\\0` character," +"`&str` to `CString`: you need to allocate space for a trailing `\\0` " +"character," msgstr "" #: src/unsafe-rust/exercise.md @@ -12044,7 +12373,8 @@ msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" -"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را پیدا کند." +"از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " +"پیدا کند." #: src/unsafe-rust/exercise.md msgid "" @@ -12058,8 +12388,8 @@ msgid "" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" "از `&[u8]` به `&OsStr`: `&OsStr` گامی به سوی `OsString` است، از [`OsStrExt`]" -"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد آن " -"استفاده کنید،" +"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) برای ایجاد " +"آن استفاده کنید،" #: src/unsafe-rust/exercise.md msgid "" @@ -12069,19 +12399,19 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "" -"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very useful " -"chapter about FFI." +"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " +"useful chapter about FFI." msgstr "" -"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل بسیار " -"مفید در مورد FFI دارد." +"مورد [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) همچنین یک فصل " +"بسیار مفید در مورد FFI دارد." #: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" -"کد زیر را در کپی کنید و توابع و متدهای از مفقود شده " -"را پر کنید:" +"کد زیر را در کپی کنید و توابع و متدهای از " +"مفقود شده را پر کنید:" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" @@ -12117,14 +12447,18 @@ msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" msgstr "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" -" // \"Platforms that existed before these updates were available\" refers\n" -" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and PowerPC.\n" +" // \"Platforms that existed before these updates were available\" " +"refers\n" +" // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " +"PowerPC.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" @@ -12244,101 +12578,102 @@ msgstr "به Rust در اندروید خوش‌آمدید." #: src/android.md msgid "" -"Rust is supported for system software on Android. This means that you can write " -"new services, libraries, drivers or even firmware in Rust (or improve existing " -"code as needed)." +"Rust is supported for system software on Android. This means that you can " +"write new services, libraries, drivers or even firmware in Rust (or improve " +"existing code as needed)." msgstr "" "‏ Rust برای system software در اندروید پشتیبانی می‌شود. این بدان معناست که می " -"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust بنویسید (یا " -"در صورت نیاز کدهای موجود را بهبود ببخشید)." +"توانید سرویس‌ها، کتابخانه‌‌ها، درایورها یا حتی سیستم‌عامل جدید را در Rust " +"بنویسید (یا در صورت نیاز کدهای موجود را بهبود ببخشید)." #: src/android.md msgid "" -"We will attempt to call Rust from one of your own projects today. So try to find " -"a little corner of your code base where we can move some lines of code to Rust. " -"The fewer dependencies and \"exotic\" types the better. Something that parses " -"some raw bytes would be ideal." +"We will attempt to call Rust from one of your own projects today. So try to " +"find a little corner of your code base where we can move some lines of code " +"to Rust. The fewer dependencies and \"exotic\" types the better. Something " +"that parses some raw bytes would be ideal." msgstr "" -"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. بنابراین " -"سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از خطوط کد را به " -"Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد برای ما بهتر است. " -"چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." +"ما امروز سعی خواهیم کرد Rust را از یکی از پروژه‌های خودتان فراخوانی کنیم. " +"بنابراین سعی کنید گوشه کوچکی از پایه کد خود را پیدا کنید تا بتوانیم برخی از " +"خطوط کد را به Rust منتقل کنیم. هر چه وابستگی‌ها و انواع \"exotic\" کمتر باشد " +"برای ما بهتر است. چیزی که برخی از بایت‌های خام را تجزیه کند ایده آل خواهد بود." #: src/android.md msgid "" -"The speaker may mention any of the following given the increased use of Rust in " -"Android:" +"The speaker may mention any of the following given the increased use of Rust " +"in Android:" msgstr "" -"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد زیر " -"اشاره کند:" +"با‌توجه‌به افزایش استفاده از Rust در اندروید، سخنران ممکن است به یکی از موارد " +"زیر اشاره کند:" #: src/android.md msgid "" -"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" -"http3-in-android.html)" +"Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" msgstr "" -"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-over-" -"http3-in-android.html)" +"‏ مثال سرویس: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" +"over-http3-in-android.html)" #: src/android.md msgid "" -"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/appendix/" -"rutabaga_gfx.html)" +"Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" +"appendix/rutabaga_gfx.html)" msgstr "" "کتابخانه‌ها: [Rutabaga Virtual Graphics Interface]‌(https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" #: src/android.md msgid "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" -"binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" msgstr "" -"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-rust-" -"binder-v1-0-08ba9197f637@google.com/)" +"Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" +"rust-binder-v1-0-08ba9197f637@google.com/)" #: src/android.md msgid "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" -"in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" msgstr "" -"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-rust-" -"in-android.html)" +"Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" +"rust-in-android.html)" #: src/android/setup.md msgid "" -"We will be using a Cuttlefish Android Virtual Device to test our code. Make sure " -"you have access to one or create a new one with:" +"We will be using a Cuttlefish Android Virtual Device to test our code. Make " +"sure you have access to one or create a new one with:" msgstr "" -"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم کرد. " -"مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" +"ما از یک دستگاه Cuttlefish Android Virtual برای آزمایش کد خود استفاده خواهیم " +"کرد. مطمئن شوید که به یکی از آنها دسترسی دارید یا یک مورد جدید ایجاد کنید:" #: src/android/setup.md msgid "" -"Please see the [Android Developer Codelab](https://source.android.com/docs/setup/" -"start) for details." +"Please see the [Android Developer Codelab](https://source.android.com/docs/" +"setup/start) for details." msgstr "" -"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/docs/" -"setup/start) مراجعه کنید." +"لطفاً برای جزئیات به [Android Developer Codelab]‌(https://source.android.com/" +"docs/setup/start) مراجعه کنید." #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " "desktops. MacOS support is also planned." msgstr "" -"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس عمومی " -"طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." +"‏ Cuttlefish یک Android device مرجع است که برای کار بر روی دسکتاپ های لینوکس " +"عمومی طراحی شده است. پشتیبانی از MacOS نیز برنامه‌ریزی شده است." #: src/android/setup.md msgid "" -"The Cuttlefish system image maintains high fidelity to real devices, and is the " -"ideal emulator to run many Rust use cases." +"The Cuttlefish system image maintains high fidelity to real devices, and is " +"the ideal emulator to run many Rust use cases." msgstr "" -"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز ایده آل " -"برای اجرای بسیاری از موارد استفاده از Rust است." +"این Cuttlefish system image تعهد بالایی به دستگاه‌های واقعی دارد و شبیه‌ساز " +"ایده آل برای اجرای بسیاری از موارد استفاده از Rust است." #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" +msgstr "" +"‏ Android build system (Soong) از Rust از طریق تعدادی ماژول پشتیبانی می‌کند:" #: src/android/build-rules.md msgid "Module Type" @@ -12362,7 +12697,8 @@ msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." -msgstr "یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." +msgstr "" +"یک کتابخانه Rust تولید می‌کند و هر دو نوع `rlib` و `dylib` را ارائه می‌دهد." #: src/android/build-rules.md msgid "`rust_ffi`" @@ -12370,11 +12706,11 @@ msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" -"Produces a Rust C library usable by `cc` modules, and provides both static and " -"shared variants." +"Produces a Rust C library usable by `cc` modules, and provides both static " +"and shared variants." msgstr "" -"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع متغیرهای " -"static و share را ارائه می‌کند." +"یک کتابخانه Rust C قابل استفاده توسط ماژول‌های `cc` تولید می‌کند و انواع " +"متغیرهای static و share را ارائه می‌کند." #: src/android/build-rules.md msgid "`rust_proc_macro`" @@ -12382,8 +12718,10 @@ msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" -"Produces a `proc-macro` Rust library. These are analogous to compiler plugins." -msgstr "یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." +"Produces a `proc-macro` Rust library. These are analogous to compiler " +"plugins." +msgstr "" +"یک کتابخانه `proc-macro` تولید می‌کند. اینها مشابه پلاگین‌های کامپایلر هستند." #: src/android/build-rules.md msgid "`rust_test`" @@ -12392,7 +12730,8 @@ msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "" -"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده می‌کند." +"یک باینری تست Rust تولید می‌کند که از استاندارد Rust test مهار شده استفاده " +"می‌کند." #: src/android/build-rules.md msgid "`rust_fuzz`" @@ -12408,8 +12747,8 @@ msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" -"Generates source and produces a Rust library that provides an interface for a " -"particular protobuf." +"Generates source and produces a Rust library that provides an interface for " +"a particular protobuf." msgstr "" "یک source تولید می‌کند و یک کتابخانه Rust تولید می‌کند که یک interface برای یک " "protobuf خاص فراهم می‌کند." @@ -12436,28 +12775,28 @@ msgstr "موارد دیگری که سخنران ممکن است ذکر کند:" #: src/android/build-rules.md msgid "" -"Cargo is not optimized for multi-language repos, and also downloads packages from " -"the internet." +"Cargo is not optimized for multi-language repos, and also downloads packages " +"from the internet." msgstr "" -"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از اینترنت " -"دانلود می‌کند." +"‏ Cargo برای repoهای چند‌زبانه بهینه‌سازی نشده است و همچنین packageها را از " +"اینترنت دانلود می‌کند." #: src/android/build-rules.md msgid "" -"For compliance and performance, Android must have crates in-tree. It must also " -"interop with C/C++/Java code. Soong fills that gap." +"For compliance and performance, Android must have crates in-tree. It must " +"also interop with C/C++/Java code. Soong fills that gap." msgstr "" -"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با کد C/" -"C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." +"برای انطباق و کارایی، اندروید باید crates in-tree داشته باشد. همچنین باید با " +"کد C/C++/Java همکاری داشته باشد. Soong این شکاف را پر می کند." #: src/android/build-rules.md #, fuzzy msgid "" -"Soong has many similarities to [Bazel](https://bazel.build/), which is the open-" -"source variant of Blaze (used in google3)." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" -"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد استفاده " -"در google3)." +"‏ Soong شباهت‌های زیادی به Bazel دارد که نوع open-source از Blaze است (مورد " +"استفاده در google3)." #: src/android/build-rules.md #, fuzzy @@ -12470,11 +12809,11 @@ msgstr "Rust Binaries" #: src/android/build-rules/binary.md msgid "" -"Let us start with a simple application. At the root of an AOSP checkout, create " -"the following files:" +"Let us start with a simple application. At the root of an AOSP checkout, " +"create the following files:" msgstr "" -"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را ایجاد " -"کنید:" +"اجازه دهید با یک برنامه ساده شروع کنیم. در ریشه یک AOSP، فایل های زیر را " +"ایجاد کنید:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" @@ -12549,9 +12888,9 @@ msgid "" "(https://cs.android.com/android/platform/superproject/+/master:external/rust/" "crates/)." msgstr "" -"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`](https://" -"cs.android.com/android/platform/superproject/+/master:external/rust/crates/) عرضه " -"شده است." +"‏`libtextwrap`، که این crates‌ای است که قبلاً در [`external/rust/crates/`]" +"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" +"crates/) عرضه شده است." #: src/android/build-rules/library.md msgid "\"hello_rust_with_dep\"" @@ -12574,8 +12913,9 @@ msgstr "// Need this to avoid dynamic link error.\n" msgid "\"greetings\"" msgstr "\"greetings\"" -#: src/android/build-rules/library.md src/android/aidl/example-service/service.md -#: src/android/testing.md src/android/interoperability/java.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/service.md src/android/testing.md +#: src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" @@ -12604,20 +12944,22 @@ msgstr "باینری را مانند قبل می سازید، push و اجرا msgid "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" -"The [Android Interface Definition Language (AIDL)](https://developer.android.com/" -"guide/components/aidl) is supported in Rust:" +"The [Android Interface Definition Language (AIDL)](https://developer.android." +"com/guide/components/aidl) is supported in Rust:" msgstr "" "‏[Android Interface Definition Language (AIDL)](https://developer.android.com/" "guide/components/aidl) در Rust پشتیبانی می‌شود:" @@ -12633,12 +12975,12 @@ msgstr "می‌توانید سرورهای جدید AIDL را در Rust ایجا #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " -"process of creating a Binder interface. We're then going to both implement the " -"described service and write client code that talks to that service." +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." msgstr "" -"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط Binder " -"را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد کلاینت را " -"می‌نویسیم که با آن سرویس صحبت می‌کند." +"برای نشان‌دادن نحوه استفاده از Rust با Binder، ما می‌خواهیم روند ایجاد رابط " +"Binder را بررسی کنیم. سپس هم سرویس توصیف‌شده را پیاده‌سازی می‌کنیم و هم کد " +"کلاینت را می‌نویسیم که با آن سرویس صحبت می‌کند." #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" @@ -12650,8 +12992,10 @@ msgstr "شما API سرویس خود را با استفاده از یک AIDL int #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md -msgid "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" -msgstr "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgid "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" +msgstr "" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md @@ -12684,13 +13028,14 @@ msgstr "// Rust is not enabled by default\n" #: src/android/aidl/example-service/interface.md #, fuzzy msgid "" -"Note that the directory structure under the `aidl/` directory needs to match the " -"package name used in the AIDL file, i.e. the package is `com.example." +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" -"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام package " -"استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com.example." -"birthdayservice` و این فایل در `aidl/com/example/IBirthdayService.aidl` است. `." +"توجه داشته باشید که ساختار دایرکتوری زیر دایرکتوری `aidl/` باید با نام " +"package استفاده شده در فایل AIDL مطابقت داشته باشد، به‌عنوان‌مثال بسته `com." +"example.birthdayservice` و این فایل در `aidl/com/example/IBirthdayService." +"aidl` است. `." #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" @@ -12698,11 +13043,11 @@ msgstr "Generated Service API" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Binder generates a trait corresponding to the interface definition. trait to talk " -"to the service." +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن با " -"سرویس" +"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"با سرویس" #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -12710,24 +13055,24 @@ msgstr "_Generated trait_:" #: src/android/aidl/example-service/service-bindings.md msgid "" -"Your service will need to implement this trait, and your client will use this " -"trait to talk to the service." +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." msgstr "" -"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای صحبت با " -"سرویس‌ها استفاده خواهد کرد." +"سرویس شما باید این trait را پیاده‌سازی کند و کلاینت شما از این ویژگی برای " +"صحبت با سرویس‌ها استفاده خواهد کرد." #: src/android/aidl/example-service/service-bindings.md msgid "" -"The generated bindings can be found at `out/soong/.intermediates//" -"`." +"The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" -"پیوندهای تولید شده را می توان در `out/soong/.intermediates//` " -"یافت." +"پیوندهای تولید شده را می توان در `out/soong/.intermediates//" +"` یافت." #: src/android/aidl/example-service/service-bindings.md msgid "" -"Point out how the generated function signature, specifically the argument and " -"return types, correspond the interface definition." +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." msgstr "" "اشاره کنید که چگونه function signature تولید شده، به ویژه typeهای آرگومان و " "بازگشتی، با تعریف interface مطابقت دارد." @@ -12737,8 +13082,8 @@ msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" -"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان type " -"برگشتی می‌شود." +"‏ `String` برای آرگومان منجر به type متفاوتی Rust نسبت به `String` به عنوان " +"type برگشتی می‌شود." #: src/android/aidl/example-service/service.md msgid "Service Implementation" @@ -12796,19 +13141,19 @@ msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" -"Point out the path to the generated `IBirthdayService` trait, and explain why " -"each of the segments is necessary." +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." msgstr "" -"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک از " -"بخش‌ها ضروری است." +"به مسیر ایجاد `IBirthdayService` trait اشاره کنید و توضیح‌دهید که چرا هر یک " +"از بخش‌ها ضروری است." #: src/android/aidl/example-service/service.md msgid "" -"TODO: What does the `binder::Interface` trait do? Are there methods to override? " -"Where source?" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" msgstr "" -"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی برای " -"override وجود دارد؟ source کجاست؟" +"‏ TODO: trait وویژگی `binder::Interface` چه کاری انجام می‌دهد؟ آیا متد‌هایی " +"برای override وجود دارد؟ source کجاست؟" #: src/android/aidl/example-service/server.md msgid "AIDL Server" @@ -12852,17 +13197,17 @@ msgstr "// To avoid dynamic link error.\n" #: src/android/aidl/example-service/server.md msgid "" -"The process for taking a user-defined service implementation (in this case the " -"`BirthdayService` type, which implements the `IBirthdayService`) and starting it " -"as a Binder service has multiple steps, and may appear more complicated than " -"students are used to if they've used Binder from C++ or another language. Explain " -"to students why each step is necessary." +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." msgstr "" -"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` که " -"`IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder چند " -"مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به نظر برسد. " -"اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به دانش‌آموزان توضیح دهید " -"که چرا هر مرحله لازم است." +"فرآیند اجرای یک سرویس تعریف‌شده توسط کاربر (در این مورد نوع `BirthdayService` " +"که `IBirthdayService` را پیاده‌سازی می‌کند) و شروع آن به‌عنوان یک سرویس Binder " +"چند مرحله دارد و ممکن است پیچیده‌تر از آنچه دانش‌آموزان به آن عادت کرده‌اند به " +"نظر برسد. اگر آن‌ها از Binder برای C++ یا زبان دیگری استفاده کردند. به " +"دانش‌آموزان توضیح دهید که چرا هر مرحله لازم است." #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." @@ -12870,33 +13215,33 @@ msgstr "نمونه‌ای از نوع سرویس خود (`BirthdayService`) ای #: src/android/aidl/example-service/server.md msgid "" -"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in this " -"case). This type is generated by Binder and provides the common Binder " +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " "functionality that would be provided by the `BnBinder` base class in C++. We " "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" "این service object را در `Bn*` type مربوطه قرار دهید (در این مورد،" -"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder را " -"ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust ارث‌بری یا " -"inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " +"`BnBirthdayService`). این نوع توسط Binder تولید می‌شود و عملکرد رایج Binder " +"را ارائه می‌کند که توسط کلاس پایه `BnBinder` در C++ ارائه می‌شود. ما در Rust " +"ارث‌بری یا inheritance نداریم، بنابراین در عوض از ترکیب composition می‌کنیم و " "`BirthdayService` خود را در `BnBinderService` تولید شده قرار می‌دهیم." #: src/android/aidl/example-service/server.md msgid "" -"Call `add_service`, giving it a service identifier and your service object (the " -"`BnBirthdayService` object in the example)." +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." msgstr "" -"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید (شی‏ " -"«BnBirthdayService» در مثال)." +"‏ `add_service` را فراخوانی کنید و به آن یک شناسه سرویس و شی‏ سرویس خود بدهید " +"(شی‏ «BnBirthdayService» در مثال)." #: src/android/aidl/example-service/server.md msgid "" -"Call `join_thread_pool` to add the current thread to Binder's thread pool and " -"start listening for connections." +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." msgstr "" -"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread اضافه " -"کنید و شروع به گوش دادن برای connectionها کنید." +"‏ `join_thread_pool` را فراخوانی کنید تا thread فعلی را به Binder thread " +"اضافه کنید و شروع به گوش دادن برای connectionها کنید." #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" @@ -12906,14 +13251,16 @@ msgstr "اکنون می‌توانیم سرویس را بسازیم، push کن msgid "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" @@ -12944,7 +13291,8 @@ msgid "/// Call the birthday service.\n" msgstr "/// Call the birthday service.\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md -#: src/android/aidl/types/parcelables.md src/android/aidl/types/file-descriptor.md +#: src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" @@ -12979,63 +13327,67 @@ msgstr "کلاینت را در دستگاه خود بسازید، push کرده msgid "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is the trait object representing the service that " -"the client has connected to." +"`Strong` is the trait object representing the service " +"that the client has connected to." msgstr "" -"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است که " -"کلاینت به آن متصل شده است." +"‏`Strong` یک trait object است که نشان‌دهنده سرویسی است " +"که کلاینت به آن متصل شده است." #: src/android/aidl/example-service/client.md msgid "" -"`Strong` is a custom smart pointer type for Binder. It handles both an in-process " -"ref count for the service trait object, and the global Binder ref count that " -"tracks how many processes have a reference to the object." +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." msgstr "" -"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های درون " -"فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم شمارنده global " -"Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را ردیابی می‌کند." +"‏ `Strong` یک نوع اشاره‌گر هوشمند سفارشی برای Binder است. هم تعداد ref های " +"درون فرآیندی (in-process) را برای سرویس trait object مدیریت می‌کند و هم " +"شمارنده global Binder را که تعداد فرآیندهایی را که به object ارجاع دارند را " +"ردیابی می‌کند." #: src/android/aidl/example-service/client.md #, fuzzy msgid "" -"Note that the trait object that the client uses to talk to the service uses the " -"exact same trait that the server implements. For a given Binder interface, there " -"is a single Rust trait generated that both client and server use." +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." msgstr "" "توجه داشته باشید که trait object که کلاینت برای صحبت با سرویس استفاده می‌کند، " "دقیقاً از همان ویژگی استفاده می‌کند که سرور پیاده‌سازی می‌کند. برای یک Binder " -"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور از آن " -"استفاده می کنند." +"interface معین، یک trait یا ویژگی Rust ایجاد شده است که هم کلاینت و هم سرور " +"از آن استفاده می کنند." #: src/android/aidl/example-service/client.md msgid "" -"Use the same service identifier used when registering the service. This should " -"ideally be defined in a common crate that both the client and server can depend " -"on." +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." msgstr "" "از همان شناسه سرویس استفاده شده در هنگام ثبت سرویس استفاده کنید. این به طور " -"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به آن " -"وابسته باشند." +"ایده‌آل باید در یک crate مشترک تعریف شود که هم کلاینت و هم سرور می توانند به " +"آن وابسته باشند." #: src/android/aidl/example-service/changing-definition.md msgid "" -"Let us extend the API with more functionality: we want to let clients specify a " -"list of lines for the birthday card:" +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" msgstr "" -"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه دهیم " -"لیستی از خطوط را برای کارت تولد مشخص کنند:" +"اجازه دهید API را با عملکرد بیشتری گسترش دهیم: می‌خواهیم به مشتریان اجازه " +"دهیم لیستی از خطوط را برای کارت تولد مشخص کنند:" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" @@ -13043,13 +13395,13 @@ msgstr "این منجر به یک تعریف ویژگی به روز شده بر #: src/android/aidl/example-service/changing-definition.md msgid "" -"Note how the `String[]` in the AIDL definition is translated as a `&[String]` in " -"Rust, i.e. that idiomatic Rust types are used in the generated bindings wherever " -"possible:" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" msgstr "" -"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در Rust " -"ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید شده تا جایی " -"که ممکن است استفاده می‌شود:" +"توجه داشته باشید که چگونه `String[]`در تعریف AIDL به عنوان `&[String]` در " +"Rust ترجمه می‌شود، به‌عنوان مثال از idiomatic Rust type در bindingهای تولید " +"شده تا جایی که ممکن است استفاده می‌شود:" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." @@ -13087,8 +13439,10 @@ msgstr "\"And also: many more\"" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy -msgid "TODO: Move code snippets into project files where they'll actually be built?" -msgstr "‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" +msgid "" +"TODO: Move code snippets into project files where they'll actually be built?" +msgstr "" +"‏TODO: قطعات کد را به فایل‌های پروژه منتقل کنید، جایی که واقعاً ساخته می‌شوند؟" #: src/android/aidl/types.md msgid "Working With AIDL Types" @@ -13100,18 +13454,21 @@ msgstr "انواع AIDL به نوع اصطلاحی Rust مناسب ترجمه م #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." -msgstr "انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." +msgstr "" +"انواع اولیه یا Primitive types (بیشتر) به idiomatic Rust type نگاشت می‌شوند." #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." -msgstr "انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." +msgstr "" +"انواع Collectionها مانند sliceها،`Vec` و string typeها پشتیبانی می‌شوند." #: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" -"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال کرد." +"ارجاع به AIDL objects و دسته فایل‌ها را می‌توان بین clientها و سرویس‌ها ارسال " +"کرد." #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." @@ -13120,7 +13477,8 @@ msgstr "دسته‌های فایل و بسته‌بندی‌ها به طور ک #: src/android/aidl/types/primitives.md #, fuzzy msgid "Primitive types map (mostly) idiomatically:" -msgstr "انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" +msgstr "" +"انواع ابتدایی یا Primitive type (عمدتا) به صورت idiomatically نگاشت می‌شوند:" #: src/android/aidl/types/primitives.md #, fuzzy @@ -13227,20 +13585,22 @@ msgstr "`&mut Vec`" msgid "Return" msgstr "Return" -#: src/android/aidl/types/arrays.md src/android/interoperability/cpp/type-mapping.md +#: src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" -"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` becomes " -"`[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. `int[3][4]`). In " -"the Java backend, fixed-size arrays are represented as array types." +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" -"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی `T[N]` به " -"`[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند (مانند ‌`int[3]" -"[4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array type نمایش داده " -"می‌شوند." +"در اندروید ۱۳ یا بالاتر، آرایه‌های با اندازه ثابت پشتیبانی می‌شوند، یعنی " +"`T[N]` به `[T; N]`. آرایه‌های با اندازه ثابت می‌توانند چندین بعد داشته باشند " +"(مانند ‌`int[3][4]`. در Java backend، آرایه‌های با اندازه ثابت به عنوان array " +"type نمایش داده می‌شوند." #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." @@ -13248,21 +13608,24 @@ msgstr "آرایه‌های موجود در فیلدهای parcelable همیشه #: src/android/aidl/types/objects.md msgid "" -"AIDL objects can be sent either as a concrete AIDL type or as the type-erased " -"`IBinder` interface:" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" msgstr "" -"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` interface " -"پاک‌شده ارسال کرد:" +"‏ AIDL objects را می‌توان به‌عنوان یک نوع AIDL مشخص یا به عنوان `IBinder` " +"interface پاک‌شده ارسال کرد:" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" msgstr "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider.aidl**:" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" #: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" msgstr "" "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" @@ -13294,8 +13657,10 @@ msgstr "// SAFETY: `abs` doesn't have any safety requirements.\n" #: src/android/aidl/types/objects.md #, fuzzy -msgid "// Perform the same operation but passing the provider as an `SpIBinder`.\n" -msgstr "// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" #: src/android/aidl/types/objects.md msgid "" @@ -13311,8 +13676,10 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "‏ Binder برای Rust از ارسال مستقیم بسته‌بندی‌ها پشتیبانی می‌کند:" #: src/android/aidl/types/parcelables.md -msgid "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" -msgstr "**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" #: src/android/aidl/types/parcelables.md #, fuzzy @@ -13321,11 +13688,11 @@ msgstr "/** The same thing, but with a parcelable. */" #: src/android/aidl/types/file-descriptor.md msgid "" -"Files can be sent between Binder clients/servers using the `ParcelFileDescriptor` " -"type:" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" msgstr "" -"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/سرورهای " -"Binder ارسال کرد:" +"فایل‌ها را می‌توان با استفاده از نوع `ParcelFileDescriptor` بین کلاینت‌ها/" +"سرورهای Binder ارسال کرد:" #: src/android/aidl/types/file-descriptor.md #, fuzzy @@ -13362,11 +13729,13 @@ msgstr "**birthday_service/src/lib.rs**:" #, fuzzy msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" msgstr "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" -" // an `OwnedFd`, which can be cloned and then used to create a `File`\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" " // object.\n" #: src/android/aidl/types/file-descriptor.md @@ -13375,21 +13744,21 @@ msgstr "\"کنترل فایل نامعتبر\"" #: src/android/aidl/types/file-descriptor.md msgid "" -"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a `File` " -"(or any other type that wraps an `OwnedFd`), and can be used to create a new " -"`File` handle on the other side." +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." msgstr "" "‏ `ParcelFileDescriptor` یک `OwnedFd` را احاطه می‌کند و بنابراین می‌تواند از یک " -"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند برای " -"ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." +"`File` (یا هر نوع دیگری که یک `OwnedFd` را احاطه می‌کند) ایجاد کند و می‌تواند " +"برای ایجاد یک دسته `File` جدید در طرف دیگر استفاده شود." #: src/android/aidl/types/file-descriptor.md msgid "" -"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and UNIX " -"sockets." +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" -"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. سوکت های " -"TCP، UDP و UNIX." +"انواع دیگر توصیف‌گرهای فایل را می توان بسته‌بندی و ارسال کرد، به‌عنوان‌مثال. " +"سوکت های TCP، UDP و UNIX." #: src/android/testing.md msgid "Testing in Android" @@ -13397,11 +13766,11 @@ msgstr "تست‌کردن در Android" #: src/android/testing.md msgid "" -"Building on [Testing](../testing.md), we will now look at how unit tests work in " -"AOSP. Use the `rust_test` module for your unit tests:" +"Building on [Testing](../testing.md), we will now look at how unit tests " +"work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP خواهیم " -"پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" +"بر اساس [Testing](../testing.md)، اکنون به نحوه عملکرد unit testها در AOSP " +"خواهیم پرداخت. از ماژول `rust_test` برای تست های واحد خود استفاده کنید:" #: src/android/testing.md msgid "_testing/Android.bp_:" @@ -13467,8 +13836,8 @@ msgid "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " -"2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13478,8 +13847,8 @@ msgstr "" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" -"//comprehensive-rust-android/testing:libleftpad_test_host PASSED in " -"2.3s\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" @@ -13490,16 +13859,16 @@ msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" -"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت بازگشتی " -"در ماژول‌های تودرتو یافت می‌شوند." +"توجه کنید که چگونه فقط ریشه crate کتابخانه را ذکر می‌کنید. تست‌ها به صورت " +"بازگشتی در ماژول‌های تودرتو یافت می‌شوند." #: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" -"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ اجازه " -"می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" +"جعبه [GoogleTest](https://docs.rs/googletest/) با استفاده از _matchers_ " +"اجازه می‌دهد تا assertهای آزمایشی انعطاف‌پذیر را انجام دهید:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13511,52 +13880,55 @@ msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured error " -"message pin-pointing the error:" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" msgstr "" -"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته که " -"خطا را pin-pointing می‌کند، شکست می خورد:" +"اگر آخرین عنصر را به`\"!\"`تغییر دهیم، آزمایش با یک پیغام خطای ساختار یافته " +"که خطا را pin-pointing می‌کند، شکست می خورد:" #: src/android/testing/googletest.md msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this example in " -"a local environment. Use `cargo add googletest` to quickly add it to an existing " -"Cargo project." +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" -"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " -"local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo add " -"googletest` استفاده کنید." +"‏ GoogleTest بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک " +"محیط local اجرا کنید. برای افزودن سریع آن به پروژه Cargo موجود، از `cargo " +"add googletest` استفاده کنید." #: src/android/testing/googletest.md msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used macros " -"and types](https://docs.rs/googletest/latest/googletest/prelude/index.html)." +"The `use googletest::prelude::*;` line imports a number of [commonly used " +"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." +"html)." msgstr "" -"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد](https://" -"docs.rs/googletest/latest/googletest/prelude/index.html) را وارد می‌کند." +"خط `use googletest::prelude::*;` تعدادی از [ماکروها و typeهای پرکاربرد]" +"(https://docs.rs/googletest/latest/googletest/prelude/index.html) را وارد " +"می‌کند." #: src/android/testing/googletest.md #, fuzzy msgid "" -"This just scratches the surface, there are many builtin matchers. Consider going " -"through the first chapter of [\"Advanced testing for Rust applications\"](https://" -"rust-exercises.com/advanced-testing/), a self-guided Rust course: it provides a " -"guided introduction to the library, with exercises to help you get comfortable " -"with `googletest` macros, its matchers and its overall philosophy." +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" "این فقط سطح را نشان می‌دهد، تطبیق‌های داخلی زیادی وجود دارد. فصل اول [‌آزمایش " -"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-testing-" -"workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه راهنمایی برای " -"کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای `googletest` و مطابقت‌های آن " -"و فلسفه کلی آن راحت باشید." +"پیشرفته برای برنامه های Rust]‌(https://github.com/mainmatter/rust-advanced-" +"testing-workshop)، یک دوره آموزشی Rust را در نظر بگیرید: این یک مقدمه " +"راهنمایی برای کتابخانه با تمرین‌هایی که به شما کمک می‌کند با ماکروهای " +"`googletest` و مطابقت‌های آن و فلسفه کلی آن راحت باشید." #: src/android/testing/googletest.md msgid "" -"A particularly nice feature is that mismatches in multi-line strings are shown as " -"a diff:" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" msgstr "" -"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت نشان " -"داده می شود:" +"یک ویژگی خاص خوب این است که عدم تطابق در string‌های چند خطی به صورت یک تفاوت " +"نشان داده می شود:" #: src/android/testing/googletest.md msgid "" @@ -13587,103 +13959,109 @@ msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" -"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) در " -"Rust است." +"این crate یک پورت [GoogleTest for C++]‌(https://google.github.io/googletest/) " +"در Rust است." #: src/android/testing/mocking.md msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. You " -"need to refactor your code to use traits, which you can then quickly mock:" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " +"You need to refactor your code to use traits, which you can then quickly " +"mock:" msgstr "" -"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب بوده " -"استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر دهید، سپس " -"می‌توانید به سرعت آنها را mock کنید:" +"برای mocking از [Mockall](https://docs.rs/mockall/) که یک کتابخانه محبوب " +"بوده استفاده شده است. برای استفاده از traitها، باید کد خود را مجدداً تغییر " +"دهید، سپس می‌توانید به سرعت آنها را mock کنید:" #: src/android/testing/mocking.md msgid "" -"Mockall is the recommended mocking library in Android (AOSP). There are other " -"[mocking libraries available on crates.io](https://crates.io/keywords/mock), in " -"particular in the area of mocking HTTP services. The other mocking libraries work " -"in a similar fashion as Mockall, meaning that they make it easy to get a mock " -"implementation of a given trait." +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other [mocking libraries available on crates.io](https://crates.io/keywords/" +"mock), in particular in the area of mocking HTTP services. The other mocking " +"libraries work in a similar fashion as Mockall, meaning that they make it " +"easy to get a mock implementation of a given trait." msgstr "" -"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های mocking " -"دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، به‌ویژه در " -"زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی مشابه Mockall کار " -"می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص را آسان می‌کنند." +"‏ Mockall کتابخانه mocking توصیه شده در Android (AOSP) است. [کتابخانه‌های " +"mocking دیگری در crates.io](https://crates.io/keywords/mock) در دسترس هستند، " +"به‌ویژه در زمینه سرویس‌های mocking HTTP. سایر کتابخانه‌های mocking به روشی " +"مشابه Mockall کار می‌کنند، به این معنی که اجرای ساختگی یا mock یک ویژگی خاص " +"را آسان می‌کنند." #: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and more " -"stable test execution. On the other hand, the mocks can be configured wrongly and " -"return output different from what the real dependencies would do." +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." msgstr "" -"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این امکان " -"را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، اجرای " -"سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه پیکربندی کرد " -"و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را برگرداند." +"توجه داشته باشید که mocking تا حدودی _جنجال_برانگیز_ است: mockها به شما این " +"امکان را می‌دهند که آزمون را کاملاً از وابستگی‌های آن جدا کنید. نتیجه فوری آن، " +"اجرای سریع‌تر و پایدارتر تست است. از طرف دیگر، mockها را می توان به اشتباه " +"پیکربندی کرد و خروجی متفاوتی با آنچه وابستگی های واقعی انجام می دادند را " +"برگرداند." #: src/android/testing/mocking.md #, fuzzy msgid "" -"If at all possible, it is recommended that you use the real dependencies. As an " -"example, many databases allow you to configure an in-memory backend. This means " -"that you get the correct behavior in your tests, plus they are fast and will " -"automatically clean up after themselves." +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." msgstr "" "در صورت امکان، توصیه می‌شود از وابستگی‌های واقعی استفاده کنید. به عنوان مثال، " -"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را پیکربندی " -"کنید. این به این معنی است که شما در تست های خود رفتار صحیح را دریافت می کنید، به " -"علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات مخصوص به خود پاک می شوند." +"بسیاری از پایگاه‌داده‌ها به شما اجازه می‌دهند تا یک in-memory backend را " +"پیکربندی کنید. این به این معنی است که شما در تست های خود رفتار صحیح را " +"دریافت می کنید، به علاوه آنها سریع هستند و به طور خودکار پس از اجرای عملیات " +"مخصوص به خود پاک می شوند." #: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away the " -"framework since it helps you test your code in the real environment." +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." msgstr "" -"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک process " -"دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. همیشه این را " -"به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود را در محیط واقعی " -"آزمایش کنید." +"به‌طور‌ مشابه، بسیاری از frameworkهای وب به شما اجازه می‌دهند یک سرور در یک " +"process دیگر راه‌اندازی کنید که به یک پورت تصادفی در `localhost` متصل می‌شود. " +"همیشه این را به mock کردن framework ترجیح دهید زیرا به شما کمک می‌کند کد خود " +"را در محیط واقعی آزمایش کنید." #: src/android/testing/mocking.md msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example in a " -"local environment. Use `cargo add mockall` to quickly add Mockall to an existing " -"Cargo project." +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." msgstr "" -"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط local " -"اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به پروژه Cargo " -"موجود استفاده کنید." +"‏ Mockall بخشی از Rust Playground نیست، بنابراین باید این مثال را در یک محیط " +"local اجرا کنید. از `cargo add mockall` برای اضافه کردن سریع Mockall به " +"پروژه Cargo موجود استفاده کنید." #: src/android/testing/mocking.md msgid "" -"Mockall has a lot more functionality. In particular, you can set up expectations " -"which depend on the arguments passed. Here we use this to mock a cat which " -"becomes hungry 3 hours after the last time it was fed:" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید که " -"به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن عملکرد cat " -"استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده گرسنه می‌شود:" +"‏ Mockall عملکرد بسیار بیشتری دارد. به ویژه، می‌توانید انتظاراتی را تنظیم کنید " +"که به استدلال های ارائه شده بستگی دارد. در اینجا ما از این برای mock کردن " +"عملکرد cat استفاده می‌کنیم که 3 ساعت پس از آخرین باری که به آن غذا داده شده " +"گرسنه می‌شود:" #: src/android/testing/mocking.md msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be called " -"to `n` --- the mock will automatically panic when dropped if this isn't satisfied." +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" -"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method می‌تواند " -"به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی که آن را حذف " -"کنید به‌طور خودکار دچار panic می‌شود." +"می‌توانید از `.times(n)` برای محدود‌کردن تعداد دفعاتی که یک mock method " +"می‌تواند به`n` فراخوانی شود استفاده کنید --- در صورت عدم ارضای این روش، زمانی " +"که آن را حذف کنید به‌طور خودکار دچار panic می‌شود." #: src/android/logging.md msgid "" -"You should use the `log` crate to automatically log to `logcat` (on-device) or " -"`stdout` (on-host):" +"You should use the `log` crate to automatically log to `logcat` (on-device) " +"or `stdout` (on-host):" msgstr "" -"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` (روی " -"host) استفاده کنید:" +"باید از `log` crate برای ورود خودکار به`logcat` (روی دستگاه) یا `stdout` " +"(روی host) استفاده کنید:" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" @@ -13741,13 +14119,15 @@ msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین msgid "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" @@ -13757,11 +14137,11 @@ msgstr "لاگ‌ها در `adb logcat` نشان‌داده می‌شوند:" #: src/android/interoperability.md msgid "" -"Rust has excellent support for interoperability with other languages. This means " -"that you can:" +"Rust has excellent support for interoperability with other languages. This " +"means that you can:" msgstr "" -"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که شما " -"می‌توانید:" +"‏‌Rust از قابلیت همکاری با زبان‌های دیگر پشتیبانی می‌کند. این بدان معنی است که " +"شما می‌توانید:" #: src/android/interoperability.md msgid "Call Rust functions from other languages." @@ -13773,8 +14153,8 @@ msgstr "فراخوانی توابع نوشته شده به زبان های دی #: src/android/interoperability.md msgid "" -"When you call functions in a foreign language we say that you're using a _foreign " -"function interface_, also known as FFI." +"When you call functions in a foreign language we say that you're using a " +"_foreign function interface_, also known as FFI." msgstr "" "وقتی توابعی را به‌ یک زبان خارجی فراخوانی می‌کنید، می‌گوییم که از یک رابط تابع " "خارج( _foreign function interface_) که به نام FFI نیز شناخته می‌شود، استفاده " @@ -13789,8 +14169,9 @@ msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" -"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. به " -"طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی کنید." +"‏ Rust پشتیبانی کاملی برای link دادن object fileهایی با یک فراخوانی C دارد. " +"به طور مشابه، می توانید توابع Rust را export کرده و آنها را از C فراخوانی " +"کنید." #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" @@ -13807,16 +14188,18 @@ msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/exercise." -"md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." msgstr "" -"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) دیدیم." +"ما قبلاً این را در [تمرین Safe FFI Wrapper](../../unsafe-rust/exercise.md) " +"دیدیم." #: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." -msgstr "این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." +msgstr "" +"این مستلزم آگاهی کامل از پلتفرم هدف است و برای production توصیه نمی‌شود." #: src/android/interoperability/with-c.md msgid "We will look at better options next." @@ -13828,8 +14211,8 @@ msgstr "با استفاده از Bindgen" #: src/android/interoperability/with-c/bindgen.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) tool " -"can auto-generate bindings from a C header file." +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"tool can auto-generate bindings from a C header file." msgstr "" "ابزار [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "می‌تواند اتصالات را از یک فایل هدر C به طور خودکار ایجاد کند." @@ -13887,7 +14270,8 @@ msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" -"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز نیست):" +"یک فایل هدر wrapper برای کتابخانه ایجاد کنید (در این مثال به شدت مورد نیاز " +"نیست):" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" @@ -13936,34 +14320,40 @@ msgstr "//! Bindgen demo.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" msgstr "" "// SAFETY: The pointer we pass is valid because it came from a Rust\n" -" // reference, and the `name` it contains refers to `name` above which also\n" -" // remains valid. `print_card` doesn't store either pointer to use later\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" " // after it returns.\n" #: src/android/interoperability/with-c/bindgen.md msgid "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد اتصالات " -"(bindings) اجرا کنیم:" +"در نهایت، ما می‌توانیم تست‌های تولید شده خودکار را برای اطمینان از کارکرد " +"اتصالات (bindings) اجرا کنیم:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" @@ -14058,32 +14448,35 @@ msgstr "\"main.c\"" msgid "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/tmp\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" +"tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will " -"just be the name of the function. You can also use `#[export_name = " +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " +"will just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده فقط " -"نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` برای " -"تعیین هر نامی استفاده کنید" +"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " +"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " +"برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md msgid "" -"The [CXX crate](https://cxx.rs/) makes it possible to do safe interoperability " -"between Rust and C++." +"The [CXX crate](https://cxx.rs/) makes it possible to do safe " +"interoperability between Rust and C++." msgstr "" -"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم می‌کند." +"این [CXX crate](https://cxx.rs/) امکان همکاری امن بین Rust و C++ را فراهم " +"می‌کند." #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" @@ -14091,13 +14484,14 @@ msgstr "رویکرد کلی به این صورت است:" #: src/android/interoperability/cpp/bridge.md msgid "" -"CXX relies on a description of the function signatures that will be exposed from " -"each language to the other. You provide this description using extern blocks in a " -"Rust module annotated with the `#[cxx::bridge]` attribute macro." +"CXX relies on a description of the function signatures that will be exposed " +"from each language to the other. You provide this description using extern " +"blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" -"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در معرض " -"دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک ماژول Rust " -"ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده شده است." +"‏ CXX متکی به توصیفی از signatureهای تابع است که از هر زبان به زبان دیگر در " +"معرض دید قرار می‌گیرد. شما این توضیحات را با استفاده از بلوک‌های خارجی در یک " +"ماژول Rust ارائه می‌کنید که با attribute ماکروها `#[cxx::bridge]` شرح داده " +"شده است." #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" @@ -14146,24 +14540,25 @@ msgstr "پل به طور کلی در یک ماژول `ffi`در crate شما اع #: src/android/interoperability/cpp/bridge.md msgid "" -"From the declarations made in the bridge module, CXX will generate matching Rust " -"and C++ type/function definitions in order to expose those items to both " -"languages." +"From the declarations made in the bridge module, CXX will generate matching " +"Rust and C++ type/function definitions in order to expose those items to " +"both languages." msgstr "" "از اعلان‌های (declarations) انجام شده در ماژول پل، CXX تعاریف مطابق با type/" -"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار دهد." +"function در Rust و ++C را ایجاد می‌کند تا آن موارد را در معرض هر دو زبان قرار " +"دهد." #: src/android/interoperability/cpp/bridge.md msgid "" -"To view the generated Rust code, use [cargo-expand](https://github.com/dtolnay/" -"cargo-expand) to view the expanded proc macro. For most of the examples you would " -"use `cargo expand ::ffi` to expand just the `ffi` module (though this doesn't " -"apply for Android projects)." +"To view the generated Rust code, use [cargo-expand](https://github.com/" +"dtolnay/cargo-expand) to view the expanded proc macro. For most of the " +"examples you would use `cargo expand ::ffi` to expand just the `ffi` module " +"(though this doesn't apply for Android projects)." msgstr "" -"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/cargo-" -"expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر نمونه‌ها از " -"`cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید (اگرچه این برای " -"پروژه‌های Android کاربرد ندارد)." +"برای مشاهده کد Rust ایجاد شده از [cargo-expand](https://github.com/dtolnay/" +"cargo-expand) که برای مشاهده ماکرو proc توسعه یافته استفاده کنید. برای بیشتر " +"نمونه‌ها از `cargo expand ::ffi` فقط برای گسترش ماژول `ffi` استفاده کنید " +"(اگرچه این برای پروژه‌های Android کاربرد ندارد)." #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." @@ -14188,22 +14583,23 @@ msgstr "توابع" #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"Items declared in the `extern \"Rust\"` reference items that are in scope in the " -"parent module." +"Items declared in the `extern \"Rust\"` reference items that are in scope in " +"the parent module." msgstr "" -"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول والد " -"قرار دارند." +"موارد اعلام شده در موارد `extern \"Rust\"` reference که در محدوده ماژول " +"والد قرار دارند." #: src/android/interoperability/cpp/rust-bridge.md msgid "" -"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C++ " -"header file containing the corresponding C++ declarations. The generated header " -"has the same path as the Rust source file containing the bridge, except with a ." -"rs.h file extension." +"The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" +"+ header file containing the corresponding C++ declarations. The generated " +"header has the same path as the Rust source file containing the bridge, " +"except with a .rs.h file extension." msgstr "" -"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر ++C " -"حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را دارد که " -"فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs.h." +"تولیدکننده کد CXX از `extern \"Rust\"` خارجی شما برای تولید یک فایل هدر +" +"+C حاوی اعلان‌های ++C مربوطه استفاده می‌کند. header تولید‌شده همان مسیری را " +"دارد که فایل منبع Rust حاوی پل دارای آن است، به جز استفاده از پسوند فایل rs." +"h." #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" @@ -14228,8 +14624,8 @@ msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"The programmer does not need to promise that the signatures they have typed in " -"are accurate. CXX performs static assertions that the signatures exactly " +"The programmer does not need to promise that the signatures they have typed " +"in are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" "برنامه‌نویس نیازی به تضمینی در مورد درست بودن signatureهایی که تایپ کرده است " @@ -14238,11 +14634,11 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" -"`unsafe extern` blocks allow you to declare C++ functions that are safe to call " -"from Rust." +"`unsafe extern` blocks allow you to declare C++ functions that are safe to " +"call from Rust." msgstr "" -"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از Rust " -"امن هستند را اعلام کنید." +"بلوک‌های `unsafe extern` به شما امکان می‌دهند توابع ++C را که برای فراخوانی از " +"Rust امن هستند را اعلام کنید." #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" @@ -14259,9 +14655,9 @@ msgid "" "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" -"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. عملکرد " -"مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را استخراج کنید، " -"پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." +"تعداد محدودی از ویژگی‌ها برای `#[derive()]`در انواع مشترک پشتیبانی می‌شوند. " +"عملکرد مربوطه نیز برای کد ++C ایجاد می شود، به عنوان مثال. اگر `Hash` را " +"استخراج کنید، پیاده‌سازی `std::hash` برای نوع ++C مربوطه نیز ایجاد می‌کند." #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" @@ -14275,14 +14671,14 @@ msgstr "Generated C++:" #, fuzzy msgid "" "On the Rust side, the code generated for shared enums is actually a struct " -"wrapping a numeric value. This is because it is not UB in C++ for an enum class " -"to hold a value different from all of the listed variants, and our Rust " -"representation needs to have the same behavior." +"wrapping a numeric value. This is because it is not UB in C++ for an enum " +"class to hold a value different from all of the listed variants, and our " +"Rust representation needs to have the same behavior." msgstr "" -"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار عددی " -"را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری متفاوت از " -"همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید رفتار مشابهی " -"داشته باشد." +"در سمت Rust، کد تولید شده برای enums مشترک در واقع ساختاری است که یک مقدار " +"عددی را بسته‌بندی می‌کند. به این دلیل که UB در ++C نیست تا یک کلاس enum مقداری " +"متفاوت از همه انواع فهرست شده داشته باشد و نمایش‌دهنده Rust مورد نظر ما باید " +"رفتار مشابهی داشته باشد." #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" @@ -14294,23 +14690,25 @@ msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md msgid "" -"Rust functions that return `Result` are translated to exceptions on the C++ side." +"Rust functions that return `Result` are translated to exceptions on the C++ " +"side." msgstr "" "توابع Rust که «نتیجه» را برمی‌گردانند به exceptionهای سمت ++C ترجمه می‌شوند." #: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " -"exposes a way to get the error message string. The error message will come from " -"the error type's `Display` impl." +"exposes a way to get the error message string. The error message will come " +"from the error type's `Display` impl." msgstr "" -"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه اول " -"راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع خطای`Display` می‌آید." +"این exception به وقوع پیوسته همیشه از نوع `rust::Error` خواهد بود که در درجه " +"اول راهی برای دریافت string پیام خطا نشان می‌دهد. پیغام خطا از نوع " +"خطای`Display` می‌آید." #: src/android/interoperability/cpp/rust-result.md msgid "" -"A panic unwinding from Rust to C++ will always cause the process to immediately " -"terminate." +"A panic unwinding from Rust to C++ will always cause the process to " +"immediately terminate." msgstr "" "باز شدن panic از Rust به ++C همیشه باعث می‌شود که فرآیند بلافاصله خاتمه یابد." @@ -14325,23 +14723,24 @@ msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "" -"C++ functions declared to return a `Result` will catch any thrown exception on " -"the C++ side and return it as an `Err` value to the calling Rust function." +"C++ functions declared to return a `Result` will catch any thrown exception " +"on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" -"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در سمت +" -"+C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust برمی‌گردانند." +"توابع ++C اعلام شده برای برگرداندن «نتیجه»، هر exception صورت گرفته شده در " +"سمت ++C را می‌گیرند و آن را به عنوان مقدار `Err` به تابع فراخوانی Rust " +"برمی‌گردانند." #: src/android/interoperability/cpp/cpp-exception.md msgid "" -"If an exception is thrown from an extern \"C++\" function that is not declared by " -"the CXX bridge to return `Result`, the program calls C++'s `std::terminate`. The " -"behavior is equivalent to the same exception being thrown through a `noexcept` C+" -"+ function." +"If an exception is thrown from an extern \"C++\" function that is not " +"declared by the CXX bridge to return `Result`, the program calls C++'s `std::" +"terminate`. The behavior is equivalent to the same exception being thrown " +"through a `noexcept` C++ function." msgstr "" "اگر یک exception از یک extern \"C++\" function که توسط پل CXX برای بازگشت " -"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را فراخوانی " -"می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` C++ function " -"فعال می‌شود." +"\"نتیجه\" اعلان نشده است، ایجاد شود، برنامه C++' `std::terminate` را " +"فراخوانی می‌کند. این رفتار معادل همان exception است که از طریق یک `noexcept` " +"C++ function فعال می‌شود." #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" @@ -14401,41 +14800,42 @@ msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" -"These types can be used in the fields of shared structs and the arguments and " -"returns of extern functions." +"These types can be used in the fields of shared structs and the arguments " +"and returns of extern functions." msgstr "" -"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern functionها " -"استفاده کرد." +"این typeها را می‌توان در فیلدهای ساختارهای مشترک و آرگومان‌ها و extern " +"functionها استفاده کرد." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"Note that Rust's `String` does not map directly to `std::string`. There are a few " -"reasons for this:" +"Note that Rust's `String` does not map directly to `std::string`. There are " +"a few reasons for this:" msgstr "" -"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. چند " -"دلیل برای این وجود دارد:" +"توجه داشته باشید که `String` در Rust مستقیماً به `std::string` نگاشت نمی‌شود. " +"چند دلیل برای این وجود دارد:" #: src/android/interoperability/cpp/type-mapping.md -msgid "`std::string` does not uphold the UTF-8 invariant that `String` requires." +msgid "" +"`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "" "‏`std::string` ثابت UTF-8 را که `String` به آن نیاز دارد را پشتیبانی نمی‌کند." #: src/android/interoperability/cpp/type-mapping.md msgid "" -"The two types have different layouts in memory and so can't be passed directly " -"between languages." +"The two types have different layouts in memory and so can't be passed " +"directly between languages." msgstr "" -"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را مستقیماً " -"بین زبان‌ها منتقل کرد." +"این دو نوع طرح‌بندی‌های متفاوتی در حافظه دارند و بنابراین نمی‌توان آنها را " +"مستقیماً بین زبان‌ها منتقل کرد." #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "" -"`std::string` requires move constructors that don't match Rust's move semantics, " -"so a `std::string` can't be passed by value to Rust." +"`std::string` requires move constructors that don't match Rust's move " +"semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت ندارند، " -"بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." +"‏ `std::string` به سازنده‌های حرکتی نیاز دارد که با معنای حرکت Rust مطابقت " +"ندارند، بنابراین `std::string` نمی‌تواند با مقدار به Rust منتقل شود." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14448,8 +14848,8 @@ msgid "" "Create a `cc_library_static` to build the C++ library, including the CXX " "generated header and source file." msgstr "" -"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید شده " -"CXX ایجاد کنید." +"یک `cc_library_static` برای ساخت کتابخانه ++C از جمله هدر و فایل منبع تولید " +"شده CXX ایجاد کنید." #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md @@ -14476,43 +14876,43 @@ msgstr "\"libcxx_test_bridge_code\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are the " -"dependencies for the CXX-generated C++ bindings. We'll show how these are setup " -"on the next slide." +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." msgstr "" "به این نکته اشاره کنید که `libcxx_test_bridge_header` و " -"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​هستند. " -"نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." +"`libcxx_test_bridge_code` وابستگی‌هایی برای پیوندهای ++C تولید شده توسط CXX ​​" +"هستند. نحوه تنظیم اینها را در اسلاید بعدی نشان خواهیم داد." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in order to " -"pull in common CXX definitions." +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." msgstr "" "توجه داشته باشید که برای ایجاد تعاریف رایج CXX باید به کتابخانه `cxx-bridge-" "header` وابسته باشید." #: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"Full docs for using CXX in Android can be found in [the Android docs](https://" -"source.android.com/docs/setup/build/rust/building-rust-modules/android-rust-" -"patterns#rust-cpp-interop-using-cxx). You may want to share that link with the " -"class so that students know where they can find these instructions again in the " -"future." +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." msgstr "" -"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا کنید " -"[the Android docs](https://source.android.com/docs/setup/build/rust/building-rust-" -"modules/android-rust-patterns#rust-cpp-interop-using-cxx). ممکن است بخواهید آن " -"پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند که در آینده می‌توانند این " -"دستورالعمل‌ها را دوباره پیدا کنند." +"مستندات کامل برای استفاده از CXX در Android را می‌توانید در این آدرس پیدا " +"کنید [the Android docs](https://source.android.com/docs/setup/build/rust/" +"building-rust-modules/android-rust-patterns#rust-cpp-interop-using-cxx). " +"ممکن است بخواهید آن پیوند را با کلاس به اشتراک بگذارید تا دانش‌آموزان بدانند " +"که در آینده می‌توانند این دستورالعمل‌ها را دوباره پیدا کنند." #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the CXX " -"source file. These are then used as inputs to the `cc_library_static`." +"Create two genrules: One to generate the CXX header, and one to generate the " +"CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" -"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع CXX. " -"سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." +"دو نوع ژانر ایجاد کنید: یکی برای تولید هدر CXX و دیگری برای تولید فایل منبع " +"CXX. سپس از اینها به عنوان ورودی `cc_library_static` استفاده می‌شود." #: src/android/interoperability/cpp/android-cpp-genrules.md #, fuzzy @@ -14567,14 +14967,16 @@ msgid "" "named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " "convention isn't enforced, though." msgstr "" -"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs.h` و " -"فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری اجرا نمی‌شود." +"طبق قرارداد، اگر فایل منبع Rust شما `lib.rs` باشد، فایل header شما `lib.rs." +"h` و فایل منبع شما `lib.rs.cc` نام خواهد داشت. اگرچه این قرارداد نامگذاری " +"اجرا نمی‌شود." #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "" -"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی دارد." +"یک`rust_binary` ایجاد کنید که به `libcxx` و `cc_library_static` شما بستگی " +"دارد." #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" @@ -14594,9 +14996,10 @@ msgid "" "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" -"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native Interface " -"(JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) بارگیری کند. [`jni` " -"crate](https://docs.rs/jni/) به شما امکان می دهد یک کتابخانه سازگار ایجاد کنید." +"جاوا می‌تواند objectهای مشترک را از طریق [واسط بومی جاوا [Java Native " +"Interface (JNI)](https://en.wikipedia.org/wiki/Java_Native_Interface) " +"بارگیری کند. [`jni` crate](https://docs.rs/jni/) به شما امکان می دهد یک " +"کتابخانه سازگار ایجاد کنید." #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" @@ -14666,11 +15069,11 @@ msgstr "در نهایت، می‌توانید باینری را بسازید، #: src/exercises/android/morning.md msgid "" -"This is a group exercise: We will look at one of the projects you work with and " -"try to integrate some Rust into it. Some suggestions:" +"This is a group exercise: We will look at one of the projects you work with " +"and try to integrate some Rust into it. Some suggestions:" msgstr "" -"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه می‌کنیم و " -"سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" +"این یک تمرین گروهی است: ما به یکی از پروژه‌هایی که با آن کار می‌کنید نگاه " +"می‌کنیم و سعی می‌کنیم مقداری Rust را در آن ادغام کنیم. چند پیشنهاد:" #: src/exercises/android/morning.md msgid "Call your AIDL service with a client written in Rust." @@ -14682,11 +15085,11 @@ msgstr "یک تابع را از پروژه خود به Rust منتقل کنید #: src/exercises/android/morning.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone in " -"the class having a piece of code which you can turn in to Rust on the fly." +"No solution is provided here since this is open-ended: it relies on someone " +"in the class having a piece of code which you can turn in to Rust on the fly." msgstr "" -"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس متکی " -"است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." +"هیچ راه‌حلی در اینجا ارائه نشده است زیرا این مورد باز است: به فردی در کلاس " +"متکی است که یک قطعه کد دارد که می توانید آن را به Rust on fly تبدیل کنید." #: src/chromium.md msgid "Welcome to Rust in Chromium" @@ -14694,51 +15097,51 @@ msgstr "به Rust در Chromium خوش‌آمدید." #: src/chromium.md msgid "" -"Rust is supported for third-party libraries in Chromium, with first-party glue " -"code to connect between Rust and existing Chromium C++ code." +"Rust is supported for third-party libraries in Chromium, with first-party " +"glue code to connect between Rust and existing Chromium C++ code." msgstr "" -"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول شخص " -"برای اتصال بین Rust و کد موجود در ++Chromium C." +"‏ Rust برای کتابخانه‌های شخص ثالث در Chromium پشتیبانی می‌شود، با glue code اول " +"شخص برای اتصال بین Rust و کد موجود در ++Chromium C." #: src/chromium.md msgid "" -"Today, we'll call into Rust to do something silly with strings. If you've got a " -"corner of the code where you're displaying a UTF8 string to the user, feel free " -"to follow this recipe in your part of the codebase instead of the exact part we " -"talk about." +"Today, we'll call into Rust to do something silly with strings. If you've " +"got a corner of the code where you're displaying a UTF8 string to the user, " +"feel free to follow this recipe in your part of the codebase instead of the " +"exact part we talk about." msgstr "" "امروز ما با Rust ارتباط می‌گیریم تا کار احمقانه‌ای با stringها انجام دهد. اگر " -"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای قسمت " -"دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از پایگاه کد " -"دنبال کنید." +"گوشه‌ای از کد را دارید که در آن رشته UTF8 را به کاربر نشان می دهید، به جای " +"قسمت دقیقی که در مورد آن صحبت می‌کنیم، این دستور العمل را در قسمت خود از " +"پایگاه کد دنبال کنید." #: src/chromium/setup.md msgid "" -"Make sure you can build and run Chromium. Any platform and set of build flags is " -"OK, so long as your code is relatively recent (commit position 1223636 onwards, " -"corresponding to November 2023):" +"Make sure you can build and run Chromium. Any platform and set of build " +"flags is OK, so long as your code is relatively recent (commit position " +"1223636 onwards, corresponding to November 2023):" msgstr "" -"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای از " -"build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت commit " -"1223636 به بعد، مربوط به نوامبر 2023):" +"مطمئن شوید که می‌توانید Chromium را build و اجرا کنید. هر پلتفرم و مجموعه‌ای " +"از build flag ها بدون مشکل هستند، تا زمانی که کد شما نسبتاً جدید باشد (موقعیت " +"commit 1223636 به بعد، مربوط به نوامبر 2023):" #: src/chromium/setup.md msgid "" -"(A component, debug build is recommended for quickest iteration time. This is the " -"default!)" +"(A component, debug build is recommended for quickest iteration time. This " +"is the default!)" msgstr "" -"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این یک " -"حالت پیش‌فرض است!)" +"(یک component به صورت debug build برای سریع‌ترین زمان تکرار توصیه می‌شود. این " +"یک حالت پیش‌فرض است!)" #: src/chromium/setup.md msgid "" -"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-the-" -"code/) if you aren't already at that point. Be warned: setting up to build " -"Chromium takes time." +"See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" +"the-code/) if you aren't already at that point. Be warned: setting up to " +"build Chromium takes time." msgstr "" -"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www.chromium." -"org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی برای build " -"Chromium زمان زیادی می‌برد." +"اگر از قبل در آن مرحله نیستید، به [چگونه Chromium بسازیم](https://www." +"chromium.org/developers/how-tos/get-the-code/) مراجعه کنید. هشدار: راه‌اندازی " +"برای build Chromium زمان زیادی می‌برد." #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." @@ -14751,19 +15154,20 @@ msgstr "در مورد تمرین‌ها" #: src/chromium/setup.md msgid "" "This part of the course has a series of exercises which build on each other. " -"We'll be doing them spread throughout the course instead of just at the end. If " -"you don't have time to complete a certain part, don't worry: you can catch up in " -"the next slot." +"We'll be doing them spread throughout the course instead of just at the end. " +"If you don't have time to complete a certain part, don't worry: you can " +"catch up in the next slot." msgstr "" -"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما آنها " -"را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. اگر برای " -"تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی به عقب برگردید." +"این بخش از دوره دارای یک سری تمرینات است که بر روی یکدیگر ساخته می‌شوند. ما " +"آنها را به جای اینکه فقط در انتها انجام دهیم، در طول دوره پخش خواهیم کرد. " +"اگر برای تکمیل قسمت خاصی وقت ندارید، نگران نباشید: می توانید در اسلاید بعدی " +"به عقب برگردید." #: src/chromium/cargo.md msgid "" -"The Rust community typically uses `cargo` and libraries from [crates.io](https://" -"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " -"dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io]" +"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " +"set of dependencies." msgstr "" "جامعه Rust معمولاً از `cargo` و کتابخانه‌های [crates.io](https://crates.io/) " "استفاده می‌کند. Chromium با استفاده از `gn` و `ninja` و مجموعه‌ای از وابستگی‌ها " @@ -14775,41 +15179,41 @@ msgstr "هنگام نوشتن کد در Rust، انتخاب‌های شما عب #: src/chromium/cargo.md msgid "" -"Use `gn` and `ninja` with the help of the templates from `//build/rust/*.gni` (e." -"g. `rust_static_library` that we'll meet later). This uses Chromium's audited " -"toolchain and crates." +"Use `gn` and `ninja` with the help of the templates from `//build/rust/*." +"gni` (e.g. `rust_static_library` that we'll meet later). This uses " +"Chromium's audited toolchain and crates." msgstr "" "از `gn` و `ninja` با کمک الگوهای `//build/rust/*.gni` استفاده کنید (مثلاً " -"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و crateهای " -"بررسی‌شده Chromium استفاده می‌کند." +"`rust_static_library` که بعداً با آن آشنا خواهیم شد). این از toolchain و " +"crateهای بررسی‌شده Chromium استفاده می‌کند." #: src/chromium/cargo.md msgid "" -"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and crates]" -"(https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." -"md#Using-cargo)" +"Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " +"crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" +"docs/rust.md#Using-cargo)" msgstr "" -"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده Chromium " -"محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/" -"rust.md#Using-cargo)" +"از `cargo` استفاده کنید، اما [خود را به toolchain و crateهای بررسی‌شده " +"Chromium محدود کنید](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Using-cargo)" #: src/chromium/cargo.md msgid "" -"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates downloaded " -"from the internet](https://crates.io/)" +"Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " +"downloaded from the internet](https://crates.io/)" msgstr "" -"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا [crateهای " -"دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." +"از `cargo` استفاده کنید، به یک [toolchain](https://rustup.rs/) و/یا " +"[crateهای دانلود شده از اینترنت]‌(https://crates.io/) اعتماد کنید." #: src/chromium/cargo.md msgid "" -"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust code " -"can be built into the Chromium browser. At the same time, Cargo is an important " -"part of the Rust ecosystem and you should keep it in your toolbox." +"From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " +"code can be built into the Chromium browser. At the same time, Cargo is an " +"important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" -"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب می‌توان " -"کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی از اکوسیستم " -"Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." +"از اینجا به بعد ما روی `gn` و `ninja` تمرکز خواهیم کرد، زیرا به این ترتیب " +"می‌توان کد Rust را در مرورگر Chromium ایجاد کرد. در عین حال، Cargo بخش مهمی " +"از اکوسیستم Rust است و شما باید آن را در جعبه ابزار خود نگه دارید." #: src/chromium/cargo.md msgid "Mini exercise" @@ -14821,11 +15225,11 @@ msgstr "به گروه‌های کوچک تقسیم شده و:" #: src/chromium/cargo.md msgid "" -"Brainstorm scenarios where `cargo` may offer an advantage and assess the risk " -"profile of these scenarios." +"Brainstorm scenarios where `cargo` may offer an advantage and assess the " +"risk profile of these scenarios." msgstr "" -"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه ریسک‌های " -"این سناریوها را ارزیابی کند." +"سناریوهای طوفان فکری که در آن `cargo` ممکن است مزیتی را ارائه دهد و نمایه " +"ریسک‌های این سناریوها را ارزیابی کند." #: src/chromium/cargo.md msgid "" @@ -14838,105 +15242,111 @@ msgstr "" #: src/chromium/cargo.md msgid "" "Ask students to avoid peeking at the speaker notes before completing the " -"exercise. Assuming folks taking the course are physically together, ask them to " -"discuss in small groups of 3-4 people." +"exercise. Assuming folks taking the course are physically together, ask them " +"to discuss in small groups of 3-4 people." msgstr "" -"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های سخنران " -"خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی با هم هستند، " -"از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." +"از دانش‌آموزان بخواهید که قبل از اتمام تمرین از نگاه کردن به یادداشت‌های " +"سخنران خودداری کنند. با فرض اینکه افرادی که دوره را می‌گذرانند از نظر فیزیکی " +"با هم هستند، از آنها بخواهید در گروه های کوچک ۳-۴ نفره بحث کنند." #: src/chromium/cargo.md msgid "" -"Notes/hints related to the first part of the exercise (\"scenarios where Cargo " -"may offer an advantage\"):" +"Notes/hints related to the first part of the exercise (\"scenarios where " +"Cargo may offer an advantage\"):" msgstr "" -"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی را " -"ارائه دهد\"):" +"نکته‌ها/تکنیک‌ها مربوط به بخش اول تمرین (\"سناریوهایی که Cargo ممکن است مزیتی " +"را ارائه دهد\"):" #: src/chromium/cargo.md msgid "" -"It's fantastic that when writing a tool, or prototyping a part of Chromium, one " -"has access to the rich ecosystem of crates.io libraries. There is a crate for " -"almost anything and they are usually quite pleasant to use. (`clap` for command-" -"line parsing, `serde` for serializing/deserializing to/from various formats, " -"`itertools` for working with iterators, etc.)." +"It's fantastic that when writing a tool, or prototyping a part of Chromium, " +"one has access to the rich ecosystem of crates.io libraries. There is a " +"crate for almost anything and they are usually quite pleasant to use. " +"(`clap` for command-line parsing, `serde` for serializing/deserializing to/" +"from various formats, `itertools` for working with iterators, etc.)." msgstr "" "این فوق العاده است که هنگام نوشتن یک ابزار یا نمونه‌سازی بخشی از Chromium به " -"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی یک " -"crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای تجزیه خط " -"فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، `itertools` برای " -"کار با تکرارکننده‌ها (iterators) و غیره)." +"اکوسیستم غنی کتابخانه‌های crates.io دسترسی داشته باشید. تقریباً برای هر چیزی " +"یک crate وجود دارد و معمولاً استفاده از آنها بسیار لذت بخش است. (`clap` برای " +"تجزیه خط فرمان، `serde` برای سریال‌سازی/جداسازی‌سریال به/از قالب‌های مختلف، " +"`itertools` برای کار با تکرارکننده‌ها (iterators) و غیره)." #: src/chromium/cargo.md msgid "" -"`cargo` makes it easy to try a library (just add a single line to `Cargo.toml` " -"and start writing code)" +"`cargo` makes it easy to try a library (just add a single line to `Cargo." +"toml` and start writing code)" msgstr "" -"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` اضافه " -"کنید و شروع به نوشتن کد کنید)" +"‏ `cargo` بررسی کردن یک کتابخانه را آسان می‌کند (فقط یک خط به `Cargo.toml` " +"اضافه کنید و شروع به نوشتن کد کنید)" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" -"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا مقایسه با " -"`python` + `pip`." +"شاید ارزش این را داشته باشد که چگونه CPAN به انتخاب `perl` کمک کرد. یا " +"مقایسه با `python` + `pip`." #: src/chromium/cargo.md #, fuzzy msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " -"using `rustup` to switch to a different `rustc` version when testing a crate that " -"needs to work on nightly, current stable, and older stable) but also by an " -"ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " -"streamlining and sharing security audits; `criterion` crate gives a streamlined " -"way to run benchmarks)." -msgstr "" -"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` برای " -"تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر روی " -"پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک اکوسیستم نیز " -"انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را برای ساده‌سازی و " -"اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate راهی ساده برای اجرای " -"benchmark‌ها می‌دهد)." +"using `rustup` to switch to a different `rustc` version when testing a crate " +"that needs to work on nightly, current stable, and older stable) but also by " +"an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " +"streamlining and sharing security audits; `criterion` crate gives a " +"streamlined way to run benchmarks)." +msgstr "" +"تجربه توسعه نه تنها با ابزارهای اصلی Rust (به عنوان مثال استفاده از `rustup` " +"برای تغییر به نسخه `rustc` متفاوت در هنگام آزمایش crate ای که نیاز به کار بر " +"روی پایداری‌های شبانه، فعلی و قدیمی‌تر دارد) بسیار خوب است، بلکه توسط یک " +"اکوسیستم نیز انجام می‌شود. از ابزارهای شخص ثالث (مثلاً موزیلا `cargo vet` را " +"برای ساده‌سازی و اشتراک‌گذاری ممیزی‌های امنیتی فراهم می‌کند؛ `criterion` crate " +"راهی ساده برای اجرای benchmark‌ها می‌دهد)." #: src/chromium/cargo.md -msgid "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." +msgid "" +"`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" -"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل می‌کند." +"‏ `cargo` افزودن ابزارها را از طریق`cargo install --locked cargo-vet` تسهیل " +"می‌کند." #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" -"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته باشد." +"ممکن است ارزش مقایسه با برنامه‌های افزودنی کروم یا افزونه‌های VScode را داشته " +"باشد." #: src/chromium/cargo.md -msgid "Broad, generic examples of projects where `cargo` may be the right choice:" -msgstr "نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" +msgid "" +"Broad, generic examples of projects where `cargo` may be the right choice:" +msgstr "" +"نمونه‌های کلی و عمومی از پروژه‌هایی که `cargo` ممکن است انتخاب مناسبی باشد:" #: src/chromium/cargo.md msgid "" -"Perhaps surprisingly, Rust is becoming increasingly popular in the industry for " -"writing command line tools. The breadth and ergonomics of libraries is comparable " -"to Python, while being more robust (thanks to the rich typesystem) and running " -"faster (as a compiled, rather than interpreted language)." +"Perhaps surprisingly, Rust is becoming increasingly popular in the industry " +"for writing command line tools. The breadth and ergonomics of libraries is " +"comparable to Python, while being more robust (thanks to the rich " +"typesystem) and running faster (as a compiled, rather than interpreted " +"language)." msgstr "" -"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط فرمان " -"محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، درحالی‌که " -"قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک زبان کامپایل " -"شده و نه مفسری)." +"شاید تعجب‌آور باشد که Rust به طور فزاینده ای در صنعت برای نوشتن ابزارهای خط " +"فرمان محبوب می‌شود. گستردگی و ارگونومی کتابخانه‌ها با پایتون قابل مقایسه است، " +"درحالی‌که قوی‌تر (به لطف تایپ سیستم غنی) است و سریعتر کار می‌کند (به عنوان یک " +"زبان کامپایل شده و نه مفسری)." #: src/chromium/cargo.md msgid "" "Participating in the Rust ecosystem requires using standard Rust tools like " -"Cargo. Libraries that want to get external contributions, and want to be used " -"outside of Chromium (e.g. in Bazel or Android/Soong build environments) should " -"probably use Cargo." +"Cargo. Libraries that want to get external contributions, and want to be " +"used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " +"should probably use Cargo." msgstr "" -"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo است. " -"کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از Chromium " -"استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً باید از Cargo " -"استفاده کنند." +"مشارکت در اکوسیستم Rust مستلزم استفاده از ابزار استاندارد Rust مانند Cargo " +"است. کتابخانه‌هایی که می‌خواهند مشارکت‌های خارجی دریافت کنند و می‌خواهند خارج از " +"Chromium استفاده شوند (مثلاً در محیط‌های ساخت Bazel یا Android/Soong) احتمالاً " +"باید از Cargo استفاده کنند." #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" @@ -14944,11 +15354,11 @@ msgstr "نمونه‌هایی از پروژه‌های مرتبط با Chromium #: src/chromium/cargo.md msgid "" -"`serde_json_lenient` (experimented with in other parts of Google which resulted " -"in PRs with performance improvements)" +"`serde_json_lenient` (experimented with in other parts of Google which " +"resulted in PRs with performance improvements)" msgstr "" -"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی با " -"بهبود در عملکرد می‌باشد.)" +"‏ `serde_json_lenient` (در قسمت‌های دیگر Google آزمایش شده که منجر به PRهایی " +"با بهبود در عملکرد می‌باشد.)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" @@ -14956,20 +15366,22 @@ msgstr "کتابخانه‌های فونت مانند `font-types`." #: src/chromium/cargo.md msgid "" -"`gnrt` tool (we will meet it later in the course) which depends on `clap` for " -"command-line parsing and on `toml` for configuration files." +"`gnrt` tool (we will meet it later in the course) which depends on `clap` " +"for command-line parsing and on `toml` for configuration files." msgstr "" -"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان به " -"`clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." +"ابزار `gnrt` (ما بعداً در دوره با آن آشنا خواهیم شد) که برای تجزیه خط فرمان " +"به `clap` و برای فایل‌های پیکربندی به `toml` بستگی دارد." #: src/chromium/cargo.md #, fuzzy msgid "" -"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` when " -"building and bootstrapping Rust standard library when building Rust toolchain." +"Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " +"when building and bootstrapping Rust standard library when building Rust " +"toolchain." msgstr "" -"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن `gn` در " -"هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust toolchain بود." +"سلب مسئولیت: یک دلیل منحصر به فرد برای استفاده از `cargo` در دسترس نبودن " +"`gn` در هنگام ساخت و راه‌اندازی کتابخانه استاندارد Rust درحین ساخت Rust " +"toolchain بود." #: src/chromium/cargo.md msgid "" @@ -14978,14 +15390,16 @@ msgid "" "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" "‏ `run_gnrt.py` از کپی Chromium از `cargo` و `rustc` استفاده می‌کند.`gnrt` به " -"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt.py` " -"از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز است.)" +"کتابخانه‌های شخص ثالثی بستگی دارد که از اینترنت دانلود شده‌اند، اما `run_gnrt." +"py` از `cargo` می‌پرسد که فقط محتوای `--locked` از طریق `Cargo.lock` مجاز " +"است.)" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" -msgstr "دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" +msgstr "" +"دانش‌آموزان ممکن است موارد زیر را به طور ضمنی یا صریح مورد اعتماد تشخیص‌دهند:" #: src/chromium/cargo.md msgid "" @@ -14994,16 +15408,16 @@ msgid "" "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" "‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، کامپایلر " -"Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " +"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" -"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/rust-" -"lang/ - همانند `rustc` توسعه یافته است)" +"‏ `rustup` (شاید شایان ذکر است که `rustup` زیر چتر سازمان https://github.com/" +"rust-lang/ - همانند `rustc` توسعه یافته است)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." @@ -15011,11 +15425,11 @@ msgstr "`cargo`, `rustfmt`,سایر موارد." #: src/chromium/cargo.md msgid "" -"Various internal infrastructure (bots that build `rustc`, system for distributing " -"the prebuilt toolchain to Chromium engineers, etc.)" +"Various internal infrastructure (bots that build `rustc`, system for " +"distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" -"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع toolchain " -"از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" +"زیرساخت‌های داخلی مختلف (ربات‌هایی که `rustc` می‌سازند، سیستمی برای توزیع " +"toolchain از پیش‌ساخته شده بین مهندسان Chromium و بقیغ)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." @@ -15023,8 +15437,8 @@ msgstr "ابزار Cargo مانند `cargo audit`، `cargo vet` و غیره." #: src/chromium/cargo.md msgid "" -"Rust libraries vendored into `//third_party/rust` (audited by security@chromium." -"org)" +"Rust libraries vendored into `//third_party/rust` (audited by " +"security@chromium.org)" msgstr "" "کتابخانه‌های Rust در `//third_party/rust` عرضه شده است (بازرسی شده توسط " "security@chromium.org)" @@ -15039,76 +15453,94 @@ msgstr "رویکرد Chromium Rust" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as approved by " -"Chromium's [Area Tech Leads](https://source.chromium.org/chromium/chromium/src/+/" -"main:ATL_OWNERS)." +"Chromium does not yet allow first-party Rust except in rare cases as " +"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" +"chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" -"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area Tech " -"Leads](https://source.chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) تأیید " -"شده است." +"‏ Chromium هنوز Rust شخص اول را مجاز نمی‌کند، مگر در موارد نادر که توسط [Area " +"Tech Leads](https://source.chromium.org/chromium/chromium/src/+/main:" +"ATL_OWNERS) تأیید شده است." #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) - Rust " -"is allowed for third party libraries under various circumstances, including if " -"they're the best option for performance or for security." +"Chromium's policy on third party libraries is outlined [here](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." +"md#rust) - Rust is allowed for third party libraries under various " +"circumstances, including if they're the best option for performance or for " +"security." msgstr "" "رویکردهای Chromium در مورد کتابخانه‌های شخص ثالث [اینجا](https://chromium." -"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) مشخص شده " -"است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از جمله اینکه آیا " -"آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#rust) " +"مشخص شده است. Rust برای کتابخانه‌های شخص ثالث تحت شرایط مختلف مجاز است، از " +"جمله اینکه آیا آنها بهترین گزینه برای کارایی بالا یا موارد امنیتی هستند." #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that nearly " -"all such libraries will require a small amount of first-party glue code." +"Very few Rust libraries directly expose a C/C++ API, so that means that " +"nearly all such libraries will require a small amount of first-party glue " +"code." msgstr "" -"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید (expose) " -"قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی glue code اول " -"شخص نیاز دارند." +"تعداد بسیار کمی از کتابخانه‌های Rust مستقیماً یک C/C++ API را در معرض دید " +"(expose) قرار می‌دهند، به این معنی که تقریباً همه این کتابخانه‌ها به مقدار کمی " +"glue code اول شخص نیاز دارند." #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" -".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - -.\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" ": : : :\n" -": Existing Chromium : : Chromium Rust Existing Rust :\n" +": Existing Chromium : : Chromium Rust Existing " +"Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" -": +---------------+ : : +----------------+ +-------------+ :\n" -": | | : : | | | | :\n" -": | o-----+-+-----------+-+-> o-+----------+--> | :\n" -": | | : Language : | | Crate | | :\n" -": +---------------+ : boundary : +----------------+ API +-------------+ :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : Language : | | Crate | " +"| :\n" +": +---------------+ : boundary : +----------------+ API +-------------" +"+ :\n" ": : : :\n" -"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - -'\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" "```" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should normally be " -"kept in `third_party/rust///wrapper`." +"First-party Rust glue code for a particular third-party crate should " +"normally be kept in `third_party/rust///wrapper`." msgstr "" -"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/rust/" -"//wrapper` نگهداری شود." +"کد Rust glue اول شخص برای یک crate شخص ثالث خاص معمولاً باید در `third_party/" +"rust///wrapper` نگهداری شود." #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" @@ -15121,13 +15553,14 @@ msgstr "آوردن کتابخانه های Rust شخص ثالث (\"crates\")" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "" -"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده کنید." +"نوشتن glue code برای اینکه بتوانید به کمک آن crateها از ++Chromium C استفاده " +"کنید." #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "" -"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در مسیر " -"مناسب ادامه یابد." +"اگر این رویکرد در طول زمان تغییر کند، این دوره به گونه‌ای تکامل می‌یابد که در " +"مسیر مناسب ادامه یابد." #: src/chromium/build-rules.md msgid "Build rules" @@ -15135,21 +15568,23 @@ msgstr "قوانین Build" #: src/chromium/build-rules.md msgid "" -"Rust code is usually built using `cargo`. Chromium builds with `gn` and `ninja` " -"for efficiency --- its static rules allow maximum parallelism. Rust is no " -"exception." +"Rust code is usually built using `cargo`. Chromium builds with `gn` and " +"`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " +"is no exception." msgstr "" -"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و `ninja` جهت " -"کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی را امکان‌پذیر " -"می‌سازد. Rust نیز از این قاعده مستثنی نیست." +"کد Rust معمولاً با استفاده از `cargo` ساخته می‌شود. Chromium با `gn` و " +"`ninja` جهت کارایی بیشتر ساخته می‌شود --- قواعد استاتیک آن حداکثر موازی‌سازی " +"را امکان‌پذیر می‌سازد. Rust نیز از این قاعده مستثنی نیست." #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "افزودن کد Rust به Chromium" #: src/chromium/build-rules.md -msgid "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" -msgstr "در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" +msgid "" +"In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" +msgstr "" +"در برخی از فایل‌های موجود `BUILD.gn` یک `rust_static_library` را اعلام کنید:" #: src/chromium/build-rules.md msgid "" @@ -15173,8 +15608,8 @@ msgstr "" #: src/chromium/build-rules.md msgid "" -"You can also add `deps` on other Rust targets. Later we'll use this to depend " -"upon third party code." +"You can also add `deps` on other Rust targets. Later we'll use this to " +"depend upon third party code." msgstr "" "همچنین می‌توانید `deps` را روی سایر اهداف Rust اضافه کنید. بعداً از این برای " "وابستگی به کد شخص ثالث استفاده خواهیم کرد." @@ -15182,37 +15617,38 @@ msgstr "" #: src/chromium/build-rules.md msgid "" "You must specify _both_ the crate root, _and_ a full list of sources. The " -"`crate_root` is the file given to the Rust compiler representing the root file of " -"the compilation unit --- typically `lib.rs`. `sources` is a complete list of all " -"source files which `ninja` needs in order to determine when rebuilds are " -"necessary." -msgstr "" -"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` فایلی " -"است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل است --- " -"معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام فایل‌های منبعی " -"است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز دارد." +"`crate_root` is the file given to the Rust compiler representing the root " +"file of the compilation unit --- typically `lib.rs`. `sources` is a complete " +"list of all source files which `ninja` needs in order to determine when " +"rebuilds are necessary." +msgstr "" +"شما باید هر دوی crate root و فهرست کامل منابع را مشخص کنید. `crate_root` " +"فایلی است که به کامپایلر Rust داده می‌شود که نشان‌دهنده فایل ریشه واحد کامپایل " +"است --- معمولاً به‌نام `lib.rs` است. همینطور `sources` فهرست کاملی از تمام " +"فایل‌های منبعی است که `ninja` برای تعیین زمان لازم برای بازسازی به آن‌ها نیاز " +"دارد." #: src/chromium/build-rules.md msgid "" -"(There's no such thing as a Rust `source_set`, because in Rust, an entire crate " -"is a compilation unit. A `static_library` is the smallest unit.)" +"(There's no such thing as a Rust `source_set`, because in Rust, an entire " +"crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" "(چیزی به نام Rust `source_set` وجود ندارد، زیرا در Rust، تمامی crate یک واحد " "جمع‌آوری است. `static_library` کوچک‌ترین واحد است.)" #: src/chromium/build-rules.md msgid "" -"Students might be wondering why we need a gn template, rather than using [gn's " -"built-in support for Rust static libraries](https://gn.googlesource.com/gn/+/main/" -"docs/reference.md#func_static_library). The answer is that this template provides " -"support for CXX interop, Rust features, and unit tests, some of which we'll use " -"later." +"Students might be wondering why we need a gn template, rather than using " +"[gn's built-in support for Rust static libraries](https://gn.googlesource." +"com/gn/+/main/docs/reference.md#func_static_library). The answer is that " +"this template provides support for CXX interop, Rust features, and unit " +"tests, some of which we'll use later." msgstr "" -"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn برای " -"کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/reference." -"md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که این الگو از " -"CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً از برخی از آنها " -"استفاده خواهیم کرد." +"دانش‌آموزان ممکن است تعجب کنند که چرا به جای استفاده از [پشتیبانی داخلی gn " +"برای کتابخانه‌های استاتیک Rust](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#func_static_library) به یک الگوی gn نیاز داریم. پاسخ این است که " +"این الگو از CXX interop، ویژگی‌های Rust و تست‌های واحد پشتیبانی می‌کند که بعداً " +"از برخی از آنها استفاده خواهیم کرد." #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" @@ -15220,13 +15656,15 @@ msgstr "شامل کد `unsafe` Rust." #: src/chromium/build-rules/unsafe.md msgid "" -"Unsafe Rust code is forbidden in `rust_static_library` by default --- it won't " -"compile. If you need unsafe Rust code, add `allow_unsafe = true` to the gn " -"target. (Later in the course we'll see circumstances where this is necessary.)" +"Unsafe Rust code is forbidden in `rust_static_library` by default --- it " +"won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " +"the gn target. (Later in the course we'll see circumstances where this is " +"necessary.)" msgstr "" -"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- کامپایل " -"نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را به هدف gn " -"اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم است.)" +"کد ناامن Rust به طور پیش‌فرض در `rust_static_library` غیرمجاز است --- " +"کامپایل نمی‌شود. اگر به کد unsafe Rust نیاز دارید، `allow_unsafe = true` را " +"به هدف gn اضافه کنید. (بعداً در دوره ما شرایطی را خواهیم دید که در آن لازم " +"است.)" #: src/chromium/build-rules/unsafe.md msgid "" @@ -15292,26 +15730,29 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Types are elided in Rust code, which makes a good IDE even more useful than for C+" -"+. Visual Studio code works well for Rust in Chromium. To use it," +"Types are elided in Rust code, which makes a good IDE even more useful than " +"for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" -"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C باشد. کد " -"ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای استفاده از آن،" +"تایپ‌ها در کد Rust حذف شده اند که باعث می‌شود یک IDE خوب حتی مفیدتر از++C " +"باشد. کد ویژوال استودیو برای Rust در Chromium به خوبی کار می کند و برای " +"استفاده از آن،" #: src/chromium/build-rules/vscode.md #, fuzzy msgid "" -"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of Rust " -"support" +"Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " +"Rust support" msgstr "" -"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های قبلی " -"پشتیبانی از Rust" +"اطمینان حاصل کنید که VSCode شما دارای پسوند `rust-analyzer` است، نه فرم‌های " +"قبلی پشتیبانی از Rust" #: src/chromium/build-rules/vscode.md msgid "" -"`gn gen out/Debug --export-rust-project` (or equivalent for your output directory)" +"`gn gen out/Debug --export-rust-project` (or equivalent for your output " +"directory)" msgstr "" -"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی شما)" +"‏ `gn gen out/Debug --export-rust-project` (یا معادل آن برای دایرکتوری خروجی " +"شما)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" @@ -15319,23 +15760,24 @@ msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" -"A demo of some of the code annotation and exploration features of rust-analyzer " -"might be beneficial if the audience are naturally skeptical of IDEs." +"A demo of some of the code annotation and exploration features of rust-" +"analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" -"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از ویژگی‌های " -"code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." +"اگر مخاطب به طور طبیعی نسبت به IDE‌ها علاقه نداشته باشد، نمایش برخی از " +"ویژگی‌های code annotation و کاوش در rust-analyzer می‌تواند مفید باشد." #: src/chromium/build-rules/vscode.md msgid "" -"The following steps may help with the demo (but feel free to instead use a piece " -"of Chromium-related Rust that you are most familiar with):" +"The following steps may help with the demo (but feel free to instead use a " +"piece of Chromium-related Rust that you are most familiar with):" msgstr "" -"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط به " -"Chromium که بیشتر با آن آشنا هستید استفاده کنید):" +"مراحل زیر ممکن است به نسخه نمایشی کمک کند (اما در عوض از یک قطعه Rust مربوط " +"به Chromium که بیشتر با آن آشنا هستید استفاده کنید):" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" -msgstr "‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" +msgstr "" +"‏ `components/qr_code_generator/qr_code_generator_ffi_glue.rs` را باز کنید" #: src/chromium/build-rules/vscode.md msgid "" @@ -15347,46 +15789,48 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K)." -msgstr "" -"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/CoC = " +"Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." +msgstr "" +"نسخه‌ی نمایشی **نمایش مستندات ** (typical bindings: vscode = ctrl k i; vim/" +"CoC = K)." #: src/chromium/build-rules/vscode.md msgid "" -"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). (This " -"will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" +"Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " +"(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" -"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; vim/" -"CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib.rs` " -"می‌رساند.)" +"نسخه‌ی Demo یا نمایشی **go to definition** (typical bindings: vscode = F12; " +"vim/CoC = g d). (این شما را به `//third_party/rust/.../qr_code-.../src/lib." +"rs` می‌رساند.)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **outline** and navigate to the `QrCode::with_bits` method (around line 164; " -"the outline is in the file explorer pane in vscode; typical vim/CoC bindings = " -"space o)" +"Demo **outline** and navigate to the `QrCode::with_bits` method (around line " +"164; the outline is in the file explorer pane in vscode; typical vim/CoC " +"bindings = space o)" msgstr "" -"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود خط " -"164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC bindings = " -"space o)" +"نسخه آزمایشی **outline** و در ادامه به متد `QrCode::with_bits` بروید (حدود " +"خط 164؛ طرح کلی در پنجره file explorer در vscode است؛ typical vim/CoC " +"bindings = space o)" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quite a few nice examples in the `QrCode::" -"with_bits` method)" +"Demo **type annotations** (there are quite a few nice examples in the " +"`QrCode::with_bits` method)" msgstr "" "نسخه‌ی نمایشی **type annotations** (مثال های بسیار خوبی در متد `QrCode::" "with_bits` وجود دارد)" #: src/chromium/build-rules/vscode.md msgid "" -"It may be worth pointing out that `gn gen ... --export-rust-project` will need to " -"be rerun after editing `BUILD.gn` files (which we will do a few times throughout " -"the exercises in this session)." +"It may be worth pointing out that `gn gen ... --export-rust-project` will " +"need to be rerun after editing `BUILD.gn` files (which we will do a few " +"times throughout the exercises in this session)." msgstr "" -"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش فایل‌های " -"`BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره اجرا شود." +"ممکن است مهم باشد که `gn gen ... --export-rust-project` باید پس از ویرایش " +"فایل‌های `BUILD.gn` (که در طول تمرین‌های این جلسه چند بار انجام می‌دهیم) دوباره " +"اجرا شود." #: src/exercises/chromium/build-rules.md msgid "Build rules exercise" @@ -15394,50 +15838,53 @@ msgstr "تمرین قواعد ساخت" #: src/exercises/chromium/build-rules.md msgid "" -"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` containing:" +"In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " +"containing:" msgstr "" -"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید که " -"حاوی:" +"در ساخت Chromium خود، یک Rust target جدید به `//ui/base/BUILD.gn` اضافه کنید " +"که حاوی:" #: src/exercises/chromium/build-rules.md msgid "" -"**Important**: note that `no_mangle` here is considered a type of unsafety by the " -"Rust compiler, so you'll need to allow unsafe code in your `gn` target." +"**Important**: note that `no_mangle` here is considered a type of unsafety " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " +"target." msgstr "" -"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی ناامنی " -"(type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در `gn` target " -"خود مجاز کنید." +"**مهم**: توجه داشته باشید که `no_mangle` در اینجا توسط کامپایلر Rust نوعی " +"ناامنی (type of unsafety) در نظر گرفته می‌شود، بنابراین باید کد unsafe را در " +"`gn` target خود مجاز کنید." #: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " -"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll see " -"how this can be automated by bindings generation tools):" +"function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " +"see how this can be automated by bindings generation tools):" msgstr "" -"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این تابع را " -"در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً خواهیم دید که " -"چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" +"این هدف جدید Rust را به عنوان وابستگی به `//ui/base:base` اضافه کنید. این " +"تابع را در بالای `ui/base/resource/resource_bundle.cc` اعلام کنید (بعداً " +"خواهیم دید که چگونه می‌توان این کار را با ابزارهای تولید bindings خودکار کرد):" #: src/exercises/chromium/build-rules.md msgid "" -"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - we " -"suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build and run " -"Chromium, and ensure that \"Hello from Rust!\" is printed lots of times." +"Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " +"we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " +"and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " +"times." msgstr "" -"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - ما " -"قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد می‌کنیم. " -"Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" بارها چاپ " -"می‌شود." +"این تابع را از جایی در `ui/base/resource/resource_bundle.cc` فراخوانی کنید - " +"ما قسمت بالای `ResourceBundle::MaybeMangleLocalizedString` را پیشنهاد " +"می‌کنیم. Chromium را Build و اجرا کنید و مطمئن شوید که \"Hello from Rust!\" " +"بارها چاپ می‌شود." #: src/exercises/chromium/build-rules.md msgid "" -"If you use VSCode, now set up Rust to work well in VSCode. It will be useful in " -"subsequent exercises. If you've succeeded, you will be able to use right-click " -"\"Go to definition\" on `println!`." +"If you use VSCode, now set up Rust to work well in VSCode. It will be useful " +"in subsequent exercises. If you've succeeded, you will be able to use right-" +"click \"Go to definition\" on `println!`." msgstr "" -"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی کار " -"کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید از کلیک " -"راست روی\"Go to definition\" در`println!` استفاده کنید." +"اگر از VSCode استفاده می‌کنید، اکنون Rust را تنظیم کنید تا در VSCode به خوبی " +"کار کند. این کار در تمرین‌های بعدی مفید خواهد بود. اگر موفق شده‌اید، می‌توانید " +"از کلیک راست روی\"Go to definition\" در`println!` استفاده کنید." #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md @@ -15446,35 +15893,38 @@ msgstr "کجا می‌توان help پیدا کرد" #: src/exercises/chromium/build-rules.md msgid "" -"The options available to the [`rust_static_library` gn template](https://source." -"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"The options available to the [`rust_static_library` gn template](https://" +"source.chromium.org/chromium/chromium/src/+/main:build/rust/" +"rust_static_library.gni;l=16)" msgstr "" -"گزینه‌های موجود برای [`rust_static_library` gn template](https://source.chromium." -"org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" +"گزینه‌های موجود برای [`rust_static_library` gn template](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/rust_static_library.gni;" +"l=16)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." -"html#the-no_mangle-attribute)" +"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" +"abi.html#the-no_mangle-attribute)" msgstr "" "اطلاعات درباره [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi." "html#the-no_mangle-attribute)" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." -"html)" +"Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." +"extern.html)" msgstr "" -"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html)" +"اطلاعات درباره [`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern." +"html)" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" -"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/gn/+/" -"main/docs/reference.md#compilation-database) switch" +"Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" -"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/gn/+/" -"main/docs/reference.md#compilation-database) سوییچ." +"اطلاعاتی درباره gnهای [`--export-rust-project`](https://gn.googlesource.com/" +"gn/+/main/docs/reference.md#compilation-database) سوییچ." #: src/exercises/chromium/build-rules.md #, fuzzy @@ -15487,145 +15937,152 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"This example is unusual because it boils down to the lowest-common-denominator " -"interop language, C. Both C++ and Rust can natively declare and call C ABI " -"functions. Later in the course, we'll connect C++ directly to Rust." +"This example is unusual because it boils down to the lowest-common-" +"denominator interop language, C. Both C++ and Rust can natively declare and " +"call C ABI functions. Later in the course, we'll connect C++ directly to " +"Rust." msgstr "" -"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه می‌شود. " -"بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." +"این مثال غیرعادی است زیرا به زبان متقابل با کمترین مخرج مشترک، C خلاصه " +"می‌شود. بعداً در دوره، ++C آن را مستقیماً به Rust وصل خواهیم کرد." #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow Rust to " -"generate two functions with the same name, and Rust can no longer guarantee that " -"the right one is called." +"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " +"Rust to generate two functions with the same name, and Rust can no longer " +"guarantee that the right one is called." msgstr "" -"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است به " -"Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین کند که " -"تابع مورد نظر فراخوانی شده است." +"‏ `allow_unsafe = true` در اینجا مورد نیاز است زیرا `#[no_mangle]` ممکن است " +"به Rust اجازه دهد دو تابع با نام یکسان تولید کند و Rust دیگر نمی‌تواند تضمین " +"کند که تابع مورد نظر فراخوانی شده است." #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" -"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده از " -"الگوی`rust_executable` gn نیز انجام دهید." +"اگر به یک فایل اجرایی Rust خالص نیاز دارید، می‌توانید این کار را با استفاده " +"از الگوی`rust_executable` gn نیز انجام دهید." #: src/chromium/testing.md msgid "" -"Rust community typically authors unit tests in a module placed in the same source " -"file as the code being tested. This was covered [earlier](../testing.md) in the " -"course and looks like this:" +"Rust community typically authors unit tests in a module placed in the same " +"source file as the code being tested. This was covered [earlier](../testing." +"md) in the course and looks like this:" msgstr "" -"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل منبع کد " -"مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره پوشش داده شده " -"بود و به این صورت است:" +"جامعه Rust معمولاً unit testهای را در یک ماژول قرار می‌دهد که در همان فایل " +"منبع کد مورد آزمایش قرار می‌گیرد. این مورد [قبل‌تر](../testing.md) در دوره " +"پوشش داده شده بود و به این صورت است:" #: src/chromium/testing.md msgid "" "In Chromium we place unit tests in a separate source file and we continue to " -"follow this practice for Rust --- this makes tests consistently discoverable and " -"helps to avoid rebuilding `.rs` files a second time (in the `test` configuration)." +"follow this practice for Rust --- this makes tests consistently discoverable " +"and helps to avoid rebuilding `.rs` files a second time (in the `test` " +"configuration)." msgstr "" -"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان این " -"روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل کشف " -"باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی `test`) " -"جلوگیری شود." +"در Chromium باید unit testها را در یک فایل منبع جداگانه قرار دهیم و همچنان " +"این روش را برای Rust دنبال می‌کنیم --- این باعث می‌شود تست‌ها به طور مداوم قابل " +"کشف باشند و کمک می‌کند از بازسازی فایل‌های `.rs` برای بار دوم (در پیکربندی " +"`test`) جلوگیری شود." #: src/chromium/testing.md -msgid "This results in the following options for testing Rust code in Chromium:" +msgid "" +"This results in the following options for testing Rust code in Chromium:" msgstr "این منجر به گزینه‌های زیر برای تست کد Rust در Chromium می‌شود:" #: src/chromium/testing.md msgid "" -"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/rust`." +"Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" +"rust`." msgstr "" "تست‌های Native Rust (یعنی `#[test]`). خارج از `//third_party/rust` مناسب نیست." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient when " -"Rust code is just a thin FFI layer and the existing unit tests provide sufficient " -"coverage for the feature." +"`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " +"when Rust code is just a thin FFI layer and the existing unit tests provide " +"sufficient coverage for the feature." msgstr "" -"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام می‌دهند. " -"زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، پوشش کافی برای " -"ویژگی‌هایی که ارائه می‌کنند کافی است." +"تست‌های `gtest` که در C++ نوشته شده‌اند و Rust را از طریق تماس‌های FFI انجام " +"می‌دهند. زمانی که کد Rust فقط یک لایه نازکی از FFI است و unit testها موجود، " +"پوشش کافی برای ویژگی‌هایی که ارائه می‌کنند کافی است." #: src/chromium/testing.md msgid "" -"`gtest` tests authored in Rust and using the crate under test through its public " -"API (using `pub mod for_testing { ... }` if needed). This is the subject of the " -"next few slides." +"`gtest` tests authored in Rust and using the crate under test through its " +"public API (using `pub mod for_testing { ... }` if needed). This is the " +"subject of the next few slides." msgstr "" -"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API عمومی " -"آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » استفاده " -"می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." +"آزمایش‌های `gtest` که در Rust نوشته شده‌اند و از crate تحت آزمایش از طریق API " +"عمومی آن استفاده می‌کنند (در صورت نیاز از `pub mod for_testing { ... }` » " +"استفاده می‌کنند. این موضوع در چند اسلاید بعد معرفی شده است." #: src/chromium/testing.md msgid "" "Mention that native Rust tests of third-party crates should eventually be " -"exercised by Chromium bots. (Such testing is needed rarely --- only after adding " -"or updating third-party crates.)" +"exercised by Chromium bots. (Such testing is needed rarely --- only after " +"adding or updating third-party crates.)" msgstr "" "ذکر کنید که تست‌هایnative Rust در مورد crateهای شخص ثالث باید در نهایت توسط " -"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس از " -"افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" +"روبات‌های Chromium انجام شود. (چنین آزمایشی به ندرت مورد نیاز است --- فقط پس " +"از افزودن یا به‌روز‌رسانی crateهای شخص ثالث.)" #: src/chromium/testing.md msgid "" -"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be used:" +"Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " +"used:" msgstr "" -"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در مقابل " -"Rust `gtest` استفاده شود کمک کند:" +"برخی از مثال‌ها ممکن است به توضیح اینکه چه زمانی باید از C++ `gtest` در " +"مقابل Rust `gtest` استفاده شود کمک کند:" #: src/chromium/testing.md msgid "" -"QR has very little functionality in the first-party Rust layer (it's just a thin " -"FFI glue) and therefore uses the existing C++ unit tests for testing both the C++ " -"and the Rust implementation (parameterizing the tests so they enable or disable " -"Rust using a `ScopedFeatureList`)." +"QR has very little functionality in the first-party Rust layer (it's just a " +"thin FFI glue) and therefore uses the existing C++ unit tests for testing " +"both the C++ and the Rust implementation (parameterizing the tests so they " +"enable or disable Rust using a `ScopedFeatureList`)." msgstr "" -"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک است) و " -"بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust استفاده می‌کند " -"(تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک `ScopedFeatureList` آن را " -"فعال یا غیرفعال کند." +"‏ QR عملکرد بسیار کمی در لایه Rust شخص اول دارد (این فقط یک چسب FFI باریک " +"است) و بنابراین از unit testهای++C موجود برای آزمایش ++C و اجرای Rust " +"استفاده می‌کند (تست‌ها را پارامتر می‌کند تا Rust را با استفاده از یک " +"`ScopedFeatureList` آن را فعال یا غیرفعال کند." #: src/chromium/testing.md msgid "" -"Hypothetical/WIP PNG integration may need to implement memory-safe implementation " -"of pixel transformations that are provided by `libpng` but missing in the `png` " -"crate - e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit " -"from separate tests authored in Rust." +"Hypothetical/WIP PNG integration may need to implement memory-safe " +"implementation of pixel transformations that are provided by `libpng` but " +"missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " +"functionality may benefit from separate tests authored in Rust." msgstr "" -"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های پیکسلی " -"داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود ندارند - به " -"عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). چنین عملکردی ممکن " -"است از آزمایش های جداگانه‌ای که در Rust نوشته شده است بهره‌مند شود." +"‏ Hypothetical/WIP PNG ممکن است نیاز به پیاده‌سازی ایمن از حافظه تبدیل‌های " +"پیکسلی داشته باشد که توسط `libpng` ارائه شده‌اند اما در `png` crate وجود " +"ندارند - به عنوان مثال. RGBA => BGRA یا تصحیح‌گر گاما (gamma correction). " +"چنین عملکردی ممکن است از آزمایش های جداگانه‌ای که در Rust نوشته شده است " +"بهره‌مند شود." #: src/chromium/testing/rust-gtest-interop.md msgid "" -"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" -"testing/rust_gtest_interop/README.md) library provides a way to:" +"The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" +"main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" -"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" -"main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" +"کتابخانه [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/" +"src/+/main/testing/rust_gtest_interop/README.md) راهی را ارائه می‌دهد:" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` attribute)" +"Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " +"attribute)" msgstr "" "از یک تابع Rust به عنوان یک تست `gtest` استفاده کنید (با استفاده از " "`#[gtest(...)]` attribute)" #: src/chromium/testing/rust-gtest-interop.md msgid "" -"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not panicking " -"and not terminating the test when the assertion fails)." +"Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " +"panicking and not terminating the test when the assertion fails)." msgstr "" -"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما وقتی " -"assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." +"از `expect_eq!` و ماکروهای مشابه (شبیه به `assert_eq!` استفاده کنید، اما " +"وقتی assertion ناموفق بود، panic نکنید و تست را خاتمه ندهید)." #: src/chromium/testing/rust-gtest-interop.md msgid "Example:" @@ -15633,11 +16090,11 @@ msgstr "مثال:" #: src/chromium/testing/build-gn.md msgid "" -"The simplest way to build Rust `gtest` tests is to add them to an existing test " -"binary that already contains tests authored in C++. For example:" +"The simplest way to build Rust `gtest` tests is to add them to an existing " +"test binary that already contains tests authored in C++. For example:" msgstr "" -"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود است که " -"از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" +"ساده‌ترین راه برای build Rust `gtest` اضافه‌کردن آن‌ها به یک باینری تست موجود " +"است که از قبل حاوی تست‌هایی است که در ++C نوشته شده‌اند. به عنوان مثال:" #: src/chromium/testing/build-gn.md msgid "" @@ -15662,8 +16119,8 @@ msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" -"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به اعلام " -"دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" +"نگارش تست‌های Rust در یک `static_library` جداگانه نیز کار می‌کند، اما نیاز به " +"اعلام دستی وابستگی به کتابخانه‌های پشتیبانی دارد:" #: src/chromium/testing/build-gn.md msgid "" @@ -15705,19 +16162,19 @@ msgstr "" #: src/chromium/testing/chromium-import-macro.md msgid "" -"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to import " -"and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't provided an " -"explicit `crate_name` for `my_rust_lib` so its crate name is computed based on " -"the full target path and name. Fortunately we can avoid working with such an " -"unwieldy name by using the `chromium::import!` macro from the automatically-" -"imported `chromium` crate:" +"After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " +"import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " +"provided an explicit `crate_name` for `my_rust_lib` so its crate name is " +"computed based on the full target path and name. Fortunately we can avoid " +"working with such an unwieldy name by using the `chromium::import!` macro " +"from the automatically-imported `chromium` crate:" msgstr "" -"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و استفاده از " -"`my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک `crate_name` صریح " -"برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن بر اساس مسیر و نام کامل " -"هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده از ماکرو `chromium::import!` " -"از `chromium` crate که به‌طور خودکار وارد می‌شود، درنتیجه از کار با چنین نامی پرهیز " -"کنیم:" +"پس از افزودن `:my_rust_lib` به GN `deps`، همچنان باید نحوه وارد کردن و " +"استفاده از `my_rust_lib` را از `my_rust_lib_unittest.rs` یاد بگیریم. ما یک " +"`crate_name` صریح برای `my_rust_lib` ارائه نکرده‌ایم، بنابراین نام crate آن " +"بر اساس مسیر و نام کامل هدف محاسبه می‌شود. خوشبختانه ما می‌توانیم با استفاده " +"از ماکرو `chromium::import!` از `chromium` crate که به‌طور خودکار وارد می‌شود، " +"درنتیجه از کار با چنین نامی پرهیز کنیم:" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" @@ -15729,30 +16186,30 @@ msgstr "در زیر جلدها، ماکرو به چیزی شبیه به زیر #: src/chromium/testing/chromium-import-macro.md msgid "" -"More information can be found in [the doc comment](https://source.chromium.org/" -"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" -"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"More information can be found in [the doc comment](https://source.chromium." +"org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" +"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" -"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/chromium/" -"chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?q=f:" -"chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"اطلاعات بیشتر را می‌توانید در [ doc comment](https://source.chromium.org/" +"chromium/chromium/src/+/main:build/rust/chromium_prelude/chromium_prelude.rs?" +"q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) پیدا کنید. ماکرو مربوطه `chromium::" "import`." #: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " -"property, but doing this is discouraged. And it is discouraged because the crate " -"name has to be globally unique. crates.io guarantees uniqueness of its crate " -"names so `cargo_crate` GN targets (generated by the `gnrt` tool covered in a " -"later section) use short crate names." +"property, but doing this is discouraged. And it is discouraged because the " +"crate name has to be globally unique. crates.io guarantees uniqueness of its " +"crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " +"covered in a later section) use short crate names." msgstr "" -"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی می‌کند، " -"اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید در سطح " -"سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را تضمین " -"می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که در بخش " -"بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." +"‏`rust_static_library` از تعیین نام صریح از طریق ویژگی`crate_name` پشتیبانی " +"می‌کند، اما انجام این کار ممنوع است و از آن جلوگیری می‌شود زیرا نام crate باید " +"در سطح سراسری منحصر‌به‌فرد باشد. crates.io منحصر‌به‌فرد بودن نام crateهای خود را " +"تضمین می‌کند، بنابراین اهداف`cargo_crate` GN (تولید شده توسط ابزار `gnrt` که " +"در بخش بعدی پوشش داده شده است) از نام‌های crate کوتاه استفاده می‌کنند." #: src/exercises/chromium/testing.md msgid "Testing exercise" @@ -15768,13 +16225,13 @@ msgstr "درChromium build شما باید:" #: src/exercises/chromium/testing.md msgid "" -"Add a testable function next to `hello_from_rust`. Some suggestions: adding two " -"integers received as arguments, computing the nth Fibonacci number, summing " -"integers in a slice, etc." +"Add a testable function next to `hello_from_rust`. Some suggestions: adding " +"two integers received as arguments, computing the nth Fibonacci number, " +"summing integers in a slice, etc." msgstr "" -"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه کردن " -"دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع اعداد صحیح " -"در یک برش و غیره." +"یک تابع قابل آزمایش در کنار `hello_from_rust` اضافه کنید. چند پیشنهاد: اضافه " +"کردن دو عدد صحیح دریافت شده به عنوان آرگومان، محاسبه عدد فیبوناچی nام، جمع " +"اعداد صحیح در یک برش و غیره." #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." @@ -15786,114 +16243,122 @@ msgstr "تست‌های جدید را به `BUILD.gn` اضافه کنید." #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." +msgstr "" +"تست‌ها را بسازید، اجرا کنید و بررسی کنید که آيا تست جدید به درستی کار می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"The Rust community offers multiple options for C++/Rust interop, with new tools " -"being developed all the time. At the moment, Chromium uses a tool called CXX." +"The Rust community offers multiple options for C++/Rust interop, with new " +"tools being developed all the time. At the moment, Chromium uses a tool " +"called CXX." msgstr "" "جامعه Rust گزینه‌های متعددی را برای C++/Rust interop ارائه می‌دهد، با ابزارهای " -"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام CXX " -"استفاده می‌کند." +"جدیدی که همیشه در حال توسعه هستند. در حال حاضر، Chromium از ابزاری به نام " +"CXX استفاده می‌کند." #: src/chromium/interoperability-with-cpp.md msgid "" -"You describe your whole language boundary in an interface definition language " -"(which looks a lot like Rust) and then CXX tools generate declarations for " -"functions and types in both Rust and C++." +"You describe your whole language boundary in an interface definition " +"language (which looks a lot like Rust) and then CXX tools generate " +"declarations for functions and types in both Rust and C++." msgstr "" -"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که بسیار " -"شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را برای توابع " -"و تایپ‌ها در Rust و ++C ایجاد می‌کنند." +"شما کل مرز زبان (language boundary) خود را در یک زبان تعریف interface (که " +"بسیار شبیه Rust به نظر می رسد) توصیف می کنید و سپس ابزارهای CXX اعلان‌هایی را " +"برای توابع و تایپ‌ها در Rust و ++C ایجاد می‌کنند." #: src/chromium/interoperability-with-cpp.md msgid "" -"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of using " -"this." +"See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " +"using this." msgstr "" -"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را ببینید." +"برای مثال کامل استفاده از این [آموزش CXX](https://cxx.rs/tutorial.html) را " +"ببینید." #: src/chromium/interoperability-with-cpp.md msgid "" -"Talk through the diagram. Explain that behind the scenes, this is doing just the " -"same as you previously did. Point out that automating the process has the " -"following benefits:" +"Talk through the diagram. Explain that behind the scenes, this is doing just " +"the same as you previously did. Point out that automating the process has " +"the following benefits:" msgstr "" "از طریق دیاگرام صحبت کنید. توضیح دهید که در پشت صحنه، این دقیقاً همان کاری را " -"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی فرآیند " -"دارای مزایای زیر است:" +"انجام می‌دهد که قبلاً انجام می‌دادید. به این نکته اشاره کنید که خودکارسازی " +"فرآیند دارای مزایای زیر است:" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool guarantees that the C++ and Rust sides match (e.g. you get compile " -"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust definitions, " -"but with out-of-sync manual bindings you'd get Undefined Behavior)" +"errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " +"definitions, but with out-of-sync manual bindings you'd get Undefined " +"Behavior)" msgstr "" -"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر `#[cxx::" -"bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با خطاهای " -"کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync manual " -"bindings) می‌توانید رفتار نامشخص دریافت کنید)" +"این ابزار تضمین می‌کند که مجانب ++C و Rust مطابقت کامل دارند (مثلاً اگر " +"`#[cxx::bridge]` با تعاریف واقعی ++C یا Rust مطابقت نداشته باشد، درنتیجه با " +"خطاهای کامپایل مواجه می‌شوید اما با اتصال‌های دستی غیرهمگام‌شده (out-of-sync " +"manual bindings) می‌توانید رفتار نامشخص دریافت کنید)" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool automates generation of FFI thunks (small, C-ABI-compatible, free " -"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ methods; " -"manual bindings would require authoring such top-level, free functions manually)" +"functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " +"methods; manual bindings would require authoring such top-level, free " +"functions manually)" msgstr "" -"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را برای " -"ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به طور " -"خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح بالا و " -"رایگان به صورت دستی دارد." +"این ابزار تولید Thunk‌های FFI (کارکردهای کوچک، سازگار با C-ABI، و رایگان) را " +"برای ویژگی های غیر C (به عنوان مثال فعال کردن تماس‌های FFI به‌ متدهای Rust) به " +"طور خودکار انجام می دهد؛ اتصال های دستی نیاز به نوشتن چنین عملکردهای سطح " +"بالا و رایگان به صورت دستی دارد." #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "" -"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت کنند - " -"به عنوان مثال:" +"ابزارها و کتابخانه می‌توانند مجموعه‌ای از انواع هسته (core types) را مدیریت " +"کنند - به عنوان مثال:" #: src/chromium/interoperability-with-cpp.md msgid "" -"`&[T]` can be passed across the FFI boundary, even though it doesn't guarantee " -"any particular ABI or memory layout. With manual bindings `std::span` / `&[T]` " -"have to be manually destructured and rebuilt out of a pointer and length - this " -"is error-prone given that each language represents empty slices slightly " -"differently)" +"`&[T]` can be passed across the FFI boundary, even though it doesn't " +"guarantee any particular ABI or memory layout. With manual bindings `std::" +"span` / `&[T]` have to be manually destructured and rebuilt out of a " +"pointer and length - this is error-prone given that each language represents " +"empty slices slightly differently)" msgstr "" -"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه خاصی " -"را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید به‌صورت " -"دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با توجه به اینکه " -"هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد خطا است)" +"‏ `&[T]` را می‌توان از مرز FFI عبور داد، حتی اگر هیچ‌گونه طرح‌بندی ABI یا حافظه " +"خاصی را تضمین نکند. با اتصال‌های (bindings) دستی،`std::span` / `&[T]` باید " +"به‌صورت دستی تخریب شود و از یک pointer و length به صورت مجدد ساخته شود - با " +"توجه به اینکه هر زبان sliceهای خالی را کمی متفاوت نشان می‌دهد، درنتیجه مستعد " +"خطا است)" #: src/chromium/interoperability-with-cpp.md msgid "" -"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` are " -"natively supported. With manual bindings, one would have to pass C-ABI-compatible " -"raw pointers, which would increase lifetime and memory-safety risks." +"Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " +"are natively supported. With manual bindings, one would have to pass C-ABI-" +"compatible raw pointers, which would increase lifetime and memory-safety " +"risks." msgstr "" -"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا `Box` " -"به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual bindings)، باید C-" -"ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و طول عمر را افزایش می‌دهد." +"اشاره گرهای هوشمند مانند `std::unique_ptr`, `std::shared_ptr` و/یا " +"`Box` به صورت native پشتیبانی می‌شوند. با کمک اتصال‌های دستی (manual " +"bindings)، باید C-ABI-compatible raw pointers را پاس کنید که خطرات ایمنی و " +"طول عمر را افزایش می‌دهد." #: src/chromium/interoperability-with-cpp.md msgid "" "`rust::String` and `CxxString` types understand and maintain differences in " -"string representation across the languages (e.g. `rust::String::lossy` can build " -"a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-terminate a " -"string)." +"string representation across the languages (e.g. `rust::String::lossy` can " +"build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" +"terminate a string)." msgstr "" -"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین زبان‌ها " -"درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک Rust string را " -"از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک string را با NUL " -"خاتمه دهد)." +"تایپ‌های `rust::String` و `CxxString` تفاوت‌ها را در نمایش stringها در بین " +"زبان‌ها درک و حفظ می‌کنند (به عنوان مثال، `rust::String::lossy` می‌تواند یک " +"Rust string را از ورودی غیر UTF8 و `rust::String::c_str` بسازد و می‌تواند یک " +"string را با NUL خاتمه دهد)." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" -"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `.rs` " -"اعلام شود." +"‏ CXX مستلزم آن است که کل مرز C++/Rust در ماژول‌های `cxx::bridge` در کد منبع `." +"rs` اعلام شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" @@ -15909,14 +16374,14 @@ msgstr "اشاره کنید:" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` procedural " -"macro does complex things to it. The generated code is quite a bit more " -"sophisticated - though this does still result in a `mod` called `ffi` in your " -"code." +"Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " +"procedural macro does complex things to it. The generated code is quite a " +"bit more sophisticated - though this does still result in a `mod` called " +"`ffi` in your code." msgstr "" -"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::bridge]` " -"کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر است - اگرچه این " -"کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." +"اگرچه این شبیه به یک `mod` معمولی Rust است، اما ماکرو رویه‌ای `#[cxx::" +"bridge]` کارهای پیچیده‌ای برای آن انجام می‌دهد و کد تولید شده کمی پیچیده تر " +"است - اگرچه این کار همچنان منجر به یک `mod` به نام `ffi` در کد شما می شود." #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" @@ -15936,21 +16401,22 @@ msgstr "فراخوانی از Rust به ++C و تایپ‌های ++C (در قس #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" -"**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, " -"but this is misleading. This header is never interpreted by Rust, but simply " -"`#include`d in the generated C++ code for the benefit of C++ compilers." +"**Common misconception**: It _looks_ like a C++ header is being parsed by " +"Rust, but this is misleading. This header is never interpreted by Rust, but " +"simply `#include`d in the generated C++ code for the benefit of C++ " +"compilers." msgstr "" -"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این گمراه " -"کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی `#include` در کد +" -"+C تولید‌شده برای کامپایلرهای ++C است." +"تصور نادرست رایج**: به نظر می‌رسد هِدِر ++C توسط Rust تجزیه می‌شود، اما این " +"گمراه کننده است. این هِدِر هرگز توسط Rust تفسیر نمی‌شود، بلکه به سادگی " +"`#include` در کد ++C تولید‌شده برای کامپایلرهای ++C است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"By far the most useful page when using CXX is the [type reference](https://cxx.rs/" -"bindings.html)." +"By far the most useful page when using CXX is the [type reference](https://" +"cxx.rs/bindings.html)." msgstr "" -"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference](https://cxx." -"rs/bindings.html) است." +"تا حد زیادی مفیدترین صفحه هنگام استفاده از CXX برابر [type reference]" +"(https://cxx.rs/bindings.html) است." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" @@ -15958,45 +16424,51 @@ msgstr "‏ CXX به‌طورکلی مناسب مواردی است که:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"Your Rust-C++ interface is sufficiently simple that you can declare all of it." +"Your Rust-C++ interface is sufficiently simple that you can declare all of " +"it." msgstr "" "اینترفیس ++Rust-C شما به اندازه کافی ساده است که می‌توانید همه آن را اعلام یا " "declare کنید." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You're using only the types natively supported by CXX already, for example `std::" -"unique_ptr`, `std::string`, `&[u8]` etc." +"You're using only the types natively supported by CXX already, for example " +"`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" "شما فقط از تایپ‌هایی استفاده می‌کنید که قبلاً توسط CXX ​​پشتیبانی می‌شوند، برای " "مثال`std::unique_ptr`, `std::string`, `&[u8]` و غیره." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"It has many limitations --- for example lack of support for Rust's `Option` type." +"It has many limitations --- for example lack of support for Rust's `Option` " +"type." msgstr "" -"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' Rust." +"این مورد محدودیت‌های زیادی دارد --- برای مثال عدم پشتیبانی از تایپ 'Option' " +"Rust." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"These limitations constrain us to using Rust in Chromium only for well isolated " -"\"leaf nodes\" rather than for arbitrary Rust-C++ interop. When considering a use-" -"case for Rust in Chromium, a good starting point is to draft the CXX bindings for " -"the language boundary to see if it appears simple enough." +"These limitations constrain us to using Rust in Chromium only for well " +"isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " +"considering a use-case for Rust in Chromium, a good starting point is to " +"draft the CXX bindings for the language boundary to see if it appears simple " +"enough." msgstr "" -"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های برگ\" " -"به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام در نظر گرفتن " -"یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است که پیش نویس " -"پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید تا ببینید آیا به " -"اندازه کافی ساده به نظر می رسد یا خیر." +"این محدودیت‌ها ما را محدود می‌کنند تا از Rust در Chromium فقط برای \"گره‌های " +"برگ\" به خوبی ایزوله شده استفاده کنیم نه برای تعامل دلخواه ++Rust-C. هنگام " +"در نظر گرفتن یک مورد استفاده برای Rust در Chromium، یک نقطه شروع خوب این است " +"که پیش نویس پیوندهای CXX برای مرز زبان (language boundary) را پیش‌نویس کنید " +"تا ببینید آیا به اندازه کافی ساده به نظر می رسد یا خیر." #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" -"You should also discuss some of the other sticky points with CXX, for example:" +"You should also discuss some of the other sticky points with CXX, for " +"example:" msgstr "همچنین باید برخی از نکات مهم دیگر را با CXX مطرح کنید، به عنوان مثال:" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md -msgid "Its error handling is based around C++ exceptions (given on the next slide)" +msgid "" +"Its error handling is based around C++ exceptions (given on the next slide)" msgstr "مدیریت خطای آن بر اساسC++ exception است (در اسلاید بعدی ارائه شده است)" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md @@ -16005,12 +16477,12 @@ msgstr "استفاده ازFunction pointerها دشوار است." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies on C+" -"+ exceptions, so we can't use that in Chromium. Alternatives:" +"CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " +"on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" -"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C++ " -"exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. جایگزین‌های " -"آن عبارتند از:" +"‏ CXX [پشتیبانی از `Result`](https://cxx.rs/binding/result.html) به C+" +"+ exception متکی است، بنابراین نمی‌توانیم از آن در Chromium استفاده کنیم. " +"جایگزین‌های آن عبارتند از:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" @@ -16019,11 +16491,12 @@ msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "" -"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can be " -"passed across the FFI boundary - for example `T` has to be:" +"Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " +"be passed across the FFI boundary - for example `T` has to be:" msgstr "" -"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. این " -"مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید باشد:" +"از طریق پارامترهای خارجی (به عنوان مثال از طریق `&mut T`) برگردانده شده است. " +"این مستلزم آن است که `T` بتواند از مرز FFI عبور کند - برای مثال `T` باید " +"باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" @@ -16034,18 +16507,19 @@ msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" -"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که دارای " -"یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ `Box`)." +"تایپی که به طور native توسط `cxx` پشتیبانی می‌شود (مانند `UniquePtr`) که " +"دارای یک مقدار پیش‌فرض مناسب برای استفاده در موارد خرابی است (_unlike_ " +"`Box`)." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Retained on the Rust side, and exposed via reference. This may be needed when `T` " -"is a Rust type, which cannot be passed across the FFI boundary, and cannot be " -"stored in `UniquePtr`." +"Retained on the Rust side, and exposed via reference. This may be needed " +"when `T` is a Rust type, which cannot be passed across the FFI boundary, and " +"cannot be stored in `UniquePtr`." msgstr "" -"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن است " -"زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور کند و " -"نمی تواند در `UniquePtr` ذخیره شود." +"در سمت Rust حفظ شده و از طریق مرجع در معرض دید قرار گرفته است. این کار ممکن " +"است زمانی مورد نیاز باشد که `T` یک تایپ Rust است که نمی‌تواند از مرز FFI عبور " +"کند و نمی تواند در `UniquePtr` ذخیره شود." #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" @@ -16053,18 +16527,19 @@ msgstr "قسمت `E` از `Result` می‌تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Returned as a boolean (e.g. `true` representing success, and `false` representing " -"failure)" +"Returned as a boolean (e.g. `true` representing success, and `false` " +"representing failure)" msgstr "" "به‌عنوان یک boolean برگردانده می‌شود (مثلاً `true` نشان‌دهنده موفقیت و `false` " "نشان‌دهنده یک شکست است)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" -"Preserving error details is in theory possible, but so far hasn't been needed in " -"practice." +"Preserving error details is in theory possible, but so far hasn't been " +"needed in practice." msgstr "" -"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده است." +"حفظ جزئیات خطا در تئوری امکان پذیر است، اما تاکنون در عمل مورد نیاز نبوده " +"است." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "CXX Error Handling: QR Example" @@ -16073,15 +16548,15 @@ msgstr "مدیریت خطا CXX: مثال QR" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" -"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;" -"l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is used to " -"communicate success vs failure, and where the successful result can be passed " -"across the FFI boundary:" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." +"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " +"used to communicate success vs failure, and where the successful result can " +"be passed across the FFI boundary:" msgstr "" -"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/main:" -"components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" -"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و جایی " -"که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" +"تولید کد QR [نمونه‌ای](https://source.chromium.org/chromium/chromium/src/+/" +"main:components/qr_code_generator/qr_code_generator_ffi_glue.rs;l=13-18;" +"drc=7bf1b75b9101ca2013) است که در آن بولی برای ارتباط موفقیت در مق‌بل شکست و " +"جایی که نتیجه موفقیت آمیز را می‌توان از مرز FFI عبور داد استفاده می شود:" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" @@ -16089,36 +16564,37 @@ msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"Students may be curious about the semantics of the `out_qr_size` output. This is " -"not the size of the vector, but the size of the QR code (and admittedly it is a " -"bit redundant - this is the square root of the size of the vector)." +"Students may be curious about the semantics of the `out_qr_size` output. " +"This is not the size of the vector, but the size of the QR code (and " +"admittedly it is a bit redundant - this is the square root of the size of " +"the vector)." msgstr "" -"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این اندازه " -"بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این جذر اندازه " -"بردار است)." +"دانش آموزان ممکن است در مورد معنایی خروجی `out_qr_size` کنجکاو باشند. این " +"اندازه بردار نیست بلکه اندازه کد QR است (و مسلماً کمی اضافی است - درواقع این " +"جذر اندازه بردار است)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"It may be worth pointing out the importance of initializing `out_qr_size` before " -"calling into the Rust function. Creation of a Rust reference that points to " -"uninitialized memory results in Undefined Behavior (unlike in C++, when only the " -"act of dereferencing such memory results in UB)." +"It may be worth pointing out the importance of initializing `out_qr_size` " +"before calling into the Rust function. Creation of a Rust reference that " +"points to uninitialized memory results in Undefined Behavior (unlike in C++, " +"when only the act of dereferencing such memory results in UB)." msgstr "" -"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه `out_qr_size` " -"اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، منجر به رفتار " -"نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین حافظه‌ای منجر به UB " -"می‌شود)." +"شاید لازم باشد قبل از فراخوانی تابع Rust به اهمیت مقداردهی اولیه " +"`out_qr_size` اشاره کنیم. ایجاد یک مرجع Rust که به حافظه اولیه اشاره می‌کند، " +"منجر به رفتار نامشخص می‌شود (برخلاف ++C، زمانی که تنها عمل عدم ارجاع چنین " +"حافظه‌ای منجر به UB می‌شود)." #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" -"If students ask about `Pin`, then explain why CXX needs it for mutable references " -"to C++ data: the answer is that C++ data can’t be moved around like Rust data, " -"because it may contain self-referential pointers." +"If students ask about `Pin`, then explain why CXX needs it for mutable " +"references to C++ data: the answer is that C++ data can’t be moved around " +"like Rust data, because it may contain self-referential pointers." msgstr "" -"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های قابل " -"تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را نمی‌توان مانند " -"داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-referential " -"pointers) باشد." +"اگر دانش‌آموزان درباره `Pin` سؤال می‌کنند، توضیح دهید که چرا CXX برای ارجاع‌های " +"قابل تغییر به داده‌های ++C به آن نیاز دارد: پاسخ این است که داده‌های++C را " +"نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای " +"خودارجاعی (self-referential pointers) باشد." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "CXX Error Handling: PNG Example" @@ -16126,11 +16602,11 @@ msgstr "مدیریت خطا CXX: مثال PNG" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"A prototype of a PNG decoder illustrates what can be done when the successful " -"result cannot be passed across the FFI boundary:" +"A prototype of a PNG decoder illustrates what can be done when the " +"successful result cannot be passed across the FFI boundary:" msgstr "" -"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز FFI " -"عبور کند و چه کاری می توان انجام داد:" +"نمونه اولیه PNG decoder نشان می‌دهد که وقتی نتیجه موفقیت آمیز نمی‌تواند از مرز " +"FFI عبور کند و چه کاری می توان انجام داد:" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" @@ -16155,29 +16631,31 @@ msgstr "/// C++ bindings for the `crate::png::PngReader` type.\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these types " -"cannot cross the FFI boundary without indirection of a `Box`. We can't have an " -"`out_parameter: &mut PngReader`, because CXX doesn't allow C++ to store Rust " -"objects by value." +"`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " +"types cannot cross the FFI boundary without indirection of a `Box`. We " +"can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " +"to store Rust objects by value." msgstr "" -"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از این " -"نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما نمی‌توانیم " -"`out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه نمی‌دهد Rust " -"object ها را براساس مقدار ذخیره کند." +"‏ \"PngReader\" و \"ResultOfPngReader\" تایپ‌های Rust هستند --- objectهای از " +"این نوع نمیتوانند بدون جهت‌گیری غیرمستقیم `Box` از مرز FFI عبور کنند. ما " +"نمی‌توانیم `out_parameter: &mut PngReader` داشته باشیم، زیرا CXX به ++C اجازه " +"نمی‌دهد Rust object ها را براساس مقدار ذخیره کند." #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" -"This example illustrates that even though CXX doesn't support arbitrary generics " -"nor templates, we can still pass them across the FFI boundary by manually " -"specializing / monomorphizing them into a non-generic type. In the example " -"`ResultOfPngReader` is a non-generic type that forwards into appropriate methods " -"of `Result` (e.g. into `is_err`, `unwrap`, and/or `as_mut`)." +"This example illustrates that even though CXX doesn't support arbitrary " +"generics nor templates, we can still pass them across the FFI boundary by " +"manually specializing / monomorphizing them into a non-generic type. In the " +"example `ResultOfPngReader` is a non-generic type that forwards into " +"appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " +"`as_mut`)." msgstr "" -"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه پشتیبانی " -"نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را به‌صورت دستی " -"تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی تبدیل کنیم. در " -"مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای مناسب `Result` " -"(به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» ارسال می‌شود." +"این مثال نشان می‌دهد که حتی اگر CXX از genericها و templateهای دلخواه " +"پشتیبانی نمی‌کند، ما همچنان می‌توانیم آنها را از مرز FFI عبور دهیم و آنها را " +"به‌صورت دستی تخصصی/تک‌شکلی ( specializing / monomorphizing) در یک نوع غیرعمومی " +"تبدیل کنیم. در مثال `ResultOfPngReader` یک نوع non-generic است که به متدهای " +"مناسب `Result` (به عنوان مثال به «is_err»، «unwrap» و/یا «as_mut» " +"ارسال می‌شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" @@ -16185,13 +16663,13 @@ msgstr "استفاده از cxx در Chromium" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-node " -"where we want to use Rust. You'd typically have one for each " +"In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" +"node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" -"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از Rust " -"استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` یکی دارید. " -"پس فقط اضافه کنید." +"در Chromium، یک `#[cxx::bridge] mod` مستقل برای هر برگ گره‌ای که می‌خواهیم از " +"Rust استفاده کنیم را تعریف می‌کنیم. شما معمولاً برای هر `rust_static_library` " +"یکی دارید. پس فقط اضافه کنید." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -16223,13 +16701,15 @@ msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"You will find some utility functions in `//base` to convert to/from Chromium C++ " -"types to CXX Rust types --- for example [`SpanToRustSlice`](https://source." -"chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;l=21)." +"You will find some utility functions in `//base` to convert to/from Chromium " +"C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" +"l=21)." msgstr "" -"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C به " -"انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://source." -"chromium.org/chromium/chromium/src /+/main:base/containers/span_rust.h;l=21)." +"برخی از توابع کاربردی را در `//base` برای تبدیل به/از تایپ‌های ++Chromium C " +"به انواع CXX Rust پیدا خواهید کرد --- برای مثال [`SpanToRustSlice`](https://" +"source.chromium.org/chromium/chromium/src /+/main:base/containers/span_rust." +"h;l=21)." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" @@ -16238,31 +16718,32 @@ msgstr "" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" -"The broad answer is that no C/C++ code is \"safe\" by the normal Rust standards. " -"Calling back and forth to C/C++ from Rust may do arbitrary things to memory, and " -"compromise the safety of Rust's own data layouts. Presence of _too many_ `unsafe` " -"keywords in C/C++ interop can harm the signal-to-noise ratio of such a keyword, " -"and is [controversial](https://steveklabnik.com/writing/the-cxx-debate), but " -"strictly, bringing any foreign code into a Rust binary can cause unexpected " -"behavior from Rust's perspective." +"The broad answer is that no C/C++ code is \"safe\" by the normal Rust " +"standards. Calling back and forth to C/C++ from Rust may do arbitrary things " +"to memory, and compromise the safety of Rust's own data layouts. Presence of " +"_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " +"ratio of such a keyword, and is [controversial](https://steveklabnik.com/" +"writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " +"binary can cause unexpected behavior from Rust's perspective." msgstr "" "پاسخ کلی این است که هیچ کد ++C/C با استانداردهای معمول Rust \"ایمن\" نیست. " -"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه انجام " -"دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات کلیدی بسیار " -"زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین کلمه کلیدی آسیب " -"برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/the-cxx-debate) است، " -"اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust می‌تواند باعث رفتار غیرمنتظره " -"از دیدگاه Rust شود." +"فراخوانی مجدد و برگشتی به ++C/C از Rust ممکن است کارهای دلخواه را در حافظه " +"انجام دهد و ایمنی طرح‌بندی داده‌های خود Rust را به خطر بیندازد. وجود کلمات " +"کلیدی بسیار زیاد «ناامن» در تعامل ++C/C می‌تواند به نسبت سیگنال به نویز چنین " +"کلمه کلیدی آسیب برساند و این [جنجال‌برانگیز]‌(https://steveklabnik.com/writing/" +"the-cxx-debate) است، اما به طور دقیق، آوردن هر کد خارجی به یک باینری Rust " +"می‌تواند باعث رفتار غیرمنتظره از دیدگاه Rust شود." #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" -"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust `unsafe` " -"and `extern \"C\"` functions just like we did manually in the previous section." +"interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " +"`unsafe` and `extern \"C\"` functions just like we did manually in the " +"previous section." msgstr "" -"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته است " -"--- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند در بخش قبل " -"به صورت دستی انجام دادیم." +"پاسخ دقیقق دردیاگرام بالای [این صفحه](../interoperability-with-cpp.md) نهفته " +"است --- در پشت صحنه، CXX توابع Rust «ناامن» و `extern \"C\"` را درست مانند " +"در بخش قبل به صورت دستی انجام دادیم." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Exercise: Interoperability with C++" @@ -16274,13 +16755,13 @@ msgstr "قسمت اول" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In the Rust file you previously created, add a `#[cxx::bridge]` which specifies a " -"single function, to be called from C++, called `hello_from_rust`, taking no " -"parameters and returning no value." +"In the Rust file you previously created, add a `#[cxx::bridge]` which " +"specifies a single function, to be called from C++, called " +"`hello_from_rust`, taking no parameters and returning no value." msgstr "" -"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک تابع را " -"مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، بدون اینکه " -"پارامتر و هیچ مقداری برگرداند." +"در فایل Rust که قبلاً ایجاد کرده‌اید، یک `#[cxx::bridge]` اضافه کنید که یک " +"تابع را مشخص می‌کند که باید از++C فراخوانی شود که نام `hello_from_rust` دارد، " +"بدون اینکه پارامتر و هیچ مقداری برگرداند." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -16296,11 +16777,11 @@ msgstr "هدف `gn` خود را برای ایجاد این پیوندها (bindi #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"In your C++ code, remove the forward-declaration of `hello_from_rust`. Instead, " -"include the generated header file." +"In your C++ code, remove the forward-declaration of `hello_from_rust`. " +"Instead, include the generated header file." msgstr "" -"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در عوض، " -"فایل هِدِر تولید شده را اضافه کنید." +"در کد ++C خود، forward-declaration برای `hello_from_rust` را حذف کنید. در " +"عوض، فایل هِدِر تولید شده را اضافه کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" @@ -16312,11 +16793,11 @@ msgstr "قسمت دوم" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"It's a good idea to play with CXX a little. It helps you think about how flexible " -"Rust in Chromium actually is." +"It's a good idea to play with CXX a little. It helps you think about how " +"flexible Rust in Chromium actually is." msgstr "" -"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر کنید " -"که Rust در Chromium واقعا چقدر انعطاف پذیر است." +"ایده خوبی است که کمی با CXX بازی کنید. این به شما کمک می کند تا به این فکر " +"کنید که Rust در Chromium واقعا چقدر انعطاف پذیر است." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" @@ -16331,25 +16812,26 @@ msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" -"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. شما " -"باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." +"یک فایل هِدِر اضافی که می‌توانید از `cxx::bridge` خود `include!` را وارد کنید. " +"شما باید تابع ++C خود را در آن فایل هِدِر جدید اعلام کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"An `unsafe` block to call such a function, or alternatively specify the `unsafe` " -"keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/extern-c++." -"html#functions-and-member-functions)." +"An `unsafe` block to call such a function, or alternatively specify the " +"`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" +"extern-c++.html#functions-and-member-functions)." msgstr "" -"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی `unsafe` " -"را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است](https://cxx." -"rs/extern-c++.html#functions-and-member-functions)." +"یک بلوک `unsafe` برای فراخوانی چنین تابعی، یا به طور متناوب کلمه کلیدی " +"`unsafe` را در `#[cxx::bridge]` خود [همانطور که در اینجا توضیح داده شده است]" +"(https://cxx.rs/extern-c++.html#functions-and-member-functions)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"`" +"You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." +"h\"`" msgstr "" -"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/cxx." -"h\"` را وارد کنید." +"همچنین ممکن است لازم باشد`#include \"third_party/rust/cxx/v1/crate/include/" +"cxx.h\"` را وارد کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." @@ -16364,32 +16846,32 @@ msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " -"خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع Rust را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید " +"و به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" -"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و به " -"خطاهایی که می بینید عادت کنید." +"عمداً امضاهای تابع ++C را که از `#[cxx::bridge]` مطابقت ندارند، دریافت کنید و " +"به خطاهایی که می بینید عادت کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can own " -"some C++ object." +"Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " +"own some C++ object." msgstr "" -"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust بتواند " -"دارای یک C++ object باشد." +"یک `std::unique_ptr` از نوعی از ++C را به Rust ارسال کنید، به طوری که Rust " +"بتواند دارای یک C++ object باشد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you need a " -"`Box`)." +"Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " +"need a `Box`)." msgstr "" -"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. (نکته: " -"شما به یک `Box` نیاز دارید)." +"یک Rust object ایجاد کنید و آن را به ++C ارسال کنید تا ++C مالک آن باشد. " +"(نکته: شما به یک `Box` نیاز دارید)." #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." @@ -16409,9 +16891,9 @@ msgid "" "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" -"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده برای " -"Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه تعریف این " -"رابط را ترسیم کنید." +"اکنون نقاط قوت و محدودیت‌های CXX interop را درک کرده‌اید، به چند مورد استفاده " +"برای Rust در Chromium فکر کنید که در آن رابط به اندازه کافی ساده باشد. نحوه " +"تعریف این رابط را ترسیم کنید." #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" @@ -16428,39 +16910,40 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "" -"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با آن " -"مواجه شوید:" +"برخی از سؤالاتی که ممکن است با آن مواجه شوید:برخی از سوالاتی که ممکن است با " +"آن مواجه شوید:" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I'm seeing a problem initializing a variable of type X with type Y, where X and Y " -"are both function types. This is because your C++ function doesn't quite match " -"the declaration in your `cxx::bridge`." +"I'm seeing a problem initializing a variable of type X with type Y, where X " +"and Y are both function types. This is because your C++ function doesn't " +"quite match the declaration in your `cxx::bridge`." msgstr "" -"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y هر " -"دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در `cxx::" -"bridge` شما مطابقت ندارد." +"من مشکلی در مقداردهی اولیه یک متغیر از نوع X با نوع Y می‌بینم، که در آن X و Y " +"هر دو نوع تابع هستند. بخاطر اینکه تابع ++ C شما کاملاً با اعلان موجود در " +"`cxx::bridge` شما مطابقت ندارد." #: src/exercises/chromium/interoperability-with-cpp.md msgid "" -"I seem to be able to freely convert C++ references into Rust references. Doesn't " -"that risk UB? For CXX's _opaque_ types, no, because they are zero-sized. For CXX " -"trivial types yes, it's _possible_ to cause UB, although CXX's design makes it " -"quite difficult to craft such an example." +"I seem to be able to freely convert C++ references into Rust references. " +"Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" +"sized. For CXX trivial types yes, it's _possible_ to cause UB, although " +"CXX's design makes it quite difficult to craft such an example." msgstr "" -"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این خطر UB " -"را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. برای انواع " -"بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین نمونه‌ای را بسیار " -"دشوار می‌کند." +"به نظر می‌رسد می‌توانم آزادانه مراجع ++C را به منابع Rust تبدیل کنم. آیا این " +"خطر UB را ندارد؟ برای تایپ‌های _opaque_ CXX، خیر، زیرا اندازه آنها صفر است. " +"برای انواع بی‌اهمیت CXX بله، ممکن است باعث UB شود، اگرچه طراحی CXX ساخت چنین " +"نمونه‌ای را بسیار دشوار می‌کند." #: src/chromium/adding-third-party-crates.md msgid "" -"Rust libraries are called \"crates\" and are found at [crates.io](https://crates." -"io). It's _very easy_ for Rust crates to depend upon one another. So they do!" +"Rust libraries are called \"crates\" and are found at [crates.io](https://" +"crates.io). It's _very easy_ for Rust crates to depend upon one another. So " +"they do!" msgstr "" -"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates.io) " -"یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین آنها این " -"کار را انجام می‌دهند!" +"کتابخانه‌های Rust \"Crates\" نامیده می‌شوند و در [crates.io](https://crates." +"io) یافت می‌شوند. وابستگی cratesهای Rust به یکدیگر بسیار آسان است. بنابراین " +"آنها این کار را انجام می‌دهند!" #: src/chromium/adding-third-party-crates.md msgid "Property" @@ -16515,16 +16998,16 @@ msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" -"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن آن‌ها " -"در Chromium را خودکار کنیم..." +"همه crateها از یک سیستم ساخت مشترک استفاده می‌کنند، بنابراین می‌توانیم گنجاندن " +"آن‌ها در Chromium را خودکار کنیم..." #: src/chromium/adding-third-party-crates.md msgid "" -"... but, crates typically have transitive dependencies, so you will likely have " -"to bring in multiple libraries." +"... but, crates typically have transitive dependencies, so you will likely " +"have to bring in multiple libraries." msgstr "" -"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید بود " -"چندین کتابخانه را بیاورید." +"... اما، crateها معمولاً وابستگی‌های گذرا دارند، بنابراین احتمالاً مجبور خواهید " +"بود چندین کتابخانه را بیاورید." #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" @@ -16548,13 +17031,15 @@ msgstr "پیکربندی فایل `Cargo.toml` برای افزودن crateها" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" -"Chromium has a single set of centrally-managed direct crate dependencies. These " -"are managed through a single [`Cargo.toml`](https://source.chromium.org/chromium/" -"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml):" +"Chromium has a single set of centrally-managed direct crate dependencies. " +"These are managed through a single [`Cargo.toml`](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." +"toml):" msgstr "" -"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی است. " -"اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/chromium/src/" -"+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت می‌شوند :" +"‏ Chromium دارای یک مجموعه واحد از وابستگی‌های crate مستقیم با مدیریت مرکزی " +"است. اینها از طریق یک [`Cargo.toml`](https://source.chromium.org/chromium/" +"chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) مدیریت " +"می‌شوند :" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16577,13 +17062,14 @@ msgstr "" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " -"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies." -"html) --- most commonly, you'll want to specify the `features` that you wish to " -"enable in the crate." +"dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" +"dependencies.html) --- most commonly, you'll want to specify the `features` " +"that you wish to enable in the crate." msgstr "" -"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها](https://" -"doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را مشخص کنید --- " -"معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال کنید را مشخص کنید." +"مانند هر `Cargo.toml` دیگری، می‌توانید [جزئیات بیشتر در مورد وابستگی‌ها]" +"(https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html) را " +"مشخص کنید --- معمولاً شما می‌خواهید «ویژگی‌هایی» را که می‌خواهید در crate فعال " +"کنید را مشخص کنید." #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -16601,13 +17087,15 @@ msgid "" msgstr "" "در کنار `Cargo.toml` یک [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." -"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت crate " -"است." +"toml) قرار دارد. این شامل برنامه‌های extension مخصوص Chromium برای مدیریت " +"crate است." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"If you add a new crate, you should specify at least the `group`. This is one of:" -msgstr "اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" +"If you add a new crate, you should specify at least the `group`. This is one " +"of:" +msgstr "" +"اگر crate جدیدی اضافه کنید، باید حداقل`group` را مشخص کنید. این یکی از:" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -16616,27 +17104,27 @@ msgstr "به عنوان مثال،" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Depending on the crate source code layout, you may also need to use this file to " -"specify where its `LICENSE` file(s) can be found." +"Depending on the crate source code layout, you may also need to use this " +"file to specify where its `LICENSE` file(s) can be found." msgstr "" -"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل یافتن " -"فایل (های) مجوز آن استفاده کنید." +"بسته به طرح کد منبع crate، ممکن است لازم باشد از این فایل برای تعیین محل " +"یافتن فایل (های) مجوز آن استفاده کنید." #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" -"Later, we'll see some other things you will need to configure in this file to " -"resolve problems." +"Later, we'll see some other things you will need to configure in this file " +"to resolve problems." msgstr "" -"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل مشاهده " -"خواهیم کرد." +"بعداً، موارد دیگری را که برای حل مشکلات باید پیکربندی کنید، در این فایل " +"مشاهده خواهیم کرد." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"A tool called `gnrt` knows how to download crates and how to generate `BUILD.gn` " -"rules." +"A tool called `gnrt` knows how to download crates and how to generate `BUILD." +"gn` rules." msgstr "" -"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد `BUILD." -"gn` را ایجاد کند." +"ابزاری به نام `gnrt` می‌داند که چگونه جعبه‌ها را بارگیری کند و چگونه قواعد " +"`BUILD.gn` را ایجاد کند." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" @@ -16644,13 +17132,14 @@ msgstr "برای شروع، crate مورد نظر خود را به صورت زی #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"Although the `gnrt` tool is part of the Chromium source code, by running this " -"command you will be downloading and running its dependencies from `crates.io`. " -"See [the earlier section](../cargo.md) discussing this security decision." +"Although the `gnrt` tool is part of the Chromium source code, by running " +"this command you will be downloading and running its dependencies from " +"`crates.io`. See [the earlier section](../cargo.md) discussing this security " +"decision." msgstr "" -"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، وابستگی‌های آن " -"را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo.md) را در مورد این " -"تصمیم امنیتی ببینید." +"اگرچه ابزار`gnrt` بخشی از کد منبع Chromium است، با اجرای این دستور، " +"وابستگی‌های آن را از `crates.io` دانلود و اجرا می‌کنید. [بخش قبلی](../cargo." +"md) را در مورد این تصمیم امنیتی ببینید." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" @@ -16666,11 +17155,11 @@ msgstr "وابستگی های مستقیم و گذرا" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" -"New versions of other crates, as required by `cargo` to resolve the complete set " -"of crates required by Chromium." +"New versions of other crates, as required by `cargo` to resolve the complete " +"set of crates required by Chromium." msgstr "" -"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل جعبه‌های " -"مورد نیاز Chromium لازم است." +"نسخه‌های جدید crateهای دیگر، همانطور که `cargo` برای حل کردن مجموعه کامل " +"جعبه‌های مورد نیاز Chromium لازم است." #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -16678,12 +17167,13 @@ msgid "" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" -"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/rust/" -"chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره اعمال " -"می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." +"‏ Chromium وصله‌هایی را برای برخی crateها نگهداری می‌کند که در`//third_party/" +"rust/chromium_crates_io/patches` نگهداری می‌شوند. این‌ها به‌طور خودکار دوباره " +"اعمال می‌شوند، اما اگر وصله نشد، ممکن است نیاز به اقدام دستی داشته باشید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" +msgid "" +"Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "هنگامی که crate را دانلود کردید، فایل‌های `BUILD.gn` را مانند این تولید کنید:" @@ -16693,8 +17183,10 @@ msgstr "اکنون `git status` را اجرا کنید. شما باید این #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"At least one new crate source code in `third_party/rust/chromium_crates_io/vendor`" -msgstr "حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" +"At least one new crate source code in `third_party/rust/chromium_crates_io/" +"vendor`" +msgstr "" +"حداقل یک کد منبع جعبه جدید در `third_party/rust/chromium_crates_io/vendor`" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" @@ -16710,44 +17202,46 @@ msgstr "یک `README.chromium` مناسب" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"The \"major semver version\" is a [Rust \"semver\" version number](https://doc." -"rust-lang.org/cargo/reference/semver.html)." +"The \"major semver version\" is a [Rust \"semver\" version number](https://" +"doc.rust-lang.org/cargo/reference/semver.html)." msgstr "" -"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) مراجعه " -"کنید." +"لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) " +"مراجعه کنید." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md -msgid "Take a close look, especially at the things generated in `third_party/rust`." +msgid "" +"Take a close look, especially at the things generated in `third_party/rust`." msgstr "" "نگاهی دقیق بیندازید، به‌خصوص به چیزهایی که در `third_party/rust` ایجاد می‌شوند." #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" -"Talk a little about semver --- and specifically the way that in Chromium it's to " -"allow multiple incompatible versions of a crate, which is discouraged but " -"sometimes necessary in the Cargo ecosystem." +"Talk a little about semver --- and specifically the way that in Chromium " +"it's to allow multiple incompatible versions of a crate, which is " +"discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" "کمی در مورد semver --- و به‌ویژه روشی که در Chromium اجازه می‌دهد چندین نسخه " -"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo منع " -"می‌شود ولی گاهی اوقات ضروری است." +"ناسازگار از crateها را مجاز کند، صحبت کنید. این مورد که در اکوسیستم Cargo " +"منع می‌شود ولی گاهی اوقات ضروری است." #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " -"arbitrary things at build time. This is fundamentally at odds with the design of " -"`gn` and `ninja` which aim for static, deterministic, build rules to maximize " -"parallelism and repeatability of builds." +"arbitrary things at build time. This is fundamentally at odds with the " +"design of `gn` and `ninja` which aim for static, deterministic, build rules " +"to maximize parallelism and repeatability of builds." msgstr "" -"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی که " -"کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با طراحی " -"`gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر رساندن " -"موازی‌سازی و تکرارپذیری buildها است." +"اگر build شما با شکست مواجه شد، ممکن است به دلیل `build.rs` باشد: برنامه‌هایی " +"که کارهای دلخواه را در زمان build انجام می‌دهند. این مورد به‌طورکلی در تضاد با " +"طراحی `gn` و `ninja` است که هدفشان قواعد build ایستا، قطعی برای به حداکثر " +"رساندن موازی‌سازی و تکرارپذیری buildها است." #: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "Some `build.rs` actions are automatically supported; others require action:" +msgid "" +"Some `build.rs` actions are automatically supported; others require action:" msgstr "" -"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به اقدام " -"دارند:" +"برخی از اقدامات `build.rs` به طور خودکار پشتیبانی می‌شوند. دیگران نیاز به " +"اقدام دارند:" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" @@ -16806,28 +17300,30 @@ msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" -"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build scriptها " -"تنها دو عمل اصلی را انجام می‌دهند." +"خوشبختانه، اکثر crateها حاوی build script نیستند و خوشبختانه، اکثر build " +"scriptها تنها دو عمل اصلی را انجام می‌دهند." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" -"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و ببینید که " -"آیا کدهای منبع را می‌نویسد." +"اگه `ninja` درباره نبودن فایل‌ها اعتراض کرد، `build.rs` را بررسی کنید و " +"ببینید که آیا کدهای منبع را می‌نویسد." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" -"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to add " -"`build-script-outputs` to the crate. If this is a transitive dependency, that is, " -"one on which Chromium code should not directly depend, also add `allow-first-" -"party-usage=false`. There are several examples already in that file:" +"If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " +"add `build-script-outputs` to the crate. If this is a transitive dependency, " +"that is, one on which Chromium code should not directly depend, also add " +"`allow-first-party-usage=false`. There are several examples already in that " +"file:" msgstr "" -"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را تغییر " -"دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی گذرا است، " -"یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس `allow-first-" -"party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن فایل وجود دارد:" +"در این صورت، [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) را " +"تغییر دهید تا `build-script-outputs` به crate اضافه شود. اگر این یک وابستگی " +"گذرا است، یعنی وابستگی که کد Chromium نباید مستقیماً به آن وابسته باشد، پس " +"`allow-first-party-usage=false` را نیز اضافه کنید. چندین نمونه از قبل در آن " +"فایل وجود دارد:" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -16846,26 +17342,27 @@ msgstr "" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " -"`BUILD.gn` files to inform ninja that this particular output file is input to " -"subsequent build steps." +"`BUILD.gn` files to inform ninja that this particular output file is input " +"to subsequent build steps." msgstr "" -"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید تا " -"فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این فایل خروجی " -"خاص ورودی مراحل build بعدی است." +"اکنون [`gnrt.py -- gen`](../generating-gn-build-rules.md) را مجدداً اجرا کنید " +"تا فایل‌های `BUILD.gn` را دوباره تولید کنید تا به ninja اطلاع دهید که این " +"فایل خروجی خاص ورودی مراحل build بعدی است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" -"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and link C/" -"C++ libraries. Other crates parse C/C++ using [`bindgen`](https://crates.io/" -"crates/bindgen) within their build scripts. These actions can't be supported in a " -"Chromium context --- our gn, ninja and LLVM build system is very specific in " -"expressing relationships between build actions." -msgstr "" -"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای build " -"و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با استفاده از " -"[`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build خود تجزیه " -"می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- سیستم ساخت gn، " -"ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص است." +"Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " +"link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" +"crates.io/crates/bindgen) within their build scripts. These actions can't be " +"supported in a Chromium context --- our gn, ninja and LLVM build system is " +"very specific in expressing relationships between build actions." +msgstr "" +"برخی از crateها از crate مربوط به [`cc`](https://crates.io/crates/cc) برای " +"build و link کتابخانه‌های C/C++ استفاده می‌کنند. crateهای دیگر C/C++ را با " +"استفاده از [`bindgen`](https://crates.io/crates/bindgen) در اسکریپت‌های build " +"خود تجزیه می‌کنند. این فعالیت‌ها را نمی‌توان در زمینه Chromium پشتیبانی کرد --- " +"سیستم ساخت gn، ninja و LLVM ما در بیان روابط بین build actionsها بسیار خاص " +"است." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" @@ -16882,25 +17379,27 @@ msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md #, fuzzy msgid "" -"Patches should be kept in `third_party/rust/chromium_crates_io/patches/` - " -"see for example the [patches against the `cxx` crate](https://source.chromium.org/" -"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/cxx/) - " -"and will be applied automatically by `gnrt` each time it upgrades the crate." +"Patches should be kept in `third_party/rust/chromium_crates_io/patches/" +"` - see for example the [patches against the `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - and will be applied automatically by " +"`gnrt` each time it upgrades the crate." msgstr "" -"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/` " -"نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://source.chromium." -"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" -"cxx/) - و هر بار که crate را upgrade می‌کند به‌طور خودکار توسط`gnrt` اعمال می‌شود." +"وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" +"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" +"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " +"خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" -"Once you've added a third-party crate and generated build rules, depending on a " -"crate is simple. Find your `rust_static_library` target, and add a `dep` on the `:" -"lib` target within your crate." +"Once you've added a third-party crate and generated build rules, depending " +"on a crate is simple. Find your `rust_static_library` target, and add a " +"`dep` on the `:lib` target within your crate." msgstr "" -"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با توجه " -"به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود را پیدا " -"کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." +"هنگامی که یک crate شخص ثالث اضافه کردید و قواعد build را ایجاد کردید که با " +"توجه به نوع crate می‌تواند ساده باشد. درنتیجه هدف `rust_static_library` خود " +"را پیدا کنید و یک `dep` روی هدف `:lib` در crate خود اضافه کنید." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," @@ -16910,13 +17409,15 @@ msgstr "به‌طور‌مشخص،" msgid "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +----------------------+\n" -"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":lib\"\n" +"\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" +"lib\"\n" " +------------+ +----------------------+\n" "```" @@ -16945,41 +17446,43 @@ msgstr "حسابرسی Crateهای شخص ثالث" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" -"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust.md#Third_party-" -"review), but of course also subject to security review. As you may be bringing in " -"not just a single crate but also transitive dependencies, there may be a lot of " -"code to review. On the other hand, safe Rust code can have limited negative side " -"effects. How should you review it?" -msgstr "" -"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/chromium/" -"src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به Chromium است، اما " -"البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن است نه تنها یک crate، " -"بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای زیادی برای بررسی وجود داشته " -"باشد. از سوی دیگر، safe Rust code می‌تواند عوارض جانبی محدودی داشته باشد. پس " -"چگونه باید آن را بررسی کنید؟" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Third_party-review), but of course also subject to security review. As " +"you may be bringing in not just a single crate but also transitive " +"dependencies, there may be a lot of code to review. On the other hand, safe " +"Rust code can have limited negative side effects. How should you review it?" +msgstr "" +"افزودن کتابخانه‌های جدید تابع [قواعد](https://chromium.googlesource.com/" +"chromium/src/+/refs/heads/main/docs/rust.md#Third_party-review) مربوط به " +"Chromium است، اما البته موضوع بررسی امنیتی نیز وجود دارد. از آنجایی که ممکن " +"است نه تنها یک crate، بلکه وابستگی‌های گذرا را نیز وارد کنید، ممکن است کدهای " +"زیادی برای بررسی وجود داشته باشد. از سوی دیگر، safe Rust code می‌تواند عوارض " +"جانبی محدودی داشته باشد. پس چگونه باید آن را بررسی کنید؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Over time Chromium aims to move to a process based around [cargo vet](https://" -"mozilla.github.io/cargo-vet/)." +"Over time Chromium aims to move to a process based around [cargo vet]" +"(https://mozilla.github.io/cargo-vet/)." msgstr "" -"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://mozilla." -"github.io/cargo-vet/) حرکت کند." +"با گذشت زمان، Chromium قصد دارد به فرآیندی بر اساس [cargo vet](https://" +"mozilla.github.io/cargo-vet/) حرکت کند." #: src/chromium/adding-third-party-crates/reviews-and-audits.md -msgid "Meanwhile, for each new crate addition, we are checking for the following:" +msgid "" +"Meanwhile, for each new crate addition, we are checking for the following:" msgstr "در همین حال، برای هر crate جدید اضافه شده، موارد زیر را بررسی می کنیم:" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Understand why each crate is used. What's the relationship between crates? If the " -"build system for each crate contains a `build.rs` or procedural macros, work out " -"what they're for. Are they compatible with the way Chromium is normally built?" +"Understand why each crate is used. What's the relationship between crates? " +"If the build system for each crate contains a `build.rs` or procedural " +"macros, work out what they're for. Are they compatible with the way Chromium " +"is normally built?" msgstr "" -"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت هر " -"جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص کنید که " -"آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول ساخته و built " -"می‌شود سازگار هستند؟" +"بدانید که چرا هر crate استفاده می‌شود. رابطه بین crateها چیست؟ اگر سیستم ساخت " +"هر جعبه حاوی `build.rs` یا ماکروهای رویه‌ای (procedural macros) است، مشخص " +"کنید که آن‌ها برای چه چیزی هستند. آیا آنها با روشی که Chromium به طور معمول " +"ساخته و built می‌شود سازگار هستند؟" #: src/chromium/adding-third-party-crates/reviews-and-audits.md #, fuzzy @@ -16994,18 +17497,19 @@ msgid "" "cargo.md))" msgstr "" "از `cd third-party/rust/chromium_crates_io; cargo audit` استفاده کنید. بررسی " -"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-audit` " -"که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo.md))" +"cargo برای بررسی آسیب‌پذیری‌های شناخته‌شده (ابتدا باید `cargo install cargo-" +"audit` که از قضا شامل دانلود وابستگی‌های زیادی از اینترنت می‌شود[2](../cargo." +"md))" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Ensure any `unsafe` code is good enough for the [Rule of Two](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" -"safe-languages)" +"Ensure any `unsafe` code is good enough for the [Rule of Two](https://" +"chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." +"md#unsafe-code-in-safe-languages)" msgstr "" "مطمئن شوید هر کد `unsafe` به اندازه کافی برای [قاعده دو](https://chromium." -"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-in-" -"safe-languages) خوب است" +"googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md#unsafe-code-" +"in-safe-languages) خوب است" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" @@ -17013,21 +17517,21 @@ msgstr "هرگونه استفاده از APIهای `fs` یا `net` را بررس #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"Read all the code at a sufficient level to look for anything out of place that " -"might have been maliciously inserted. (You can't realistically aim for 100% " -"perfection here: there's often just too much code.)" +"Read all the code at a sufficient level to look for anything out of place " +"that might have been maliciously inserted. (You can't realistically aim for " +"100% perfection here: there's often just too much code.)" msgstr "" -"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب وارد " -"شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال نتیجه ۱۰۰ " -"درصدی باشید: اغلب کدهای زیادی وجود دارد.)" +"تمام کدها را در سطح کافی بخوانید تا به دنبال هر چیزی که ممکن است به طور مخرب " +"وارد شده باشد را بگردید. (در اینجا نمی توانید به طور واقع بینانه به دنبال " +"نتیجه ۱۰۰ درصدی باشید: اغلب کدهای زیادی وجود دارد.)" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" -"These are just guidelines --- work with reviewers from `security@chromium.org` to " -"work out the right way to become confident of the crate." +"These are just guidelines --- work with reviewers from `security@chromium." +"org` to work out the right way to become confident of the crate." msgstr "" -"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` کار " -"کنید تا راه درستی برای اطمینان از crate پیدا کنید." +"این‌ها فقط دستورالعمل‌هایی هستند --- با بازبین‌هایی از `security@chromium.org` " +"کار کنید تا راه درستی برای اطمینان از crate پیدا کنید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" @@ -17046,7 +17550,8 @@ msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" -"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//`" +"متادیتا (`BUILD.gn` و `README.chromium`) in `//third_party/rust//" +"`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." @@ -17054,16 +17559,16 @@ msgstr "لطفاً یک فایل`OWNERS` در مکان دیگر نیز اضاف #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` " -"changes, into the Chromium repo." +"You should land all this, along with your `Cargo.toml` and `gnrt_config." +"toml` changes, into the Chromium repo." msgstr "" -"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در مخزن " -"Chromium قرار دهید." +"باید همه اینها را به همراه تغییرات `Cargo.toml` و `gnrt_config.toml` خود در " +"مخزن Chromium قرار دهید." #: src/chromium/adding-third-party-crates/checking-in.md msgid "" -"**Important**: you need to use `git add -f` because otherwise `.gitignore` files " -"may result in some files being skipped." +"**Important**: you need to use `git add -f` because otherwise `.gitignore` " +"files may result in some files being skipped." msgstr "" "**مهم**: باید از `git add -f` استفاده کنید زیرا در غیر این صورت فایل‌های `." "gitignore` ممکن است منجر به حذف برخی از فایل‌ها شود." @@ -17072,48 +17577,49 @@ msgstr "" #, fuzzy msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " -"language. This is because Rust crate data tends to include names of git branches, " -"and many projects still use non-inclusive terminology there. So you may need to " -"run:" +"language. This is because Rust crate data tends to include names of git " +"branches, and many projects still use non-inclusive terminology there. So " +"you may need to run:" msgstr "" "در حین انجام این کار، ممکن است متوجه شوید که بررسی‌های پیش‌ارسال به دلیل زبان " -"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل نام " -"شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا استفاده " -"می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" +"غیرمطرح با شکست مواجه می‌شوند. بخاطر این که داده‌های Rust crate معمولاً شامل " +"نام شاخه‌های git می‌شوند و بسیاری از پروژه‌ها هنوز از اصطلاحات غیرمطرح در آنجا " +"استفاده می‌کنند. بنابراین ممکن است لازم باشد این موارد را اجرا کنید:" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" -"As the OWNER of any third party Chromium dependency, you are [expected to keep it " -"up to date with any security fixes](https://chromium.googlesource.com/chromium/" -"src/+/main/docs/adding_to_third_party.md#add-owners). It is hoped that we will " -"soon automate this for Rust crates, but for now, it's still your responsibility " -"just as it is for any other third party dependency." +"As the OWNER of any third party Chromium dependency, you are [expected to " +"keep it up to date with any security fixes](https://chromium.googlesource." +"com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " +"hoped that we will soon automate this for Rust crates, but for now, it's " +"still your responsibility just as it is for any other third party dependency." msgstr "" "شما به‌عنوان مالک هر وابستگی شخص ثالث Chromium، [انتظار می‌رود آن را با هرگونه " -"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/src/+/" -"main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی این را " -"برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت شماست، همانطور که " -"برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." +"اصلاحات امنیتی به‌روز نگه دارید](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/adding_to_third_party.md#add-owners). امید است که ما به زودی " +"این را برای crateهای Rust خودکار کنیم، اما در حال حاضر، همچنان مسئولیت " +"شماست، همانطور که برای هر وابستگی به شخص ثالث دیگر این مسئولیت را دارید." #: src/exercises/chromium/third-party.md #, fuzzy msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " -"crate's [default features](https://doc.rust-lang.org/cargo/reference/features." -"html#the-default-feature). Assume that the crate will be used in shipping " -"Chromium, but won't be used to handle untrustworthy input." -msgstr "" -"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و [ویژگی‌های " -"پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features.html#the-default-" -"feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای Chromium استفاده می‌شود، " -"اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده نمی‌شود." +"crate's [default features](https://doc.rust-lang.org/cargo/reference/" +"features.html#the-default-feature). Assume that the crate will be used in " +"shipping Chromium, but won't be used to handle untrustworthy input." +msgstr "" +"‏ [uwuify](https://crates.io/crates/uwuify) را به Chromium اضافه کنید و " +"[ویژگی‌های پیش‌فرض](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature). فرض کنید از crate در ارسال و دریافت بسته‌ها برای " +"Chromium استفاده می‌شود، اما برای رسیدگی به ورودی‌های غیرقابل اعتماد استفاده " +"نمی‌شود." #: src/exercises/chromium/third-party.md msgid "" -"(In the next exercise we'll use uwuify from Chromium, but feel free to skip ahead " -"and do that now if you like. Or, you could create a new [`rust_executable` target]" -"(https://source.chromium.org/chromium/chromium/src/+/main:build/rust/" -"rust_executable.gni) which uses `uwuify`)." +"(In the next exercise we'll use uwuify from Chromium, but feel free to skip " +"ahead and do that now if you like. Or, you could create a new " +"[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" +"+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" "(در تمرین بعدی از uwuify برای Chromium استفاده خواهیم کرد، اما در صورت تمایل " "می‌توانید این کار را انجام دهید. همینطور می‌توانید یک هدف ['rust_executable']" @@ -17162,17 +17668,18 @@ msgstr "`uwuify`." #: src/exercises/chromium/third-party.md msgid "" -"If students are downloading even more than that, they probably forgot to turn off " -"the default features." +"If students are downloading even more than that, they probably forgot to " +"turn off the default features." msgstr "" -"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که ویژگی‌های " -"پیش‌فرض را خاموش کنند." +"اگر دانش‌آموزان حتی بیشتر از آن دانلود می‌کنند، احتمالا فراموش کرده‌اند که " +"ویژگی‌های پیش‌فرض را خاموش کنند." #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" -"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این crate!" +"با تشکر از [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) برای این " +"crate!" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" @@ -17183,8 +17690,8 @@ msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" -"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه چیزهایی " -"را که قبلاً یاد گرفته‌اید جمع آوری کنید." +"در این تمرین، می‌خواهید یک ویژگی کاملاً جدید Chromium را اضافه کنید و همه " +"چیزهایی را که قبلاً یاد گرفته‌اید جمع آوری کنید." #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" @@ -17192,43 +17699,46 @@ msgstr "خلاصه‌ای از مدیریت محصول" #: src/exercises/chromium/bringing-it-together.md msgid "" -"A community of pixies has been discovered living in a remote rainforest. It's " -"important that we get Chromium for Pixies delivered to them as soon as possible." +"A community of pixies has been discovered living in a remote rainforest. " +"It's important that we get Chromium for Pixies delivered to them as soon as " +"possible." msgstr "" -"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. مهم " -"است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." +"جامعه‌ای از pixyها کشف شده است که در یک جنگل بارانی دور افتاده زندگی می کنند. " +"مهم است که Chromium برای pixyها را در اسرع وقت به آنها تحویل دهیم." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The requirement is to translate all Chromium's UI strings into Pixie language." +"The requirement is to translate all Chromium's UI strings into Pixie " +"language." msgstr "" -"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه شوند." +"لازمه کار این است که تمام stringهای رابط کاربری Chromium به زبان Pixie ترجمه " +"شوند." #: src/exercises/chromium/bringing-it-together.md msgid "" -"There's not time to wait for proper translations, but fortunately pixie language " -"is very close to English, and it turns out there's a Rust crate which does the " -"translation." +"There's not time to wait for proper translations, but fortunately pixie " +"language is very close to English, and it turns out there's a Rust crate " +"which does the translation." msgstr "" -"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان pixie " -"بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد که ترجمه را " -"انجام می‌دهد." +"زمانی برای منتظر ماندن برای ترجمه‌های مناسب وجود ندارد، اما خوشبختانه زبان " +"pixie بسیار نزدیک به انگلیسی است و به نظر می‌رسد که Rust crate ای وجود دارد " +"که ترجمه را انجام می‌دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" -"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/crates/" -"uwuify)." +"در واقع، شما قبلا [آن crate را در تمرین قبلی وارد کردید](https://crates.io/" +"crates/uwuify)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"(Obviously, real translations of Chrome require incredible care and diligence. " -"Don't ship this!)" +"(Obviously, real translations of Chrome require incredible care and " +"diligence. Don't ship this!)" msgstr "" -"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. این " -"مورد را ارسال نکنید!)" +"(بدیهی است که ترجمه های واقعی Chrome نیاز به دقت و تلاش باورنکردنی دارند. " +"این مورد را ارسال نکنید!)" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" @@ -17237,88 +17747,89 @@ msgstr "گام‌ها" #: src/exercises/chromium/bringing-it-together.md msgid "" "Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " -"strings before display. In this special build of Chromium, it should always do " -"this irrespective of the setting of `mangle_localized_strings_`." +"strings before display. In this special build of Chromium, it should always " +"do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" -"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها را " -"قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن تنظیمات " -"`mangle_localized_strings_` همیشه باید این کار را انجام دهد." +"‏ `ResourceBundle::MaybeMangleLocalizedString` را تغییر دهید تا همه stringها " +"را قبل از نمایش یکپارچه کند. در این build خاص Chromium، بدون در نظر گرفتن " +"تنظیمات `mangle_localized_strings_` همیشه باید این کار را انجام دهد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"If you've done everything right across all these exercises, congratulations, you " -"should have created Chrome for pixies!" +"If you've done everything right across all these exercises, congratulations, " +"you should have created Chrome for pixies!" msgstr "" -"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome را " -"برای pixies ایجاد می‌کردید!" +"اگر همه این تمرین‌ها را درست انجام داده‌اید، به شما تبریک می‌گوییم، باید Chrome " +"را برای pixies ایجاد می‌کردید!" #: src/exercises/chromium/bringing-it-together.md msgid "" -"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and " -"will probably decide that it's better to do the conversion on the C++ side using " -"`base::UTF16ToUTF8` and back again." +"UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " +"and will probably decide that it's better to do the conversion on the C++ " +"side using `base::UTF16ToUTF8` and back again." msgstr "" -"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 هستند و " -"احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده از `base::" -"UTF16ToUTF8` انجام دهند و دوباره برگردند." +"‏ UTF16 در مقابل UTF8. دانش‌آموزان باید بدانند که stringهای Rust همیشه UTF8 " +"هستند و احتمالاً تصمیم خواهند گرفت که بهتر است تبدیل را در سمت C++ با استفاده " +"از `base::UTF16ToUTF8` انجام دهند و دوباره برگردند." #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " "consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." -"String.html#method.from_utf16), consider error handling, and consider which [CXX " -"supported types can transfer a lot of u16s](https://cxx.rs/binding/slice.html)." +"String.html#method.from_utf16), consider error handling, and consider which " +"[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" +"slice.html)." msgstr "" -"اگر دانش‌آموزان تصمیم بگیرند که تبدیل را در سمت Rust انجام دهند، باید [`String::" -"from_utf16`](https://doc.rust-lang.org/std/string/struct.String.html#method را در " -"نظر بگیرند. مدیریت خطا را در نظر بگیرید و در نظر داشته باشید که کدام [نوع های " -"پشتیبانی شده از CXX می توانند تعداد زیادی از u16 ها را منتقل کنند](https://cxx.rs/" -"binding/slice.html)." +"اگر دانش‌آموزان تصمیم بگیرند که تبدیل را در سمت Rust انجام دهند، باید " +"[`String::from_utf16`](https://doc.rust-lang.org/std/string/struct.String." +"html#method را در نظر بگیرند. مدیریت خطا را در نظر بگیرید و در نظر داشته " +"باشید که کدام [نوع های پشتیبانی شده از CXX می توانند تعداد زیادی از u16 ها " +"را منتقل کنند](https://cxx.rs/binding/slice.html)." #: src/exercises/chromium/bringing-it-together.md msgid "" -"Students may design the C++/Rust boundary in several different ways, e.g. taking " -"and returning strings by value, or taking a mutable reference to a string. If a " -"mutable reference is used, CXX will likely tell the student that they need to use " -"[`Pin`](https://doc.rust-lang.org/std/pin/). You may need to explain what `Pin` " -"does, and then explain why CXX needs it for mutable references to C++ data: the " -"answer is that C++ data can't be moved around like Rust data, because it may " -"contain self-referential pointers." -msgstr "" -"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان مثال. " -"گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر به یک " -"string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز می‌گوید که " -"باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. ممکن است لازم " -"باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به آن برای ارجاع‌های " -"قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که داده‌های C++ را نمی‌توان " -"مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی نشانگرهای خودارجاعی (self-" -"referential pointers) باشد." +"Students may design the C++/Rust boundary in several different ways, e.g. " +"taking and returning strings by value, or taking a mutable reference to a " +"string. If a mutable reference is used, CXX will likely tell the student " +"that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " +"need to explain what `Pin` does, and then explain why CXX needs it for " +"mutable references to C++ data: the answer is that C++ data can't be moved " +"around like Rust data, because it may contain self-referential pointers." +msgstr "" +"دانش‌آموزها ممکن است مرز C++/Rust را به روش های مختلف طراحی کنند، به عنوان " +"مثال. گرفتن و برگرداندن stringها بر اساس مقدار، یا گرفتن یک مرجع قابل تغییر " +"به یک string. اگر از یک مرجع قابل تغییر استفاده شود، CXX احتمالاً به دانش‌آموز " +"می‌گوید که باید از [`Pin`](https://doc.rust-lang.org/std/pin/) استفاده کند. " +"ممکن است لازم باشد توضیح دهید `Pin` چه می‌کند و سپس توضیح دهید که چرا CXX به " +"آن برای ارجاع‌های قابل تغییر به داده‌های C++ نیاز دارد: پاسخ این است که " +"داده‌های C++ را نمی‌توان مانند داده‌های Rust جابه‌جا کرد، زیرا ممکن است حاوی " +"نشانگرهای خودارجاعی (self-referential pointers) باشد." #: src/exercises/chromium/bringing-it-together.md msgid "" -"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will need " -"to depend on a `rust_static_library` target. The student probably already did " -"this." +"The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " +"need to depend on a `rust_static_library` target. The student probably " +"already did this." msgstr "" "هدف C++ حاوی `ResourceBundle::MaybeMangleLocalizedString` باید به هدف " -"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام داده " -"است." +"`rust_static_library` وابسته باشد. دانش‌آموز احتمالاً از قبل این کار را انجام " +"داده است." #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" -"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` وابسته " -"باشد." +"هدف `rust_static_library` باید به `//third_party/rust/uwuify/v0_2:lib` " +"وابسته باشد." #: src/exercises/chromium/solutions.md msgid "" -"Solutions to the Chromium exercises can be found in [this series of CLs](https://" -"chromium-review.googlesource.com/c/chromium/src/+/5096560)." +"Solutions to the Chromium exercises can be found in [this series of CLs]" +"(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" -"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-review." -"googlesource.com/c/chromium/src/+/5096560) پیدا کنید." +"راه‌حل‌های تمرینات Chromium را می‌توانید در [این سری از CLs](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560) پیدا کنید." #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" @@ -17326,22 +17837,22 @@ msgstr "به Bare Metal Rust خوش آمدید" #: src/bare-metal.md msgid "" -"This is a standalone one-day course about bare-metal Rust, aimed at people who " -"are familiar with the basics of Rust (perhaps from completing the Comprehensive " -"Rust course), and ideally also have some experience with bare-metal programming " -"in some other language such as C." +"This is a standalone one-day course about bare-metal Rust, aimed at people " +"who are familiar with the basics of Rust (perhaps from completing the " +"Comprehensive Rust course), and ideally also have some experience with bare-" +"metal programming in some other language such as C." msgstr "" -"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با اصول " -"Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز تجربه " -"برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." +"این یک دوره مستقل یک روزه در مورد bare-metal Rust است که با هدف افرادی که با " +"اصول Rust آشنا هستند (شاید از اتمام دوره جامع Rust) و در حالت ایده آل نیز " +"تجربه برنامه‌نویسی bare-metal به زبان دیگری را دارند، مانند C می‌باشد." #: src/bare-metal.md msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" -"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون سیستم‌عامل " -"در ادامه به چند بخش تقسیم خواهد شد:" +"امروز ما در مورد'bare-metal' Rust صحبت خواهیم کرد: اجرای کد Rust بدون " +"سیستم‌عامل در ادامه به چند بخش تقسیم خواهد شد:" #: src/bare-metal.md msgid "What is `no_std` Rust?" @@ -17362,21 +17873,24 @@ msgstr "برخی از crateهای مفید برای توسعه bare-metal Rust." #: src/bare-metal.md msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" -"(https://microbit.org/) v2 as an example. It's a [development board](https://tech." -"microbit.org/hardware/) based on the Nordic nRF52833 microcontroller with some " -"LEDs and buttons, an I2C-connected accelerometer and compass, and an on-board SWD " -"debugger." +"(https://microbit.org/) v2 as an example. It's a [development board](https://" +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " +"with some LEDs and buttons, an I2C-connected accelerometer and compass, and " +"an on-board SWD debugger." msgstr "" #: src/bare-metal.md -msgid "To get started, install some tools we'll need later. On gLinux or Debian:" +msgid "" +"To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" -"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس یا " -"دبیان:" +"برای شروع، ابزارهایی را که بعداً به آنها نیاز خواهیم داشت نصب کنید. در لینوکس " +"یا دبیان:" #: src/bare-metal.md -msgid "And give users in the `plugdev` group access to the micro:bit programmer:" -msgstr "و به کاربران گروه `plugdev` اجازه دسترسی به برنامه‌نویس micro:bit را بدهید:" +msgid "" +"And give users in the `plugdev` group access to the micro:bit programmer:" +msgstr "" +"و به کاربران گروه `plugdev` اجازه دسترسی به برنامه‌نویس micro:bit را بدهید:" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" @@ -17504,26 +18018,26 @@ msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" -"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را `panic = " -"\"abort\"` کامپایل کنید." +"بسته به هدف، ممکن است لازم باشد برای جلوگیری از خطای `eh_personality` را " +"`panic = \"abort\"` کامپایل کنید." #: src/bare-metal/minimal.md msgid "" -"Note that there is no `main` or any other entry point; it's up to you to define " -"your own entry point. This will typically involve a linker script and some " -"assembly code to set things up ready for Rust code to run." +"Note that there is no `main` or any other entry point; it's up to you to " +"define your own entry point. This will typically involve a linker script and " +"some assembly code to set things up ready for Rust code to run." msgstr "" -"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما بستگی " -"دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker و مقداری " -"کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." +"توجه داشته باشید که `main` یا هیچ نقطه ورودی دیگری وجود ندارد. این به شما " +"بستگی دارد که نقطه ورود خود را تعریف کنید. این معمولاً شامل یک اسکریپت linker " +"و مقداری کد اسمبلی برای تنظیم موارد آماده برای اجرای کد Rust است." #: src/bare-metal/alloc.md msgid "" -"To use `alloc` you must implement a [global (heap) allocator](https://doc.rust-" -"lang.org/stable/std/alloc/trait.GlobalAlloc.html)." +"To use `alloc` you must implement a [global (heap) allocator](https://doc." +"rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" -"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-lang." -"org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." +"برای استفاده از `alloc` باید یک [global (heap) allocator](https://doc.rust-" +"lang.org/stable/std/alloc/trait.GlobalAlloc.html) را پیاده‌سازی کنید." #: src/bare-metal/alloc.md #, fuzzy @@ -17547,36 +18061,36 @@ msgstr "String" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy system " -"allocator. Other crates are available, or you can write your own or hook into " -"your existing allocator." +"`buddy_system_allocator` is a third-party crate implementing a basic buddy " +"system allocator. Other crates are available, or you can write your own or " +"hook into your existing allocator." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " -"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " -"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/alloc.md msgid "" -"The const parameter of `LockedHeap` is the max order of the allocator; i.e. in " -"this case it can allocate regions of up to 2\\*\\*32 bytes." +"The const parameter of `LockedHeap` is the max order of the allocator; i.e. " +"in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" -"پارامتر const `LockedHeap` حداکثر ترتیب تخصیص‌دهنده (allocator) است. یعنی در این " -"مورد می‌تواند مناطقی تا 2\\*\\*32 بایت را اختصاص دهد." +"پارامتر const `LockedHeap` حداکثر ترتیب تخصیص‌دهنده (allocator) است. یعنی در " +"این مورد می‌تواند مناطقی تا 2\\*\\*32 بایت را اختصاص دهد." #: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " -"exactly one global allocator defined in your binary. Usually this is done in the " -"top-level binary crate." +"exactly one global allocator defined in your binary. Usually this is done in " +"the top-level binary crate." msgstr "" "اگر هر crate ای در درخت وابستگی شما به `alloc` بستگی دارد، باید دقیقاً یک " -"تخصیص‌دهنده سراسری در باینری خود تعریف کنید. معمولاً این کار در binary crate سطح " -"بالا انجام می‌شود." +"تخصیص‌دهنده سراسری در باینری خود تعریف کنید. معمولاً این کار در binary crate " +"سطح بالا انجام می‌شود." #: src/bare-metal/alloc.md msgid "" -"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` crate " -"is linked in so we get its panic handler." +"`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " +"crate is linked in so we get its panic handler." msgstr "" "برای اطمینان از اینکه `panic_halt` crate لینک شده است، استفاده `extern crate " "panic_halt as _` ضروری است، بنابراین panic handler آن را دریافت می‌کنیم." @@ -17587,27 +18101,27 @@ msgstr "این مثال ساخته می شود اما اجرا نمی‌شود، #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt` crate provides (among other things) a reset handler for Cortex " -"M microcontrollers." +"The `cortex_m_rt` crate provides (among other things) a reset handler for " +"Cortex M microcontrollers." msgstr "" -"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای میکروکنترلرهای " -"Cortex M فراهم می‌کند." +"یک `cortex_m_rt` crate (در میان چیزهای دیگر) یکreset handler برای " +"میکروکنترلرهای Cortex M فراهم می‌کند." #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" -"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع بررسی " -"خواهیم کرد." +"در ادامه نحوه دسترسی به لوازم جانبی (peripherals) را با افزایش سطح انتزاع " +"بررسی خواهیم کرد." #: src/bare-metal/microcontrollers.md msgid "" -"The `cortex_m_rt::entry` macro requires that the function have type `fn() -> !`, " -"because returning to the reset handler doesn't make sense." +"The `cortex_m_rt::entry` macro requires that the function have type `fn() -" +"> !`, because returning to the reset handler doesn't make sense." msgstr "" -"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::entry` " -"باشد، زیرا بازگشت به reset handler منطقی نیست." +"ماکرو `cortex_m_rt::entry` مستلزم این است که تابع دارای نوع `cortex_m_rt::" +"entry` باشد، زیرا بازگشت به reset handler منطقی نیست." #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" @@ -17615,8 +18129,8 @@ msgstr "مثال را با `cargo embed --bin minimal` اجرا کنید" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"Most microcontrollers access peripherals via memory-mapped IO. Let's try turning " -"on an LED on our micro:bit:" +"Most microcontrollers access peripherals via memory-mapped IO. Let's try " +"turning on an LED on our micro:bit:" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -17634,7 +18148,8 @@ msgstr "// GPIO peripheral offsets\n" msgid "// PIN_CNF fields\n" msgstr "// PIN_CNF fields\n" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" @@ -17649,7 +18164,8 @@ msgstr "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #, fuzzy msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" @@ -17657,11 +18173,13 @@ msgstr "// Set pin 28 low and pin 21 high to turn the LED on.\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 to " -"the first row." -msgstr "در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." +"GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " +"to the first row." +msgstr "" +"در GPIO 0 پایه ۲۱ به ستون اول ماتریس LED و پایه ۲۸ به ردیف اول متصل است." -#: src/bare-metal/microcontrollers/mmio.md src/bare-metal/microcontrollers/pacs.md +#: src/bare-metal/microcontrollers/mmio.md +#: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" @@ -17674,37 +18192,39 @@ msgstr "Crateهای دسترسی جانبی" #: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " -"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/pack/" -"doc/CMSIS/SVD/html/index.html) files." +"wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" +"pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" -"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust عمدتاً " -"ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD](https://www." -"keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." +"گزینه [`svd2rust`](https://crates.io/crates/svd2rust) که wrapperهای Rust " +"عمدتاً ایمن را برای تجهیزات جانبی دارای memory-map از فایل‌های[CMSIS-SVD]" +"(https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) تولید می‌کند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD (System View Description) files are XML files typically provided by silicon " -"vendors which describe the memory map of the device." +"SVD (System View Description) files are XML files typically provided by " +"silicon vendors which describe the memory map of the device." msgstr "" -"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً توسط " -"فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را توصیف می‌کنند." +"فایل‌های SVD (System View Description) در واقع فایل‌های XML هستند که معمولاً " +"توسط فروشندگان تجهیزات ریزپردازنده ارائه می‌شوند که memory map دستگاه را " +"توصیف می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "" "They are organised by peripheral, register, field and value, with names, " "descriptions, addresses and so on." msgstr "" -"آنها بر اساس peripheral، register، field و value، با نام، توضیحات، آدرس و غیره " -"سازماندهی می‌شوند." +"آنها بر اساس peripheral، register، field و value، با نام، توضیحات، آدرس و " +"غیره سازماندهی می‌شوند." #: src/bare-metal/microcontrollers/pacs.md msgid "" -"SVD files are often buggy and incomplete, so there are various projects which " -"patch the mistakes, add missing details, and publish the generated crates." +"SVD files are often buggy and incomplete, so there are various projects " +"which patch the mistakes, add missing details, and publish the generated " +"crates." msgstr "" -"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد که " -"اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید شده را " -"منتشر می‌کنند." +"فایل‌های SVD اغلب دارای باگ و ناقص هستند، بنابراین پروژه‌های مختلفی وجود دارد " +"که اشتباهات را اصلاح می‌کنند، جزئیات گمشده را اضافه می‌کنند و crateهای تولید " +"شده را منتشر می‌کنند." #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." @@ -17712,11 +18232,11 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "" -"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac " -"-- -d --no-show-raw-insn` to see the resulting binary." +"If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " +"pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" -"اگر`cargo install cargo-binutils` را انجام دهید، می‌توانید `cargo objdump --bin " -"pac -- -d --no-show-raw-insn` را اجرا کنید تا باینری حاصل را ببینید." +"اگر`cargo install cargo-binutils` را انجام دهید، می‌توانید `cargo objdump --" +"bin pac -- -d --no-show-raw-insn` را اجرا کنید تا باینری حاصل را ببینید." #: src/bare-metal/microcontrollers/hals.md msgid "HAL crates" @@ -17725,14 +18245,14 @@ msgstr "HAL crates" #: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" -"implementation-crates) for many microcontrollers provide wrappers around various " -"peripherals. These generally implement traits from [`embedded-hal`](https://" -"crates.io/crates/embedded-hal)." +"implementation-crates) for many microcontrollers provide wrappers around " +"various peripherals. These generally implement traits from [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal)." msgstr "" "این [crateهای HAL]‌(https://github.com/rust-embedded/wesome-embedded-rust#hal-" "implementation-crates) برای بسیاری از میکروکنترلرها بسته‌بندی‌هایی را در اطراف " -"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`](https://" -"crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." +"تجهیزات جانبی مختلف ارائه می‌دهند. اینها معمولاً ویژگی‌های [`embedded-hal`]" +"(https://crates.io/crates/embedded-hal) را پیاده‌سازی می‌کنند." #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" @@ -17745,8 +18265,8 @@ msgstr "" #: src/bare-metal/microcontrollers/hals.md msgid "" -"HAL crates exist for many Cortex-M and RISC-V devices, including various STM32, " -"GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." +"HAL crates exist for many Cortex-M and RISC-V devices, including various " +"STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" "بسیاری از HAL crateها برای انواعی از دستگاه های Cortex-M و RISC-V از جمله " "میکروکنترلرهای STM32، GD32، nRF، NXP، MSP430، AVR و PIC مختلف وجود دارد." @@ -17758,19 +18278,19 @@ msgstr "Board support crates" #: src/bare-metal/microcontrollers/board-support.md #, fuzzy msgid "" -"Board support crates provide a further level of wrapping for a specific board for " -"convenience." +"Board support crates provide a further level of wrapping for a specific " +"board for convenience." msgstr "" -"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک board " -"خاص فراهم می‌کنند." +"پشتیبانی crateهای Boardها که برای راحتی بیشتر سطح پوششی بیشتری را برای یک " +"board خاص فراهم می‌کنند." #: src/bare-metal/microcontrollers/board-support.md msgid "" -"In this case the board support crate is just providing more useful names, and a " -"bit of initialisation." +"In this case the board support crate is just providing more useful names, " +"and a bit of initialisation." msgstr "" -"در این مورد crate پشتیبانی برد فقط نام‌های مفیدتر و مقداری مقداردهی اولیه را ارائه " -"می‌دهد." +"در این مورد crate پشتیبانی برد فقط نام‌های مفیدتر و مقداری مقداردهی اولیه را " +"ارائه می‌دهد." #: src/bare-metal/microcontrollers/board-support.md msgid "" @@ -17800,42 +18320,42 @@ msgstr "// pin_input.is_high(); // Error, moved.\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Pins don't implement `Copy` or `Clone`, so only one instance of each can exist. " -"Once a pin is moved out of the port struct nobody else can take it." +"Pins don't implement `Copy` or `Clone`, so only one instance of each can " +"exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" -"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام می‌تواند " -"وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس دیگری نمی " -"تواند آن را بگیرد." +"پین‌ها `Copy` یا `Clone` را اجرا نمی‌کنند، بنابراین فقط یک نمونه از هر کدام " +"می‌تواند وجود داشته باشد. هنگامی که یک pin از ساختار پورت خارج می شود، هیچ کس " +"دیگری نمی تواند آن را بگیرد." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"Changing the configuration of a pin consumes the old pin instance, so you can’t " -"keep use the old instance afterwards." +"Changing the configuration of a pin consumes the old pin instance, so you " +"can’t keep use the old instance afterwards." msgstr "" -"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از آن از " -"pin قدیمی استفاده کنید." +"تغییر پیکربندی pin، نمونه pin ​​قدیمی را مصرف می‌کند، بنابراین نمی‌توانید پس از " +"آن از pin قدیمی استفاده کنید." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"The type of a value indicates the state that it is in: e.g. in this case, the " -"configuration state of a GPIO pin. This encodes the state machine into the type " -"system, and ensures that you don't try to use a pin in a certain way without " -"properly configuring it first. Illegal state transitions are caught at compile " -"time." +"The type of a value indicates the state that it is in: e.g. in this case, " +"the configuration state of a GPIO pin. This encodes the state machine into " +"the type system, and ensures that you don't try to use a pin in a certain " +"way without properly configuring it first. Illegal state transitions are " +"caught at compile time." msgstr "" -"این type یک مقدار state را نشان می‌دهد که در آن قرار دارد: به عنوان مثال. در این " -"مورد، وضعیت پیکربندی یک پین GPIO. این state machine را در type system رمزگذاری " -"می‌کند و تضمین می‌کند که سعی نکنید از pin به روشی خاص استفاده کنید بدون اینکه ابتدا " -"آن را به درستی پیکربندی کنید. state transition غیرمجاز در زمان کامپایل شناسایی " -"می‌شود." +"این type یک مقدار state را نشان می‌دهد که در آن قرار دارد: به عنوان مثال. در " +"این مورد، وضعیت پیکربندی یک پین GPIO. این state machine را در type system " +"رمزگذاری می‌کند و تضمین می‌کند که سعی نکنید از pin به روشی خاص استفاده کنید " +"بدون اینکه ابتدا آن را به درستی پیکربندی کنید. state transition غیرمجاز در " +"زمان کامپایل شناسایی می‌شود." #: src/bare-metal/microcontrollers/type-state.md msgid "" -"You can call `is_high` on an input pin and `set_high` on an output pin, but not " -"vice-versa." +"You can call `is_high` on an input pin and `set_high` on an output pin, but " +"not vice-versa." msgstr "" -"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی فراخوانی " -"کنید، اما برعکس امکان پذیر نیست." +"می‌توانید `is_high` را در یک پین ورودی و `set_high` را در یک پایه خروجی " +"فراخوانی کنید، اما برعکس امکان پذیر نیست." #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." @@ -17846,8 +18366,8 @@ msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" -"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی ویژگی را " -"ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" +"این crate ['embedded-hal'](https://crates.io/crates/embedded-hal) تعدادی " +"ویژگی را ارائه می‌دهد که میکروکنترلرهای جانبی رایج را پوشش می‌دهد:" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" @@ -17867,30 +18387,32 @@ msgstr "گذرگاه‌ها و دستگاه‌های I2C و SPI" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out " -"into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-can`]" -"(https://crates.io/crates/embedded-can) and [`rand_core`](https://crates.io/" -"crates/rand_core) respectively." +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" -"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم شدن " -"به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-can`]" -"(https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates.io/crates/" -"rand_core) به ترتیب." +"ویژگی‌های مشابه برای جریان‌های بایت (مانند UART)، گذرگاه‌های CAN و RNG و تقسیم " +"شدن به [`embedded-io`](https://crates.io/crates/embedded-io)، [`embedded-" +"can`](https ://crates.io/crates/embedded-can) و [`rand_core`](https://crates." +"io/crates/rand_core) به ترتیب." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/awesome-" -"embedded-rust#driver-crates) in terms of these traits, e.g. an accelerometer " -"driver might need an I2C or SPI device instance." +"Other crates then implement [drivers](https://github.com/rust-embedded/" +"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" -"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-embedded-" -"rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به عنوان مثال. یک " -"درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز داشته باشد." +"سپس crateهای دیگر [درایورها](https://github.com/rust-embedded/wesome-" +"embedded-rust#driver-crates) را بر حسب این ویژگی‌ها پیاده‌سازی می‌کنند، به " +"عنوان مثال. یک درایور شتاب سنج ممکن است به یک نمونه دستگاه I2C یا SPI نیاز " +"داشته باشد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"The traits cover using the peripherals but not initialising or configuring them, " -"as initialisation and configuration is usually highly platform-specific." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" "این ویژگی‌ها با استفاده از وسایل جانبی(peripherals) پوشش می‌دهند، اما آنها را " "مقداردهی اولیه یا پیکربندی نمی‌کنند، زیرا مقداردهی اولیه و پیکربندی معمولاً به " @@ -17898,41 +18420,43 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There are implementations for many microcontrollers, as well as other platforms " -"such as Linux on Raspberry Pi." +"There are implementations for many microcontrollers, as well as other " +"platforms such as Linux on Raspberry Pi." msgstr "" -"پیاده‌سازی‌هایی برای بسیاری از میکروکنترلرها و همچنین پلتفرم‌های دیگری مانند لینوکس " -"در Raspberry Pi وجود دارد." +"پیاده‌سازی‌هایی برای بسیاری از میکروکنترلرها و همچنین پلتفرم‌های دیگری مانند " +"لینوکس در Raspberry Pi وجود دارد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) نسخه‌های " -"async از traitها را ارائه می دهد." +" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " +"نسخه‌های async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides another " -"approach to non-blocking I/O, based on the [`nb`](https://crates.io/crates/nb) " -"crate." +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" -"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد دیگری " -"را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// crates.io/" -"crates/nb) crate است." +"مورد [`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) رویکرد " +"دیگری را برای عدم مسدود کردن I/O ارائه می دهد که بر اساس [`nb`](https:// " +"crates.io/crates/nb) crate است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, like " -"OpenOCD but better integrated." +"[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " +"like OpenOCD but better integrated." msgstr "" -"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی جاسازی شده " -"است، مانند OpenOCD است، اما بهتر یکپارچه شده است." +"یک [probe-rs](https://probe.rs/) یک مجموعه ابزار مفید برای اشکال زدایی " +"جاسازی شده است، مانند OpenOCD است، اما بهتر یکپارچه شده است." #: src/bare-metal/microcontrollers/probe-rs.md -msgid "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" -msgstr "SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" +msgid "" +"SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" +msgstr "" +"SWD (Serial Wire Debug) و JTAG از طریق پروب های CMSIS-DAP، ST-Link و J-Link" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" @@ -17944,53 +18468,56 @@ msgstr "ادغام Cargo" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT (Real " -"Time Transfers) output and connect GDB. It's configured by an `Embed.toml` file " -"in your project directory." +"`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " +"(Real Time Transfers) output and connect GDB. It's configured by an `Embed." +"toml` file in your project directory." msgstr "" -"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy system را " -"پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه مربوط به خود را " -"بنویسید یا به تخصیص دهنده موجود خود متصل کنید." +"`buddy_system_allocator`یک third-party crate است که یک تخصیص‌دهنده buddy " +"system را پیاده‌سازی می‌کند. crateهای دیگر در دسترس هستند یا می‌توانید نسخه " +"مربوط به خود را بنویسید یا به تخصیص دهنده موجود خود متصل کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is an Arm " -"standard protocol over USB for an in-circuit debugger to access the CoreSight " -"Debug Access Port of various Arm Cortex processors. It's what the on-board " -"debugger on the BBC micro:bit uses." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " +"an Arm standard protocol over USB for an in-circuit debugger to access the " +"CoreSight Debug Access Port of various Arm Cortex processors. It's what the " +"on-board debugger on the BBC micro:bit uses." msgstr "" -"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک پروتکل " -"استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی به پورت " -"CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد استفاده قرار " -"گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از آن استفاده می‌کند." +"[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) یک " +"پروتکل استاندارد ARM از طریق USB است که برای یک دیباگر درون مداری جهت دسترسی " +"به پورت CoreSight Debug Access در انواع مختلف پردازنده‌های Arm Cortex مورد " +"استفاده قرار گرفته و این همان چیزی است که دیباگر داخلی در BBC micro:bit از " +"آن استفاده می‌کند." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link is a " -"range from SEGGER." +"ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " +"is a range from SEGGER." msgstr "" -"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link محدوده ای " -"از SEGGER است." +"ST-Link طیفی از دیباگرهای درون مدار از ST Microelectronics است، J-Link " +"محدوده ای از SEGGER است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial " -"Wire Debug." +"The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " +"Serial Wire Debug." msgstr "" -"پورت دسترسی Debug معمولا یا یک رابط JTAG 5 پین یا Serial Wire Debug 2 پین است." +"پورت دسترسی Debug معمولا یا یک رابط JTAG 5 پین یا Serial Wire Debug 2 پین " +"است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"probe-rs is a library which you can integrate into your own tools if you want to." +"probe-rs is a library which you can integrate into your own tools if you " +"want to." msgstr "" -"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود ادغام " -"کنید." +"probe-rs یک کتابخانه است که در صورت تمایل می‌توانید آن را در ابزارهای خود " +"ادغام کنید." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-" -"protocol/) lets VSCode and other IDEs debug code running on any supported " -"microcontroller." +"The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" +"adapter-protocol/) lets VSCode and other IDEs debug code running on any " +"supported microcontroller." msgstr "" "[پروتکل آداپتور Debug مایکروسافت](https://microsoft.github.io/debug-adapter-" "protocol/) به VSCode و سایر IDE‌ها اجازه می‌دهد کدهای موجود در هر میکروکنترلر " @@ -17999,15 +18526,16 @@ msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "" -"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده است." +"این cargo-embed یک باینری است که با استفاده از کتابخانه probe-rs ساخته شده " +"است." #: src/bare-metal/microcontrollers/probe-rs.md msgid "" -"RTT (Real Time Transfers) is a mechanism to transfer data between the debug host " -"and the target through a number of ringbuffers." +"RTT (Real Time Transfers) is a mechanism to transfer data between the debug " +"host and the target through a number of ringbuffers." msgstr "" -"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و target از " -"طریق تعدادی بافر حلقه‌ای (ringbuffers) است." +"RTT (Real Time Transfers) مکانیزمی برای انتقال داده‌ها بین debug host و " +"target از طریق تعدادی بافر حلقه‌ای (ringbuffers) است." #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" @@ -18043,10 +18571,11 @@ msgid "\"Real-Time Interrupt-driven Concurrency\"" msgstr "\"همراهی مبتنی بر وقفه بلادرنگ\"" #: src/bare-metal/microcontrollers/other-projects.md -msgid "Shared resource management, message passing, task scheduling, timer queue" +msgid "" +"Shared resource management, message passing, task scheduling, timer queue" msgstr "" -"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر (timer " -"queue)" +"مدیریت منابع مشترک، ارسال پیام، زمان‌بندی تسک (task scheduling)، صف تایمر " +"(timer queue)" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" @@ -18065,7 +18594,8 @@ msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support" msgstr "" -"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از حافظه" +"RTOS متمرکز بر امنیت با برنامه‌ریزی پیشگیرانه و پشتیبانی از واحد حفاظت از " +"حافظه" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" @@ -18073,8 +18603,8 @@ msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Microkernel RTOS from Oxide Computer Company with memory protection, unprivileged " -"drivers, IPC" +"Microkernel RTOS from Oxide Computer Company with memory protection, " +"unprivileged drivers, IPC" msgstr "" "یک Microkernel RTOS از شرکت Oxide Computer با protection از حافظه، درایورهای " "غیرمجاز و IPC" @@ -18085,16 +18615,17 @@ msgstr "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs.github." -"io/book/overview/using-the-standard-library.html)." -msgstr "" -"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-rs." +"Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." "github.io/book/overview/using-the-standard-library.html)." +msgstr "" +"برخی از پلتفرم‌ها پیاده‌سازی `std` دارند، به عنوان مثال. [esp-idf](https://esp-" +"rs.github.io/book/overview/using-the-standard-library.html)." #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" -"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر گرفت." +"RTIC را می‌توان یک RTOS یا یک چارچوب همزمان (concurrency framework) در نظر " +"گرفت." #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." @@ -18102,8 +18633,8 @@ msgstr "این شامل هیچ HAL نیست." #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for scheduling " -"rather than a proper kernel." +"It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " +"scheduling rather than a proper kernel." msgstr "" "از Cortex-M NVIC (کنترل‌کننده وقفه مجازی تودرتو-Nested Virtual Interrupt " "Controller) برای زمان‌بندی به جای یک هسته مناسب استفاده می‌کند." @@ -18113,7 +18644,8 @@ msgid "Cortex-M only." msgstr "Cortex-M فقط." #: src/bare-metal/microcontrollers/other-projects.md -msgid "Google uses TockOS on the Haven microcontroller for Titan security keys." +msgid "" +"Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" "گوگل از TockOS در میکروکنترلر Haven برای کلیدهای امنیتی Titan استفاده می‌کند." @@ -18127,27 +18659,28 @@ msgstr "" #: src/exercises/bare-metal/morning.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial " -"port." -msgstr "ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port." +msgstr "" +"ما جهت را از قطب‌نمای I2C می‌خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم." #: src/exercises/bare-metal/morning.md msgid "" -"After looking at the exercises, you can look at the [solutions](solutions-morning." -"md) provided." +"After looking at the exercises, you can look at the [solutions](solutions-" +"morning.md) provided." msgstr "" -"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده نگاه " -"کنید." +"پس از دیدن تمرین‌ها، می‌توانید به [راه حل‌ها] (solutions-morning.md) ارائه شده " +"نگاه کنید." #: src/exercises/bare-metal/compass.md msgid "" -"We will read the direction from an I2C compass, and log the readings to a serial " -"port. If you have time, try displaying it on the LEDs somehow too, or use the " -"buttons somehow." +"We will read the direction from an I2C compass, and log the readings to a " +"serial port. If you have time, try displaying it on the LEDs somehow too, or " +"use the buttons somehow." msgstr "" -"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. اگر " -"وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از دکمه‌ها " -"استفاده کنید." +"ما جهت را از قطب‌نمای I2C می خوانیم و خوانش‌ها را در یک پورت سریال ثبت می‌کنیم. " +"اگر وقت دارید، سعی کنید آن را به نحوی روی LED‌ها نیز نمایش دهید یا به نوعی از " +"دکمه‌ها استفاده کنید." #: src/exercises/bare-metal/compass.md msgid "Hints:" @@ -18155,14 +18688,15 @@ msgstr "نکته‌ها:" #: src/exercises/bare-metal/compass.md msgid "" -"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/latest/" -"lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) " -"crates, as well as the [micro:bit hardware](https://tech.microbit.org/hardware/)." +"Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" +"latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" +"microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." +"org/hardware/)." msgstr "" -"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و [`microbit-" -"v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه crateهای آن را بررسی " -"کنید همانطور که [micro:bit hardware](https://tech.microbit.org/hardware/) را " -"بررسی می‌کنید." +"مستندات [`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) و " +"[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/) به همراه " +"crateهای آن را بررسی کنید همانطور که [micro:bit hardware](https://tech." +"microbit.org/hardware/) را بررسی می‌کنید." #: src/exercises/bare-metal/compass.md msgid "" @@ -18170,41 +18704,43 @@ msgid "" msgstr "واحد اندازه‌گیری اینرسی در قطعه LSM303AGR به bus داخلی I2C متصل است." #: src/exercises/bare-metal/compass.md -msgid "TWI is another name for I2C, so the I2C master peripheral is called TWIM." +msgid "" +"TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "" "TWI نام دیگری برای I2C است، بنابراین دستگاه جانبی اصلی I2C TWIM نامیده می‌شود." #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::I2c` " -"trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/" -"hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" -"درایور LSM303AGR به چیزی نیاز دارد که ویژگی `embedded_hal::i2c::I2c` را اجرا کند. " -"ساختار[`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/microbit/hal/" -"struct.Twim.html) این مورد را پیاده‌سازی می‌کند." +"درایور LSM303AGR به چیزی نیاز دارد که ویژگی `embedded_hal::i2c::I2c` را اجرا " +"کند. ساختار[`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) این مورد را پیاده‌سازی می‌کند." #: src/exercises/bare-metal/compass.md msgid "" -"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/struct." -"Board.html) struct with fields for the various pins and peripherals." +"You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" +"struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" -"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/microbit/" -"struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف دارید." +"شما یک ساختار ['microbit::Board'](https://docs.rs/microbit-v2/latest/" +"microbit/struct.Board.html) با فیلدهایی برای پین‌ها و تجهیزات جانبی مختلف " +"دارید." #: src/exercises/bare-metal/compass.md msgid "" -"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi.com/" -"pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for this " -"exercise." +"You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " +"this exercise." msgstr "" -"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi.com/" -"pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." +"در صورت تمایل می‌توانید به [nRF52833 datasheet](https://infocenter.nordicsemi." +"com/pdf/nRF52833_PS_v1.5.pdf) نیز نگاه کنید، اما برای این تمرین لازم نیست." #: src/exercises/bare-metal/compass.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " -"in the `compass` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `compass` directory for the following files." msgstr "" "این [الگوی تمرین](../../comprehensive-rust-exercises.zip) را دانلود کنید و " "فایل‌های زیر را در دایرکتوری `compass` جستجو کنید." @@ -18230,8 +18766,10 @@ msgid "See the serial output on Linux with:" msgstr "مشاهده خروجی سریال در لینوکس با:" #: src/exercises/bare-metal/compass.md -msgid "Or on Mac OS something like (the device name may be slightly different):" -msgstr "یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" +msgid "" +"Or on Mac OS something like (the device name may be slightly different):" +msgstr "" +"یا در سیستم‌عامل Mac چیزی شبیه به (نام دستگاه ممکن است کمی متفاوت باشد):" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." @@ -18284,10 +18822,12 @@ msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md #, fuzzy msgid "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" msgstr "" -"// If button A is pressed, switch to the next mode and briefly blink all LEDs\n" +"// If button A is pressed, switch to the next mode and briefly blink all " +"LEDs\n" " // on.\n" #: src/bare-metal/aps.md @@ -18296,14 +18836,15 @@ msgstr "Application processors" #: src/bare-metal/aps.md msgid "" -"So far we've talked about microcontrollers, such as the Arm Cortex-M series. Now " -"let's try writing something for Cortex-A. For simplicity we'll just work with " -"QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " -"board." +"So far we've talked about microcontrollers, such as the Arm Cortex-M series. " +"Now let's try writing something for Cortex-A. For simplicity we'll just work " +"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" +"virt.html) board." msgstr "" -"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا بیایید " -"سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's aarch64 " -"['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) کار می‌کنیم." +"تا اینجا در مورد میکروکنترلرهایی مانند سری Arm Cortex-M صحبت کردیم. حالا " +"بیایید سعی کنیم چیزی برای Cortex-A بنویسیم. برای سادگی، ما فقط با بردQEMU's " +"aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/virt.html) " +"کار می‌کنیم." #: src/bare-metal/aps.md msgid "" @@ -18321,15 +18862,16 @@ msgid "" "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" -"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی می " -"کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای ماشین‌های " -"مجازی طراحی شده است." +"QEMU از شبیه‌سازی ماشین‌های مختلف یا مدل‌های برد مختلف برای هر معماری پشتیبانی " +"می کند. برد 'virt' با هیچ سخت‌افزار واقعی خاصی مطابقت ندارد، اما صرفا برای " +"ماشین‌های مجازی طراحی شده است." #: src/bare-metal/aps/entry-point.md -msgid "Before we can start running Rust code, we need to do some initialisation." +msgid "" +"Before we can start running Rust code, we need to do some initialisation." msgstr "" -"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه را " -"انجام دهیم." +"قبل از اینکه بتوانیم اجرای کد Rust را شروع کنیم، باید مقداری مقداردهی اولیه " +"را انجام دهیم." #: src/bare-metal/aps/entry-point.md msgid "" @@ -18338,8 +18880,8 @@ msgid "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU " -"and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18358,7 +18900,8 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18368,7 +18911,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18409,8 +18953,8 @@ msgstr "" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable MMU " -"and\n" +" * Load and apply the memory management configuration, ready to enable " +"MMU and\n" " * caches.\n" " */\n" " adrp x30, idmap\n" @@ -18429,7 +18973,8 @@ msgstr "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate any\n" +" * Ensure everything before this point has completed, then invalidate " +"any\n" " * potentially stale local TLB entries before they start being used.\n" " */\n" " isb\n" @@ -18439,7 +18984,8 @@ msgstr "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until this\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " +"this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" @@ -18477,73 +19023,77 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" -"This is the same as it would be for C: initialising the processor state, zeroing " -"the BSS, and setting up the stack pointer." +"This is the same as it would be for C: initialising the processor state, " +"zeroing the BSS, and setting up the stack pointer." msgstr "" -"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر کردن " -"BSS و تنظیم stack pointer." +"این همان چیزی است که برای C وجود دارد: مقداردهی اولیه وضعیت پردازنده، صفر " +"کردن BSS و تنظیم stack pointer." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS (block starting symbol, for historical reasons) is the part of the object " -"file which containing statically allocated variables which are initialised to " -"zero. They are omitted from the image, to avoid wasting space on zeroes. The " -"compiler assumes that the loader will take care of zeroing them." +"The BSS (block starting symbol, for historical reasons) is the part of the " +"object file which containing statically allocated variables which are " +"initialised to zero. They are omitted from the image, to avoid wasting space " +"on zeroes. The compiler assumes that the loader will take care of zeroing " +"them." msgstr "" "این BSS (نماد شروع بلوک، به دلایل تاریخی) بخشی از object file است که حاوی " -"متغیرهای تخصیص یافته استاتیکی است که مقدار اولیه آنها صفر است. برای جلوگیری از " -"اتلاف فضا روی صفر، آنها از تصویر حذف شده‌اند. کامپایلر فرض می‌کند که لودر از صفر " -"کردن آنها مراقبت می‌کند." +"متغیرهای تخصیص یافته استاتیکی است که مقدار اولیه آنها صفر است. برای جلوگیری " +"از اتلاف فضا روی صفر، آنها از تصویر حذف شده‌اند. کامپایلر فرض می‌کند که لودر " +"از صفر کردن آنها مراقبت می‌کند." #: src/bare-metal/aps/entry-point.md msgid "" -"The BSS may already be zeroed, depending on how memory is initialised and the " -"image is loaded, but we zero it to be sure." +"The BSS may already be zeroed, depending on how memory is initialised and " +"the image is loaded, but we zero it to be sure." msgstr "" -"ممکن است BSS قبلاً صفر شده باشد، بسته به اینکه چگونه حافظه مقداردهی اولیه شده و " -"تصویر بارگذاری شده است، اما برای اطمینان آن را صفر می‌کنیم." +"ممکن است BSS قبلاً صفر شده باشد، بسته به اینکه چگونه حافظه مقداردهی اولیه شده " +"و تصویر بارگذاری شده است، اما برای اطمینان آن را صفر می‌کنیم." #: src/bare-metal/aps/entry-point.md msgid "" -"We need to enable the MMU and cache before reading or writing any memory. If we " -"don't:" +"We need to enable the MMU and cache before reading or writing any memory. If " +"we don't:" msgstr "" -"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار را " -"نکنیم:" +"قبل از خواندن یا نوشتن هر حافظه باید MMU و cache را فعال کنیم. اگر این کار " +"را نکنیم:" #: src/bare-metal/aps/entry-point.md msgid "" -"Unaligned accesses will fault. We build the Rust code for the `aarch64-unknown-" -"none` target which sets `+strict-align` to prevent the compiler generating " -"unaligned accesses, so it should be fine in this case, but this is not " -"necessarily the case in general." +"Unaligned accesses will fault. We build the Rust code for the `aarch64-" +"unknown-none` target which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses, so it should be fine in this case, but this " +"is not necessarily the case in general." msgstr "" -"دسترسی‌های بدون تراز خطا خواهند داشت. ما کد Rust را برای هدف`aarch64-unknown-none` " -"می‌سازیم که `+strict-align` را تنظیم می‌کند تا از ایجاد دسترسی‌های بدون تراز توسط " -"کامپایلر جلوگیری کند، بنابراین در این مورد باید خوب باشد، اما لزوماً اینطور نیست." +"دسترسی‌های بدون تراز خطا خواهند داشت. ما کد Rust را برای هدف`aarch64-unknown-" +"none` می‌سازیم که `+strict-align` را تنظیم می‌کند تا از ایجاد دسترسی‌های بدون " +"تراز توسط کامپایلر جلوگیری کند، بنابراین در این مورد باید خوب باشد، اما " +"لزوماً اینطور نیست." #: src/bare-metal/aps/entry-point.md msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem " -"is that the VM is accessing memory directly with the cache disabled, while the " -"host has cacheable aliases to the same memory. Even if the host doesn't " -"explicitly access the memory, speculative accesses can lead to cache fills, and " -"then changes from one or the other will get lost when the cache is cleaned or the " -"VM enables the cache. (Cache is keyed by physical address, not VA or IPA.)" -msgstr "" -"اگر در VM اجرا می‌شد، این کار می‌تواند منجر به مشکلات انسجام cache شود. مشکل این " -"است که VM مستقیماً با حافظه cache غیرفعال شده به حافظه دسترسی پیدا می‌کند، در حالی " -"که host دارای نام مستعار قابل cache برای همان حافظه است. حتی اگر cache به طور " -"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های گمانه‌زنی می‌تواند منجر به پر شدن حافظه " -"cache شود، و پس از پاک شدن حافظه cache یا فعال کردن حافظه توسط VM، تغییرات از یک " -"یا دیگری از بین می‌رود. (حافظه cache با آدرس فیزیکی کلید می‌خورد، نه VA یا IPA.)" +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost when the cache " +"is cleaned or the VM enables the cache. (Cache is keyed by physical address, " +"not VA or IPA.)" +msgstr "" +"اگر در VM اجرا می‌شد، این کار می‌تواند منجر به مشکلات انسجام cache شود. مشکل " +"این است که VM مستقیماً با حافظه cache غیرفعال شده به حافظه دسترسی پیدا می‌کند، " +"در حالی که host دارای نام مستعار قابل cache برای همان حافظه است. حتی اگر " +"cache به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های گمانه‌زنی می‌تواند " +"منجر به پر شدن حافظه cache شود، و پس از پاک شدن حافظه cache یا فعال کردن " +"حافظه توسط VM، تغییرات از یک یا دیگری از بین می‌رود. (حافظه cache با آدرس " +"فیزیکی کلید می‌خورد، نه VA یا IPA.)" #: src/bare-metal/aps/entry-point.md msgid "" -"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which identity " -"maps the first 1 GiB of address space for devices, the next 1 GiB for DRAM, and " -"another 1 GiB higher up for more devices. This matches the memory layout that " -"QEMU uses." +"For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " +"identity maps the first 1 GiB of address space for devices, the next 1 GiB " +"for DRAM, and another 1 GiB higher up for more devices. This matches the " +"memory layout that QEMU uses." msgstr "" #: src/bare-metal/aps/entry-point.md @@ -18551,18 +19101,18 @@ msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" -"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در مورد " -"آن خواهیم دید." +"ما همچنین exception vector (`vbar_el1`) را تنظیم کردیم که در ادامه بیشتر در " +"مورد آن خواهیم دید." #: src/bare-metal/aps/entry-point.md msgid "" -"All examples this afternoon assume we will be running at exception level 1 (EL1). " -"If you need to run at a different exception level you'll need to modify `entry.S` " -"accordingly." +"All examples this afternoon assume we will be running at exception level 1 " +"(EL1). If you need to run at a different exception level you'll need to " +"modify `entry.S` accordingly." msgstr "" -"همه مثال‌ها امروز بعد از ظهر فرض می‌کنند که ما در سطح استثنا 1 (EL1) اجرا خواهیم " -"کرد. اگر نیاز به اجرا در سطح استثنایی متفاوت دارید، باید `entry.S`را بر این اساس " -"تغییر دهید." +"همه مثال‌ها امروز بعد از ظهر فرض می‌کنند که ما در سطح استثنا 1 (EL1) اجرا " +"خواهیم کرد. اگر نیاز به اجرا در سطح استثنایی متفاوت دارید، باید `entry.S`را " +"بر این اساس تغییر دهید." #: src/bare-metal/aps/inline-assembly.md msgid "Inline assembly" @@ -18570,13 +19120,13 @@ msgstr "Inline assembly" #: src/bare-metal/aps/inline-assembly.md msgid "" -"Sometimes we need to use assembly to do things that aren't possible with Rust " -"code. For example, to make an HVC (hypervisor call) to tell the firmware to power " -"off the system:" +"Sometimes we need to use assembly to do things that aren't possible with " +"Rust code. For example, to make an HVC (hypervisor call) to tell the " +"firmware to power off the system:" msgstr "" "گاهی اوقات برای انجام کارهایی که با کد Rust امکان پذیر نیست، باید از اسمبلی " -"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است که به " -"firmware بگویید سیستم را خاموش کند:" +"استفاده کنیم. به عنوان مثال، برای برقراری یک HVC (hypervisor call) نایز است " +"که به firmware بگویید سیستم را خاموش کند:" #: src/bare-metal/aps/inline-assembly.md #, fuzzy @@ -18634,56 +19184,58 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"PSCI is the Arm Power State Coordination Interface, a standard set of functions " -"to manage system and CPU power states, among other things. It is implemented by " -"EL3 firmware and hypervisors on many systems." +"PSCI is the Arm Power State Coordination Interface, a standard set of " +"functions to manage system and CPU power states, among other things. It is " +"implemented by EL3 firmware and hypervisors on many systems." msgstr "" -"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع برای " -"مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این مورد توسط " -"میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." +"‏ PSCI یک رابط هدایت‌گر Arm Power State است که مجموعه‌ای استاندارد از توابع " +"برای مدیریت وضعیت‌های power در سیستم و CPU بوده، از جمله موارد دیگری از این " +"مورد توسط میان‌افزار EL3 و hypervisor در بسیاری از سیستم‌ها پیاده سازی شده است." #: src/bare-metal/aps/inline-assembly.md msgid "" -"The `0 => _` syntax means initialise the register to 0 before running the inline " -"assembly code, and ignore its contents afterwards. We need to use `inout` rather " -"than `in` because the call could potentially clobber the contents of the " -"registers." +"The `0 => _` syntax means initialise the register to 0 before running the " +"inline assembly code, and ignore its contents afterwards. We need to use " +"`inout` rather than `in` because the call could potentially clobber the " +"contents of the registers." msgstr "" -"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی درون خطی " -"به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید از `inout` به " -"جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند محتویات رجیسترها را " -"مخدوش کند." +"یک `0 => _` syntax به این معنی است که رجیستر را قبل از اجرای کد اسمبلی " +"درون خطی به 0 مقداردهی کنید و پس از آن محتوای آن را نادیده بگیرید. ما باید " +"از `inout` به جای `in` استفاده کنیم زیرا این فراخوانی به طور بالقوه می‌تواند " +"محتویات رجیسترها را مخدوش کند." #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because it is " -"called from our entry point in `entry.S`." +"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " +"it is called from our entry point in `entry.S`." msgstr "" -"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از نقطه " -"ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." +"این تابع `main` باید به صورت`#[no_mangle]` و `extern \"C\"` باشد زیرا از " +"نقطه ورودی (entry point) ما در `entry.S` فراخوانی می‌شود." #: src/bare-metal/aps/inline-assembly.md msgid "" -"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used " -"by the bootloader to pass things like a pointer to the device tree. According to " -"the standard aarch64 calling convention (which is what `extern \"C\"` specifies " -"to use), registers `x0`–`x7` are used for the first 8 arguments passed to a " -"function, so `entry.S` doesn't need to do anything special except make sure it " -"doesn't change these registers." -msgstr "" -"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط bootloader " -"برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. طبق قرارداد " -"فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` برای استفاده مشخص " -"می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده به یک تابع استفاده " -"می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم نیست کار خاصی انجام " -"دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر نمی‌دهد." +"`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " +"used by the bootloader to pass things like a pointer to the device tree. " +"According to the standard aarch64 calling convention (which is what `extern " +"\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " +"arguments passed to a function, so `entry.S` doesn't need to do anything " +"special except make sure it doesn't change these registers." +msgstr "" +"‏ `_x0`–`_x3` مقادیر رجیسترهای `x0`–`x3` هستند که به طور معمول توسط " +"bootloader برای ارسال چیزهایی مانند اشاره‌گر به device tree استفاده می‌شود. " +"طبق قرارداد فراخوانی استاندارد aarch64 (که همان چیزی است که `extern \"C\"` " +"برای استفاده مشخص می‌کند)، رجیسترهای `x0`–`x7` برای ۸ آرگومان اول ارسال شده " +"به یک تابع استفاده می‌شوند، بنابراین `entry.S` این کار را انجام نمی‌دهد. لازم " +"نیست کار خاصی انجام دهید، جز اینکه مطمئن شوید که این مورد رجیسترها را تغییر " +"نمی‌دهد." #: src/bare-metal/aps/inline-assembly.md msgid "" -"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/examples`." +"Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" +"examples`." msgstr "" -"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_psci` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" @@ -18702,44 +19254,45 @@ msgid "" "`addr_of!` lets you get fields of structs without creating an intermediate " "reference." msgstr "" -"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از ساختارها را " -"دریافت کنید." +"‏ `addr_of!` به شما امکان می‌دهد بدون ایجاد یک مرجع میانی، فیلدهایی از " +"ساختارها را دریافت کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Volatile access: read or write operations may have side-effects, so prevent the " -"compiler or hardware from reordering, duplicating or eliding them." +"Volatile access: read or write operations may have side-effects, so prevent " +"the compiler or hardware from reordering, duplicating or eliding them." msgstr "" -"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی داشته " -"باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا حذف آنها " -"جلوگیری کنید." +"دسترسی فرار (Volatile access): عملیات خواندن یا نوشتن ممکن است عوارض جانبی " +"داشته باشد، بنابراین از کامپایلر یا سخت‌افزار از مرتب‌سازی مجدد، کپی‌کردن یا " +"حذف آنها جلوگیری کنید." #: src/bare-metal/aps/mmio.md msgid "" -"Usually if you write and then read, e.g. via a mutable reference, the compiler " -"may assume that the value read is the same as the value just written, and not " -"bother actually reading memory." +"Usually if you write and then read, e.g. via a mutable reference, the " +"compiler may assume that the value read is the same as the value just " +"written, and not bother actually reading memory." msgstr "" -"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، کامپایلر " -"ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده است و در واقع " -"خواندن memory را سخت‌تر نکند." +"معمولاً اگر بنویسید و سپس بخوانید، به عنوان مثال. از طریق یک reference، " +"کامپایلر ممکن است فرض کند که مقدار خوانده شده همان مقداری است که نوشته شده " +"است و در واقع خواندن memory را سخت‌تر نکند." #: src/bare-metal/aps/mmio.md msgid "" -"Some existing crates for volatile access to hardware do hold references, but this " -"is unsound. Whenever a reference exist, the compiler may choose to dereference it." +"Some existing crates for volatile access to hardware do hold references, but " +"this is unsound. Whenever a reference exist, the compiler may choose to " +"dereference it." msgstr "" "برخی از crateهای موجود برای دسترسی فَرار(volatile access) به سخت‌افزار دارای " -"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود داشته " -"باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." +"referenceهایی هستند، اما این همیشه درست نیست. هر زمان که یک reference وجود " +"داشته باشد، کامپایلر ممکن است انتخاب کند که reference آن را لغو کند." #: src/bare-metal/aps/mmio.md msgid "" "Use the `addr_of!` macro to get struct field pointers from a pointer to the " "struct." msgstr "" -"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به ساختار " -"استفاده کنید." +"از ماکرو `addr_of!` برای دریافت اشاره‌گرهای struct field از یک اشاره‌گر به " +"ساختار استفاده کنید." #: src/bare-metal/aps/uart.md msgid "Let's write a UART driver" @@ -18747,11 +19300,11 @@ msgstr "بیایید یک درایور UART بنویسیم" #: src/bare-metal/aps/uart.md msgid "" -"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/documentation/" -"ddi0183/g) UART, so let's write a driver for that." +"The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" +"documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" -"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/ddi0183/" -"g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." +"این ماشین QEMU 'virt' یک [PL011](https://developer.arm.com/documentation/" +"ddi0183/g) به‌عنوان UART دارد، پس بیایید یک درایور برای آن بنویسیم." #: src/bare-metal/aps/uart.md #, fuzzy @@ -18766,8 +19319,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" @@ -18775,8 +19330,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the 8 MMIO control registers of a\n" -" /// PL011 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the 8 MMIO control registers of " +"a\n" +" /// PL011 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md @@ -18810,37 +19367,40 @@ msgstr "// Wait until the UART is no longer busy.\n" #: src/bare-metal/aps/uart.md msgid "" -"Note that `Uart::new` is unsafe while the other methods are safe. This is because " -"as long as the caller of `Uart::new` guarantees that its safety requirements are " -"met (i.e. that there is only ever one instance of the driver for a given UART, " -"and nothing else aliasing its address space), then it is always safe to call " -"`write_byte` later because we can assume the necessary preconditions." +"Note that `Uart::new` is unsafe while the other methods are safe. This is " +"because as long as the caller of `Uart::new` guarantees that its safety " +"requirements are met (i.e. that there is only ever one instance of the " +"driver for a given UART, and nothing else aliasing its address space), then " +"it is always safe to call `write_byte` later because we can assume the " +"necessary preconditions." msgstr "" -"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر ایمن " -"هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین کند که " -"الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک UART مشخص " -"وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس همیشه می‌توان " -"`write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم را فرض کنیم." +"توجه داشته باشید که `Uart::new` ناامن یا unsafe است در حالی که متد‌های دیگر " +"ایمن هستند. این به‌خاطر این است که تا زمانی که تماس گیرنده `Uart::new` تضمین " +"کند که الزامات ایمنی آن برآورده شده است (یعنی فقط یک نمونه از درایور برای یک " +"UART مشخص وجود دارد و هیچ چیز دیگری نام مستعار فضای آدرس آن را ندارد)، پس " +"همیشه می‌توان `write_byte` را بعداً فراخوانی کرد زیرا می‌توانیم پیش‌شرط‌های لازم " +"را فرض کنیم." #: src/bare-metal/aps/uart.md msgid "" -"We could have done it the other way around (making `new` safe but `write_byte` " -"unsafe), but that would be much less convenient to use as every place that calls " -"`write_byte` would need to reason about the safety" +"We could have done it the other way around (making `new` safe but " +"`write_byte` unsafe), but that would be much less convenient to use as every " +"place that calls `write_byte` would need to reason about the safety" msgstr "" -"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، اما " -"`write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، زیرا هر " -"مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety استدلال کند." +"ما می‌توانستیم این کار را به صورت دیگری انجام دهیم ( ساخت `new` را ایمن کنیم، " +"اما `write_byte` را ناامن کنیم)، اما استفاده از آن بسیار راحت‌تر خواهد بود، " +"زیرا هر مکانی که `write_byte` را صدا می‌زند باید در مورد ایمنی یا safety " +"استدلال کند." #: src/bare-metal/aps/uart.md #, fuzzy msgid "" -"This is a common pattern for writing safe wrappers of unsafe code: moving the " -"burden of proof for soundness from a large number of places to a smaller number " -"of places." +"This is a common pattern for writing safe wrappers of unsafe code: moving " +"the burden of proof for soundness from a large number of places to a smaller " +"number of places." msgstr "" -"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات سلامت " -"عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." +"این یک الگوی رایج برای نوشتن بسته‌های ایمن کد ناامن است: انتقال بار اثبات " +"سلامت عملکردی از تعداد زیادی مکان به تعداد کمتری مکان." #: src/bare-metal/aps/uart/traits.md msgid "More traits" @@ -18848,9 +19408,10 @@ msgstr "‏ traitهای بیشتر" #: src/bare-metal/aps/uart/traits.md msgid "" -"We derived the `Debug` trait. It would be useful to implement a few more traits " -"too." -msgstr "ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." +"We derived the `Debug` trait. It would be useful to implement a few more " +"traits too." +msgstr "" +"ما ویژگی `Debug` را استخراج کردیم. اجرای چند ویژگی دیگر نیز مفید خواهد بود." #: src/bare-metal/aps/uart/traits.md #, fuzzy @@ -18874,8 +19435,8 @@ msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_minimal` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" @@ -18886,15 +19447,15 @@ msgstr "یک درایور UART بهتر" msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " -"offsets to construct pointers to access them is error-prone and hard to read. " -"Plus, some of them are bit fields which would be nice to access in a structured " -"way." +"offsets to construct pointers to access them is error-prone and hard to " +"read. Plus, some of them are bit fields which would be nice to access in a " +"structured way." msgstr "" "‏ PL011 در واقع [مجموعه رجیسترهای زیادی دارد](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers) و اضافه کردن " -"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند خواندن " -"را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی به آنها به " -"روشی ساختاریافته خوب است." +"offset برای ساختن اشاره‌گرها برای دسترسی به آنها مستعدخطا است و حتی فرآبند " +"خواندن را می‌تواند پیچیده کند، برخی از آن فیلدها از نوع bit هستند که دسترسی " +"به آنها به روشی ساختاریافته خوب است." #: src/bare-metal/aps/better-uart.md msgid "Offset" @@ -19058,8 +19619,8 @@ msgstr "همچنین برخی از ID register هایی وجود دارد که #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for working " -"with bitflags." +"The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " +"working with bitflags." msgstr "" "این crate برای [`bitflags`](https://crates.io/crates/bitflags) جهت کار با " "bitflags مفید است." @@ -19116,34 +19677,37 @@ msgstr "/// Ring indicator.\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along with a " -"bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " +"with a bunch of method implementations to get and set flags." msgstr "" -"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی پیاده‌سازی " -"متد برای دریافت و تنظیم flagها ایجاد می‌کند." +"ماکرو `bitflags!` یک نوع جدید چیزی مانند`Flags(u16)` را به همراه تعدادی " +"پیاده‌سازی متد برای دریافت و تنظیم flagها ایجاد می‌کند." #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "رجیستر چندگانه" #: src/bare-metal/aps/better-uart/registers.md -msgid "We can use a struct to represent the memory layout of the UART's registers." +msgid "" +"We can use a struct to represent the memory layout of the UART's registers." msgstr "" -"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده کنیم." +"ما می‌توانیم از یک ساختار برای نمایش طرح memory layout یک رجیستر UART استفاده " +"کنیم." #: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " -"predictable layout, as default Rust representation allows the compiler to (among " -"other things) reorder fields however it sees fit." +"predictable layout, as default Rust representation allows the compiler to " +"(among other things) reorder fields however it sees fit." msgstr "" "‏ [`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" -"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد و این " -"پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای داشتن یک طرح " -"قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر اجازه می دهد تا (از " -"جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب کند." +"representation) به کامپایلر می گوید که فیلدهای ساختاری را به ترتیب قرار دهد " +"و این پیروی از قوانین مشابه با زبان C است. این کار را برای ساختار ما برای " +"داشتن یک طرح قابل پیش‌بینی ضروری است، زیرا نمایش پیش‌فرض Rust به کامپایلر " +"اجازه می دهد تا (از جمله موارد دیگر) فیلدها را به هر نحوی که صلاح بداند مرتب " +"کند." #: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." @@ -19189,8 +19753,8 @@ msgstr "// TODO: Check for error conditions in bits 8-11.\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual fields " -"without creating an intermediate reference, which would be unsound." +"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"fields without creating an intermediate reference, which would be unsound." msgstr "" "به استفاده از `addr_of!` / `addr_of_mut!` برای دریافت pointerها به فیلدهای " "جداگانه بدون ایجاد یک reference میانی توجه کنید، که ممکن است نادرست باشد." @@ -19201,11 +19765,11 @@ msgstr "با استفاده از آن" #: src/bare-metal/aps/better-uart/using.md msgid "" -"Let's write a small program using our driver to write to the serial console, and " -"echo incoming bytes." +"Let's write a small program using our driver to write to the serial console, " +"and echo incoming bytes." msgstr "" -"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال بنویسیم " -"و بایت‌های ورودی را echo کنیم." +"بیایید یک برنامه کوچک با استفاده از درایور خود بنویسیم تا روی کنسول سریال " +"بنویسیم و بایت‌های ورودی را echo کنیم." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md @@ -19246,27 +19810,30 @@ msgstr "\"Bye!\"" #: src/bare-metal/aps/better-uart/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` function " -"is called from our entry point code in `entry.S`. See the speaker notes there for " -"details." +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." msgstr "" -"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` از " -"کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، یادداشت‌های " -"سخنرانی‌ها را در آنجا ببینید." +"همانطور که در مثال [inline assembly]‌(../inline-assembly.md)، این تابع `main` " +"از کد نقطه ورودی ما در `entry.S` فراخوانی می‌شود. برای جزئیات بیشتر، " +"یادداشت‌های سخنرانی‌ها را در آنجا ببینید." #: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" -"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا کنید." +"مثال را در QEMU با `make qemu` در زیر `src/bare-metal/aps/examples` اجرا " +"کنید." #: src/bare-metal/aps/logging.md msgid "" -"It would be nice to be able to use the logging macros from the [`log`](https://" -"crates.io/crates/log) crate. We can do this by implementing the `Log` trait." +"It would be nice to be able to use the logging macros from the [`log`]" +"(https://crates.io/crates/log) crate. We can do this by implementing the " +"`Log` trait." msgstr "" -"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/crates/" -"log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام دهیم." +"خوب است که بتوانید از ماکروهای logging از crate [`log`](https://crates.io/" +"crates/log) استفاده کنید. ما می‌توانیم این کار را با اجرای ویژگی `Log` انجام " +"دهیم." #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" @@ -19282,8 +19849,8 @@ msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" -"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` مقداردهی " -"اولیه می‌کنیم." +"باز کردن در`log` ایمن است زیرا `LOGGER` را قبل از فراخوانی `set_logger` " +"مقداردهی اولیه می‌کنیم." #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." @@ -19304,39 +19871,40 @@ msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" -"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` اجرا " -"کنید." +"مثال را در QEMU با `make qemu_logger` در زیر `src/bare-metal/aps/examples` " +"اجرا کنید." #: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " -"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with SP0, " -"current EL with SPx, lower EL using AArch64, lower EL using AArch32). We " -"implement this in assembly to save volatile registers to the stack before calling " -"into Rust code:" +"exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " +"SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " +"We implement this in assembly to save volatile registers to the stack before " +"calling into Rust code:" msgstr "" -"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا (synchronous، " -"IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL with SPx, lower EL " -"using AArch64, lower EL using AArch32) تعریف می‌کند. ما این کار را در اسمبلی " -"پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از فراخوانی Rust در stack " -"ذخیره کنیم:" +"‏ AArch64 یک جدول برداری استثنایی با ۱۶ ورودی، برای ۴ نوع استثنا " +"(synchronous، IRQ، FIQ، SError) از ۴ حالت (Ecurrent EL with SP0, current EL " +"with SPx, lower EL using AArch64, lower EL using AArch32) تعریف می‌کند. ما " +"این کار را در اسمبلی پیاده‌سازی می‌کنیم تا رجیسترهای فرار (volatile) را قبل از " +"فراخوانی Rust در stack ذخیره کنیم:" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." -msgstr "‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." +msgstr "" +"‏ EL سطح استثنا است. تمام نمونه‌های ما امروز بعدازظهر در EL1 اجرا می‌شوند." #: src/bare-metal/aps/exceptions.md msgid "" -"For simplicity we aren't distinguishing between SP0 and SPx for the current EL " -"exceptions, or between AArch32 and AArch64 for the lower EL exceptions." +"For simplicity we aren't distinguishing between SP0 and SPx for the current " +"EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" -"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و AArch64 " -"برای استثناهای پایین EL تمایز قائل نمی‌شویم." +"برای سادگی، ما بین SP0 و SPx برای استثناهای EL فعلی، یا بین AArch32 و " +"AArch64 برای استثناهای پایین EL تمایز قائل نمی‌شویم." #: src/bare-metal/aps/exceptions.md msgid "" -"For this example we just log the exception and power down, as we don't expect any " -"of them to actually happen." +"For this example we just log the exception and power down, as we don't " +"expect any of them to actually happen." msgstr "" "برای این مثال، ما فقط exception را log کرده و سپس خاموش می‌کنیم، زیرا انتظار " "نداریم هیچ یک از آنها واقعاً اتفاق بیفتد." @@ -19344,19 +19912,20 @@ msgstr "" #: src/bare-metal/aps/exceptions.md #, fuzzy msgid "" -"We can think of exception handlers and our main execution context more or less " -"like different threads. [`Send` and `Sync`](../../concurrency/send-sync.md) will " -"control what we can share between them, just like with threads. For example, if " -"we want to share some value between exception handlers and the rest of the " -"program, and it's `Send` but not `Sync`, then we'll need to wrap it in something " -"like a `Mutex` and put it in a static." +"We can think of exception handlers and our main execution context more or " +"less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." +"md) will control what we can share between them, just like with threads. For " +"example, if we want to share some value between exception handlers and the " +"rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " +"it in something like a `Mutex` and put it in a static." msgstr "" -"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند threadهای " -"مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync.md) آنچه را که " -"می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، کنترل می‌کنند. برای " -"مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و بقیه برنامه به اشتراک " -"بگذاریم که بیشتر در مورد `Send` است اما مربوط به `Sync` نیست، باید آن را در چیزی " -"مانند`Mutex` محصور کرده و یک استاتیک در آن قرار دهیم." +"می‌توانیم به handlerهای exception و context اجرای اصلی‌مان کمابیش مانند " +"threadهای مختلف فکر کنیم. [`Send` and `Sync`](../../concurrency/send-sync." +"md) آنچه را که می‌توانیم بین آنها به اشتراک بگذاریم، دقیقاً مانند threadها، " +"کنترل می‌کنند. برای مثال، اگر می‌خواهیم مقداری را بین handlerهای exception و " +"بقیه برنامه به اشتراک بگذاریم که بیشتر در مورد `Send` است اما مربوط به " +"`Sync` نیست، باید آن را در چیزی مانند`Mutex` محصور کرده و یک استاتیک در آن " +"قرار دهیم." #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" @@ -19377,27 +19946,27 @@ msgstr "به جای اینکه خود درایورهای زیادی داشته #: src/bare-metal/aps/other-projects.md msgid "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" -"OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" msgstr "" -"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-" -"OS-tutorials)" +"[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" +"raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md msgid "" -"Initialisation, UART driver, simple bootloader, JTAG, exception levels, exception " -"handling, page tables" +"Initialisation, UART driver, simple bootloader, JTAG, exception levels, " +"exception handling, page tables" msgstr "" -"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت exception " -"و page tableها" +"راه‌اندازی، درایور UART و bootloader ساده، JTAG، سطوح exception، مدیریت " +"exception و page tableها" #: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" -"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی برای " -"کپی کردن برای کد production نیست." +"برخی ابهامات در مورد نگهداری کَش و راه‌اندازی اولیه در Rust، لزوماً مثال خوبی " +"برای کپی کردن برای کد production نیست." #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" @@ -19409,43 +19978,44 @@ msgstr "تجزیه‌و‌تحلیل استاتیک برای تعیین حداک #: src/bare-metal/aps/other-projects.md msgid "" -"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are enabled. " -"This will read and write memory (e.g. the stack). However:" +"The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " +"enabled. This will read and write memory (e.g. the stack). However:" msgstr "" "آموزش سیستم عامل RaspberryPi، کد Rust را قبل از فعال شدن MMU و حافظه کَش اجرا " -"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). بااین‌حال:" +"می‌کند. این کار memory را می‌خواند و روی آن می‌نویسد (به عنوان مثال stack). " +"بااین‌حال:" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with `aarch64-" -"unknown-none` which sets `+strict-align` to prevent the compiler generating " -"unaligned accesses so it should be alright, but this is not necessarily the case " -"in general." +"Without the MMU and cache, unaligned accesses will fault. It builds with " +"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " +"generating unaligned accesses so it should be alright, but this is not " +"necessarily the case in general." msgstr "" -"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با `aarch64-" -"unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از ایجاد دسترسی‌های " -"غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید صحیح باشد، اما لزوماً " -"اینطور نیست." +"بدون MMU و حافظه کَش، دسترسی‌های بدون تراز دچار خطا خواهند شد.این‌ها با " +"`aarch64-unknown-none` ساخته می‌شود که `+strict-align` را تنظیم کنند تا از " +"ایجاد دسترسی‌های غیرهمتراز توسط کامپایلر جلوگیری کند، بنابراین همیشه باید " +"صحیح باشد، اما لزوماً اینطور نیست." #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The problem " -"is that the VM is accessing memory directly with the cache disabled, while the " -"host has cacheable aliases to the same memory. Even if the host doesn't " -"explicitly access the memory, speculative accesses can lead to cache fills, and " -"then changes from one or the other will get lost. Again this is alright in this " -"particular case (running directly on the hardware with no hypervisor), but isn't " -"a good pattern in general." -msgstr "" -"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) شود. " -"مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه دسترسی پیدا " -"می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. حتی اگر host به طور " -"صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی می‌تواند منجر به پر شدن حافظه کَش " -"شود و سپس تغییرات از یکی پس از دیگری از بین می‌رود. باز هم در این مورد خاص درست " -"است (مستقیماً روی سخت‌افزار بدون hypervisor اجرا می‌شود)، اما به‌طورکلی الگوی خوبی " -"نیست." +"If it were running in a VM, this can lead to cache coherency issues. The " +"problem is that the VM is accessing memory directly with the cache disabled, " +"while the host has cacheable aliases to the same memory. Even if the host " +"doesn't explicitly access the memory, speculative accesses can lead to cache " +"fills, and then changes from one or the other will get lost. Again this is " +"alright in this particular case (running directly on the hardware with no " +"hypervisor), but isn't a good pattern in general." +msgstr "" +"اگر در VM اجرا می‌شد، این می‌تواند منجر به مشکلات انسجام کَش (cache coherency) " +"شود. مشکل این است که ماشین مجازی مستقیماً با حافظه کَش غیرفعال شده به حافظه " +"دسترسی پیدا می‌کند، درحالی‌که host دارای alias قابل کَش برای همان حافظه است. " +"حتی اگر host به طور صریح به حافظه دسترسی نداشته باشد، دسترسی‌های موقتی " +"می‌تواند منجر به پر شدن حافظه کَش شود و سپس تغییرات از یکی پس از دیگری از بین " +"می‌رود. باز هم در این مورد خاص درست است (مستقیماً روی سخت‌افزار بدون hypervisor " +"اجرا می‌شود)، اما به‌طورکلی الگوی خوبی نیست." #: src/bare-metal/useful-crates.md msgid "Useful crates" @@ -19456,41 +20026,42 @@ msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" -"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal را حل " -"می‌کند." +"ما به چند crate می‌پردازیم که برخی از مشکلات رایج در برنامه‌نویسی bare-metal " +"را حل می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides traits " -"and macros for safely converting between byte sequences and other types." +"The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " +"traits and macros for safely converting between byte sequences and other " +"types." msgstr "" -"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و ماکروهایی " -"را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." +"این crate [`zerocopy`](https://docs.rs/zerocopy/) (از Fuchsia) صفات و " +"ماکروهایی را برای تبدیل ایمن بین دنباله‌های بایت و انواع دیگر فراهم می‌کند." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"This is not suitable for MMIO (as it doesn't use volatile reads and writes), but " -"can be useful for working with structures shared with hardware e.g. by DMA, or " -"sent over some external interface." +"This is not suitable for MMIO (as it doesn't use volatile reads and writes), " +"but can be useful for working with structures shared with hardware e.g. by " +"DMA, or sent over some external interface." msgstr "" "این برای MMIO مناسب نیست (زیرا از خواندن و نوشتن فرار یا volatile استفاده " -"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. توسط " -"DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." +"نمی‌کند)، اما می‌تواند برای کار با ساختارهای مشترک با سخت افزار مفید باشد. " +"توسط DMA، یا از طریق برخی از رابط‌های خارجی ارسال می‌شود." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"`FromBytes` can be implemented for types for which any byte pattern is valid, and " -"so can safely be converted from an untrusted sequence of bytes." +"`FromBytes` can be implemented for types for which any byte pattern is " +"valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" "‏ `FromBytes` را می‌توان برای انواعی که هر الگوی بایتی برای آنها معتبر است " -"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر تبدیل " -"کرد." +"پیاده‌سازی کرد و بنابراین می‌توان با خیال راحت از یک دنباله بایت‌های نامعتبر " +"تبدیل کرد." #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " -"`RequestType` doesn't use all possible u32 values as discriminants, so not all " -"byte patterns are valid." +"`RequestType` doesn't use all possible u32 values as discriminants, so not " +"all byte patterns are valid." msgstr "" "تلاش برای استخراج `FromBytes` برای این تایپ‌ها ناموفق خواهد بود، زیرا " "`RequestType` از همه مقادیر ممکن u32 به عنوان متمایزکننده استفاده نمی‌کند، " @@ -19498,25 +20069,29 @@ msgstr "" #: src/bare-metal/useful-crates/zerocopy.md #, fuzzy -msgid "`zerocopy::byteorder` has types for byte-order aware numeric primitives." +msgid "" +"`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/zerocopy-" -"example/`. (It won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"zerocopy-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/`اجرا " -"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/zerocopy-example/" +"`اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets you " -"create page tables according to the AArch64 Virtual Memory System Architecture." +"The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " +"you create page tables according to the AArch64 Virtual Memory System " +"Architecture." msgstr "" "این crate [`aarch64-paging`](https://crates.io/crates/aarch64-paging) به شما " -"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد کنید." +"امکان می‌دهد page tableها را مطابق با معماری سیستم حافظه‌مجازی AArch64 ایجاد " +"کنید." #: src/bare-metal/useful-crates/aarch64-paging.md #, fuzzy @@ -19535,47 +20110,50 @@ msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"For now it only supports EL1, but support for other exception levels should be " -"straightforward to add." +"For now it only supports EL1, but support for other exception levels should " +"be straightforward to add." msgstr "" -"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید ساده " -"باشد." +"در حال حاضر فقط از EL1 پشتیبانی می‌کند، اما پشتیبانی از سایر سطوح استثنا باید " +"ساده باشد." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"This is used in Android for the [Protected VM Firmware](https://cs.android.com/" -"android/platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)." +"This is used in Android for the [Protected VM Firmware](https://cs.android." +"com/android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/)." msgstr "" -"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/android/" -"platform/superproject/+/master:packages/modules/Virtualization/pvmfw/) استفاده " -"می‌شود." +"این مورد در Android برای [Protected VM Firmware]‌(https://cs.android.com/" +"android/platform/superproject/+/master:packages/modules/Virtualization/" +"pvmfw/) استفاده می‌شود." #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware or " -"under QEMU." +"There's no easy way to run this example, as it needs to run on real hardware " +"or under QEMU." msgstr "" -"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی یا تحت " -"QEMU اجرا شود." +"هیچ راه آسانی برای اجرای این مثال وجود ندارد، زیرا باید روی سخت‌افزار واقعی " +"یا تحت QEMU اجرا شود." #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) is a " -"third-party crate implementing a basic buddy system allocator. It can be used " -"both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" +"[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " +"is a third-party crate implementing a basic buddy system allocator. It can " +"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" "buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use the " -"standard `alloc` crate (as we saw [before](../alloc.md)), or for allocating other " -"address space. For example, we might want to allocate MMIO space for PCI BARs:" -msgstr "" -"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) یک " -"third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. می‌توان آن " -"را هم برای ['LockedHeap'](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) در پیاده‌سازی [`GlobalAlloc`]‌" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) استفاده کرد. " -"بنابراین می‌توانید از crate استاندارد `alloc` (همانطور که [قبل از](../alloc.md) " -"دیدیم) یا برای تخصیص فضای آدرس دیگر استفاده کنید. به عنوان مثال، ممکن است بخواهیم " -"فضای MMIO را برای PCI BARها اختصاص دهیم:" +"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " +"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " +"allocating other address space. For example, we might want to allocate MMIO " +"space for PCI BARs:" +msgstr "" +"‏ ['buddy_system_allocator'](https://crates.io/crates/buddy_system_allocator) " +"یک third-party crate است که یک buddy system allocator را پیاده‌سازی می‌کند. " +"می‌توان آن را هم برای ['LockedHeap'](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " +"در پیاده‌سازی [`GlobalAlloc`]‌(https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) استفاده کرد. بنابراین می‌توانید از crate استاندارد `alloc` " +"(همانطور که [قبل از](../alloc.md) دیدیم) یا برای تخصیص فضای آدرس دیگر " +"استفاده کنید. به عنوان مثال، ممکن است بخواهیم فضای MMIO را برای PCI BARها " +"اختصاص دهیم:" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." @@ -19583,29 +20161,32 @@ msgstr "‏ PCI BAR‌ها همیشه دارای تراز برابر با اند #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" -"Run the example with `cargo run` under `src/bare-metal/useful-crates/allocator-" -"example/`. (It won't run in the Playground because of the crate dependency.)" +"Run the example with `cargo run` under `src/bare-metal/useful-crates/" +"allocator-example/`. (It won't run in the Playground because of the crate " +"dependency.)" msgstr "" -"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` اجرا " -"کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" +"مثال را با `cargo run` در `src/bare-metal/useful-crates/allocator-example/` " +"اجرا کنید. (به دلیل وابستگی به crate در Playground اجرا نمی‌شود.)" #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"Sometimes you want something which can be resized like a `Vec`, but without heap " -"allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides this: a vector " -"backed by an array or slice, which could be statically allocated or on the stack, " -"which keeps track of how many elements are used and panics if you try to use more " -"than are allocated." +"Sometimes you want something which can be resized like a `Vec`, but without " +"heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " +"this: a vector backed by an array or slice, which could be statically " +"allocated or on the stack, which keeps track of how many elements are used " +"and panics if you try to use more than are allocated." msgstr "" -"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، اما " -"بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) این را " -"فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که می‌تواند به‌صورت " -"ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده شده را ردیابی می‌کند و " -"اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده کنید panic می‌کند." +"گاهی اوقات شما چیزی را می‌خواهید که بتوان آن را مانند Vec تغییر اندازه داد، " +"اما بدون heap allocation که [`tinyvec`] (https://crates.io/crates/tinyvec) " +"این را فراهم می‌کند: یک برداری که توسط یک آرایه یا برش پشتیبانی می‌شود که " +"می‌تواند به‌صورت ایستا allocate داده شود یا روی stack که تعداد عناصر استفاده " +"شده را ردیابی می‌کند و اگر سعی کنید بیشتر از آنچه که اختصاص‌داده‌شده را استفاده " +"کنید panic می‌کند." #: src/bare-metal/useful-crates/tinyvec.md msgid "" -"`tinyvec` requires that the element type implement `Default` for initialisation." +"`tinyvec` requires that the element type implement `Default` for " +"initialisation." msgstr "" "‏ `tinyvec` نیاز دارد که تایپ عنصر `Default` را برای مقداردهی اولیه اجرا کند." @@ -19613,14 +20194,14 @@ msgstr "" msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" -"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت داخلی " -"اجرا می‌شود." +"‏ Rust Playground شامل `tinyvec` می‌شود، بنابراین این مثال به‌خوبی به صورت " +"داخلی اجرا می‌شود." #: src/bare-metal/useful-crates/spin.md msgid "" -"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` are " -"not available in `core` or `alloc`. How can we manage synchronisation or interior " -"mutability, such as for sharing state between different CPUs?" +"`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " +"are not available in `core` or `alloc`. How can we manage synchronisation or " +"interior mutability, such as for sharing state between different CPUs?" msgstr "" "‏ `std::sync::Mutex` و دیگر موارد اولیه همگام‌سازی از `std::sync` در `core` یا " "`alloc` موجود نیستند. چگونه می‌توانیم هماهنگ‌سازی یا تغییرپذیری داخلی، مانند " @@ -19631,48 +20212,51 @@ msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" -"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر spinlock، " -"بسیاری از این موارد اولیه را ارائه می‌کند." +"این crate [`spin`](https://crates.io/crates/spin) معادل‌های مبتنی بر " +"spinlock، بسیاری از این موارد اولیه را ارائه می‌کند." #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" -"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری کنید." +"اگر در handlerهای وقفه قفل می‌کنید مراقب باشید که از بن بست(deadlock) جلوگیری " +"کنید." #: src/bare-metal/useful-crates/spin.md msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" -"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, `Barrier` و " -"`Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." +"‏ `spin` همچنین دارای اجرای ticket lock mutex است. معادل‌های `RwLock`, " +"`Barrier` و `Once` از `std::sync`. و `Lazy` برای مقداردهی اولیه lazy." #: src/bare-metal/useful-crates/spin.md msgid "" -"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some useful " -"types for late initialisation with a slightly different approach to `spin::once::" -"Once`." +"The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " +"useful types for late initialisation with a slightly different approach to " +"`spin::once::Once`." msgstr "" -"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای تایپ‌های " -"مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::once::Once` است." +"این crate ['once_cell'](https://crates.io/crates/once_cell) همچنین دارای " +"تایپ‌های مفیدی برای مقداردهی اولیه دیرهنگام با رویکرد کمی متفاوت به `spin::" +"once::Once` است." #: src/bare-metal/useful-crates/spin.md -msgid "The Rust Playground includes `spin`, so this example will run fine inline." +msgid "" +"The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" -"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی اجرا " -"می‌شود." +"‏ Playground Rust شامل `spin` است، بنابراین این مثال به خوبی به صورت داخلی " +"اجرا می‌شود." #: src/bare-metal/android.md msgid "" -"To build a bare-metal Rust binary in AOSP, you need to use a `rust_ffi_static` " -"Soong rule to build your Rust code, then a `cc_binary` with a linker script to " -"produce the binary itself, and then a `raw_binary` to convert the ELF to a raw " -"binary ready to be run." +"To build a bare-metal Rust binary in AOSP, you need to use a " +"`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " +"with a linker script to produce the binary itself, and then a `raw_binary` " +"to convert the ELF to a raw binary ready to be run." msgstr "" -"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` Soong " -"برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker script " -"برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل ELF به یک raw " -"binary آماده اجرا استفاده کنید." +"برای ساختن یک bare-metal Rust binary در AOSP، باید از یک `rust_ffi_static` " +"Soong برای ساخت کد Rust خود استفاده کنید، سپس از یک `cc_binary` با یک linker " +"script برای تولید binary استفاده کرده و سپس از یک `raw_binary` برای تبدیل " +"ELF به یک raw binary آماده اجرا استفاده کنید." #: src/bare-metal/android/vmbase.md msgid "vmbase" @@ -19682,30 +20266,31 @@ msgstr "vmbase" #, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/" -"libvmbase/) library provides a linker script and useful defaults for the build " -"rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" "برای ماشین‌های مجازی که تحت crosvm در aarch64 اجرا می‌شوند، کتابخانه [vmbase]" -"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/" -"heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه می‌کند. برای " -"این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و موارد دیگر." +"(https://android.googlesource.com/platform/packages/modules/Virtualization/+/" +"refs/heads/master/vmbase/) یک اسکریپت linker و پیش‌فرض‌های مفیدی را ارائه " +"می‌کند. برای این قوانین ساخت، همراه با یک نقطه ورودی، UART console logging و " +"موارد دیگر." #: src/bare-metal/android/vmbase.md msgid "" -"The `main!` macro marks your main function, to be called from the `vmbase` entry " -"point." +"The `main!` macro marks your main function, to be called from the `vmbase` " +"entry point." msgstr "" -"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` فراخوانی " -"شود." +"این ماکرو `main!`عملکرد اصلی شما را مشخص می‌کند تا از نقطه ورودی `vmbase` " +"فراخوانی شود." #: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" -"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت main " -"function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." +"نقطه ورودی `vmbase` مقدار دهی اولیه کنسول را کنترل می‌کند و در صورت بازگشت " +"main function، یک PSCI_SYSTEM_OFF برای خاموش کردن VM صادر می‌کند." #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." @@ -19716,10 +20301,11 @@ msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" -"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه شده " -"نگاهی بیندازید." +"پس از بررسی تمرین‌ها، می‌توانید به [راه‌حل ها](solutions-afternoon.md) ارائه " +"شده نگاهی بیندازید." -#: src/exercises/bare-metal/rtc.md src/exercises/bare-metal/solutions-afternoon.md +#: src/exercises/bare-metal/rtc.md +#: src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC driver" @@ -19727,27 +20313,28 @@ msgstr "RTC driver" #, fuzzy msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, you " -"should write a driver for it." +"documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " +"you should write a driver for it." msgstr "" -"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm.com/" -"documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور برای آن " -"بنویسید." +"ماشین QEMU aarch64 virt دارای یک ساعت بلادرنگ [PL031](https://developer.arm." +"com/documentation/ddi0224/c) در 0x9010000 است. برای این تمرین باید یک درایور " +"برای آن بنویسید." #: src/exercises/bare-metal/rtc.md msgid "" -"Use it to print the current time to the serial console. You can use the [`chrono`]" -"(https://crates.io/crates/chrono) crate for date/time formatting." +"Use it to print the current time to the serial console. You can use the " +"[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" -"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate [`chrono`]" -"(https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده کنید." +"از آن برای چاپ زمان جاری در کنسول سریال استفاده کنید. می‌توانید از crate " +"[`chrono`](https://crates.io/crates/chrono) برای قالب‌بندی date/time استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" -"Use the match register and raw interrupt status to busy-wait until a given time, " -"e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://doc.rust-" -"lang.org/core/hint/fn.spin_loop.html) inside the loop.)" +"Use the match register and raw interrupt status to busy-wait until a given " +"time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" +"doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" "از match register و raw interrupt status استفاده کنید تا تا زمان معینی منتظر " "بمانید، به عنوان مثال. ۳ ثانیه در آینده نزدیک (Call [`core::hint::spin_loop`]" @@ -19755,13 +20342,14 @@ msgstr "" #: src/exercises/bare-metal/rtc.md msgid "" -"_Extension if you have time:_ Enable and handle the interrupt generated by the " -"RTC match. You can use the driver provided in the [`arm-gic`](https://docs.rs/arm-" -"gic/) crate to configure the Arm Generic Interrupt Controller." +"_Extension if you have time:_ Enable and handle the interrupt generated by " +"the RTC match. You can use the driver provided in the [`arm-gic`](https://" +"docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" -"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن را " -"مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://docs.rs/" -"arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده کنید." +"‏ _افزونه‌ها اگر زمان دارید:_ وقفه ایجاد شده توسط تطبیق RTC را فعال کرده و آن " +"را مدیریت کنید. می‌توانید از درایور ارائه شده در crate [`arm-gic`](https://" +"docs.rs/arm-gic/) برای پیکربندی Arm Generic Interrupt Controller استفاده " +"کنید." #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." @@ -19772,22 +20360,24 @@ msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" -"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::wfi()` به " -"حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند به خواب برود." +"هنگامی که وقفه (interrupt) فعال شد، می‌توانید هسته را از طریق `arm_gic::" +"wfi()` به حالت Sleep درآورید، که باعث می‌شود هسته تا زمانی که وقفه دریافت کند " +"به خواب برود." #: src/exercises/bare-metal/rtc.md msgid "" -"Download the [exercise template](../../comprehensive-rust-exercises.zip) and look " -"in the `rtc` directory for the following files." +"Download the [exercise template](../../comprehensive-rust-exercises.zip) and " +"look in the `rtc` directory for the following files." msgstr "" -"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و فایل‌های " -"زیر را در دایرکتوری `rtc` جستجو کنید." +"دانلود از [exercise template](../../comprehensive-rust-exercises.zip) و " +"فایل‌های زیر را در دایرکتوری `rtc` جستجو کنید." #: src/exercises/bare-metal/rtc.md msgid "" -"_src/exceptions.rs_ (you should only need to change this for the 3rd part of the " -"exercise):" -msgstr "‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" +"_src/exceptions.rs_ (you should only need to change this for the 3rd part of " +"the exercise):" +msgstr "" +"‏ _src/exceptions.rs_ (شما فقط باید این را برای بخش سوم تمرین تغییر دهید):" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" @@ -19962,8 +20552,10 @@ msgid "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// Constructs a new instance of the RTC driver for a PL031 device at the\n" @@ -19971,8 +20563,10 @@ msgstr "" " ///\n" " /// # Safety\n" " ///\n" -" /// The given base address must point to the MMIO control registers of a\n" -" /// PL031 device, which must be mapped into the address space of the process\n" +" /// The given base address must point to the MMIO control registers of " +"a\n" +" /// PL031 device, which must be mapped into the address space of the " +"process\n" " /// as device memory and not have any other aliases.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20001,10 +20595,12 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" msgstr "" -"/// Returns whether the match register matches the RTC value, whether or not\n" +"/// Returns whether the match register matches the RTC value, whether or " +"not\n" " /// the interrupt is enabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20025,12 +20621,14 @@ msgstr "" msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" msgstr "" "/// Sets or clears the interrupt mask.\n" " ///\n" -" /// When the mask is true the interrupt is enabled; when it is false the\n" +" /// When the mask is true the interrupt is enabled; when it is false " +"the\n" " /// interrupt is disabled.\n" #: src/exercises/bare-metal/solutions-afternoon.md @@ -20053,50 +20651,54 @@ msgstr "به مبحث Concurrency در Rust خوش‌آمدید" #: src/concurrency/welcome.md msgid "" -"Rust has full support for concurrency using OS threads with mutexes and channels." +"Rust has full support for concurrency using OS threads with mutexes and " +"channels." msgstr "" -"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده از " -"mutex ها و channel ها پشتیبانی می‌کند." +"زبان Rust به طور کامل از concurrency در سطح thread های سیستم‌عامل با استفاده " +"از mutex ها و channel ها پشتیبانی می‌کند." #: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " -"compile time bugs. This is often referred to as _fearless concurrency_ since you " -"can rely on the compiler to ensure correctness at runtime." +"compile time bugs. This is often referred to as _fearless concurrency_ since " +"you can rely on the compiler to ensure correctness at runtime." msgstr "" -"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های زمان " -"کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " -"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در زمان " -"اجرا (runtime) اعتماد کنید." +"سیستم Rust راست نقش مهمی در تبدیل بسیاری از باگ‌های concurrency به باگ‌های " +"زمان کامپایل ایفا می‌کند. این مورد اغلب به‌عنوان هم‌زمانی بی‌پروا ( _fearless " +"concurrency_) شناخته می‌شود زیرا می‌توانید به کامپایلر برای اطمینان از صحت در " +"زمان اجرا (runtime) اعتماد کنید." #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "" -"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول بکشد. " -"شامل موارد زیر است:" +"با احتساب استراحت‌های ۱۰ دقیقه‌ای، این جلسه باید حدود ۳ ساعت و ۲۰ دقیقه طول " +"بکشد. شامل موارد زیر است:" #: src/concurrency/welcome.md -msgid "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته باشیم: " -"thread‌ها، سازوکارهای همگام‌سازی و غیره." +"‏ Rust به ما اجازه می‌دهد تا به ابزارهای همزمانی سیستم عامل دسترسی داشته " +"باشیم: thread‌ها، سازوکارهای همگام‌سازی و غیره." #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." -msgstr "این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." +msgstr "" +"این سیستم تایپ به ما ایمنی لازم برای concurrency بدون هیچ ویژگی خاصی می‌دهد." #: src/concurrency/welcome.md msgid "" -"The same tools that help with \"concurrent\" access in a single thread (e.g., a " -"called function that might mutate an argument or save references to it to read " -"later) save us from multi-threading issues." +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." msgstr "" -" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند (مانند " -"یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به آن را برای " -"خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات می‌دهند. " +" همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " +"(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " +"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " +"می‌دهند. " #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -20117,8 +20719,8 @@ msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" -"Spawning new threads does not automatically delay program termination at the end " -"of `main`." +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." msgstr "" "ایجاد threadهای جدید به طور خودکار خاتمه برنامه را تا پایان `main` به تاخیر " "نمی‌اندازد." @@ -20130,13 +20732,14 @@ msgstr "Thread panicها مستقل از یکدیگر هستند." #: src/concurrency/threads/plain.md msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." msgstr "" -"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز کرد." +"‏Panicها می‌تواند payloadای را حمل کند که می‌توان آن را با «downcast_ref» باز " +"کرد." #: src/concurrency/threads/plain.md msgid "Rust thread APIs look not too different from e.g. C++ ones." msgstr "" -"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از آن‌ها " -"است." +"‏Rust thread API ها خیلی متفاوت از موارد دیگر به نظر نمی‌رسند. که C++ یکی از " +"آن‌ها است." #: src/concurrency/threads/plain.md msgid "Run the example." @@ -20144,7 +20747,8 @@ msgstr "مثال را اجرا کنید." #: src/concurrency/threads/plain.md msgid "" -"5ms timing is loose enough that main and spawned threads stay mostly in lockstep." +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." msgstr "" "زمان‌بندی 5 میلی‌ثانیه به اندازه‌ای سست هستند که thread اصلی و spawned threadها " "عمدتاً همگام می‌مانند." @@ -20152,15 +20756,16 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به پایان " -"می‌رسد!" +"توجه داشته باشید که برنامه قبل از اینکه thread spawned به مقدار ۱۰ برسد به " +"پایان می‌رسد!" #: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it persist." +"This is because main ends the program and spawned threads do not make it " +"persist." msgstr "" -"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث تداوم " -"آن نمی‌شوند." +"این به خاطر است که انتهای main برنامه است و spawned threadها ایجاد شده باعث " +"تداوم آن نمی‌شوند." #: src/concurrency/threads/plain.md msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." @@ -20172,11 +20777,11 @@ msgstr "چقدر باید صبر کنیم تا یک spawned thread تکمیل ش #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " -"`JoinHandle`. Look at the docs." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. Look at the docs." msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) returns a " -"`JoinHandle`. به سند نگاه کنید." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. به سند نگاه کنید." #: src/concurrency/threads/plain.md msgid "" @@ -20188,11 +20793,11 @@ msgstr "" #: src/concurrency/threads/plain.md msgid "" -"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for the " -"thread to finish and have the program count all the way to 10." +"Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " +"the thread to finish and have the program count all the way to 10." msgstr "" -"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید تا " -"منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." +"از «let handle = thread::spawn(...)» و بعد از «handle.join()» استفاده کنید " +"تا منتظر بمانید تا thread تمام شود و شمارنده برنامه برابر با مقدار ۱۰ باشد." #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" @@ -20204,25 +20809,26 @@ msgstr "دوباره به اسناد نگاه کنید:" #: src/concurrency/threads/plain.md msgid "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " -"returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" msgstr "" -"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s closure " -"returns `T`" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" #: src/concurrency/threads/plain.md msgid "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct.JoinHandle." -"html#method.join) returns `thread::Result`" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" #: src/concurrency/threads/plain.md msgid "" -"Use the `Result` return value from `handle.join()` to get access to the returned " -"value." -msgstr "به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." +"Use the `Result` return value from `handle.join()` to get access to the " +"returned value." +msgstr "" +"به کمک`Result` از «handle.join()» برای دسترسی به مقدار برگشتی استفاده کنید." #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" @@ -20230,19 +20836,21 @@ msgstr "خوب، مورد دیگر چطور؟" #: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." -msgstr "فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." +msgstr "" +"فعال‌سازی یک panic در یک thread. توجه شود که این مورد panic `main` نیست." #: src/concurrency/threads/plain.md msgid "" -"Access the panic payload. This is a good time to talk about [`Any`](https://doc." -"rust-lang.org/std/any/index.html)." +"Access the panic payload. This is a good time to talk about [`Any`](https://" +"doc.rust-lang.org/std/any/index.html)." msgstr "" "دسترسی به این panic payload. بهترین زمان برای پرداخت به این موضوع است [`Any`]" "(https://doc.rust-lang.org/std/any/index.html)." #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" -msgstr "اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" +msgstr "" +"اکنون می‌توانیم مقادیر را از رشته‌ها برگردانیم! در مورد گرفتن ورودی‌ها چطور؟" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." @@ -20255,8 +20863,8 @@ msgstr "یک پیغام خطا نشان می‌دهد که باید آن را ج #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار مشتق " -"شده را برگردانیم." +"آن را به داخل منتقل کنید، درنتیجه ما می توانیم محاسبه کنیم و سپس یک مقدار " +"مشتق شده را برگردانیم." #: src/concurrency/threads/plain.md msgid "If we want to borrow?" @@ -20264,17 +20872,17 @@ msgstr "اگر بخواهیم قرض (borrow) بگیریم چطور؟" #: src/concurrency/threads/plain.md msgid "" -"Main kills child threads when it returns, but another function would just return " -"and leave them running." +"Main kills child threads when it returns, but another function would just " +"return and leave them running." msgstr "" -" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری return " -"می‌شود و آنها را در حال اجرا می‌گذارد." +" تابع ‏Main در هنگام بازگشت threadهای فرزند را از بین می‌برد، اما تابع دیگری " +"return می‌شود و آنها را در حال اجرا می‌گذارد." #: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را نقض " -"می‌کند!" +"این کار می‌تواند منجر به stack استفاده پس از return شود که memory safety را " +"نقض می‌کند!" #: src/concurrency/threads/plain.md msgid "How do we avoid this? see next slide." @@ -20286,27 +20894,28 @@ msgstr "‏thread‌های معمولی نمی‌توانند از محیط خو #: src/concurrency/threads/scoped.md msgid "" -"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/fn." -"scope.html) for this:" +"However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" +"fn.scope.html) for this:" msgstr "" -"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/std/" -"thread/fn.scope.html) ببینید:" +"به‌هرحال, می‌توانید برای این مورد [scoped thread](https://doc.rust-lang.org/" +"std/thread/fn.scope.html) ببینید:" #: src/concurrency/threads/scoped.md msgid "" -"The reason for that is that when the `thread::scope` function completes, all the " -"threads are guaranteed to be joined, so they can return borrowed data." +"The reason for that is that when the `thread::scope` function completes, all " +"the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها تضمین " -"می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." +"دلیل آن این است که وقتی تابع «thread::scope» کامل می‌شود، اتصال همه thread‌ها " +"تضمین می‌شود، بنابراین می‌توانند داده‌های قرضی را برگردانند." #: src/concurrency/threads/scoped.md msgid "" -"Normal Rust borrowing rules apply: you can either borrow mutably by one thread, " -"or immutably by any number of threads." +"Normal Rust borrowing rules apply: you can either borrow mutably by one " +"thread, or immutably by any number of threads." msgstr "" -"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) با " -"یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) بگیرید." +"قوانین عادی قرض‌گیری Rust اعمال می‌شود: شما می‌توانید به‌صورت تغییرپذیر(mutable) " +"با یک thread یا غیرقابل تغییر (immutable) با هر تعداد thread قرض (borrow) " +"بگیرید." #: src/concurrency/channels.md src/concurrency/async-control-flow.md msgid "This segment should take about 20 minutes. It contains:" @@ -20314,11 +20923,12 @@ msgstr "این بخش باید حدود ۲۰ دقیقه طول بکشد. این #: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two parts " -"are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a `Sender` and a `Receiver`. The two " +"parts are connected via the channel, but you only see the end-points." msgstr "" -"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از طریق " -"channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را می‌بینید." +"کانال‌های Rust دارای دو بخش هستند: `Sender` و `Receiver`. این دو بخش از " +"طریق channel به هم متصل می‌شوند، اما شما فقط نقاط پایانی (end-points) را " +"می‌بینید." #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" @@ -20327,7 +20937,8 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" "`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does not." +"implement `Clone` (so you can make multiple producers) but `Receiver` does " +"not." msgstr "" #: src/concurrency/channels/senders-receivers.md @@ -20357,30 +20968,32 @@ msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md -msgid "With bounded (synchronous) channels, `send` can block the current thread:" +msgid "" +"With bounded (synchronous) channels, `send` can block the current thread:" msgstr "" -"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را مسدود کند:" +"با کانال‌های bounded (synchronous)، فرآیند `send` می‌تواند thread فعلی را " +"مسدود کند:" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the channel " -"for the new message. The thread can be blocked indefinitely if there is nobody " -"who reads from the channel." +"Calling `send` will block the current thread until there is space in the " +"channel for the new message. The thread can be blocked indefinitely if there " +"is nobody who reads from the channel." msgstr "" -"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته باشد، " -"thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread را می‌توان " -"به طور نامحدود مسدود کرد." +"فراخوانی `send` تا زمانی که فضای کافی در کانال برای پیام جدید وجود داشته " +"باشد، thread کنونی را مسدود می‌کند. اگر کسی از کانال چیزی نخواند آنگاه thread " +"را می‌توان به طور نامحدود مسدود کرد." #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) if " -"the channel is closed. A channel is closed when the receiver is dropped." +"A call to `send` will abort with an error (that is why it returns `Result`) " +"if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A bounded channel with a size of zero is called a \"rendezvous channel\". Every " -"send will block the current thread until another thread calls `recv`." +"A bounded channel with a size of zero is called a \"rendezvous channel\". " +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -20393,48 +21006,48 @@ msgstr "همگام‌سازی" #: src/concurrency/send-sync/marker-traits.md msgid "" -"How does Rust know to forbid shared access across threads? The answer is in two " -"traits:" +"How does Rust know to forbid shared access across threads? The answer is in " +"two traits:" msgstr "" -"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در دو " -"trait است:" +"‏ Rust چگونه می‌داند که دسترسی مشترک در سراسر threadها را ممنوع می‌کند؟ پاسخ در " +"دو trait است:" #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` is " -"`Send` if it is safe to move a `T` across a thread boundary." +"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " +"is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" "‏[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): در صورتی که " "جابجایی `T` در امتداد thread boundary ایمن باشد، تایپ `T` از جنس `Send` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` is " -"`Sync` if it is safe to move a `&T` across a thread boundary." +"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " +"is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" "‏[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): در صورتی که " -"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس `Sync` " -"است." +"جابجایی یک `&T` در سراسر یک thread boundary ایمن باشد، یک تایپ `T` از جنس " +"`Sync` است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). The " -"compiler will automatically derive them for your types as long as they only " -"contain `Send` and `Sync` types. You can also implement them manually when you " -"know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" "‏`Send` و `Sync` [ویژگی‌های ناامن] هستند (../../unsafe-rust/unsafe-traits.md). " -"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط دارای " -"انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی پیاده سازی " -"کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." +"کامپایلر به‌طور خودکار آنها را برای تایپ‌های شما مشتق می‌کند تا زمانی که فقط " +"دارای انواع `Send` و `Sync` باشند. شما همچنین می توانید آنها را به صورت دستی " +"پیاده سازی کنید به‌خصوص زمانی که می دانید مقدار آن معتبر است." #: src/concurrency/send-sync/marker-traits.md msgid "" -"One can think of these traits as markers that the type has certain thread-safety " -"properties." +"One can think of these traits as markers that the type has certain thread-" +"safety properties." msgstr "" -"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-safety " -"خاصی را دارد." +"می‌توان این traitها را به عنوان نشانگرهایی در نظر گرفت که نوعی ویژگی thread-" +"safety خاصی را دارد." #: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." @@ -20442,37 +21055,39 @@ msgstr "آنها را می‌توان در محدودیت‌های generic به #: src/concurrency/send-sync/send.md msgid "" -"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) if " -"it is safe to move a `T` value to another thread." +"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " +"if it is safe to move a `T` value to another thread." msgstr "" -"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://doc." -"rust-lang.org/std/marker/trait.Send.html) است." +"اگر انتقال مقدار `T` به thread دیگری امن باشد، تایپ `T` در [`Send`](https://" +"doc.rust-lang.org/std/marker/trait.Send.html) است." #: src/concurrency/send-sync/send.md msgid "" -"The effect of moving ownership to another thread is that _destructors_ will run " -"in that thread. So the question is when you can allocate a value in one thread " -"and deallocate it in another." +"The effect of moving ownership to another thread is that _destructors_ will " +"run in that thread. So the question is when you can allocate a value in one " +"thread and deallocate it in another." msgstr "" -"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که _نابودگرها_ " -"( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این است که چه زمانی " -"می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در thread دیگر توزیع کنید." +"تأثیر انتقال مالکیت (moving ownership) به یک thread دیگر این است که " +"_نابودگرها_ ( _destructors_ ) در آن thread اجرا می شوند. بنابراین سوال این " +"است که چه زمانی می‌توانید یک مقدار را در یک thread تخصیص دهید و آن را در " +"thread دیگر توزیع کنید." #: src/concurrency/send-sync/send.md msgid "" -"As an example, a connection to the SQLite library must only be accessed from a " -"single thread." +"As an example, a connection to the SQLite library must only be accessed from " +"a single thread." msgstr "" -"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی باشد." +"به عنوان مثال، اتصال به کتابخانه SQLite فقط باید از یک thread قابل دسترسی " +"باشد." #: src/concurrency/send-sync/sync.md msgid "" -"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) if " -"it is safe to access a `T` value from multiple threads at the same time." +"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " +"if it is safe to access a `T` value from multiple threads at the same time." msgstr "" -"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync." -"html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور همزمان امن " -"باشد." +"یک تایپ `T` در واقع نوعی [`Sync`](https://doc.rust-lang.org/std/marker/trait." +"Sync.html) است، اگر در دسترسی به یک مقدار`T` از طریق چندین رشته به طور " +"همزمان امن باشد." #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" @@ -20484,26 +21099,27 @@ msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک ن #: src/concurrency/send-sync/sync.md msgid "" -"This statement is essentially a shorthand way of saying that if a type is thread-" -"safe for shared use, it is also thread-safe to pass references of it across " -"threads." +"This statement is essentially a shorthand way of saying that if a type is " +"thread-safe for shared use, it is also thread-safe to pass references of it " +"across threads." msgstr "" -"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای استفاده " -"مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز امن است." +"این عبارت به طور کلی روشی مختصر برای گفتن این است که اگر یک تایپ برای " +"استفاده مشترک امن باشد، انتقال ارجاعات (pass references) آن به threadها نیز " +"امن است." #: src/concurrency/send-sync/sync.md msgid "" -"This is because if a type is Sync it means that it can be shared across multiple " -"threads without the risk of data races or other synchronization issues, so it is " -"safe to move it to another thread. A reference to the type is also safe to move " -"to another thread, because the data it references can be accessed from any thread " -"safely." +"This is because if a type is Sync it means that it can be shared across " +"multiple threads without the risk of data races or other synchronization " +"issues, so it is safe to move it to another thread. A reference to the type " +"is also safe to move to another thread, because the data it references can " +"be accessed from any thread safely." msgstr "" -"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن را " -"در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به اشتراک " -"گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ نیز برای " -"انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع می‌دهد می‌توانند از " -"هر threadای با خیال راحت دسترسی داشته باشند." +"این به خاطراست که اگر یک تایپ از جنس Sync باشد، به این معنی است که می‌توان آن " +"را در چند thread بدون خطر در مورد وضعیت رقابتی داده یا سایر مشکلات Sync به " +"اشتراک گذاشت، بنابراین انتقال آن به thread‌ای دیگر امن است. ارجاع به تایپ " +"نیز برای انتقال به threadای دیگر ایمن است، زیرا داده‌هایی که به آن ارجاع " +"می‌دهد می‌توانند از هر threadای با خیال راحت دسترسی داشته باشند." #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" @@ -20531,7 +21147,8 @@ msgstr "`String`, `Option`, `Vec`, `Box`, ..." #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." -msgstr "‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." +msgstr "" +"‏`Arc`:به طور صریح از طریق تعداد شمارش atomic reference با thread-safe." #: src/concurrency/send-sync/examples.md msgid "`mpsc::Sender`: As of 1.72.0." @@ -20539,15 +21156,16 @@ msgstr "`mpsc::Sender`: از 1.72.0." #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." -msgstr "‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." +msgstr "" +"‏`AtomicBool`، `AtomicU8`، ...: از دستورالعمل های atomic ویژه استفاده می‌کند." #: src/concurrency/send-sync/examples.md msgid "" -"The generic types are typically `Send + Sync` when the type parameters are `Send " -"+ Sync`." -msgstr "" -"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` هستند." +"The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." +msgstr "" +"در صورت وجود پارامترهای نوع، تایپ‌های generic معمولاً از نوع `Send + Sync` " +"هستند.`Send + Sync`." #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" @@ -20555,8 +21173,8 @@ msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" -"These types can be moved to other threads, but they're not thread-safe. Typically " -"because of interior mutability:" +"These types can be moved to other threads, but they're not thread-safe. " +"Typically because of interior mutability:" msgstr "" "این تایپ‌ها را می‌توان به رشته‌های دیگر منتقل کرد، اما آنها ایمن نیستند. به طور " "معمول به دلیل تغییرپذیری داخلی(interior mutability):" @@ -20580,18 +21198,18 @@ msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"These types are safe to access (via shared references) from multiple threads, but " -"they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" msgstr "" -"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری منتقل " -"کرد:" +"این تایپ‌ها از نظر thread ایمن هستند، اما نمی توان آنها را به thread دیگری " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" -"`MutexGuard`: Uses OS level primitives which must be deallocated on the " -"thread which created them. However, an already-locked mutex can have its guarded " -"variable read by any thread with which the guard is shared." +"`MutexGuard`: Uses OS level primitives which must be deallocated on " +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" "‏«MutexGuard»: از ابتدایی‌های سطح سیستم‌عامل استفاده می‌کند که باید در " "threadای که آنها را ایجاد کرده است، توزیع شوند." @@ -20603,24 +21221,24 @@ msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" -"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر منتقل " -"کرد:" +"این تایپ‌ها از نظر thread ایمن نیستند و نمی توان آنها را به رشته های دیگر " +"منتقل کرد:" #: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" -"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد مراجع " -"غیر atomic است." +"‏\"Rc\": هر \"Rc\" دارای یک ارجاع به \"RcBox\" است که حاوی تعداد " +"مراجع غیر atomic است." #: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" -"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن است " -"ملاحظات همزمانی خاصی داشته باشند." +"درمورد `*const T`, `*mut T`: زبان فرض Rust می کند که اشاره گرهای خام ممکن " +"است ملاحظات همزمانی خاصی داشته باشند." #: src/concurrency/shared-state.md msgid "Arc" @@ -20632,11 +21250,11 @@ msgstr "Mutex" #: src/concurrency/shared-state/arc.md msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared read-" -"only access via `Arc::clone`:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " +"read-only access via `Arc::clone`:" msgstr "" -"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد تا " -"دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" +"‏[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) اجازه می‌دهد " +"تا دسترسی read-only مشترک از طریق `Arc::clone` صورت پذیرد:" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" @@ -20648,32 +21266,33 @@ msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` that " -"uses atomic operations." +"`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " +"that uses atomic operations." msgstr "" -"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از عملیات " -"atomic استفاده می‌کند." +"‏\"Arc\" مخفف \"Atomic Reference Counted\" است، یک نسخه ایمن از `Rc` که از " +"عملیات atomic استفاده می‌کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc` implements `Clone` whether or not `T` does. It implements `Send` and " -"`Sync` if and only if `T` implements them both." +"`Arc` implements `Clone` whether or not `T` does. It implements `Send` " +"and `Sync` if and only if `T` implements them both." msgstr "" -"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می کند. " -"`Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی آنها را " -"پیاده‌سازی کند." +"‏\"Arc\" به طور کلی \"Clone\" را خواه `T` انجام دهد یا نه، پیاده سازی می " +"کند. `Send` و `Sync` را اگر و فقط در صورتی پیاده‌سازی می‌کند که `T` هر دوی " +"آنها را پیاده‌سازی کند." #: src/concurrency/shared-state/arc.md msgid "" -"`Arc::clone()` has the cost of atomic operations that get executed, but after " -"that the use of the `T` is free." +"`Arc::clone()` has the cost of atomic operations that get executed, but " +"after that the use of the `T` is free." msgstr "" -"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن استفاده " -"از 'T' آزاد است." +"`Arc::clone()` هزینه یک عملیات atomic که اجرا می‌شود را دارد، اما پس از آن " +"استفاده از 'T' آزاد است." #: src/concurrency/shared-state/arc.md msgid "" -"Beware of reference cycles, `Arc` does not use a garbage collector to detect them." +"Beware of reference cycles, `Arc` does not use a garbage collector to detect " +"them." msgstr "" "مراقب reference cycleها باشید، `Arc` از garbage collector برای شناسایی آنها " "استفاده نمی‌کند." @@ -20684,14 +21303,15 @@ msgstr "`std::sync::Weak` می‌تواند مفید باشد." #: src/concurrency/shared-state/mutex.md msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures mutual " -"exclusion _and_ allows mutable access to `T` behind a read-only interface " -"(another form of [interior mutability](../../borrowing/interior-mutability.md)):" +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " +"mutual exclusion _and_ allows mutable access to `T` behind a read-only " +"interface (another form of [interior mutability](../../borrowing/interior-" +"mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین می‌کند که " -"حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت یکread-only " -"interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../borrowing/interior-" -"mutability.md)) فراهم می‌کند." +"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " +"می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " +"یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" +"borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -20699,41 +21319,42 @@ msgstr "\"v: {:?}\"" #: src/concurrency/shared-state/mutex.md msgid "" -"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-lang." -"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket implementation." +"Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " +"implementation." msgstr "" -"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-lang." -"org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای کامل آن " -"داریم." +"توجه کنید که چگونه یک [`impl Sync for Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) برای اجرای " +"کامل آن داریم." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` in Rust looks like a collection with just one element --- the protected " -"data." +"`Mutex` in Rust looks like a collection with just one element --- the " +"protected data." msgstr "" -"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده (protected) " -"به نظر می‌رسد." +"‏«Mutex» در Rust مانند مجموعه‌ای با تنها یک عنصر --- داده‌های محافظت شده " +"(protected) به نظر می‌رسد." #: src/concurrency/shared-state/mutex.md msgid "" -"It is not possible to forget to acquire the mutex before accessing the protected " -"data." +"It is not possible to forget to acquire the mutex before accessing the " +"protected data." msgstr "" -"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را فراموش " -"کرد." +"نمی‌توان قبل از دسترسی به داده‌های محافظت شده یا protected، دسترسی mutex را " +"فراموش کرد." #: src/concurrency/shared-state/mutex.md msgid "" -"You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` " -"ensures that the `&mut T` doesn't outlive the lock being held." +"You can get an `&mut T` from an `&Mutex` by taking the lock. The " +"`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` تضمین " -"می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." +"با گرفتن lock می‌توانید `&mut T` را از `&Mutex` دریافت کنید.`MutexGuard` " +"تضمین می‌کند که`&mut T` بیشتر از قفل نگه‌داشته شده، موجود نمی‌ماند." #: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` implements " -"`Send`." +"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " +"implements `Send`." msgstr "" "‏`Mutex` هر دوی پیاده سازی `Send` و `Sync` iff (فقط و فقط) `T` از `Send` " "استفاده‌ می‌کنند." @@ -20748,17 +21369,18 @@ msgstr "چرا `lock()` یک`Result` برمی‌گرداند؟" #: src/concurrency/shared-state/mutex.md msgid "" -"If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to " -"signal that the data it protected might be in an inconsistent state. Calling " -"`lock()` on a poisoned mutex fails with a [`PoisonError`](https://doc.rust-lang." -"org/std/sync/struct.PoisonError.html). You can call `into_inner()` on the error " -"to recover the data regardless." +"If the thread that held the `Mutex` panicked, the `Mutex` becomes " +"\"poisoned\" to signal that the data it protected might be in an " +"inconsistent state. Calling `lock()` on a poisoned mutex fails with a " +"[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " +"You can call `into_inner()` on the error to recover the data regardless." msgstr "" -"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/poisoned» " -"می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت ناسازگاری باشند. " -"فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] (https://doc.rust-lang." -"org/std/sync/struct.PoisonError.html) انجام نمی‌شود. می‌توانید `into_inner()` را در " -"مورد خطا برای بازیابی داده‌ها بدون توجه به آن فراخوانی کنید." +"اگر threadای که `Mutex` را نگه می‌دارد دچار panic شود، `Mutex` «مسموم/" +"poisoned» می‌شود تا نشان دهد که داده‌هایی که محافظت می‌کند ممکن است در وضعیت " +"ناسازگاری باشند. فراخوانی `lock()` در یک mutex مسموم با یک [«PoisonError»] " +"(https://doc.rust-lang.org/std/sync/struct.PoisonError.html) انجام نمی‌شود. " +"می‌توانید `into_inner()` را در مورد خطا برای بازیابی داده‌ها بدون توجه به آن " +"فراخوانی کنید." #: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" @@ -20778,28 +21400,30 @@ msgstr "بخش‌های قابل توجه:" #: src/concurrency/shared-state/example.md msgid "" -"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal." +"`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " +"orthogonal." msgstr "‏ `v` در `Arc` و `Mutex` احاطه می‌شود، زیرا مسائل آنها شبیه به هم است." #: src/concurrency/shared-state/example.md msgid "" -"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between " -"threads." +"Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " +"between threads." msgstr "" -"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت قابل " -"تغییر (mutable) بین threadها است." +"قرار دادن یک `Mutex` در یک `Arc` یک الگوی رایج برای به اشتراک گذاشتن حالت " +"قابل تغییر (mutable) بین threadها است." #: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" -"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری منتقل " -"کرد. نکته `move` به lambda signature اضافه شد." +"‏ `v: Arc<_>` باید به عنوان `v2` کلون شود تا بتوان آن را به thread دیگری " +"منتقل کرد. نکته `move` به lambda signature اضافه شد." #: src/concurrency/shared-state/example.md msgid "" -"Blocks are introduced to narrow the scope of the `LockGuard` as much as possible." +"Blocks are introduced to narrow the scope of the `LockGuard` as much as " +"possible." msgstr "بلوک‌ها برای محدود کردن دامنه `LockGuard` تا حد امکان معرفی شده‌اند." #: src/concurrency/sync-exercises/dining-philosophers.md @@ -20808,31 +21432,33 @@ msgstr "مسئله ناهار خوردن فیلسوفان، در واقع یک #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"Five philosophers dine together at the same table. Each philosopher has their own " -"place at the table. There is a fork between each plate. The dish served is a kind " -"of spaghetti which has to be eaten with two forks. Each philosopher can only " -"alternately think and eat. Moreover, a philosopher can only eat their spaghetti " -"when they have both a left and right fork. Thus two forks will only be available " -"when their two nearest neighbors are thinking, not eating. After an individual " -"philosopher finishes eating, they will put down both forks." -msgstr "" -"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در میز " -"دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی است که " -"باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر کند و غذا " -"بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی بخورد که هم چنگال " -"چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط زمانی در دسترس خواهد بود " -"که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه در حال غذاخوردن. پس از اینکه یک " -"فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را پایین می‌گذارد." +"Five philosophers dine together at the same table. Each philosopher has " +"their own place at the table. There is a fork between each plate. The dish " +"served is a kind of spaghetti which has to be eaten with two forks. Each " +"philosopher can only alternately think and eat. Moreover, a philosopher can " +"only eat their spaghetti when they have both a left and right fork. Thus two " +"forks will only be available when their two nearest neighbors are thinking, " +"not eating. After an individual philosopher finishes eating, they will put " +"down both forks." +msgstr "" +"پنج فیلسوف در کنار هم دور یک میز غذا می‌خورند. هر فیلسوف جایگاه خاص خود را در " +"میز دارد. بین هر بشقاب یک چنگال قرار دارد. غذایی که سِرو می‌شود نوعی اسپاگتی " +"است که باید با دو چنگال خورده شود. هر فیلسوف فقط می‌تواند به طور متناوب فکر " +"کند و غذا بخورد. علاوه بر این، یک فیلسوف فقط می‌تواند اسپاگتی خود را زمانی " +"بخورد که هم چنگال چپ و هم چنگال راست را داشته باشد؛ بنابراین دو چنگال فقط " +"زمانی در دسترس خواهد بود که دو همسایه نزدیک آنها در حال فکرکردن باشند و نه " +"در حال غذاخوردن. پس از اینکه یک فیلسوف غذاخوردن را تمام کرد، هر دو چنگال را " +"پایین می‌گذارد." #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" -"You will need a local [Cargo installation](../../cargo/running-locally.md) for " -"this exercise. Copy the code below to a file called `src/main.rs`, fill out the " -"blanks, and test that `cargo run` does not deadlock:" +"You will need a local [Cargo installation](../../cargo/running-locally.md) " +"for this exercise. Copy the code below to a file called `src/main.rs`, fill " +"out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) محلی " -"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " -"کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" +"برای این تمرین به یک [Cargo installation](../../cargo/running-locally.md) " +"محلی نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای " +"خالی را پر کنید و آزمایش کنید که `cargo run` به بن‌بست (deadlock) نمی‌خورد:" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md @@ -20947,47 +21573,49 @@ msgstr "" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Let us use our new knowledge to create a multi-threaded link checker. It should " -"start at a webpage and check that links on the page are valid. It should " -"recursively check other pages on the same domain and keep doing this until all " -"pages have been validated." +"Let us use our new knowledge to create a multi-threaded link checker. It " +"should start at a webpage and check that links on the page are valid. It " +"should recursively check other pages on the same domain and keep doing this " +"until all pages have been validated." msgstr "" -"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده کنیم. " -"باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه معتبر هستند. " -"باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این کار را تا زمانی " -"که همه صفحات تأیید نشده‌اند ادامه دهد." +"اجازه دهید از دانش جدید خود برای ایجاد یک جستجوگر لینک multi-thread استفاده " +"کنیم. باید از یک صفحه وب شروع شود و بررسی کنید که لینک‌های موجود در صفحه " +"معتبر هستند. باید به‌صورت بازگشتی صفحات دیگر را در همان دامنه بررسی کند و این " +"کار را تا زمانی که همه صفحات تأیید نشده‌اند ادامه دهد." #: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). You will also need a way to find links, we can use [`scraper`](https://" -"docs.rs/scraper/). Finally, we'll need some way of handling errors, we will use " -"[`thiserror`](https://docs.rs/thiserror/)." -msgstr "" -"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) نیاز " -"دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " -"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی برای " -"رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" +"reqwest/). You will also need a way to find links, we can use [`scraper`]" +"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " +"we will use [`thiserror`](https://docs.rs/thiserror/)." +msgstr "" +"برای این کار به یک کلاینت HTTP مانند [`reqwest`](https://docs.rs/reqwest/) " +"نیاز دارید. شما همچنین به راهی برای یافتن لینک‌ها نیاز دارید، ما می توانیم از " +"[`reqwest`](https://docs.rs/reqwest/) استفاده کنیم. در نهایت، ما به روشی " +"برای رسیدگی به خطاها نیاز داریم پس درنتیجه از [`thiserror`](https://docs.rs/" "thiserror/) استفاده خواهیم کرد." #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` اعلام " -"کنید:" +"یک پروژه Cargo جدید ایجاد کنید و آن را به عنوان یک وابستگی با `reqwest` " +"اعلام کنید:" #: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo.toml` " -"را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." +"اگر`cargo add` با `error: no such subcommand` ناموفق بود، لطفاً فایل `Cargo." +"toml` را دستی ویرایش کنید و وابستگی‌های ذکر شده در زیر را اضافه کنید." #: src/concurrency/sync-exercises/link-checker.md -msgid "The `cargo add` calls will update the `Cargo.toml` file to look like this:" -msgstr "فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" +msgid "" +"The `cargo add` calls will update the `Cargo.toml` file to look like this:" +msgstr "" +"فراخوانی‌ها `cargo add` را در فایل `Cargo.toml` به‌صورت زیر به‌روزرسانی می‌کند:" #: src/concurrency/sync-exercises/link-checker.md msgid "" @@ -20999,7 +21627,8 @@ msgid "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" @@ -21012,15 +21641,16 @@ msgstr "" "publish = false\n" "\n" "[dependencies]\n" -"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-tls\"] }\n" +"reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" +"tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: src/concurrency/sync-exercises/link-checker.md msgid "" -"You can now download the start page. Try with a small site such as `https://www." -"google.org/`." +"You can now download the start page. Try with a small site such as `https://" +"www.google.org/`." msgstr "" "اکنون می توانید صفحه شروع را دانلود کنید. با یک سایت کوچک مانند `https://www." "google.org/` امتحان کنید." @@ -21078,18 +21708,19 @@ msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی شوند " -"به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را بررسی کنند." +"برای بررسی موازی لینک‌ها از threadها استفاده کنید: URLهایی را که باید بررسی " +"شوند به یک channel ارسال کنید و اجازه دهید چند thread به‌صورت موازی URLها را " +"بررسی کنند." #: src/concurrency/sync-exercises/link-checker.md msgid "" -"Extend this to recursively extract links from all pages on the `www.google.org` " -"domain. Put an upper limit of 100 pages or so so that you don't end up being " -"blocked by the site." +"Extend this to recursively extract links from all pages on the `www.google." +"org` domain. Put an upper limit of 100 pages or so so that you don't end up " +"being blocked by the site." msgstr "" -"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www.google." -"org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در نهایت توسط " -"سایت مسدود نشوید." +"این را به صورت بازگشتی پیوندها گسترش دهید تا از همه صفحات را در دامنه «www." +"google.org» استخراج کنید. حد بالا را حدود ۱۰۰ صفحه یا بیشتر قرار دهید تا در " +"نهایت توسط سایت مسدود نشوید." #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" @@ -21116,8 +21747,10 @@ msgstr "جستجوگر Link" #: src/concurrency/sync-exercises/solutions.md #, fuzzy -msgid "/// Determine whether links within the given page should be extracted.\n" -msgstr "/// Determine whether links within the given page should be extracted.\n" +msgid "" +"/// Determine whether links within the given page should be extracted.\n" +msgstr "" +"/// Determine whether links within the given page should be extracted.\n" #: src/concurrency/sync-exercises/solutions.md #, fuzzy @@ -21143,57 +21776,57 @@ msgstr "\"Bad URLs: {:#?}\"" #: src/concurrency/welcome-async.md msgid "" -"\"Async\" is a concurrency model where multiple tasks are executed concurrently " -"by executing each task until it would block, then switching to another task that " -"is ready to make progress. The model allows running a larger number of tasks on a " -"limited number of threads. This is because the per-task overhead is typically " -"very low and operating systems provide primitives for efficiently identifying I/O " -"that is able to proceed." -msgstr "" -"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای هر " -"کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه دادن است " -"سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد محدودی از " -"رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار کم است و " -"سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به ادامه هستند فراهم " -"می‌کنند." +"\"Async\" is a concurrency model where multiple tasks are executed " +"concurrently by executing each task until it would block, then switching to " +"another task that is ready to make progress. The model allows running a " +"larger number of tasks on a limited number of threads. This is because the " +"per-task overhead is typically very low and operating systems provide " +"primitives for efficiently identifying I/O that is able to proceed." +msgstr "" +"‏ \"Async\" یک مدل concurrency است که در آن چندین کار به طور هم‌زمان با اجرای " +"هر کار تا زمانی که مسدود شود، اجرا می‌شود و سپس به کار دیگری که آماده ادامه " +"دادن است سوئیچ می‌شود. این مدل اجازه می‌دهد تا تعداد بیشتری کار را روی تعداد " +"محدودی از رشته‌ها اجرا کنید و به این دلیل است که سربار هر task معمولاً بسیار " +"کم است و سیستم‌‌عامل‌ها معمولاً مقدماتی را برای شناسایی مؤثر I/O که قادر به " +"ادامه هستند فراهم می‌کنند." #: src/concurrency/welcome-async.md msgid "" -"Rust's asynchronous operation is based on \"futures\", which represent work that " -"may be completed in the future. Futures are \"polled\" until they signal that " -"they are complete." +"Rust's asynchronous operation is based on \"futures\", which represent work " +"that may be completed in the future. Futures are \"polled\" until they " +"signal that they are complete." msgstr "" -"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که ممکن " -"است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را ندهند، " -"«polled» می‌شوند." +"عملیات Rust asynchronous بر اساس \"futures\" است، که نشان‌دهنده کاری است که " +"ممکن است در آینده تکمیل شود. future‌ها تا زمانی که علامت کامل بودنشان را " +"ندهند، «polled» می‌شوند." #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در دسترس " -"هستند." +"‏ Futureها توسط یک زمان‌بندی ناهمزمان نظارت می‌شوند و چندین زمان‌بندی مختلف در " +"دسترس هستند." #: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " -"callback-based, and not polled. Async Python programs require a \"loop\", similar " -"to a runtime in Rust." +"callback-based, and not polled. Async Python programs require a \"loop\", " +"similar to a runtime in Rust." msgstr "" -"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی بر " -"callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به runtime " -"در Rust نیاز دارند." +"پایتون مدل مشابهی را در «asyncio» خود دارد. با‌این‌حال، تایپ «Future» آن مبتنی " +"بر callback است و poll نشده است. برنامه‌های Async Python به یک «حلقه» شبیه به " +"runtime در Rust نیاز دارند." #: src/concurrency/welcome-async.md msgid "" -"JavaScript's `Promise` is similar, but again callback-based. The language runtime " -"implements the event loop, so many of the details of Promise resolution are " -"hidden." +"JavaScript's `Promise` is similar, but again callback-based. The language " +"runtime implements the event loop, so many of the details of Promise " +"resolution are hidden." msgstr "" -"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback است. " -"runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین بسیاری از " -"جزئیات واضح در Promise پنهان می‌شوند." +"این مورد شبیه \"Promise\" در جاوا اسکریپت است که دوباره مبتنی بر callback " +"است. runtime زبان حلقه رویداد (event loop) را پیاده سازی می‌کند، بنابراین " +"بسیاری از جزئیات واضح در Promise پنهان می‌شوند." #: src/concurrency/async.md msgid "async/await" @@ -21202,7 +21835,8 @@ msgstr "async/await" #: src/concurrency/async/async-await.md #, fuzzy msgid "" -"At a high level, async Rust code looks very much like \"normal\" sequential code:" +"At a high level, async Rust code looks very much like \"normal\" sequential " +"code:" msgstr "" "در سطح بالا، کد Rust async بسیار شبیه کد متوالی \"عادی\" است (\"normal\" " "sequential code):" @@ -21217,8 +21851,8 @@ msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات طولانی " -"مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" +"توجه داشته باشید که این یک مثال ساده برای نشان دادن syntax است. هیچ عملیات " +"طولانی مدت یا هیچ هم‌زمانی(concurrency) واقعی در آن وجود ندارد!" #: src/concurrency/async/async-await.md msgid "What is the return type of an async call?" @@ -21227,23 +21861,24 @@ msgstr "نوع برگشت async call چیست؟" #: src/concurrency/async/async-await.md msgid "Use `let future: () = async_main(10);` in `main` to see the type." msgstr "" -"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده کنید." +"برای مشاهده type از `let future: () = async_main(10);` در `main` استفاده " +"کنید." #: src/concurrency/async/async-await.md msgid "" -"The \"async\" keyword is syntactic sugar. The compiler replaces the return type " -"with a future." +"The \"async\" keyword is syntactic sugar. The compiler replaces the return " +"type with a future." msgstr "" -"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با یک " -"future جایگزین می‌کند." +"کلمه کلیدی \"async\" شیرینیِ syntax زبان Rust است. کامپایلر نوع بازگشتی را با " +"یک future جایگزین می‌کند." #: src/concurrency/async/async-await.md msgid "" -"You cannot make `main` async, without additional instructions to the compiler on " -"how to use the returned future." +"You cannot make `main` async, without additional instructions to the " +"compiler on how to use the returned future." msgstr "" -"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از future " -"بازگشتی، `main` را async کنید." +"شما نمی‌توانید بدون دستورالعمل‌های اضافی به کامپایلر در مورد نحوه استفاده از " +"future بازگشتی، `main` را async کنید." #: src/concurrency/async/async-await.md msgid "" @@ -21255,8 +21890,8 @@ msgstr "" #: src/concurrency/async/async-await.md msgid "" -"`.await` asynchronously waits for the completion of another operation. Unlike " -"`block_on`, `.await` doesn't block the current thread." +"`.await` asynchronously waits for the completion of another operation. " +"Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" "همیشه `await` به طور ناهمزمان (asyn) منتظر تکمیل یک عملیات دیگر است. برخلاف " "`block_on` یک `await` معمولاً thread فعلی را مسدود نمی‌کند." @@ -21266,101 +21901,102 @@ msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این مورد در " -"آینده معرفی می‌شوند)." +"‏ `.await` فقط می‌تواند در داخل یک تابع `async` استفاده شود (یا block؛ این " +"مورد در آینده معرفی می‌شوند)." #: src/concurrency/async/futures.md msgid "" -"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a trait, " -"implemented by objects that represent an operation that may not be complete yet. " -"A future can be polled, and `poll` returns a [`Poll`](https://doc.rust-lang.org/" -"std/task/enum.Poll.html)." +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " +"trait, implemented by objects that represent an operation that may not be " +"complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait است، " -"اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز کامل نشده " -"باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://doc.rust-lang.org/" -"std/task/enum.Poll.html) را برمی‌گرداند." +" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " +"است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " +"کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" +"doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." #: src/concurrency/async/futures.md msgid "" -"An async function returns an `impl Future`. It's also possible (but uncommon) to " -"implement `Future` for your own types. For example, the `JoinHandle` returned " -"from `tokio::spawn` implements `Future` to allow joining to it." +"An async function returns an `impl Future`. It's also possible (but " +"uncommon) to implement `Future` for your own types. For example, the " +"`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " +"joining to it." msgstr "" "یک تابع async یک `impl Future` را برمی‌گرداند. همچنین امکان (اما غیرمعمول) " -"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، `JoinHandle` " -"برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا امکان پیوستن " -"(joining) به آن را فراهم کند." +"پیاده‌سازی `Future` برای تایپ‌های خودتان نیز وجود دارد. برای مثال، " +"`JoinHandle` برگردانده شده از `tokio::spawn` `Future` را پیاده‌سازی می‌کند تا " +"امکان پیوستن (joining) به آن را فراهم کند." #: src/concurrency/async/futures.md msgid "" -"The `.await` keyword, applied to a Future, causes the current async function to " -"pause until that Future is ready, and then evaluates to its output." +"The `.await` keyword, applied to a Future, causes the current async function " +"to pause until that Future is ready, and then evaluates to its output." msgstr "" -"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async فعلی تا " -"زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." +"کلمه کلیدی `.await` که برای Future اعمال می‌شود، باعث می‌شود که تابع async " +"فعلی تا زمانی که Future آماده شود متوقف شود و سپس خروجی آن ارزیابی شود." #: src/concurrency/async/futures.md msgid "" -"The `Future` and `Poll` types are implemented exactly as shown; click the links " -"to show the implementations in the docs." +"The `Future` and `Poll` types are implemented exactly as shown; click the " +"links to show the implementations in the docs." msgstr "" -"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. برای " -"نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." +"تایپ‌های `Future` و `Poll` دقیقاً همانطور که نشان داده شده است اجرا می شوند. " +"برای نمایش پیاده‌سازی‌ها در اسناد، روی لینک‌ها کلیک کنید." #: src/concurrency/async/futures.md msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async code, " -"rather than building new async primitives. Briefly:" +"We will not get to `Pin` and `Context`, as we will focus on writing async " +"code, rather than building new async primitives. Briefly:" msgstr "" -"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، بر " -"نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" +"ما به `Pin` و `Context` نخواهیم رسید، زیرا به جای ساختن کدهای اولیه async، " +"بر نوشتن کدهای async تمرکز خواهیم کرد. به طور خلاصه:" #: src/concurrency/async/futures.md msgid "" -"`Context` allows a Future to schedule itself to be polled again when an event " -"occurs." +"`Context` allows a Future to schedule itself to be polled again when an " +"event occurs." msgstr "" -"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای poll " -"مجدد برنامه‌ریزی کند." +"‏ `Context` به Future اجازه می‌دهد تا زمانی که رویدادی رخ می دهد، خود را برای " +"poll مجدد برنامه‌ریزی کند." #: src/concurrency/async/futures.md msgid "" -"`Pin` ensures that the Future isn't moved in memory, so that pointers into that " -"future remain valid. This is required to allow references to remain valid after " -"an `.await`." +"`Pin` ensures that the Future isn't moved in memory, so that pointers into " +"that future remain valid. This is required to allow references to remain " +"valid after an `.await`." msgstr "" -"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای future " -"معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر ماندن پس از `." -"await` لازم است." +"‏ `Pin` تضمین می‌کند که Future در حافظه جابه‌جا نمی‌شود، بنابراین pointerهای " +"future معتبر باقی می‌مانند. این برای اجازه دادن به referenceها برای معتبر " +"ماندن پس از `.await` لازم است." #: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " -"_reactor_) and is responsible for executing futures (an _executor_). Rust does " -"not have a \"built-in\" runtime, but several options are available:" +"_reactor_) and is responsible for executing futures (an _executor_). Rust " +"does not have a \"built-in\" runtime, but several options are available:" msgstr "" -"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می کند و " -"مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، اما چندین " -"گزینه دیگر در دسترس است:" +"یک _runtime_ برای انجام عملیات به صورت ناهمزمان از (a_reactor_) پشتیبانی می " +"کند و مسئول اجرای futureها (an _executor_) است. Rust یک runtime داخلی ندارد، " +"اما چندین گزینه دیگر در دسترس است:" #: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " -"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github." -"com/hyperium/tonic) for gRPC." +"functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" +"github.com/hyperium/tonic) for gRPC." msgstr "" -"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی بالا به " -"خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا [Tonic] (https://" -"github) .com/hyperium/tonic) برای gRPC." +"‏[Tokio](https://tokio.rs/): کارایی(performant)، با یک اکوسیستم با کارایی " +"بالا به خوبی توسعه یافته مانند [Hyper](https://hyper.rs/) برای HTTP یا " +"[Tonic] (https://github) .com/hyperium/tonic) برای gRPC." #: src/concurrency/async/runtimes.md msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes a " -"basic runtime in `async::task`." +"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " +"a basic runtime in `async::task`." msgstr "" -"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و شامل " -"یک runtime اولیه در `async::task` است." +"‏[async-std](https://async.rs/):: هدفش این است که یک \"std for async\" باشد و " +"شامل یک runtime اولیه در `async::task` است." #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" @@ -21369,8 +22005,8 @@ msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است. #: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" -"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-async/" -"src/lib.rs) already has one." +"(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" +"async/src/lib.rs) already has one." msgstr "" "چندین برنامه بزرگتر زمان اجرا (runtime) مخصوص به خود را دارند. برای مثال، " "[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/" @@ -21378,24 +22014,25 @@ msgstr "" #: src/concurrency/async/runtimes.md msgid "" -"Note that of the listed runtimes, only Tokio is supported in the Rust playground. " -"The playground also does not permit any I/O, so most interesting async things " -"can't run in the playground." +"Note that of the listed runtimes, only Tokio is supported in the Rust " +"playground. The playground also does not permit any I/O, so most interesting " +"async things can't run in the playground." msgstr "" -"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground زبان " -"Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی دهد، بنابراین " -"بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." +"توجه داشته باشید که از میان زمان‌های اجرا ذکر شده، فقط Tokio در playground " +"زبان Rust پشتیبانی می‌شود.playground همچنین اجازه ورود/خروجی (I/O) را نمی " +"دهد، بنابراین بیشتر چیزهای async جالب نمی‌توانند در playground اجرا شوند." #: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " -"Promises, for example, which will run to completion even if they are never used." +"Promises, for example, which will run to completion even if they are never " +"used." msgstr "" -"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی عملیات I/" -"O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که آنها را polling " -"کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر هرگز استفاده نشوند " -"تا پایان کامل شدن برنامه اجرا خواهند شد." +"‏ Futureها از این جهت «بی‌اثر(inert)» هستند که هیچ کاری انجام نمی‌دهند (حتی " +"عملیات I/O را شروع نمی‌کنند) مگر اینکه یک مجری(executor) وجود داشته باشد که " +"آنها را polling کند. به عنوان مثال، این با JS Promises متفاوت است که حتی اگر " +"هرگز استفاده نشوند تا پایان کامل شدن برنامه اجرا خواهند شد." #: src/concurrency/async/runtimes/tokio.md #, fuzzy @@ -21404,7 +22041,8 @@ msgstr "Tokio provides:" #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." -msgstr "یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." +msgstr "" +"یک runtime از نوع multi-thread برای اجرای کدهای ناهمزمان(asynchronous)." #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." @@ -21442,8 +22080,8 @@ msgstr "**Further بررسی:**" #: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " -"cancellation. `tokio::spawn` returns a handle which can be awaited to wait until " -"it finishes." +"cancellation. `tokio::spawn` returns a handle which can be awaited to wait " +"until it finishes." msgstr "" "چرا `count_to` (معمولا) به مقدار ۱۰ نمی‌رسد؟ این نمونه‌ای از لغو async است. " "`tokio::spawn` یک handle را برمی‌گرداند که می‌توان مدتی منتظر ماند تا تمام شود." @@ -21462,16 +22100,17 @@ msgstr "‏ Rust یک task system دارد که نوعی thread سبک‌ وزن #: src/concurrency/async/tasks.md msgid "" -"A task has a single top-level future which the executor polls to make progress. " -"That future may have one or more nested futures that its `poll` method polls, " -"corresponding loosely to a call stack. Concurrency within a task is possible by " -"polling multiple child futures, such as racing a timer and an I/O operation." +"A task has a single top-level future which the executor polls to make " +"progress. That future may have one or more nested futures that its `poll` " +"method polls, corresponding loosely to a call stack. Concurrency within a " +"task is possible by polling multiple child futures, such as racing a timer " +"and an I/O operation." msgstr "" -"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن را " -"poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد `poll` " -"آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده مطابقت دارد. " -"همزمانی در یک task با poll از چندین child future، مانند رقابت یک تایمر و یک " -"عملیات I/O امکان‌پذیر است." +"یک task یک future در سطح بالا دارد که اجراکننده (executor) برای ادامه کار آن " +"را poll می‌کند. آن future ممکن است یک یا چند future تودرتو داشته باشد که متد " +"`poll` آن را `poll` می‌کند، که به طور ناپایداری با یک stack فراخوانی شده " +"مطابقت دارد. همزمانی در یک task با poll از چندین child future، مانند رقابت " +"یک تایمر و یک عملیات I/O امکان‌پذیر است." #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" @@ -21501,47 +22140,53 @@ msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"از تماس تلفنی متشکریم، {name}!\\n\"" #: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md -msgid "Copy this example into your prepared `src/main.rs` and run it from there." +msgid "" +"Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا کنید." +"این مثال را در `src/main.rs` آماده شده خود کپی کنید و آن را از آنجا اجرا " +"کنید." #: src/concurrency/async/tasks.md msgid "" -"Try connecting to it with a TCP connection tool like [nc](https://www.unix.com/" -"man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/telnet/)." +"Try connecting to it with a TCP connection tool like [nc](https://www.unix." +"com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" +"telnet/)." msgstr "" -"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/linux/1/" -"nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." +"سعی کنید با یک ابزار اتصال TCP مانند [nc](https://www.unix.com/man-page/" +"linux/1/nc/) یا [telnet](https://www.unix.com/) به آن متصل شوید." #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"Ask students to visualize what the state of the example server would be with a " -"few connected clients. What tasks exist? What are their Futures?" +"Ask students to visualize what the state of the example server would be with " +"a few connected clients. What tasks exist? What are their Futures?" msgstr "" -"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم کنند. چه " -"taskهایی وجود دارد؟ Future آنها چیست؟" +"از دانش‌آموزان بخواهید که وضعیت سرور مورد مثال را با چند کلاینت متصل تجسم " +"کنند. چه taskهایی وجود دارد؟ Future آنها چیست؟" #: src/concurrency/async/tasks.md #, fuzzy msgid "" -"This is the first time we've seen an `async` block. This is similar to a closure, " -"but does not take any arguments. Its return value is a Future, similar to an " -"`async fn`." +"This is the first time we've seen an `async` block. This is similar to a " +"closure, but does not take any arguments. Its return value is a Future, " +"similar to an `async fn`." msgstr "" -"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما هیچ " -"استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." +"این اولین بار است که بلوک `async` را می‌بینیم. این شبیه به بسته شدن است، اما " +"هیچ استدلالی ندارد. مقدار بازگشتی آن از نوع Future است، شبیه به `async fn`." #: src/concurrency/async/tasks.md msgid "" -"Refactor the async block into a function, and improve the error handling using `?" -"`." +"Refactor the async block into a function, and improve the error handling " +"using `?`." msgstr "" -"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود بخشید." +"بلوک async را به یک تابع تغییر دهید و مدیریت خطا را با استفاده از `?` بهبود " +"بخشید." #: src/concurrency/async-control-flow/channels.md -msgid "Several crates have support for asynchronous channels. For instance `tokio`:" -msgstr "چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" +msgid "" +"Several crates have support for asynchronous channels. For instance `tokio`:" +msgstr "" +"چندین crate از asynchronous channel پشتیبانی می‌کنند. به عنوان مثال `tokio`:" #: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" @@ -21568,12 +22213,13 @@ msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." -msgstr "اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." +msgstr "" +"اندازه کانال را به`3` تغییر دهید و ببینید که چگونه بر اجرا تأثیر می‌گذارد." #: src/concurrency/async-control-flow/channels.md msgid "" -"Overall, the interface is similar to the `sync` channels as seen in the [morning " -"class](../channels.md)." +"Overall, the interface is similar to the `sync` channels as seen in the " +"[morning class](../channels.md)." msgstr "" "به‌طور‌کلی، interface شبیه به channelهای `sync` است که در [کلاس صبح‌گاهی](../" "channels.md) دیده می‌شود." @@ -21585,30 +22231,31 @@ msgstr "تماس `std::mem::drop` را حذف کنید. چه اتفاقی می #: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " -"implement both `sync` and `async` `send` and `recv`. This can be convenient for " -"complex applications with both IO and heavy CPU processing tasks." +"implement both `sync` and `async` `send` and `recv`. This can be convenient " +"for complex applications with both IO and heavy CPU processing tasks." msgstr "" -"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای کانال‌هایی " -"است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار می‌تواند برای " -"برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." +"این crate مربوط به [Flume](https://docs.rs/flume/latest/flume/) دارای " +"کانال‌هایی است که `sync` و `async` `send` و `recv` را اجرا می‌کنند. این کار " +"می‌تواند برای برنامه‌های پیچیده با taskهای پردازشی IO و CPU سنگین مناسب باشد." #: src/concurrency/async-control-flow/channels.md msgid "" -"What makes working with `async` channels preferable is the ability to combine " -"them with other `future`s to combine them and create complex control flow." +"What makes working with `async` channels preferable is the ability to " +"combine them with other `future`s to combine them and create complex control " +"flow." msgstr "" "چیزی که کار با کانال‌های `async` را ترجیح می‌دهد، توانایی ترکیب آن‌ها با دیگر " "`future` برای ترکیب آنها و ایجاد جریان کنترل پیچیده است." #: src/concurrency/async-control-flow/join.md msgid "" -"A join operation waits until all of a set of futures are ready, and returns a " -"collection of their results. This is similar to `Promise.all` in JavaScript or " -"`asyncio.gather` in Python." +"A join operation waits until all of a set of futures are ready, and returns " +"a collection of their results. This is similar to `Promise.all` in " +"JavaScript or `asyncio.gather` in Python." msgstr "" "عملیات پیوستن (join) منتظر می‌ماند تا تمام مجموعه‌ای از futureها آماده شوند و " -"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` در " -"JavaScript یا `asyncio.gather` در پایتون است." +"مجموعه‌ای (collection) از نتایج آنها را برمی‌گرداند. این شبیه به `Promise.all` " +"در JavaScript یا `asyncio.gather` در پایتون است." #: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" @@ -21628,59 +22275,62 @@ msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md msgid "" -"For multiple futures of disjoint types, you can use `std::future::join!` but you " -"must know how many futures you will have at compile time. This is currently in " -"the `futures` crate, soon to be stabilised in `std::future`." +"For multiple futures of disjoint types, you can use `std::future::join!` but " +"you must know how many futures you will have at compile time. This is " +"currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده کنید، " -"اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال حاضر در " -"جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت می‌شود." +"برای چند future از تایپ‌های مختلف، می‌توانید از `std::future::join!` استفاده " +"کنید، اما باید بدانید که در زمان کامپایل چند future خواهید داشت. این در حال " +"حاضر در جعبه (crate از نوع `futures` است که به زودی در `std::future` تثبیت " +"می‌شود." #: src/concurrency/async-control-flow/join.md msgid "" -"The risk of `join` is that one of the futures may never resolve, this would cause " -"your program to stall." +"The risk of `join` is that one of the futures may never resolve, this would " +"cause your program to stall." msgstr "" -"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله باعث " -"می‌شود برنامه شما متوقف شود." +"خطر `join` این است که یکی از future‌ها ممکن است هرگز resolve نشود، این مسئله " +"باعث می‌شود برنامه شما متوقف شود." #: src/concurrency/async-control-flow/join.md msgid "" -"You can also combine `join_all` with `join!` for instance to join all requests to " -"an http service as well as a database query. Try adding a `tokio::time::sleep` to " -"the future, using `futures::join!`. This is not a timeout (that requires `select!" -"`, explained in the next chapter), but demonstrates `join!`." +"You can also combine `join_all` with `join!` for instance to join all " +"requests to an http service as well as a database query. Try adding a " +"`tokio::time::sleep` to the future, using `futures::join!`. This is not a " +"timeout (that requires `select!`, explained in the next chapter), but " +"demonstrates `join!`." msgstr "" -"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای پیوستن " -"(`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه داده سعی کنید " -"`tokio::time::sleep` را با استفاده از `futures::join!` به future اضافه کنید. این " -"یک timeout نیست (که به `select!`نیاز دارد و در فصل بعدی توضیح داده ‌می‌شود) بلکه " -"`join!` را نشان می‌دهد." +"همچنین می‌توانید `join_all` را با `join!` ترکیب کنید، به‌عنوان مثال برای " +"پیوستن (`join!`) همه درخواست‌ها به یک سرویس http و همچنین یک کوئری پایگاه " +"داده سعی کنید `tokio::time::sleep` را با استفاده از `futures::join!` به " +"future اضافه کنید. این یک timeout نیست (که به `select!`نیاز دارد و در فصل " +"بعدی توضیح داده ‌می‌شود) بلکه `join!` را نشان می‌دهد." #: src/concurrency/async-control-flow/select.md msgid "" -"A select operation waits until any of a set of futures is ready, and responds to " -"that future's result. In JavaScript, this is similar to `Promise.race`. In " -"Python, it compares to `asyncio.wait(task_set, return_when=asyncio." +"A select operation waits until any of a set of futures is ready, and " +"responds to that future's result. In JavaScript, this is similar to `Promise." +"race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" -"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و به " -"نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` است و " -"در پایتون با `asyncio.wait(task_set, return_when=asyncio.FIRST_COMPLETED)` قابل " -"مقایسه می‌باشد." +"یک عملیات انتخابی منتظر می‌ماند تا هر یک از مجموعه‌ای از futureها آماده شود و " +"به نتیجه آن future پاسخ می‌دهد. در JavaScript این مورد شبیه به `Promise.race` " +"است و در پایتون با `asyncio.wait(task_set, return_when=asyncio." +"FIRST_COMPLETED)` قابل مقایسه می‌باشد." #: src/concurrency/async-control-flow/select.md msgid "" -"Similar to a match statement, the body of `select!` has a number of arms, each of " -"the form `pattern = future => statement`. When a `future` is ready, its return " -"value is destructured by the `pattern`. The `statement` is then run with the " -"resulting variables. The `statement` result becomes the result of the `select!` " -"macro." +"Similar to a match statement, the body of `select!` has a number of arms, " +"each of the form `pattern = future => statement`. When a `future` is ready, " +"its return value is destructured by the `pattern`. The `statement` is then " +"run with the resulting variables. The `statement` result becomes the result " +"of the `select!` macro." msgstr "" -"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو است که " -"هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که `future` " -"آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس `statement` با " -"متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو `select!` می‌شود." +"مانند یک عبارت تطبیقی (match statement)، بدنه `pattern` دارای تعدادی بازو " +"است که هر کدام به شکل عبارت `pattern = future => statement` هستند. هنگامی که " +"`future` آماده است، مقدار بازگشتی آن توسط `pattern` تخریب می‌شود. سپس " +"`statement` با متغیرهای حاصل اجرا می‌شود. در نتیجه `statement` نتیجه‌ي ماکرو " +"`select!` می‌شود." #: src/concurrency/async-control-flow/select.md #, fuzzy @@ -21702,30 +22352,32 @@ msgstr "\"شنونده شکست خورد\"" #: src/concurrency/async-control-flow/select.md msgid "" -"The `listener` async block here is a common form: wait for some async event, or " -"for a timeout. Change the `sleep` to sleep longer to see it fail. Why does the " -"`send` also fail in this situation?" +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" -"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async یا " -"به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر دهید تا " -"شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" +"بلوک async `listener` در اینجا یک شکل رایج است: منتظر برخی رویدادهای async " +"یا به‌عنوان مثال برای timeoutها باشید. `sleep` را به sleep طولانی‌تر تغییر " +"دهید تا شاهد شکست آن باشید. چرا `send` نیز در این شرایط شکست می‌خورد؟" #: src/concurrency/async-control-flow/select.md msgid "" -"`select!` is also often used in a loop in \"actor\" architectures, where a task " -"reacts to events in a loop. That has some pitfalls, which will be discussed in " -"the next segment." +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" #: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " -"asynchronous programming. However, the async/await model in Rust also comes with " -"its share of pitfalls and footguns. We illustrate some of them in this chapter." +"asynchronous programming. However, the async/await model in Rust also comes " +"with its share of pitfalls and footguns. We illustrate some of them in this " +"chapter." msgstr "" -"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent asynchronous " -"فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از مشکلات و " -"pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح می‌دهیم." +"‏ Async / await انتزاع راحت و کارآمدی را برای برنامه نویسی concurrent " +"asynchronous فراهم می‌کند. با‌این‌حال، مدل async/wait در Rust نیز با سهم خود از " +"مشکلات و pitfallها و footgunها همراه است. برخی از آنها را در این فصل توضیح " +"می‌دهیم." #: src/concurrency/async-pitfalls.md msgid "Pin" @@ -21737,14 +22389,15 @@ msgstr "مسدود کردن executor" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Most async runtimes only allow IO tasks to run concurrently. This means that CPU " -"blocking tasks will block the executor and prevent other tasks from being " -"executed. An easy workaround is to use async equivalent methods where possible." +"Most async runtimes only allow IO tasks to run concurrently. This means that " +"CPU blocking tasks will block the executor and prevent other tasks from " +"being executed. An easy workaround is to use async equivalent methods where " +"possible." msgstr "" "اکثر async runtimeهای تنها به IO task اجازه می‌دهند که به صورت همزمان " -"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث مسدود شدن " -"executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این است که در صورت " -"امکان از متدهای معادل async استفاده کنید." +"(concurrent) اجرا شوند. این بدان معنی است که تسک‌های block کردن CPU باعث " +"مسدود شدن executor و جلوگیری از اجرای سایر تسک‌ها می‌شود. یک راه حل آسان این " +"است که در صورت امکان از متدهای معادل async استفاده کنید." #: src/concurrency/async-pitfalls/blocking-executor.md #, fuzzy @@ -21766,69 +22419,73 @@ msgstr "" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"The `\"current_thread\"` flavor puts all tasks on a single thread. This makes the " -"effect more obvious, but the bug is still present in the multi-threaded flavor." +"The `\"current_thread\"` flavor puts all tasks on a single thread. This " +"makes the effect more obvious, but the bug is still present in the multi-" +"threaded flavor." msgstr "" -"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این اثرگذاری را " -"آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود دارد." +"این `\"current_thread\"` همه taskها را روی یک thread قرار می‌دهد. این " +"اثرگذاری را آشکارتر می‌کند، اما این اشکال همچنان در طبیعت multi-threaded وجود " +"دارد." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه باشید." +"‏ `std::thread::sleep` را به `tokio::time::sleep` تغییر دهید و منتظر نتیجه " +"باشید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند و " -"handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." +"راه‌حل دیگر `tokio::task::spawn_blocking` است که یک thread واقعی ایجاد می‌کند " +"و handle آن را بدون مسدود کردن executor به future تبدیل می‌کند." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " -"particularly problematic when interacting with other libraries via FFI, where " -"that library might depend on thread-local storage or map to specific OS threads " -"(e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such situations." -msgstr "" -"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از نگاشت ۱ " -"به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه می‌دهند روی یک " -"thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با کتابخانه‌های دیگر از " -"طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به ذخیره‌سازی محلی thread یا " -"نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) بستگی داشته باشد. در چنین " -"شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." +"particularly problematic when interacting with other libraries via FFI, " +"where that library might depend on thread-local storage or map to specific " +"OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " +"situations." +msgstr "" +"شما نباید taskها را به عنوان thread‌های سیستم عامل در نظر بگیرید. آنها از " +"نگاشت ۱ به ۱ پشتیبانی نمی‌کنند و اکثر executorها به بسیاری از taskها اجازه " +"می‌دهند روی یک thread سیستم عامل اجرا شوند. این امر به‌ویژه هنگام تعامل با " +"کتابخانه‌های دیگر از طریق FFI مشکل‌ساز است، جایی که آن کتابخانه ممکن است به " +"ذخیره‌سازی محلی thread یا نگاشت (map) به threadهای سیستم‌عامل خاص (مانند CUDA) " +"بستگی داشته باشد. در چنین شرایطی `tokio::task::spawn_blocking` را ترجیح دهید." #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" -"Use sync mutexes with care. Holding a mutex over an `.await` may cause another " -"task to block, and that task may be running on the same thread." +"Use sync mutexes with care. Holding a mutex over an `.await` may cause " +"another task to block, and that task may be running on the same thread." msgstr "" -"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `.await` " -"ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان thread در حال " -"اجرا باشد." +"با احتیاط از همگام‌سازی mutexها استفاده کنید. نگه داشتن یک mutex روی یک `." +"await` ممکن است باعث مسدود شدن task دیگری شود و آن task ممکن است در همان " +"thread در حال اجرا باشد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The type " -"returned is the result of a compiler transformation which turns local variables " -"into data stored inside the future." +"Async blocks and functions return types implementing the `Future` trait. The " +"type returned is the result of a compiler transformation which turns local " +"variables into data stored inside the future." msgstr "" -"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی می‌کنند. " -"نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های ذخیره شده در " -"future تبدیل می کند." +"بلوک‌ها و توابع Async انواعی را برمی‌گردانند که ویژگی `Future` را پیاده‌سازی " +"می‌کنند. نوع برگشتی نتیجه تبدیل کامپایلر است که متغیرهای محلی را به داده های " +"ذخیره شده در future تبدیل می کند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Some of those variables can hold pointers to other local variables. Because of " -"that, the future should never be moved to a different memory location, as it " -"would invalidate those pointers." +"Some of those variables can hold pointers to other local variables. Because " +"of that, the future should never be moved to a different memory location, as " +"it would invalidate those pointers." msgstr "" -"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه دارند. به " -"همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا این pointerها را " -"باطل می‌کند." +"برخی از این متغیرها می‌توانند اشاره‌گرهایی را برای سایر متغیرهای محلی نگه " +"دارند. به همین دلیل، future هرگز نباید به مکان حافظه دیگری منتقل شود، زیرا " +"این pointerها را باطل می‌کند." #: src/concurrency/async-pitfalls/pin.md msgid "" @@ -21837,10 +22494,10 @@ msgid "" "operations that would move the instance it points to into a different memory " "location." msgstr "" -"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده می " -"توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام عملیاتی " -"را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه متفاوت منتقل کند " -"را ممنوع می‌کند." +"برای جلوگیری از جابجایی تایپ future در حافظه، فقط از طریق یک pointer پین شده " +"می توان آن را بررسی کرد. `Pin` یک wrapper در اطراف یک reference است که تمام " +"عملیاتی را که می‌تواند نمونه‌ای را که به آن اشاره می‌کند به یک مکان حافظه " +"متفاوت منتقل کند را ممنوع می‌کند." #: src/concurrency/async-pitfalls/pin.md #, fuzzy @@ -21892,147 +22549,154 @@ msgstr "\"نتیجه کار برای تکرار {i}: {resp}\"" #: src/concurrency/async-pitfalls/pin.md msgid "" -"You may recognize this as an example of the actor pattern. Actors typically call " -"`select!` in a loop." +"You may recognize this as an example of the actor pattern. Actors typically " +"call `select!` in a loop." msgstr "" -"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص دهید. " -"بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." +"شما ممکن است این را به عنوان نمونه ای از الگوی بازیگر (actor pattern) تشخیص " +"دهید. بازیگران معمولاً `select!` را در یک حلقه صدا می‌زنند." #: src/concurrency/async-pitfalls/pin.md msgid "" -"This serves as a summation of a few of the previous lessons, so take your time " -"with it." +"This serves as a summation of a few of the previous lessons, so take your " +"time with it." msgstr "" -"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف آن " -"کنید." +"این به عنوان یک جمع‌بندی از چند درس قبلی عمل می کند، بنابراین وقت خود را صرف " +"آن کنید." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to the " -"`select!`. This will never execute. Why?" +"Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " +"the `select!`. This will never execute. Why?" msgstr "" "به‌سادگی یک `_ = sleep(Duration::from_millis(100)) => { println!(..) }` را به " "`select!` اضافه کنید. این مورد هرگز اجرا نمی شود. چرا؟" #: src/concurrency/async-pitfalls/pin.md -msgid "Instead, add a `timeout_fut` containing that future outside of the `loop`:" +msgid "" +"Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "درعوض، یک `timeout_fut` حاوی آن future خارج از `loop` اضافه کنید:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " -"`timeout_fut` in the `select!` to work around the move, then using `Box::pin`:" +"`timeout_fut` in the `select!` to work around the move, then using `Box::" +"pin`:" msgstr "" "این مورد هنوز کار نمی‌کند. خطاهای کامپایلر را دنبال کنید، `&mut` را به " -"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::pin` " -"استفاده کنید:" +"`timeout_fut` در `select!` اضافه کنید تا حرکت را ادامه دهید، سپس از `Box::" +"pin` استفاده کنید:" #: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " -"iteration (a fused future would help with this). Update to reset `timeout_fut` " -"every time it expires:" +"iteration (a fused future would help with this). Update to reset " +"`timeout_fut` every time it expires:" msgstr "" -"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با `Poll::" -"Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای بازنشانی " -"`timeout_fut` هر بار که منقضی می‌شود:" +"این مورد کامپایل می‌شود، اما پس از انقضای timeout و در هر تکرار برابر با " +"`Poll::Ready` است (future ترکیبی به این مسئله کمک می‌کند). به‌روزرسانی برای " +"بازنشانی `timeout_fut` هر بار که منقضی می‌شود:" #: src/concurrency/async-pitfalls/pin.md #, fuzzy msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " -"stabilized, with older code often using `tokio::pin!`) is also an option, but " -"that is difficult to use for a future that is reassigned." +"stabilized, with older code often using `tokio::pin!`) is also an option, " +"but that is difficult to use for a future that is reassigned." msgstr "" -"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی تثبیت " -"شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز یک گزینه " -"است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود دشوار است." +"جعبه allocateها بر روی heap. در برخی موارد، `std::pin::pin!` (فقط به تازگی " +"تثبیت شده است، با کدهای قدیمی‌تر که اغلب از `tokio::pin!` استفاده می‌کنند) نیز " +"یک گزینه است، اما استفاده از آن برای futureای که دوباره تخصیص داده می‌شود " +"دشوار است." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Another alternative is to not use `pin` at all but spawn another task that will " -"send to a `oneshot` channel every 100ms." +"Another alternative is to not use `pin` at all but spawn another task that " +"will send to a `oneshot` channel every 100ms." msgstr "" -"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری ایجاد " -"کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." +"جایگزین دیگر این است که به هیچ وجه از `pin` استفاده نکنید، بلکه task دیگری " +"ایجاد کنید که هر 100 میلی‌ثانیه به یک کانال `oneshot` ارسال می‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"Data that contains pointers to itself is called self-referential. Normally, the " -"Rust borrow checker would prevent self-referential data from being moved, as the " -"references cannot outlive the data they point to. However, the code " -"transformation for async blocks and functions is not verified by the borrow " -"checker." +"Data that contains pointers to itself is called self-referential. Normally, " +"the Rust borrow checker would prevent self-referential data from being " +"moved, as the references cannot outlive the data they point to. However, the " +"code transformation for async blocks and functions is not verified by the " +"borrow checker." msgstr "" -"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) نامیده " -"می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های خودارجاعی جلوگیری " -"می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها اشاره می‌کنند زنده " -"بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط borrow checker تأیید " -"نمی‌شود." +"داده‌هایی که حاوی اشاره‌گرهایی به خود هستند، خود ارجاعی ( self-referential) " +"نامیده می شوند. به طور معمول، Rust borrow checker از جابجایی داده‌های " +"خودارجاعی جلوگیری می‌کند، زیرا منابع نمی‌توانند بیشتر از داده‌هایی که به آنها " +"اشاره می‌کنند زنده بمانند. با‌این‌حال، تبدیل کد برای بلوک‌ها و توابع async توسط " +"borrow checker تأیید نمی‌شود." #: src/concurrency/async-pitfalls/pin.md msgid "" -"`Pin` is a wrapper around a reference. An object cannot be moved from its place " -"using a pinned pointer. However, it can still be moved through an unpinned " -"pointer." +"`Pin` is a wrapper around a reference. An object cannot be moved from its " +"place using a pinned pointer. However, it can still be moved through an " +"unpinned pointer." msgstr "" -"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده از " -"یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را از طریق " -"یک pointer بدون پین جابجا کرد." +"‏ `Pin` یک wrapper در اطراف یک reference است. یک object را نمی‌توان با استفاده " +"از یک pointer پین شده از جای خود حرکت داد. با این حال، هنوز هم می‌توان آن را " +"از طریق یک pointer بدون پین جابجا کرد." #: src/concurrency/async-pitfalls/pin.md msgid "" -"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of `&mut " -"Self` to refer to the instance. That's why it can only be called on a pinned " -"pointer." +"The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " +"`&mut Self` to refer to the instance. That's why it can only be called on a " +"pinned pointer." msgstr "" -"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای اشاره به " -"نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن را روی یک " -"اشاره‌‌گر پین شده فراخوانی کرد." +"متد `poll` از ویژگی `Future` از `Pin<&mut Self>` به جای `&mut Self` برای " +"اشاره به نمونه (instance) استفاده می‌‌کند. به همین دلیل است که فقط می‌توان آن " +"را روی یک اشاره‌‌گر پین شده فراخوانی کرد." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 release. " -"This required support for using return-position `impl Trait` (RPIT) in traits, as " -"the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." msgstr "" -"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به پشتیبانی " -"برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را داشت، زیرا " -"شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl Future` است." +"متدهای Async در traitها اخیراً در انتشار 1.75 تثبیت شده‌اند. این نیاز به " +"پشتیبانی برای استفاده از موقعیت بازگشتی `impl Trait` (RPIT) در traitها را " +"داشت، زیرا شیرین‌زدایی (desugaring) برای `async fn` شامل `-> impl " +"Future` است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around `async " -"fn` and RPIT in traits:" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" msgstr "" -"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و RPIT " -"در ویژگی‌ها وجود دارد:" +"با این‌حال، حتی با پشتیبانی native امروز، برخی از مشکلات در مورد `async fn` و " +"RPIT در ویژگی‌ها وجود دارد:" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns of " -"borrowing cannot be expressed)" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" msgstr "" -"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند (بنابراین " -"برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" +"‏Return-position impl Trait تمام طول عمرهای درون محدوده را ثبت می کند " +"(بنابراین برخی از الگوهای قرض کردن (borrowing) نمی توانند بیان شوند)" #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not `dyn` " -"compatible." +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" -"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده می‌کنند " -"با `dyn` سازگار نیستند." +"ویژگی‌هایی که متد‌های آن‌ها از موقعیت بازگشتی `impl trait` یا `async` استفاده " +"می‌کنند با `dyn` سازگار نیستند." #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-trait/" -"latest/async_trait/) provides a workaround through a macro, with some caveats:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) provides a workaround through a macro, with some " +"caveats:" msgstr "" -"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-trait/" -"latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر چند نکته:" +"اگر به پشتیبانی `dyn` نیاز داریم، crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) راه‌حلی را از طریق یک ماکرو ارائه می‌کند، با ذکر " +"چند نکته:" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy @@ -22049,40 +22713,43 @@ msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این هدف " -"از heap allocationها استفاده می‌کند. این heap allocation دارای سربار عملکرد است." +"استفاده از `async_trait` آسان است، اما توجه داشته باشید که برای رسیدن به این " +"هدف از heap allocationها استفاده می‌کند. این heap allocation دارای سربار " +"عملکرد است." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and probably " -"not worth describing in-depth. Niko Matsakis did a good job of explaining them in " -"[this post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-" -"traits-are-hard/) if you are interested in digging deeper." +"The challenges in language support for `async trait` are deep Rust and " +"probably not worth describing in-depth. Niko Matsakis did a good job of " +"explaining them in [this post](https://smallcultfollowing.com/babysteps/" +"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " +"digging deeper." msgstr "" -"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً ارزش " -"توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" -"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/) " -"آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند هستید." +"چالش‌های پشتیبانی برای `async trait` در زبان Rust بسیار عمیق هستند و احتمالاً " +"ارزش توصیف عمیق در اینجا را ندارند. Niko Matsakis در [این پست](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) آنها را به خوبی توضیح داده است. به خصوص اگر شما به این موضوع علاقه‌مند " +"هستید." #: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Try creating a new sleeper struct that will sleep for a random amount of time and " -"adding it to the Vec." +"Try creating a new sleeper struct that will sleep for a random amount of " +"time and adding it to the Vec." msgstr "" -"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن را به " -"Vec اضافه کنید." +"سعی کنید یک sleep خواب جدید ایجاد کنید که برای مدت زمان تصادفی می‌خوابد و آن " +"را به Vec اضافه کنید." #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " -"_cancellation_ and it can occur at any `await` point. Care is needed to ensure " -"the system works correctly even when futures are cancelled. For example, it " -"shouldn't deadlock or lose data." +"_cancellation_ and it can occur at any `await` point. Care is needed to " +"ensure the system works correctly even when futures are cancelled. For " +"example, it shouldn't deadlock or lose data." msgstr "" -"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به این " -"حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای اطمینان از " -"عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. به‌عنوان ‌مثال، " -"نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." +"کنار گذاشتن future به این معنی است که دیگر هرگز نمی‌توان آن را poll کرد. به " +"این حالت _cancellation_ می‌گویند و می‌تواند در هر نقطه `await` رخ دهد. برای " +"اطمینان از عملکرد صحیح سیستم حتی در صورت لغو futureها، دقت مناسب لازم است. " +"به‌عنوان ‌مثال، نباید داده‌ها را از دست بدهد یا به بن‌بست (deadlock) برسد." #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy @@ -22102,16 +22769,16 @@ msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را بخوانید و " -"در نظر بگیرید که `async fn` شما چه وضعیتی دارد." +"کامپایلر در مورد cancellation-safety کمکی نمی‌کند. باید مستندات API را " +"بخوانید و در نظر بگیرید که `async fn` شما چه وضعیتی دارد." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Unlike `panic` and `?`, cancellation is part of normal control flow (vs error-" -"handling)." +"Unlike `panic` and `?`, cancellation is part of normal control flow (vs " +"error-handling)." msgstr "" -"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی به " -"خطا) است." +"برخلاف `panic` و `?`، لغو یا cancellation بخشی از جریان کنترل عادی (و رسیدگی " +"به خطا) است." #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." @@ -22119,12 +22786,15 @@ msgstr "اسن مثال بخش‌هایی از string را از دست می‌د #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"Whenever the `tick()` branch finishes first, `next()` and its `buf` are dropped." -msgstr "هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." +"Whenever the `tick()` branch finishes first, `next()` and its `buf` are " +"dropped." +msgstr "" +"هر زمان که شاخه `tick()` اول تمام شود، `next()` و `buf` آن حذف می شوند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"`LinesReader` can be made cancellation-safe by making `buf` part of the struct:" +"`LinesReader` can be made cancellation-safe by making `buf` part of the " +"struct:" msgstr "‏`LinesReader` را می‌توان با تبدیل `buf` به بخشی از ساختار، ایمن کرد:" #: src/concurrency/async-pitfalls/cancellation.md @@ -22135,22 +22805,22 @@ msgstr "// prefix buf and bytes with self.\n" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) is cancellation-safe because it keeps track of whether a tick " -"has been 'delivered'." +"html#method.tick) is cancellation-safe because it keeps track of whether a " +"tick has been 'delivered'." msgstr "" "‏ ['Interval::tick'](https://docs.rs/tokio/latest/tokio/time/struct.Interval." -"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک tick " -"تحویل داده شده است." +"html#method.tick) برای cancellation-safe است زیرا ردیابی می‌کند که آیا یک " +"tick تحویل داده شده است." #: src/concurrency/async-pitfalls/cancellation.md msgid "" -"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." -"html#method.read) is cancellation-safe because it either returns or doesn't read " -"data." +"[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) is cancellation-safe because it either " +"returns or doesn't read data." msgstr "" -"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt." -"html#method.read) برای cancellation-safe است زیرا داده‌ها را برمی‌گرداند یا " -"نمی‌خواند." +"‏ [`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." +"AsyncReadExt.html#method.read) برای cancellation-safe است زیرا داده‌ها را " +"برمی‌گرداند یا نمی‌خواند." #: src/concurrency/async-pitfalls/cancellation.md msgid "" @@ -22159,8 +22829,8 @@ msgid "" "cancellation-safe. See its documentation for details and alternatives." msgstr "" "‏ [`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." -"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-safe " -"نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." +"AsyncBufReadExt.html#method.read_line) مشابه مثال است و شبیه cancellation-" +"safe نیست. برای جزئیات و موارد جایگزین به مستندات آن مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22173,18 +22843,18 @@ msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" -"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-philosophers." -"md) مراجعه کنید." +"برای توضیح مشکل به [dining philosophers](../sync-exercises/dining-" +"philosophers.md) مراجعه کنید." #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"As before, you will need a local [Cargo installation](../../cargo/running-locally." -"md) for this exercise. Copy the code below to a file called `src/main.rs`, fill " -"out the blanks, and test that `cargo run` does not deadlock:" +"As before, you will need a local [Cargo installation](../../cargo/running-" +"locally.md) for this exercise. Copy the code below to a file called `src/" +"main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally.md) " -"نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی را پر " -"کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" +"مانند قبل، برای این تمرین به Cargo installation](../../cargo/running-locally." +"md) نیاز دارید. کد زیر را در فایلی به نام `src/main.rs` کپی کنید، جاهای خالی " +"را پر کنید و تست کنید که `cargo run` به بن بست (`src/main.rs`) نمی‌خورد:" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md @@ -22200,11 +22870,11 @@ msgstr "// Make them think and eat\n" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Since this time you are using Async Rust, you'll need a `tokio` dependency. You " -"can use the following `Cargo.toml`:" +"Since this time you are using Async Rust, you'll need a `tokio` dependency. " +"You can use the following `Cargo.toml`:" msgstr "" -"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز دارید. " -"می‌توانید از `Cargo.toml` زیر استفاده کنید:" +"از آنجایی که این بار از Async Rust استفاده می‌کنید، به وابستگی `tokio` نیاز " +"دارید. می‌توانید از `Cargo.toml` زیر استفاده کنید:" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" @@ -22215,8 +22885,8 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" -"multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" msgstr "" "```toml\n" @@ -22226,14 +22896,14 @@ msgstr "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", \"rt-" -"multi-thread\"] }\n" +"tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " +"\"rt-multi-thread\"] }\n" "```" #: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"Also note that this time you have to use the `Mutex` and the `mpsc` module from " -"the `tokio` crate." +"Also note that this time you have to use the `Mutex` and the `mpsc` module " +"from the `tokio` crate." msgstr "" "همچنین توجه داشته باشید که این بار باید از ماژول `Mutex` و `mpsc` از `tokio` " "crate استفاده کنید." @@ -22244,26 +22914,28 @@ msgstr "آیا می‌توانید پیاده‌سازی خود را تک thread #: src/concurrency/async-exercises/chat-app.md msgid "" -"In this exercise, we want to use our new knowledge to implement a broadcast chat " -"application. We have a chat server that the clients connect to and publish their " -"messages. The client reads user messages from the standard input, and sends them " -"to the server. The chat server broadcasts each message that it receives to all " -"the clients." +"In this exercise, we want to use our new knowledge to implement a broadcast " +"chat application. We have a chat server that the clients connect to and " +"publish their messages. The client reads user messages from the standard " +"input, and sends them to the server. The chat server broadcasts each message " +"that it receives to all the clients." msgstr "" -"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه broadcast " -"chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل می‌شوند و پیام‌های خود " -"را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی استاندارد می‌خواند و آنها را به " -"سرور ارسال می‌کند. سرور چت هر پیامی را که دریافت می‌کند برای همه کاربران پخش می‌کند." +"در این تمرین، ما می‌خواهیم از دانش جدید خود برای پیاده سازی یک برنامه " +"broadcast chat استفاده کنیم. ما یک سرور چت داریم که کاربران به آن متصل " +"می‌شوند و پیام‌های خود را منتشر می‌کنند. کلاینت پیام‌های کاربر را از ورودی " +"استاندارد می‌خواند و آنها را به سرور ارسال می‌کند. سرور چت هر پیامی را که " +"دریافت می‌کند برای همه کاربران پخش می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "" -"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" -"broadcast/fn.channel.html) on the server, and [`tokio_websockets`](https://docs." -"rs/tokio-websockets/) for the communication between the client and the server." +"For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" +"(https://docs.rs/tokio-websockets/) for the communication between the client " +"and the server." msgstr "" -"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/sync/" -"broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://docs.rs/" -"tokio-websockets/) برای ارتباط بین کلاینت و سرور." +"برای این کار، از [ broadcast channel](https://docs.rs/tokio/latest/tokio/" +"sync/broadcast/fn.channel.html) در سمت سرور و [`tokio_websockets`](https://" +"docs.rs/tokio-websockets/) برای ارتباط بین کلاینت و سرور." #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" @@ -22286,8 +22958,8 @@ msgid "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.40.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.9.0\", features = [\"client\", \"fastrand\", " -"\"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.9.0\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" @@ -22300,8 +22972,8 @@ msgstr "" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.38.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.8.3\", features = [\"client\", \"fastrand\", " -"\"server\", \"sha1_smol\"] }\n" +"tokio-websockets = { version = \"0.8.3\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md @@ -22311,31 +22983,31 @@ msgstr "‏API‌های مورد نیاز" #: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes to " -"familiarize yourself with the API." +"[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " +"to familiarize yourself with the API." msgstr "" "شما به توابع زیر از `tokio` و [`tokio_websockets`](https://docs.rs/tokio-" "websockets/) نیاز دارید. چند دقیقه را برای آشنایی با API اختصاص دهید." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/trait." -"StreamExt.html#method.next) implemented by `WebSocketStream`: for asynchronously " -"reading messages from a Websocket Stream." +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " +"asynchronously reading messages from a Websocket Stream." msgstr "" "‏ [StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" -"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن ناهمزمان " -"پیام‌ها از یک جریان وب سوکت." +"trait.StreamExt.html#method.next) توسط `WebSocketStream`: برای خواندن " +"ناهمزمان پیام‌ها از یک جریان وب سوکت." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." -"SinkExt.html#method.send) implemented by `WebSocketStream`: for asynchronously " -"sending messages on a Websocket Stream." +"[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " +"asynchronously sending messages on a Websocket Stream." msgstr "" -"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/trait." -"SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای ارسال " -"ناهمزمان پیام‌ها در یک Websocket Stream." +"‏[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" +"trait.SinkExt.html#method.send) پیاده‌سازی شده توسط `WebSocketStream`: برای " +"ارسال ناهمزمان پیام‌ها در یک Websocket Stream." #: src/concurrency/async-exercises/chat-app.md msgid "" @@ -22344,15 +23016,16 @@ msgid "" "standard input." msgstr "" "‏[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." -"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی استاندارد." +"html#method.next_line): برای خواندن ناهمزمان پیام‌های کاربر از ورودی " +"استاندارد." #: src/concurrency/async-exercises/chat-app.md msgid "" -"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." -"Sender.html#method.subscribe): for subscribing to a broadcast channel." +"[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/struct." -"Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." +"‏[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" +"struct.Sender.html#method.subscribe): برای اشتراک در یک broadcast channel." #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" @@ -22360,28 +23033,31 @@ msgstr "دو باینری" #: src/concurrency/async-exercises/chat-app.md msgid "" -"Normally in a Cargo project, you can have only one binary, and one `src/main.rs` " -"file. In this project, we need two binaries. One for the client, and one for the " -"server. You could potentially make them two separate Cargo projects, but we are " -"going to put them in a single Cargo project with two binaries. For this to work, " -"the client and the server code should go under `src/bin` (see the [documentation]" -"(https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries))." -msgstr "" -"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل `src/" -"main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای کلاینت و " -"دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه Cargo جداگانه " -"بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری قرار می‌دهیم. برای این " -"کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند (به[documentation](https://" -"doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries) مراجعه کنید )." +"Normally in a Cargo project, you can have only one binary, and one `src/main." +"rs` file. In this project, we need two binaries. One for the client, and one " +"for the server. You could potentially make them two separate Cargo projects, " +"but we are going to put them in a single Cargo project with two binaries. " +"For this to work, the client and the server code should go under `src/bin` " +"(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" +"targets.html#binaries))." +msgstr "" +"به طور معمول در یک پروژه Cargo، شما می توانید فقط یک فایل باینری و یک فایل " +"`src/main.rs` داشته باشید. در این پروژه به دو باینری نیاز داریم. یکی برای " +"کلاینت و دیگری برای سرور. شما به طور بالقوه می‌توانید آنها را در دو پروژه " +"Cargo جداگانه بسازید، اما ما آنها را در یک پروژه Cargo واحد با دو باینری " +"قرار می‌دهیم. برای این کار، کلاینت و کد سرور باید زیر `src/bin` قرار گیرند " +"(به[documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets." +"html#binaries) مراجعه کنید )." #: src/concurrency/async-exercises/chat-app.md msgid "" -"Copy the following server and client code into `src/bin/server.rs` and `src/bin/" -"client.rs`, respectively. Your task is to complete these files as described below." +"Copy the following server and client code into `src/bin/server.rs` and `src/" +"bin/client.rs`, respectively. Your task is to complete these files as " +"described below." msgstr "" -"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` کپی " -"کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده شده است " -"تکمیل کنید." +"کد سرور و کلاینت زیر را به ترتیب در`src/bin/server.rs` و `src/bin/client.rs` " +"کپی کنید. وظیفه شما این است که این فایل‌ها را همانطور که در زیر توضیح داده " +"شده است تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md @@ -22443,13 +23119,14 @@ msgstr "تابع `handle_connection` را در `src/bin/server.rs` پیاده‌ #: src/concurrency/async-exercises/chat-app.md msgid "" -"Hint: Use `tokio::select!` for concurrently performing two tasks in a continuous " -"loop. One task receives messages from the client and broadcasts them. The other " -"sends messages received by the server to the client." +"Hint: Use `tokio::select!` for concurrently performing two tasks in a " +"continuous loop. One task receives messages from the client and broadcasts " +"them. The other sends messages received by the server to the client." msgstr "" -"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته استفاده " -"کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را پخش(broadcast) می‌کند. " -"دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال می‌کند." +"نکته: از `tokio::select!` برای انجام همزمان دو task در یک حلقه پیوسته " +"استفاده کنید. یک task پیام‌هایی را از کلاینت دریافت می‌کند و آنها را " +"پخش(broadcast) می‌کند. دیگری پیام‌های دریافت شده توسط سرور را برای کاربر ارسال " +"می‌کند." #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." @@ -22458,21 +23135,21 @@ msgstr "تابع اصلی را در `src/bin/client.rs` تکمیل کنید." #: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and sending " -"them to the server, and (2) receiving messages from the server, and displaying " -"them for the user." +"performing two tasks: (1) reading user messages from standard input and " +"sending them to the server, and (2) receiving messages from the server, and " +"displaying them for the user." msgstr "" -"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو task " -"استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها به سرور و " -"(۲) دریافت پیام از سرور و نمایش آنها برای کاربر." +"نکته: مانند قبل، از `tokio::select!` در یک حلقه پیوسته برای انجام همزمان دو " +"task استفاده کنید: (۱) خواندن پیام های کاربر از ورودی استاندارد و ارسال آنها " +"به سرور و (۲) دریافت پیام از سرور و نمایش آنها برای کاربر." #: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به جز " -"فرستنده پیام، منتشر شود." +"اختیاری: پس از اتمام کار، کد را تغییر دهید تا پیام‌ها برای همه کلاینت‌ها، به " +"جز فرستنده پیام، منتشر شود." #: src/concurrency/async-exercises/solutions.md #, fuzzy @@ -22538,33 +23215,33 @@ msgstr "\"From server: {}\"" #: src/thanks.md msgid "" -"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and that it " -"was useful." +"_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " +"that it was useful." msgstr "" -"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت برده " -"باشید و برای‌ شما مفید بوده باشد." +"ممنون که آموزش‌هایی را از Comprehensive Rust 🦀! رو گرفتید. امیدواریم لذت " +"برده باشید و برای‌ شما مفید بوده باشد." #: src/thanks.md msgid "" -"We've had a lot of fun putting the course together. The course is not perfect, so " -"if you spotted any mistakes or have ideas for improvements, please get in " -"[contact with us on GitHub](https://github.com/google/comprehensive-rust/" -"discussions). We would love to hear from you." +"We've had a lot of fun putting the course together. The course is not " +"perfect, so if you spotted any mistakes or have ideas for improvements, " +"please get in [contact with us on GitHub](https://github.com/google/" +"comprehensive-rust/discussions). We would love to hear from you." msgstr "" -"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر اشتباهی " -"را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما تماس بگیرید]" -"(https://github.com/google/comprehensive-rust/discussions) وارد شوید. ما دوست " -"داریم از شما بشنویم." +"ما از برگزاری این دوره بسیار لذت بردیم. این دوره کامل نیست، بنابراین اگر " +"اشتباهی را مشاهده کردید یا ایده‌ای برای بهبود دارید، لطفاً با [در GitHub با ما " +"تماس بگیرید](https://github.com/google/comprehensive-rust/discussions) وارد " +"شوید. ما دوست داریم از شما بشنویم." #: src/glossary.md msgid "" -"The following is a glossary which aims to give a short definition of many Rust " -"terms. For translations, this also serves to connect the term back to the English " -"original." +"The following is a glossary which aims to give a short definition of many " +"Rust terms. For translations, this also serves to connect the term back to " +"the English original." msgstr "" -"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در زبان " -"Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی انگلیسی " -"است." +"در زیر واژه‌نامه‌ای است که هدف آن ارائه تعریف کوتاهی از بسیاری از اصطلاحات در " +"زبان Rust است. برای ترجمه‌ها، این مورد نیز برای اتصال این اصطلاح به زبان اصلی " +"انگلیسی است." #. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md @@ -22586,8 +23263,8 @@ msgstr "" #: src/glossary.md msgid "" "associated type: \n" -"A type associated with a specific trait. Useful for defining the relationship " -"between types." +"A type associated with a specific trait. Useful for defining the " +"relationship between types." msgstr "" "نوع مرتبط:\n" "نوعی که با یک ویژگی خاص مرتبط است. برای تعریف رابطه بین typeها مفید است." @@ -22599,8 +23276,8 @@ msgid "" "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "Bare-metal Rust: \n" -"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. [Bare-" -"metal Rust](bare-metal.md) را ببینید." +"توسعه سطح پایین Rust، اغلب در سیستم‌هایی که سیستم‌عامل ندارند، مستقر می‌شود. " +"[Bare-metal Rust](bare-metal.md) را ببینید." #: src/glossary.md msgid "" @@ -22639,7 +23316,8 @@ msgstr "" #: src/glossary.md msgid "" "build: \n" -"The process of converting source code into executable code or a usable program." +"The process of converting source code into executable code or a usable " +"program." msgstr "" "build: \n" "فرآیند تبدیل کد منبع به کد اجرایی یا یک برنامه قابل استفاده می‌باشد." @@ -22658,7 +23336,8 @@ msgid "" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "channel: \n" -"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده می‌شود." +"‏ برای ارسال ایمن پیام‌ها [بین threadها]‌(concurrency/channels.md) استفاده " +"می‌شود." #: src/glossary.md msgid "" @@ -22680,7 +23359,8 @@ msgstr "" msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." -msgstr "‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +msgstr "" +"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" #: src/glossary.md msgid "" @@ -22693,8 +23373,8 @@ msgstr "" #: src/glossary.md msgid "" "control flow: \n" -"The order in which the individual statements or instructions are executed in a " -"program." +"The order in which the individual statements or instructions are executed in " +"a program." msgstr "" "control flow: \n" "ترتیبی که دستورات یا عملگرها در یک برنامه اجرا می‌شوند." @@ -22714,8 +23394,8 @@ msgid "" "associated tuple or struct." msgstr "" "enumeration: \n" -"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا ساختار " -"مرتبط، نگه می‌دارد." +"یک نوع داده که یکی از چندین ثابت نامگذاری شده را، احتمالاً با یک تاپل یا " +"ساختار مرتبط، نگه می‌دارد." #: src/glossary.md msgid "" @@ -22753,22 +23433,22 @@ msgstr "" #: src/glossary.md msgid "" "garbage collector: \n" -"A mechanism that automatically frees up memory occupied by objects that are no " -"longer in use." +"A mechanism that automatically frees up memory occupied by objects that are " +"no longer in use." msgstr "" "garbage collector: \n" -"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده نمی‌شوند را " -"آزاد می‌کند." +"مکانیزمی که به طور خودکار حافظه اشغال شده توسط اشیایی که دیگر استفاده " +"نمی‌شوند را آزاد می‌کند." #: src/glossary.md msgid "" "generics: \n" -"A feature that allows writing code with placeholders for types, enabling code " -"reuse with different data types." +"A feature that allows writing code with placeholders for types, enabling " +"code reuse with different data types." msgstr "" "generics: \n" -"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان استفاده " -"مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." +"قابلیتی که امکان نوشتن کد با متغیرهایی برای انواع را فراهم می‌کند و امکان " +"استفاده مجدد از کد با انواع داده‌های مختلف را فراهم می‌کند." #: src/glossary.md msgid "" @@ -22790,12 +23470,12 @@ msgstr "" #: src/glossary.md msgid "" "keyword: \n" -"A reserved word in a programming language that has a specific meaning and cannot " -"be used as an identifier." +"A reserved word in a programming language that has a specific meaning and " +"cannot be used as an identifier." msgstr "" "keyword: \n" -"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن به " -"عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." +"یک کلمه رزرو شده در یک زبان برنامه‌نویسی که معنای خاصی دارد و نمی‌توان از آن " +"به عنوان شناسه یا سایر نامگذاری‌ها استفاده کرد." #: src/glossary.md msgid "" @@ -22809,14 +23489,14 @@ msgstr "" #: src/glossary.md msgid "" "macro: \n" -"Rust macros can be recognized by a `!` in the name. Macros are used when normal " -"functions are not enough. A typical example is `format!`, which takes a variable " -"number of arguments, which isn't supported by Rust functions." +"Rust macros can be recognized by a `!` in the name. Macros are used when " +"normal functions are not enough. A typical example is `format!`, which takes " +"a variable number of arguments, which isn't supported by Rust functions." msgstr "" "macro: \n" "ماکروهای Rust را می‌توان با یک `!` در نام آن تشخیص داد. ماکروها زمانی استفاده " -"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد متغیری از " -"آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." +"می‌شوند که توابع عادی کافی نباشد. یک مثال معمولی `format!` است که تعداد " +"متغیری از آرگومان‌ها را می‌گیرد که توسط توابع Rust پشتیبانی نمی‌شوند." #: src/glossary.md msgid "" @@ -22830,22 +23510,22 @@ msgstr "" #: src/glossary.md msgid "" "match: \n" -"A control flow construct in Rust that allows for pattern matching on the value of " -"an expression." +"A control flow construct in Rust that allows for pattern matching on the " +"value of an expression." msgstr "" "match: \n" -"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را فراهم " -"می‌کند." +"یک ساختار جریان کنترلی در Rust که امکان تطبیق الگو بر روی مقدار یک عبارت را " +"فراهم می‌کند." #: src/glossary.md msgid "" "memory leak: \n" -"A situation where a program fails to release memory that is no longer needed, " -"leading to a gradual increase in memory usage." +"A situation where a program fails to release memory that is no longer " +"needed, leading to a gradual increase in memory usage." msgstr "" "memory leak: \n" -"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و منجر " -"به افزایش تدریجی استفاده از حافظه می‌شود." +"وضعیتی که در آن برنامه نمی‌تواند حافظه‌ای را که دیگر مورد نیاز نیست آزاد کند و " +"منجر به افزایش تدریجی استفاده از حافظه می‌شود." #: src/glossary.md msgid "" @@ -22858,12 +23538,12 @@ msgstr "" #: src/glossary.md msgid "" "module: \n" -"A namespace that contains definitions, such as functions, types, or traits, to " -"organize code in Rust." +"A namespace that contains definitions, such as functions, types, or traits, " +"to organize code in Rust." msgstr "" "module: \n" -"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در Rust " -"است." +"فضای نامی که شامل تعاریفی مانند توابع، انواع یا صفات برای سازماندهی کد در " +"Rust است." #: src/glossary.md msgid "" @@ -22889,14 +23569,14 @@ msgid "" "managing the memory associated with a value." msgstr "" "ownership: \n" -"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک مقدار " -"است." +"مفهومی در Rust که مشخص می‌کند کدام قسمت از کد مسئول مدیریت حافظه مرتبط با یک " +"مقدار است." #: src/glossary.md msgid "" "panic: \n" -"An unrecoverable error condition in Rust that results in the termination of the " -"program." +"An unrecoverable error condition in Rust that results in the termination of " +"the program." msgstr "" "panic: \n" "یک وضعیت خطای غیرقابل جبران در Rust که منجر به خاتمه برنامه می‌شود." @@ -22912,12 +23592,12 @@ msgstr "" #: src/glossary.md msgid "" "pattern: \n" -"A combination of values, literals, or structures that can be matched against an " -"expression in Rust." +"A combination of values, literals, or structures that can be matched against " +"an expression in Rust." msgstr "" "pattern: \n" -"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust مطابقت " -"داده شوند." +"ترکیبی از مقادیر، عبارت‌ها یا ساختارهایی که می‌توانند با یک عبارت در Rust " +"مطابقت داده شوند." #: src/glossary.md msgid "" @@ -22930,39 +23610,40 @@ msgstr "" #: src/glossary.md msgid "" "program: \n" -"A set of instructions that a computer can execute to perform a specific task or " -"solve a particular problem." +"A set of instructions that a computer can execute to perform a specific task " +"or solve a particular problem." msgstr "" "program: \n" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " -"مشکل خاصی اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاصی اجرا کند." #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" -"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا حل یک " -"مشکل خاص اجرا کند." +"مجموعه‌ای از دستورالعمل‌هایی که یک کامپیوتر می‌تواند برای انجام یک کار خاص یا " +"حل یک مشکل خاص اجرا کند." #: src/glossary.md msgid "" "receiver: \n" -"The first parameter in a Rust method that represents the instance on which the " -"method is called." +"The first parameter in a Rust method that represents the instance on which " +"the method is called." msgstr "" "receiver: \n" -"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی می‌شود." +"اولین پارامتر در متد Rust که نمونه‌ای را نشان می‌دهد که متد در آن فراخوانی " +"می‌شود." #: src/glossary.md msgid "" "reference counting: \n" -"A memory management technique in which the number of references to an object is " -"tracked, and the object is deallocated when the count reaches zero." +"A memory management technique in which the number of references to an object " +"is tracked, and the object is deallocated when the count reaches zero." msgstr "" "reference counting: \n" -"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و زمانی که " -"شمارش به صفر می‌رسد، object تخصیص داده می‌شود." +"یک تکنیک مدیریت حافظه که در آن تعداد ارجاعات به یک object ردیابی می‌شود و " +"زمانی که شمارش به صفر می‌رسد، object تخصیص داده می‌شود." #: src/glossary.md msgid "" @@ -23011,8 +23692,8 @@ msgstr "" #: src/glossary.md msgid "" "safe: \n" -"Refers to code that adheres to Rust's ownership and borrowing rules, preventing " -"memory-related errors." +"Refers to code that adheres to Rust's ownership and borrowing rules, " +"preventing memory-related errors." msgstr "" "safe: \n" "به کدی اشاره دارد که به قوانین مالکیت (ownership) در زبان Rust و قرض‌گرفتن " @@ -23047,7 +23728,8 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [Strings](references/strings.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" "string: \n" "نوع داده‌ای که داده‌های متنی را ذخیره می‌کند. برای اطلاعات بیشتر به [Strings]" @@ -23056,16 +23738,18 @@ msgstr "" #: src/glossary.md msgid "" "struct: \n" -"A composite data type in Rust that groups together variables of different types " -"under a single name." +"A composite data type in Rust that groups together variables of different " +"types under a single name." msgstr "" "struct: \n" -"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع می‌کند." +"یک نوع داده ترکیبی در Rust که متغیرهای انواع مختلف را تحت یک نام واحد جمع " +"می‌کند." #: src/glossary.md msgid "" "test: \n" -"A Rust module containing functions that test the correctness of other functions." +"A Rust module containing functions that test the correctness of other " +"functions." msgstr "" "test: \n" "یک ماژول Rust حاوی توابعی که صحت عملکردهای دیگر را آزمایش می‌کند." @@ -23090,8 +23774,8 @@ msgstr "" #: src/glossary.md msgid "" "trait: \n" -"A collection of methods defined for an unknown type, providing a way to achieve " -"polymorphism in Rust." +"A collection of methods defined for an unknown type, providing a way to " +"achieve polymorphism in Rust." msgstr "" "trait: \n" "مجموعه‌ای از متدهای تعریف شده برای یک type ناشناخته، راهی برای دستیابی به " @@ -23105,33 +23789,34 @@ msgid "" "interest." msgstr "" "trait bound: \n" -"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد علاقه‌تان " -"به typeها نیاز داشته باشید." +"انتزاعی که در آن می‌توانید برای پیاده‌سازی برخی از ویژگی‌های (traitها) مورد " +"علاقه‌تان به typeها نیاز داشته باشید." #: src/glossary.md msgid "" "tuple: \n" -"A composite data type that contains variables of different types. Tuple fields " -"have no names, and are accessed by their ordinal numbers." +"A composite data type that contains variables of different types. Tuple " +"fields have no names, and are accessed by their ordinal numbers." msgstr "" "tuple: \n" -"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple بی‌نام " -"هستند و با شماره ترتیبی آنها قابل دسترسی هستند." +"یک data type ترکیبی که شامل متغیرهایی از انواع مختلف است. فیلدهای Tuple " +"بی‌نام هستند و با شماره ترتیبی آنها قابل دسترسی هستند." #: src/glossary.md msgid "" "type: \n" -"A classification that specifies which operations can be performed on values of a " -"particular kind in Rust." +"A classification that specifies which operations can be performed on values " +"of a particular kind in Rust." msgstr "" "type: \n" -"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص در " -"Rust انجام داد." +"طبقه‌بندی که مشخص می‌کند کدام عملیات را می‌توان بر روی مقادیری از یک تایپ خاص " +"در Rust انجام داد." #: src/glossary.md msgid "" "type inference: \n" -"The ability of the Rust compiler to deduce the type of a variable or expression." +"The ability of the Rust compiler to deduce the type of a variable or " +"expression." msgstr "" "type inference: \n" "توانایی کامپایلر Rust برای شناسایی تایپ یک متغیر یا عبارت." @@ -23139,12 +23824,12 @@ msgstr "" #: src/glossary.md msgid "" "undefined behavior: \n" -"Actions or conditions in Rust that have no specified result, often leading to " -"unpredictable program behavior." +"Actions or conditions in Rust that have no specified result, often leading " +"to unpredictable program behavior." msgstr "" "undefined behavior: \n" -"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار غیرقابل " -"پیش‌بینی برنامه می‌شوند." +"اقدامات یا شرایطی در Rust که هیچ نتیجه مشخصی ندارند و اغلب منجر به رفتار " +"غیرقابل پیش‌بینی برنامه می‌شوند." #: src/glossary.md msgid "" @@ -23152,8 +23837,8 @@ msgid "" "A data type that can hold values of different types but only one at a time." msgstr "" "union: \n" -"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط یکی در " -"یک زمان خاص." +"یک data type که می‌تواند مقادیری از انواع مختلف را در خود نگه دارد، اما فقط " +"یکی در یک زمان خاص." #: src/glossary.md msgid "" @@ -23162,8 +23847,8 @@ msgid "" "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "unit test: \n" -"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای بزرگتر " -"ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." +"‏ Rust با پشتیبانی داخلی برای اجرای unit testهای کوچک و integration testهای " +"بزرگتر ارائه می‌شود. [Unit Tests](testing/unit-tests.html) را ببینید." #: src/glossary.md msgid "" @@ -23171,18 +23856,18 @@ msgid "" "Type that holds no data, written as a tuple with no members." msgstr "" "unit type: \n" -"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته شده " -"است." +"نوعی که هیچ داده‌ای را در خود نگه نمی‌دارد و به صورت tuple بدون هیچ عضوی نوشته " +"شده است." #: src/glossary.md msgid "" "unsafe: \n" -"The subset of Rust which allows you to trigger _undefined behavior_. See [Unsafe " -"Rust](unsafe-rust/unsafe.md)." +"The subset of Rust which allows you to trigger _undefined behavior_. See " +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" "unsafe: \n" -"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی کنید. " -"[Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." +"زیرمجموعه (subset) در Rust که به شما امکان می‌دهد رفتار نامشخصی را فعال‌سازی " +"کنید. [Unsafe Rust] (unsafe-rust/unsafe.md) را ببینید." #: src/glossary.md msgid "" @@ -23198,8 +23883,10 @@ msgstr "سایر منابع برای Rust" #: src/other-resources.md msgid "" -"The Rust community has created a wealth of high-quality and free resources online." -msgstr "جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." +"The Rust community has created a wealth of high-quality and free resources " +"online." +msgstr "" +"جامعه Rust منابع بسیار باکیفیت و رایگان را به صورت آنلاین ایجاد کرده است." #: src/other-resources.md msgid "Official Documentation" @@ -23208,45 +23895,46 @@ msgstr "مستندات رسمی" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" -"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش می‌دهند:" +"پروژه Rust میزبان منابع بسیاری است. این‌ منابع، Rust را به طور کامل پوشش " +"می‌دهند:" #: src/other-resources.md msgid "" -"[The Rust Programming Language](https://doc.rust-lang.org/book/): the canonical " -"free book about Rust. Covers the language in detail and includes a few projects " -"for people to build." +"[The Rust Programming Language](https://doc.rust-lang.org/book/): the " +"canonical free book about Rust. Covers the language in detail and includes a " +"few projects for people to build." msgstr "" -"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و معروف " -"در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند پروژه برای ساخت " -"نرم‌افزار می‌شود." +"‏ [زبان برنامه نویسی Rust] (https://doc.rust-lang.org/book/): کتاب رایگان و " +"معروف در مورد Rust که این زبان را با جزئیات دقیقی پوشش می‌دهد و شامل چند " +"پروژه برای ساخت نرم‌افزار می‌شود." #: src/other-resources.md msgid "" -"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the Rust " -"syntax via a series of examples which showcase different constructs. Sometimes " -"includes small exercises where you are asked to expand on the code in the " -"examples." +"[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " +"Rust syntax via a series of examples which showcase different constructs. " +"Sometimes includes small exercises where you are asked to expand on the code " +"in the examples." msgstr "" "‏ [Rust By Example](https://doc.rust-lang.org/rust-by-example/): در مورد Rust " "syntax را به کمک یک سری از مثال‌ها پوشش می‌دهد که ساختارهای مختلف را به نمایش " -"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را در " -"مثال‌ها گسترش دهید." +"می‌گذارد. گاهی اوقات شامل تمرین‌های کوچکی می‌شود که از شما خواسته می‌شود کد را " +"در مثال‌ها گسترش دهید." #: src/other-resources.md msgid "" -"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation of " -"the standard library for Rust." +"[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " +"of the standard library for Rust." msgstr "" -"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل کتابخانه " -"استاندارد برای Rust می‌باشد." +"‏ [Rust Standard Library]‌(https://doc.rust-lang.org/std/): مستندات کامل " +"کتابخانه استاندارد برای Rust می‌باشد." #: src/other-resources.md msgid "" -"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete book " -"which describes the Rust grammar and memory model." +"[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " +"book which describes the Rust grammar and memory model." msgstr "" -"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که گرامر " -"و مدل حافظه Rust را توصیف می‌کند." +"‏ [The Rust Reference](https://doc.rust-lang.org/reference/): کتاب ناقصی که " +"گرامر و مدل حافظه Rust را توصیف می‌کند." #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" @@ -23255,30 +23943,32 @@ msgstr "راهنماهای تخصصی بیشتر میزبانی شده در سا #: src/other-resources.md msgid "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " -"including working with raw pointers and interfacing with other languages (FFI)." +"including working with raw pointers and interfacing with other languages " +"(FFI)." msgstr "" -"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را پوشش " -"می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر (FFI) را " -"تشریح می‌کند." +"‏[Rustonomicon](https://doc.rust-lang.org/nomicon/): که unsafe Rust ناامن را " +"پوشش می‌دهد، از جمله کار با pointerهای خام و interfaceهای با زبان های دیگر " +"(FFI) را تشریح می‌کند." #: src/other-resources.md msgid "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " -"covers the new asynchronous programming model which was introduced after the Rust " -"Book was written." +"covers the new asynchronous programming model which was introduced after the " +"Rust Book was written." msgstr "" -"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): مدل " -"برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که پس از " -"نگارش کتاب Rust معرفی شده است." +"‏ [برنامه نویسی ناهمزمان در Rust](https://rust-lang.github.io/async-book/): " +"مدل برنامه‌نویسی ناهمزمان (asynchronous programming) جدیدی را پوشش می‌دهد که " +"پس از نگارش کتاب Rust معرفی شده است." #: src/other-resources.md msgid "" -"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): an " -"introduction to using Rust on embedded devices without an operating system." +"[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " +"an introduction to using Rust on embedded devices without an operating " +"system." msgstr "" "‏ [The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " -"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را شامل " -"می‌شود." +"مقدمه‌ای بر استفاده از Rust در embedded deviceها که بدون سیستم‌عامل هستند را " +"شامل می‌شود." #: src/other-resources.md msgid "Unofficial Learning Material" @@ -23290,113 +23980,115 @@ msgstr "مجموعه کوچکی از راهنماها و آموزش‌های د #: src/other-resources.md msgid "" -"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust from " -"the perspective of low-level C programmers." +"[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " +"from the perspective of low-level C programmers." msgstr "" -"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره Rust را " -"از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." +"‏ [Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): درباره " +"Rust را از دیدگاه برنامه‌نویسان سطح پایین C پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." -"html): covers Rust from the perspective of developers who write firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" -"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/rust_for_c_devs." -"html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به زبان C می‌نویسند پوشش " -"می‌دهد." +"‏ [Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): که Rust را از دیدگاه توسعه‌دهندگانی که سیستم‌عامل را به " +"زبان C می‌نویسند پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust for professionals](https://overexact.com/rust-for-professionals/): covers " -"the syntax of Rust using side-by-side comparisons with other languages such as C, " -"C++, Java, JavaScript, and Python." +"[Rust for professionals](https://overexact.com/rust-for-professionals/): " +"covers the syntax of Rust using side-by-side comparisons with other " +"languages such as C, C++, Java, JavaScript, and Python." msgstr "" "‏ [Rust for Professionals](https://overexact.com/rust-for-professionals/): که " -"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، C++، " -"Java، JavaScript و Python پوشش می‌دهد." +"syntax مورد استفاده Rust را به کمک مقایسه‌های جانبی با زبان‌های دیگر مانند C، " +"C++، Java، JavaScript و Python پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help you " -"learn Rust." +"[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " +"you learn Rust." msgstr "" -"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای کمک " -"به یادگیری Rust را شامل می‌شود." +"‏ [Rust on Exercism](https://exercism.org/tracks/rust): بیش از ۱۰۰ تمرین برای " +"کمک به یادگیری Rust را شامل می‌شود." #: src/other-resources.md msgid "" -"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" -"index.html): a series of small presentations covering both basic and advanced " -"part of the Rust language. Other topics such as WebAssembly, and async/await are " -"also covered." +"[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): a series of small presentations covering both basic " +"and advanced part of the Rust language. Other topics such as WebAssembly, " +"and async/await are also covered." msgstr "" -"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-material/" -"index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته زبان Rust را " -"پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز پوشش داده شده است." +"‏ [Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" +"material/index.html): مجموعه‌ای از ارائه‌های کوچک که هم بخش پایه و هم پیشرفته " +"زبان Rust را پوشش می‌دهد. موضوعات دیگری مانند WebAssembly و async/wait نیز " +"پوشش داده شده است." #: src/other-resources.md #, fuzzy msgid "" "[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" "testing/): a self-paced workshop that goes beyond Rust's built-in testing " -"framework. It covers `googletest`, snapshot testing, mocking as well as how to " -"write your own custom test harness." +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." msgstr "" -"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-advanced-" -"testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی Rust است. این " -"`googletest`، تست snapshot و mocking و همچنین نحوه نوشتن تست‌های سفارشی خود را " -"پوشش می‌دهد." +"‏ [تست پیشرفته برای برنامه‌های Rust](https://github.com/mainmatter/rust-" +"advanced-testing-workshop): کارگاهی خودآموز که فراتر از چارچوب تست داخلی " +"Rust است. این `googletest`، تست snapshot و mocking و همچنین نحوه نوشتن " +"تست‌های سفارشی خود را پوشش می‌دهد." #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) and [Take your first steps with Rust](https://docs.microsoft.com/" -"en-us/learn/paths/rust-first-steps/): two Rust guides aimed at new developers. " -"The first is a set of 35 videos and the second is a set of 11 modules which " -"covers Rust syntax and basic constructs." +"series-to-rust/) and [Take your first steps with Rust](https://docs." +"microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " +"new developers. The first is a set of 35 videos and the second is a set of " +"11 modules which covers Rust syntax and basic constructs." msgstr "" -"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" -"series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://docs.microsoft. " -"com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با هدف توسعه‌دهندگان " -"جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از ۱۱ ماژول است که دستور " -"Rust و ساختارهای اولیه را پوشش می‌دهد." +"‏ [Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/" +"beginners-series-to-rust/) و [اولین قدم های خود را با Rust بردارید](https://" +"docs.microsoft. com/en-us/learn/paths/rust-first-steps/): دو راهنمای Rust با " +"هدف توسعه‌دهندگان جدید می‌باشد. اولی مجموعه‌ای از ۳۵ ویدیو و دومی مجموعه‌ای از " +"۱۱ ماژول است که دستور Rust و ساختارهای اولیه را پوشش می‌دهد." #: src/other-resources.md msgid "" -"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial.github." -"io/too-many-lists/): in-depth exploration of Rust's memory management rules, " -"through implementing a few different types of list structures." +"[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." +"github.io/too-many-lists/): in-depth exploration of Rust's memory management " +"rules, through implementing a few different types of list structures." msgstr "" -"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github.io/" -"too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند نوع مختلف " -"list structure." +"‏ [Learn Rust With Entirely Too Linked Lists]‌(https://rust-unofficial.github." +"io/too-many-lists/): کاوش عمیق قوانین مدیریت حافظه Rust، از طریق اجرای چند " +"نوع مختلف list structure." #: src/other-resources.md msgid "" -"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for " -"even more Rust books." +"Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " +"for even more Rust books." msgstr "" -"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای کتاب‌های " -"بیشتر در مورد Rust ببینید." +"لطفاً [Little Book of Rust Books]‌(https://lborb.github.io/book/) را برای " +"کتاب‌های بیشتر در مورد Rust ببینید." #: src/credits.md msgid "" -"The material here builds on top of the many great sources of Rust documentation. " -"See the page on [other resources](other-resources.md) for a full list of useful " -"resources." +"The material here builds on top of the many great sources of Rust " +"documentation. See the page on [other resources](other-resources.md) for a " +"full list of useful resources." msgstr "" -"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای فهرست " -"کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." +"مطالب در اینجا بر روی بسیاری از منابع عالی مستندات Rust ساخته شده است. برای " +"فهرست کامل منابع مفید به صفحه [دیگر منابع]‌(other-resources.md) مراجعه کنید." #: src/credits.md msgid "" -"The material of Comprehensive Rust is licensed under the terms of the Apache 2.0 " -"license, please see [`LICENSE`](https://github.com/google/comprehensive-rust/blob/" -"main/LICENSE) for details." +"The material of Comprehensive Rust is licensed under the terms of the Apache " +"2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" +"rust/blob/main/LICENSE) for details." msgstr "" -"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات بیشتر " -"به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/LICENSE) " -"مراجعه کنید." +"محتوای Comprehensive Rust تحت مجوز Apache 2.0 مجوز دارند، لطفاً برای جزئیات " +"بیشتر به ['LICENSE'](https://github.com/google/comprehensive-rust/blob/main/" +"LICENSE) مراجعه کنید." #: src/credits.md msgid "Rust by Example" @@ -23404,13 +24096,14 @@ msgstr "‏ Rust به‌همراه مثال" #: src/credits.md msgid "" -"Some examples and exercises have been copied and adapted from [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/). Please see the `third_party/rust-by-" -"example/` directory for details, including the license terms." +"Some examples and exercises have been copied and adapted from [Rust by " +"Example](https://doc.rust-lang.org/rust-by-example/). Please see the " +"`third_party/rust-by-example/` directory for details, including the license " +"terms." msgstr "" -"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/rust-by-" -"example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به " -"دایرکتوری `third_party/rust-by-example/` مراجعه کنید." +"‏ برخی از مثال‌ها و تمرین‌ها از [Rust by Example]‌(https://doc.rust-lang.org/" +"rust-by-example/) کپی و اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط " +"license، به دایرکتوری `third_party/rust-by-example/` مراجعه کنید." #: src/credits.md msgid "Rust on Exercism" @@ -23422,9 +24115,9 @@ msgid "" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" -"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و اقتباس " -"شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری `third_party/rust-" -"on-exercism/` مراجعه کنید." +"برخی تمرین‌‌ا از [Rust on Exercism]‌(https://exercism.org/tracks/rust) کپی و " +"اقتباس شده‌اند. لطفاً برای جزئیات، از جمله شرایط license، به دایرکتوری " +"`third_party/rust-on-exercism/` مراجعه کنید." #: src/credits.md msgid "CXX" @@ -23432,13 +24125,13 @@ msgstr "CXX" #: src/credits.md msgid "" -"The [Interoperability with C++](android/interoperability/cpp.md) section uses an " -"image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` directory " -"for details, including the license terms." +"The [Interoperability with C++](android/interoperability/cpp.md) section " +"uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " +"directory for details, including the license terms." msgstr "" -"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری از " -"[CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط license، " -"دایرکتوری `third_party/cxx/` را ببینید." +"بخش [Interoperability with C++](android/interoperability/cpp.md) از تصویری " +"از [CXX](https://cxx.rs/) استفاده می‌کند. لطفاً برای جزئیات، از جمله شرایط " +"license، دایرکتوری `third_party/cxx/` را ببینید." #~ msgid "Slices: `&[T]`" #~ msgstr "برش ها: `&[T]`" @@ -23447,27 +24140,31 @@ msgstr "" #~ msgstr "برش‌ها: `[T]&`" #~ msgid "" -#~ "By default, closures will capture by reference if they can. The `move` keyword " -#~ "makes them capture by value." +#~ "By default, closures will capture by reference if they can. The `move` " +#~ "keyword makes them capture by value." #~ msgstr "" -#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را می‌گیرند. " -#~ "کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by value) بگیرند." +#~ "به‌طور پیش‌فرض، closure ها اگر بتوانند، با ارجاع (reference) مقادیر را " +#~ "می‌گیرند. کلمه کلیدی `move` باعث می‌شود که آنها مقادیر را به‌صورت مالکیت (by " +#~ "value) بگیرند." #~ msgid "" -#~ "There is a plan to transition [Android](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction), [ChromeOS](https://chromium.googlesource.com/" -#~ "chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/build/" -#~ "bazel/introduction) to Bazel." +#~ "There is a plan to transition [Android](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." +#~ "com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/" +#~ "setup/build/bazel/introduction) to Bazel." #~ msgstr "" -#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/build/" -#~ "bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/chromiumos/" -#~ "bazel/) وجود دارد و انتقال [Fuchsia](https://source.android.com/docs/setup/" -#~ "build/bazel/introduction) به Bazel." +#~ "برنامه‌ای برای انتقال [Android](https://source.android.com/docs/setup/" +#~ "build/bazel/introduction)، [ChromeOS](https://chromium.googlesource.com/" +#~ "chromiumos/bazel/) وجود دارد و انتقال [Fuchsia](https://source.android." +#~ "com/docs/setup/build/bazel/introduction) به Bazel." -#~ msgid "Learning Bazel-like build rules is useful for all Rust OS developers." -#~ msgstr "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." +#~ msgid "" +#~ "Learning Bazel-like build rules is useful for all Rust OS developers." +#~ msgstr "" +#~ "یادگیری قوانین ساخت Bazel-like برای همه توسعه‌دهندگان Rust OS مفید است." -#~ msgid "Threads are all daemon threads, the main thread does not wait for them." +#~ msgid "" +#~ "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "‏Thread‌ها همه daemon thread هستند و main thread منتظر آنها نیست." #, fuzzy @@ -23492,44 +24189,45 @@ msgstr "" #~ msgid "" #~ "In this example, we have a race between a cat and a dog. " -#~ "`first_animal_to_finish_race` listens to both channels and will pick whichever " -#~ "arrives first. Since the dog takes 50ms, it wins against the cat that take " -#~ "500ms." +#~ "`first_animal_to_finish_race` listens to both channels and will pick " +#~ "whichever arrives first. Since the dog takes 50ms, it wins against the " +#~ "cat that take 500ms." #~ msgstr "" -#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` به هر " -#~ "دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند.بنابراین " -#~ "سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول می‌کشد تا پیروز " -#~ "شود." +#~ "در این مثال مسابقه‌ای بین گربه و سگ داریم. `first_animal_to_finish_race` " +#~ "به هر دو channelها گوش می‌دهد و هر کدام را زودتر وارد شوند را انتخاب می‌کند." +#~ "بنابراین سگ ۵۰ میلی‌ثانیه طول می‌کشد، در برابر گربه‌ای که ۵۰۰ میلی‌ثانیه طول " +#~ "می‌کشد تا پیروز شود." #~ msgid "" -#~ "You can use `oneshot` channels in this example as the channels are supposed to " -#~ "receive only one `send`." +#~ "You can use `oneshot` channels in this example as the channels are " +#~ "supposed to receive only one `send`." #~ msgstr "" -#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است کانال‌ها " -#~ "فقط یک `send` را دریافت کنند." +#~ "در این مثال می‌توانید از کانال‌های `oneshot` استفاده کنید زیرا قرار است " +#~ "کانال‌ها فقط یک `send` را دریافت کنند." #~ msgid "" -#~ "Try adding a deadline to the race, demonstrating selecting different sorts of " -#~ "futures." +#~ "Try adding a deadline to the race, demonstrating selecting different " +#~ "sorts of futures." #~ msgstr "" -#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را نشان " -#~ "دهید." +#~ "سعی کنید یک ضرب الاجل به رقابت اضافه کنید و انتخاب انواع مختلف future را " +#~ "نشان دهید." #~ msgid "" -#~ "Note that `select!` drops unmatched branches, which cancels their futures. It " -#~ "is easiest to use when every execution of `select!` creates new futures." +#~ "Note that `select!` drops unmatched branches, which cancels their " +#~ "futures. It is easiest to use when every execution of `select!` creates " +#~ "new futures." #~ msgstr "" -#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و future " -#~ "آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های جدیدی ایجاد " -#~ "می‌کند، راحت‌ترین استفاده از آن است." +#~ "توجه داشته باشید که `select!` شاخه‌های (branch) بی‌همتا را حذف می کند و " +#~ "future آنها را لغو می‌کند. زمانی که هر اجرای `select!` می‌تواند future‌های " +#~ "جدیدی ایجاد می‌کند، راحت‌ترین استفاده از آن است." #~ msgid "" -#~ "An alternative is to pass `&mut future` instead of the future itself, but this " -#~ "can lead to issues, further discussed in the pinning slide." +#~ "An alternative is to pass `&mut future` instead of the future itself, but " +#~ "this can lead to issues, further discussed in the pinning slide." #~ msgstr "" -#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده کنید، اما " -#~ "این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق (pinning slide) " -#~ "شده بحث شده است." +#~ "یک راه جایگزین این است که به جای خودِ future از `&mut future` استفاده " +#~ "کنید، اما این کار می‌تواند منجر به مسائلی شود که بیشتر در اسلاید سنجاق " +#~ "(pinning slide) شده بحث شده است." #~ msgid "1 hour and 20 minutes" #~ msgstr "۱ ساعت و ۲۰ دقیقه" @@ -23565,8 +24263,8 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " -#~ "اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #, fuzzy #~ msgid "`String` - a modifiable, owned string." @@ -23580,11 +24278,11 @@ msgstr "" #~ msgstr "بلاک‌ها و اسکوپ‌ها با پرانتزهای باز و بسته مشخص می‌شوند." #~ msgid "" -#~ "Line comments are started with `//`, block comments are delimited by `/* ... */" -#~ "`." +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." #~ msgstr "" -#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` مشخص " -#~ "می‌شوند." +#~ "کامنت‌های تک خطی با ‍`//` شروع می‌شوند و کامنت‌های چند خطی با `/* ... */` " +#~ "مشخص می‌شوند." #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "کلمات کلیدی مانند `if `و `while` به همان صورت عمل می‌کنند." @@ -23594,20 +24292,21 @@ msgstr "" #~ msgid "" #~ "In this case we break the outer loop after 3 iterations of the inner loop." -#~ msgstr "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." +#~ msgstr "" +#~ "در این مورد، پس از 3 تکرار حلقه `inner`، از حلقه `outer` خارج می‌شویم." #~ msgid "`[T; N]`" #~ msgstr "[T; N]" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "" -#~ "[20, 30, 40], [0; 3]" +#~ "[20, 30, 40], [0; " +#~ "3]" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "" -#~ "(), (T,), (T1, T2), …" +#~ "(), (T,), " +#~ "(T1, T2), …" #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "" @@ -23628,16 +24327,17 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "The empty tuple `()` is also known as the \"unit type\". It is both a type, " -#~ "and the only valid value of that type --- that is to say both the type and its " -#~ "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." +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its 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 "" -#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته می‌شود. " -#~ "این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم مقدار آن به " -#~ "صورت `()` بیان می‌شوند.رای مثال برای نشان دادن اینکه یک " -#~ "تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور که در اسلاید بعدی " -#~ "خواهیم دید. " +#~ "تاپل خالی `()` همچنین به عنوان «نوع یکه» شناخته " +#~ "می‌شود. این هم یک نوع است و هم تنها مقدار معتبر آن نوع - یعنی هم نوع و هم " +#~ "مقدار آن به صورت `()` بیان می‌شوند.رای مثال برای نشان " +#~ "دادن اینکه یک تابع یا عبارت هیچ مقدار برگشتی ندارد استفاده می‌شود، همانطور " +#~ "که در اسلاید بعدی خواهیم دید. " #, fuzzy #~ msgid "" @@ -23650,7 +24350,8 @@ msgstr "" #, fuzzy #~ msgid "You can destructure tuples and arrays by matching on their elements:" #~ msgstr "" -#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure کنید." +#~ "می توانید آرایه‌ها، تاپل‌ها و برش‌ها را با تطابق با عناصر آنها destructure " +#~ "کنید." #, fuzzy #~ msgid "Create a new array pattern using `_` to represent an element." @@ -23663,9 +24364,11 @@ msgstr "" #~ "Point out that how `..` will expand to account for different number of " #~ "elements." #~ msgstr "" -#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد یافت." +#~ "اشاره کنید که چگونه `..` برای در نظر گرفتن تعداد عناصر مختلف، گسترش خواهد " +#~ "یافت." -#~ msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" +#~ msgid "" +#~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "" #~ "مطابقت با انتهای آرایه رو با با الگوهای `[.., b]` و " #~ "`[a@..,b]` را نشان دهید." @@ -23675,8 +24378,9 @@ msgstr "" #, fuzzy #~ msgid "" -#~ "Static and constant variables are two different ways to create globally-scoped " -#~ "values that cannot be moved or reallocated during the execution of the program." +#~ "Static and constant variables are two different ways to create globally-" +#~ "scoped values that cannot be moved or reallocated during the execution of " +#~ "the program." #~ msgstr "" #~ "متغیرهای `ثابت` و `ایستا` دو روش متفاوت برای ایجاد مقادیر با اسکوپ گلوبال " #~ "(قابل دسترس در کل برنامه) هستند که نمی‌توانند در طول اجرای برنامه منتقل یا " @@ -23712,16 +24416,16 @@ msgstr "" #, fuzzy #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "" -#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در Rust " -#~ "اطلاعات بیشتری کسب کنید." +#~ "به [تطبیق الگو](../pattern-matching.md) مراجعه کنید تا در مورد الگوها در " +#~ "Rust اطلاعات بیشتری کسب کنید." #~ msgid "Rust terminology:" #~ msgstr "اصطلاحات راست:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "" -#~ "&str یک مرجع غیرقابل تغییر " -#~ "به یک برش از رشته‌ است." +#~ "&str یک مرجع غیرقابل " +#~ "تغییر به یک برش از رشته‌ است." #~ msgid "`String` a mutable string buffer." #~ msgstr "`String` یک بافر رشته‌ای قابل تغییر است." @@ -23949,12 +24653,13 @@ msgstr "" #~ msgid "Concurrency Afternoon" #~ msgstr "همزمانی: عصر" -#~ msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." +#~ msgid "" +#~ "Day 1: Basic Rust, syntax, control flow, creating and consuming values." #~ msgstr "روز 1: Rust مقدمات, سینتکس, کنترل جریان, ساخت و مصرف مقادیر." #~ msgid "" -#~ "Day 2: Memory management, ownership, compound data types, and the standard " -#~ "library." +#~ "Day 2: Memory management, ownership, compound data types, and the " +#~ "standard library." #~ msgstr "روز 2: مدیریت حافظه, مالکیت, انواع داده مرکب و کتابخانه استاندارد." #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." @@ -23987,28 +24692,30 @@ msgstr "" #~ "```" #~ msgid "" -#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " -#~ "`continue`." +#~ "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, " +#~ "and `continue`." #~ msgstr "" #~ "سازوکارهای کنترل جریان: `if`, `if let`, `while`, `while let`, `break` و " #~ "`continue`. " #~ msgid "" #~ "The idea for the first day is to show _just enough_ of Rust to be able to " -#~ "speak about the famous borrow checker. The way Rust handles memory is a major " -#~ "feature and we should show students this right away." +#~ "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 یک ویژگی مهم است و باید آن را بلافاصله به " +#~ "دانشجویان نشان دهیم." #~ msgid "" -#~ "If you're teaching this in a classroom, this is a good place to go over the " -#~ "schedule. We suggest splitting the day into two parts (following the slides):" +#~ "If you're teaching this in a classroom, this is a good place to go over " +#~ "the schedule. We suggest splitting the day into two parts (following the " +#~ "slides):" #~ msgstr "" -#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در کلاس درس " -#~ "می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم کنید(اسلاید‌ها را دنبال " -#~ "کنید)" +#~ "اینجا مکان مناسبی برای یک برنامه ریزی است.,اگر که شما این موضوع را در " +#~ "کلاس درس می دهیدما پیشنهاد می کنیم که روز را به دو قسمت تقسیم " +#~ "کنید(اسلاید‌ها را دنبال کنید)" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "صبح: ۹:۰۰ تا ۱۲:۰۰" @@ -24020,8 +24727,8 @@ msgstr "" #~ "You can of course adjust this as necessary. Please make sure to include " #~ "breaks, we recommend a break every hour!" #~ msgstr "" -#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها را " -#~ "نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" +#~ "البته می‌توانید این را بر‌حسب نیاز تنظیم کنید. لطفا مطمئن شوید که استراحت‌ها " +#~ "را نیز درنظر بگیرید، ما توصیه می‌کنیم هر ساعت یک استراحت داشته باشید!" #~ msgid "Here is a small example program in Rust:" #~ msgstr "یک برنامه کوچیک در Rust:" @@ -24060,54 +24767,56 @@ msgstr "" #~ "```" #~ msgid "" -#~ "The code implements the Collatz conjecture: it is believed that the loop will " -#~ "always end, but this is not yet proved. Edit the code and play with different " -#~ "inputs." +#~ "The code implements the Collatz conjecture: it is believed that the loop " +#~ "will always end, but this is not yet proved. Edit the code and play with " +#~ "different inputs." #~ msgstr "" -#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر این " -#~ "است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را ویرایش کنید و " -#~ "با ورودی‌های مختلف بازی کنید." +#~ "این کد حدس کولاتز (`Collatz conjecture`) را پیاده سازی می کند: اعتقاد بر " +#~ "این است که حلقه همیشه تمام می شود، اما این هنوز ثابت نشده است. کد را " +#~ "ویرایش کنید و با ورودی‌های مختلف بازی کنید." #~ msgid "" -#~ "Explain that all variables are statically typed. Try removing `i32` to trigger " -#~ "type inference. Try with `i8` instead and trigger a runtime integer overflow." +#~ "Explain that all variables are statically typed. Try removing `i32` to " +#~ "trigger type inference. Try with `i8` instead and trigger a runtime " +#~ "integer overflow." #~ msgstr "" -#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف کنید تا " -#~ "استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز (`overflow`) عدد صحیح در " -#~ "زمان اجرا را فعال کنید.." +#~ "توضیح دهید که همه متغیرها از نوع استاتیک هستند. سعی کنید `i32` را حذف " +#~ "کنید تا استنتاج نوع را فعال کنید. با `i8` امتحان کنید و سرریز " +#~ "(`overflow`) عدد صحیح در زمان اجرا را فعال کنید.." #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." -#~ msgstr "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." +#~ msgstr "" +#~ "`let mut x` را به `let x` تغییر دهید، و خطای کامپایلر را بررسی کنید." #~ msgid "" -#~ "Show how `print!` gives a compilation error if the arguments don't match the " -#~ "format string." +#~ "Show how `print!` gives a compilation error if the arguments don't match " +#~ "the format string." #~ msgstr "" -#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق آرگومان‌ها " -#~ "با قالب رشته (`format string`) ، خطای کامپایل می دهد." +#~ "نشان دهید که چگونه `print!` در صورت عدم تطابق " +#~ "آرگومان‌ها با قالب رشته (`format string`) ، خطای کامپایل می دهد." #~ 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 "" -#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر واحد " -#~ "است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." +#~ "نشان دهید که چگونه در صورت تمایل به چاپ عبارتی که پیچیده‌تر از یک متغیر " +#~ "واحد است، باید از ‍`{}` به عنوان جایگزین استفاده کنید." #~ msgid "" -#~ "Show the students the standard library, show them how to search for `std::fmt` " -#~ "which has the rules of the formatting mini-language. It's important that the " -#~ "students become familiar with searching in the standard library." +#~ "Show the students the standard library, show them how to search for `std::" +#~ "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` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که دانشجویان " -#~ "با جستجو در کتابخانه استاندارد آشنا شوند." +#~ "کتابخانه استاندارد را به دانشجویان نشان دهید، به آنها نشان دهید که چگونه " +#~ "`std::fmt` را که قوانین زبان-کوچک قالب‌بندی را دارد جستجو کنند. مهم است که " +#~ "دانشجویان با جستجو در کتابخانه استاندارد آشنا شوند." #~ msgid "" -#~ "In a shell `rustup doc std::fmt` will open a browser on the local std::fmt " -#~ "documentation" +#~ "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` را توی مرورگر باز کند." +#~ "در یک خط‌‌‌‌فرمان (`shell`) دستور `rustup doc std::fmt` را بزنید تا مستندات " +#~ "محلی ‍`std::fmt` را توی مرورگر باز کند." #~ msgid "Compile time memory safety." #~ msgstr "ایمنی حافظه در زمان کامپایل." @@ -24119,7 +24828,8 @@ msgstr "" #~ msgstr "ویژگی‌های زبانی مدرن." #~ msgid "Let's consider the following \"minimum wrong example\" program in C:" -#~ msgstr "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" +#~ msgstr "" +#~ "بیایید برنامه «نمونه ای از حداقل اشتباهات» زیر را در C در نظر بگیریم:" #~ msgid "How many bugs do you spot?" #~ msgstr "چند باگ پیدا می کنید؟" @@ -24145,8 +24855,8 @@ msgstr "" #~ msgstr "فراموشی `break` در `switch` (خط ۳۲)" #~ msgid "" -#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " -#~ "(line 29)" +#~ "Forgotten NUL-termination of the `buf` string, leading to a buffer " +#~ "overflow (line 29)" #~ msgstr "فراموشی خاتمه `NUL` رشته `buf`، منجر به سرریز بافر (خط ۲۹) " #~ msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" @@ -24163,12 +24873,12 @@ msgstr "" #~ msgid "" #~ "_Shouldn't these bugs be obvious even for a C compiler?_ \n" -#~ "No, surprisingly this code compiles warning-free at the default warning level, " -#~ "even in the latest GCC version (13.2 as of writing)." +#~ "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 (۱۳.۲ این کتاب در زمان نوشتن)." +#~ "نه، به طور شگفت انگیزی این کد بدون هیچ هشدار در سطح هشدار(`warning`) پیش " +#~ "فرض کامپایل می شود، حتی در آخرین نسخه GCC (۱۳.۲ این کتاب در زمان نوشتن)." #~ msgid "" #~ "_Isn't this a highly unrealistic example?_ \n" @@ -24176,32 +24886,33 @@ msgstr "" #~ "vulnerabilities in the past. Some examples:" #~ msgstr "" #~ "_آیا این یک مثال خیلی غیر واقعی نیست؟_ \n" -#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی شده‌اند. چند " -#~ "نمونه:" +#~ "ابدا نه، این نوع از باگ‌ها در گذشته منجر به آسیب‌پذیری‌های امنیتی جدی " +#~ "شده‌اند. چند نمونه:" #~ msgid "" #~ "Assignment `=` instead of equality comparison `==`: [The Linux Backdoor " -#~ "Attempt of 2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-" -#~ "attempt-of-2003)" +#~ "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)" +#~ "تخصیص `=` به جای مقایسه برابر بودن `==`: [The Linux Backdoor Attempt of " +#~ "2003](https://freedom-to-tinker.com/2013/10/09/the-linux-backdoor-attempt-" +#~ "of-2003)" #~ 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)" +#~ "فراموشی پرانتز در `if` چند خطی: [The Apple goto fail vulnerability]" +#~ "(https://dwheeler.com/essays/apple-goto-fail.html)" #~ msgid "" -#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo](https://" -#~ "nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-break-that-" -#~ "broke-sudo)" +#~ "Forgotten `break` in a `switch` statement: [The break that broke sudo]" +#~ "(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) " +#~ "فراموشی گذاشتن `break` در `switch`: [The break that broke " +#~ "sudo](https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-" +#~ "hole-the-break-that-broke-sudo) " #~ msgid "" #~ "_How is Rust any better here?_ \n" @@ -24223,122 +24934,127 @@ msgstr "" #~ msgstr "همه شرط‌های `if` نیاز به پرانتز دارند." #~ msgid "" -#~ "`match` (as the Rust equivalent to `switch`) does not fall-through, hence you " -#~ "can't accidentally forget a `break`." +#~ "`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 را " #~ "فراموش کنید." #~ msgid "Buffer slices carry their size and don't rely on a NUL terminator." -#~ msgstr "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." +#~ msgstr "" +#~ "برش‌های بافر اندازه خود را حمل می‌کنند و به خاتمه دهنده `NUL` متکی نیستند." #~ msgid "" -#~ "Heap-allocated memory is freed via the `Drop` trait when the corresponding " -#~ "`Box` leaves the scope." +#~ "Heap-allocated memory is freed via the `Drop` trait when the " +#~ "corresponding `Box` leaves the scope." #~ msgstr "" -#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که `Box` " -#~ "مورد نظر اسکوپ مربوطه را ترک کند.‍" +#~ "حافظه اختصاص داده شده به پشته از طریق ویژگی `Drop` زمانی آزاد می‌شود که " +#~ "`Box` مورد نظر اسکوپ مربوطه را ترک کند.‍" #~ msgid "" -#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` method of " -#~ "a slice." +#~ "Out-of-bounds accesses cause a panic or can be checked via the `get` " +#~ "method of a slice." #~ msgstr "" -#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد get " -#~ "یک برش (`slice`) بررسی کرد." +#~ "دسترسی‌های خارج از محدوده باعث پانیک می‌شوند یا می‌توان آنها را از طریق متد " +#~ "get یک برش (`slice`) بررسی کرد." #~ msgid "`match` mandates that all cases are handled." #~ msgstr "دستور `match` الزام می‌کند که حالات بررسی شوند." #~ msgid "" -#~ "Fallible Rust functions return `Result` values that need to be unwrapped and " -#~ "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]`." +#~ "Fallible Rust functions return `Result` values that need to be unwrapped " +#~ "and 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]` علامت گذاری شده است را فراموش کنید، " -#~ "کامپایلر هشدار می‌دهد." +#~ "توابع خطا پذیر در زبان Rust مقدار Result را برمی‌گردانند که باید باز شوند " +#~ "و در نتیجه برای موفقیت بررسی شوند. علاوه بر این، اگر بررسی مقدار برگشتی " +#~ "تابعی که با `#[must_use]` علامت گذاری شده است را " +#~ "فراموش کنید، کامپایلر هشدار می‌دهد." #~ msgid "Static memory management at compile time:" #~ msgstr "مدیریت حافظه ایستا در زمان کامپایل:" #~ msgid "No memory leaks (_mostly_, see notes)." -#~ msgstr "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." +#~ msgstr "" +#~ "هیچ نشت حافظه‌ای وجود ندارد (_به طور کلی_، به یادداشت‌ها مراجعه کنید)." -#~ msgid "It is possible to produce memory leaks in (safe) Rust. Some examples are:" +#~ msgid "" +#~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" #~ "ایجاد نشت حافظه در Rust (ایمن) امکان‌پذیر است. برخی از نمونه‌ها عبارتند از:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." -#~ "html#method.leak) to leak a pointer. A use of this could be to get runtime-" -#~ "initialized and runtime-sized static variables" +#~ "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) برای نشت دادن یک اشاره‌گر استفاده کنید.یک " -#~ "مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای ایستا با مقداردهی " -#~ "اولیه و اندازه در زمان اجرا باشد." +#~ "می توانید از [`Box::leak`](https://doc.rust-lang.org/std/" +#~ "boxed/struct.Box.html#method.leak) برای نشت دادن یک اشاره‌گر " +#~ "استفاده کنید.یک مورد استفاده از این کار می‌تواند برای بدست آوردن متغیرهای " +#~ "ایستا با مقداردهی اولیه و اندازه در زمان اجرا باشد." #~ msgid "" -#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget." -#~ "html) to make the compiler \"forget\" about a value (meaning the destructor is " -#~ "never run)." +#~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." +#~ "forget.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`) هرگز اجرا نمی‌شود)." +#~ "می توانید از [`std::mem::forget`](https://doc.rust-lang.org/" +#~ "std/mem/fn.forget.html) استفاده کنید تا کامپایلر «مقدار» را " +#~ "فراموش کند (به این معنا که تابع مخرب (`destructor`) هرگز اجرا نمی‌شود)." #~ msgid "" -#~ "You can also accidentally create a [reference cycle](https://doc.rust-lang.org/" -#~ "book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." +#~ "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` ایجاد کنید." #~ msgid "" -#~ "In fact, some will consider infinitely populating a collection a memory leak " -#~ "and Rust does not protect from those." +#~ "In fact, some will consider infinitely populating a collection a memory " +#~ "leak and Rust does not protect from those." #~ msgstr "" -#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه در نظر " -#~ "می‌گیرند و Rust از آن محافظت نمی‌کند." +#~ "در واقع، برخی از افراد پر کردن بی نهایت یک مجموعه را به عنوان نشت حافظه " +#~ "در نظر می‌گیرند و Rust از آن محافظت نمی‌کند." #~ msgid "" -#~ "For the purpose of this course, \"No memory leaks\" should be understood as " -#~ "\"Pretty much no _accidental_ memory leaks\"." +#~ "For the purpose of this course, \"No memory leaks\" should be understood " +#~ "as \"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" #~ "برای این دوره، «هیچ نشت حافظه ای» باید به عنوان «تقریبا هیچ نشت حافظه " #~ "_تصادفی_» درنظر گرفته شود." #~ msgid "" -#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang." -#~ "org/rustc/codegen-options/index.html#overflow-checks) compile-time flag. If " -#~ "enabled, the program will panic (a controlled crash of the program), otherwise " -#~ "you get wrap-around semantics. By default, you get panics in debug mode " -#~ "(`cargo build`) and wrap-around in release mode (`cargo build --release`)." +#~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" +#~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " +#~ "flag. If enabled, the program will panic (a controlled crash of the " +#~ "program), otherwise you get wrap-around semantics. By default, you get " +#~ "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 خواهید داشت." +#~ "سرریز عدد صحیح از طریق پرچم زمان کامپایل [`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 خواهید داشت." #~ msgid "" -#~ "Bounds checking cannot be disabled with a compiler flag. It can also not be " -#~ "disabled directly with the `unsafe` keyword. However, `unsafe` allows you to " -#~ "call functions such as `slice::get_unchecked` which does not do bounds " -#~ "checking." +#~ "Bounds checking cannot be disabled with a compiler flag. It can also not " +#~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " +#~ "you to call functions such as `slice::get_unchecked` which does not do " +#~ "bounds checking." #~ msgstr "" -#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را به طور " -#~ "مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به شما امکان " -#~ "می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی محدوده را " -#~ "انجام نمی‌دهد. " +#~ "بررسی محدوده نمی‌تواند با پرچم کامپایل غیرفعال شود. همچنین نمی‌توان آن را " +#~ "به طور مستقیم با کلمه کلیدی `unsafe` غیرفعال کرد. با این حال، `unsafe` به " +#~ "شما امکان می‌دهد توابعی مانند `slice::get_unchecked` را صدا بزنید که بررسی " +#~ "محدوده را انجام نمی‌دهد. " #~ msgid "Rust is built with all the experience gained in the last decades." #~ msgstr "" -#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده ساخته شده " -#~ "است." +#~ "زبان Rust با استفاده از تمام تجربیاتی که در دهه‌های گذشته به دست آمده " +#~ "ساخته شده است." #~ msgid "Language Features" #~ msgstr "ویژگی‌های زبان" @@ -24347,51 +25063,51 @@ msgstr "" #~ msgstr "ابزارها" #~ msgid "" -#~ "Zero-cost abstractions, similar to C++, means that you don't have to 'pay' for " -#~ "higher-level programming constructs with memory or CPU. For example, writing a " -#~ "loop using `for` should result in roughly the same low level instructions as " -#~ "using the `.iter().fold()` construct." +#~ "Zero-cost abstractions, similar to C++, means that you don't have to " +#~ "'pay' for higher-level programming constructs with memory or CPU. For " +#~ "example, 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()` منجر شود." +#~ "انتزاع‌های بدون هزینه، مشابه C++، به این معنی است که " +#~ "شما مجبور نیستید برای ساختارهای برنامه‌نویسی سطح بالاتر با حافظه یا CPU " +#~ "«هزینه»‌ای پرداخت کنید. به عنوان مثال، نوشتن یک حلقه با استفاده از for " +#~ "باید تقریباً به همان دستورالعمل‌های سطح پایین به عنوان استفاده از ساختار " +#~ "`iter().fold()` منجر شود." #~ msgid "" -#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', also " -#~ "known as 'sum types', which allow the type system to express things like " -#~ "`Option` and `Result`." +#~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " +#~ "also 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` را بیان کند." #~ msgid "" #~ "Remind people to read the errors --- many developers have gotten used to " #~ "ignore lengthy compiler output. The Rust compiler is significantly more " -#~ "talkative than other compilers. It will often provide you with _actionable_ " -#~ "feedback, ready to copy-paste into your code." +#~ "talkative than other compilers. It will often provide you with " +#~ "_actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" #~ "به افراد یادآوری کنید که خطاها را بخوانند --- بسیاری از توسعه دهندگان به " -#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور قابل " -#~ "توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را در اختیار " -#~ "شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." +#~ "نادیده گرفتن خروجی طولانی کامپایلر عادت کرده‌اند. کامپایلر Rust به طور " +#~ "قابل توجه‌ای پرحرف‌تر از سایر کامپایلرها است. اغلب بازخوردهای _عملیاتی_ را " +#~ "در اختیار شما قرار می‌دهد که آماده کپی و پیست کردن در کد شما هستند." #~ msgid "" -#~ "The Rust standard library is small compared to languages like Java, Python, " -#~ "and Go. Rust does not come with several things you might consider standard and " -#~ "essential:" +#~ "The Rust standard library is small compared to languages like Java, " +#~ "Python, and Go. Rust does not come with several things you might consider " +#~ "standard and essential:" #~ msgstr "" -#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go کوچک " -#~ "است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری در نظر " -#~ "بگیرید همراه نیست:" +#~ "کتابخانه استاندارد Rust در مقایسه با زبان‌هایی مانند Java، Python و Go " +#~ "کوچک است. زبان Rust با چندین چیز که ممکن است آنها را استاندارد و ضروری " +#~ "در نظر بگیرید همراه نیست:" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "" -#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://docs.rs/" -#~ "rand/) را ببینید." +#~ "یک تولید‌کننده عدد تصادفی، اما [کتابخانه `rand`](https://" +#~ "docs.rs/rand/) را ببینید." #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" @@ -24400,44 +25116,44 @@ msgstr "" #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" -#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs.rs/" -#~ "serde_json/) را ببینید." +#~ "پشتیبانی از JSON، اما [کتابخانه `serde_json`](https://docs." +#~ "rs/serde_json/) را ببینید." #~ msgid "" -#~ "The reasoning behind this is that functionality in the standard library cannot " -#~ "go away, so it has to be very stable. For the examples above, the Rust " -#~ "community is still working on finding the best solution --- and perhaps there " -#~ "isn't a single \"best solution\" for some of these things." +#~ "The reasoning behind this is that functionality in the standard library " +#~ "cannot go away, so it has to be very stable. For the examples above, the " +#~ "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 هنوز " +#~ "در تلاش است تا بهترین راه حل را پیدا کند --- و شاید برای برخی از این " +#~ "موارد، یک «بهترین راه حل» وجود نداشته باشد. " #~ msgid "" -#~ "Rust comes with a built-in package manager in the form of Cargo and this makes " -#~ "it trivial to download and compile third-party crates. A consequence of this " -#~ "is that the standard library can be smaller." +#~ "Rust comes with a built-in package manager in the form of Cargo and this " +#~ "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 شخص ثالث را بسیار آسان می کند. یکی از " -#~ "پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." +#~ "زبان Rust همراه با یک مدیر بسته درون-ساختی به اسم Cargo ارائه می شود و " +#~ "این امر دانلود و کامپایل کردن crates شخص ثالث را بسیار آسان می کند. یکی " +#~ "از پیامدهای این امر این است که کتابخانه استاندارد می تواند کوچکتر باشد." #~ msgid "" -#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates to find a " -#~ "good and trusted one." +#~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " +#~ "to find a good and trusted one." #~ msgstr "" #~ "یافتن crates خوب شخص ثالث می تواند مشکل باشد. سایت‌هایی مانند با اجازه مقایسه معیارهای سلامت برای crates به " -#~ "شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." +#~ "dir=ltr> با اجازه مقایسه معیارهای سلامت برای " +#~ "crates به شما کمک می‌کنند تا یک مورد خوب و قابل اعتماد را پیدا کنید." #~ 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‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." +#~ "[rust-analyzer](https://rust-analyzer.github.io/): یک پیاده سازی LSP است " +#~ "که در IDE‌ها و ویرایشگرهای متن اصلی استفاده می‌شود." #~ msgid "`\"foo\"`, `\"two\\nlines\"`" #~ msgstr "" @@ -24451,12 +25167,12 @@ msgstr "" #~ "We must dereference `ref_x` when assigning to it, similar to C and C++ " #~ "pointers." #~ msgstr "" -#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه اشاره‌گرهای " -#~ "C و C++." +#~ "باید هنگام تعریف `ref_x` ارجاع دهی شود، مشابه " +#~ "اشاره‌گرهای C و C++." #~ msgid "" -#~ "References that are declared as `mut` can be bound to different values over " -#~ "their lifetime." +#~ "References that are declared as `mut` can be bound to different values " +#~ "over their lifetime." #~ msgstr "" #~ "مراجع‌ای که به‌عنوان `mut` تعریف می‌شوند، می‌توانند در طول عمر خود به مقادیر " #~ "مختلفی ارجاع داده شوند." @@ -24468,8 +25184,8 @@ msgstr "" #~ "Rust is tracking the lifetimes of all references to ensure they live long " #~ "enough." #~ msgstr "" -#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, آنها را " -#~ "رهگیری می‌کند." +#~ "راست برای اینکه اطمینان حاصل کند طول‌عمر همه مراجع به اندازه کافی است, " +#~ "آنها را رهگیری می‌کند." #~ msgid "`String` vs `str`" #~ msgstr "`String` در مقابل `str` " @@ -24478,94 +25194,100 @@ msgstr "" #~ "You can borrow `&str` slices from `String` via `&` and optionally range " #~ "selection." #~ msgstr "" -#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` و " -#~ "انتخاب محدوده به صورت اختیاری، قرض بگیرید." +#~ "شما می‌توانید برش‌های &str را از `String` از طریق `&` " +#~ "و انتخاب محدوده به صورت اختیاری، قرض بگیرید." #~ 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):" #~ msgid "" -#~ "We refer in `main` to a function written below. Neither forward declarations " -#~ "nor headers are necessary. " +#~ "We refer in `main` to a function written below. Neither forward " +#~ "declarations nor headers are necessary. " #~ msgstr "" -#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است اشاره " -#~ "می‌کنیم. نیازی به اعلان از قبل تابع `main` یا در بخش هدر " -#~ "نیست. " +#~ "ما در `main` به یک تابعی که در زیرش نوشته شده است " +#~ "اشاره می‌کنیم. نیازی به اعلان از قبل تابع `main` یا " +#~ "در بخش هدر نیست. " #~ msgid "" -#~ "The range expression in the `for` loop in `print_fizzbuzz_to()` contains `=n`, " -#~ "which causes it to include the upper bound." +#~ "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` است که " -#~ "باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." +#~ "dir=ltr>`print_fizzbuzz_to()` حاوی `=n` است " +#~ "که باعث می‌شود محدوده حد بالا را هم شامل شود (آخرین عنصر)." -#~ msgid "All language items in Rust can be documented using special `///` syntax." +#~ msgid "" +#~ "All language items in Rust can be documented using special `///` syntax." #~ msgstr "" -#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند کرد." +#~ "همه موارد زبان در راست را می‌توان با استفاده از سینتکس ویژه `///` مستند " +#~ "کرد." #~ msgid "" -#~ "This course does not include rustdoc on slides, just to save space, but in " -#~ "real code they should be present." +#~ "This course does not include rustdoc on slides, just to save space, but " +#~ "in real code they should be present." #~ msgstr "" -#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، اما " -#~ "در کدهای دنیای واقعی باید وجود داشته باشد." +#~ "این دوره برای صرفه‌جویی در نوشتار متنی rustdoc را در اسلایدها قرار نمی‌دهد، " +#~ "اما در کدهای دنیای واقعی باید وجود داشته باشد." #~ msgid "" -#~ "Inner doc comments are discussed later (in the page on modules) and need not " -#~ "be addressed here." +#~ "Inner doc comments are discussed later (in the page on modules) and need " +#~ "not be addressed here." #~ msgstr "" #~ "کامنت های داخل کد در بخش‌های بعدی (در صفحه مربوط به ماژول‌ها) مورد بحث قرار " #~ "می‌گیرد و نیازی به پرداختن به آنها در اینجا نیست." #~ msgid "" #~ "Rustdoc comments can contain code snippets that we can run and test using " -#~ "`cargo test`. We will discuss these tests in the [Testing section](../testing/" -#~ "doc-tests.html)." +#~ "`cargo test`. We will discuss these tests in the [Testing section](../" +#~ "testing/doc-tests.html)." #~ msgstr "" #~ "کامنت های rustdoc می‌توانند حاوی قطعه کدهایی باشند که می‌توانیم آنها را با " -#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در [بخش تست " -#~ "نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم کرد." +#~ "استفاده از `cargo test` اجرا و تست کنیم. ما در " +#~ "[بخش تست نویسی](../testing/doc-tests.html) در مورد این تست‌ها بحث خواهیم " +#~ "کرد." #~ msgid "" -#~ "Methods are functions associated with a type. The `self` argument of a method " -#~ "is an instance of the type it is associated with:" +#~ "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` یک متد، نمونه‌ای " +#~ "از نوعی است که با آن مرتبط است:" #~ msgid "" -#~ "We will look much more at methods in today's exercise and in tomorrow's class." +#~ "We will look much more at methods in today's exercise and in tomorrow's " +#~ "class." #~ msgstr "در تمرین امروز و کلاس فردا بیشتر به متدها می‌پردازیم." -#~ msgid "Add a static method called `Rectangle::new` and call this from `main`:" +#~ msgid "" +#~ "Add a static method called `Rectangle::new` and call this from `main`:" #~ msgstr "" -#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و آن را " -#~ "از `main` فراخوانی کنید:" +#~ "یک متد استاتیک به نام `Rectangle::new` اضافه کنید و " +#~ "آن را از `main` فراخوانی کنید:" #~ msgid "" -#~ "While _technically_, Rust does not have custom constructors, static methods " -#~ "are commonly used to initialize structs (but don't have to). The actual " -#~ "constructor, `Rectangle { width, height }`, could be called directly. See the " -#~ "[Rustnomicon](https://doc.rust-lang.org/nomicon/constructors.html)." +#~ "While _technically_, Rust does not have custom constructors, static " +#~ "methods are commonly used to initialize structs (but don't have to). The " +#~ "actual 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) را ببینید." #~ msgid "" #~ "Add a `Rectangle::square(width: u32)` constructor to illustrate that such " #~ "static methods can take arbitrary parameters." #~ msgstr "" -#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه بگیرند، " -#~ "با ارگمان‌های یک سازنده `Rectangle::square(width: u32)` " -#~ "اضافه کنید." +#~ "برای نشان دادن اینکه چنین متدهای استاتیک می‌توانند آرگومان‌های دلخواه " +#~ "بگیرند، با ارگمان‌های یک سازنده `Rectangle::square(width: " +#~ "u32)` اضافه کنید." #~ msgid "Function Overloading" #~ msgstr "سربارگذاری تابع (Function Overloading)" @@ -24589,13 +25311,13 @@ msgstr "" #~ msgstr "با این حال، پارامترهای تابع می‌توانند جنریک باشند:" #~ msgid "" -#~ "When using generics, the standard library's `Into` can provide a kind of " -#~ "limited polymorphism on argument types. We will see more details in a later " -#~ "section." +#~ "When using generics, the standard library's `Into` can provide a kind " +#~ "of limited polymorphism on argument types. We will see more details in a " +#~ "later section." #~ msgstr "" -#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه استاندارد " -#~ "می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها فراهم کند. جزئیات " -#~ "بیشتر را در بخش‌های بعدی خواهیم دید." +#~ "هنگام استفاده از جنریک‌ها، `Into` کتابخانه " +#~ "استاندارد می‌تواند نوعی چندشکلی (polymorphism) محدود در انواع آرگومان‌ها " +#~ "فراهم کند. جزئیات بیشتر را در بخش‌های بعدی خواهیم دید." #~ msgid "Day 1: Morning Exercises" #~ msgstr "روز اول: تمرین‌های صبح" @@ -24614,95 +25336,98 @@ msgstr "" #~ msgid "" #~ "Use a local Rust installation, if possible. This way you can get auto-" -#~ "completion in your editor. See the page about [Using Cargo](../../cargo.md) " -#~ "for details on installing Rust." +#~ "completion in your editor. See the page about [Using Cargo](../../cargo." +#~ "md) for details on installing Rust." #~ msgstr "" -#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از تکمیل " -#~ "خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب راست، صفحه " -#~ "مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." +#~ "در صورت امکان، از نصب محلی راست استفاده کنید. از این طریق می‌توانید از " +#~ "تکمیل خودکار در ویرایشگر خود استفاده کنید. برای جزئیات بیشتر در مورد نصب " +#~ "راست، صفحه مربوط به [استفاده از کارگو](../../cargo.md) را ببینید." #~ msgid "Alternatively, use the Rust Playground." #~ msgstr "در غیر این صورت از `Rust Playground` استفاده کنید." #~ msgid "" -#~ "The code snippets are not editable on purpose: the inline code snippets lose " -#~ "their state if you navigate away from the page." +#~ "The code snippets are not editable on purpose: the inline code snippets " +#~ "lose their state if you navigate away from the page." #~ msgstr "" -#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه خارج " -#~ "شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته نمی‌شود." +#~ "قطعه کدها به صورت عمدی قابل ویرایش نیستند: قطعه کدهای درون‌خطی اگر از صفحه " +#~ "خارج شوید، به حالت پیش‌فرض بازنشانی می‌شوند و تغییرات شما درنظر گرفته " +#~ "نمی‌شود." #~ msgid "" #~ "Rust will not automatically apply _implicit conversions_ between types " #~ "([unlike C++](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)). You can see this in a program like this:" #~ msgstr "" -#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان `C++`](https://en.cppreference.com/w/cpp/language/" +#~ "راست به طور خودکار تبدیل‌های صریح بین انواع را اعمال نمی‌کند ([برخلاف زبان " +#~ "`C++`](https://en.cppreference.com/w/cpp/language/" #~ "implicit_conversion)).به عنوان مثال میتوانید این را در یک برنامه ببینید:" #~ msgid "" -#~ "The Rust integer types all implement the [`From`](https://doc.rust-lang.org/" -#~ "std/convert/trait.From.html) and [`Into`](https://doc.rust-lang.org/std/" -#~ "convert/trait.Into.html) traits to let us convert between them. The `From` " -#~ "trait has a single `from()` method and similarly, the `Into` trait has a " -#~ "single `into()` method. Implementing these traits is how a type expresses that " -#~ "it can be converted into another type." +#~ "The Rust integer types all implement the [`From`](https://doc.rust-" +#~ "lang.org/std/convert/trait.From.html) and [`Into`](https://doc.rust-" +#~ "lang.org/std/convert/trait.Into.html) traits to let us convert between " +#~ "them. The `From` trait has a single `from()` method and similarly, the " +#~ "`Into` 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` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع بیان " -#~ "می‌کند که می‌تواند به نوع دیگری تبدیل شود." +#~ "dir=ltr>`From`](https://doc.rust-lang.org/std/convert/trait." +#~ "From.html) را پیاده‌سازی می‌کنند تا به ما امکان تبدیل بین انواع عددی صحیح " +#~ "را بدهند. با پیاده سازی ویژگی `From` همه انواع به " +#~ "صورت مشترک یک متد `from()` را دارند. با پیاده‌سازی " +#~ "تریت `Into` همه انواع یک متد مشترک به اسم `into()` را دارند. پیاده‌سازی این تریت‌ها راهی است که یک نوع " +#~ "بیان می‌کند که می‌تواند به نوع دیگری تبدیل شود." #~ msgid "" -#~ "The standard library has an implementation of `From for i16`, which means " -#~ "that we can convert a variable `x` of type `i8` to an `i16` by calling `i16::" -#~ "from(x)`. Or, simpler, with `x.into()`, because `From for i16` " -#~ "implementation automatically create an implementation of `Into for i8`." +#~ "The standard library has an implementation of `From for i16`, which " +#~ "means that we can convert a variable `x` of type `i8` to an `i16` by " +#~ "calling `i16::from(x)`. Or, simpler, with `x.into()`, because `From " +#~ "for i16` implementation automatically create an implementation of " +#~ "`Into for i8`." #~ msgstr "" -#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` دارد " -#~ "`i16` دارد، به این معنی که می‌توانیم یک متغیر `x` از نوع " -#~ "`i8` را با فراخوانی `i16::from(x)` به یک `i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x." -#~ "into()` ، زیرا پیاده‌سازی `From` برای نوع " -#~ "`i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." +#~ "کتابخانه استاندارد یک پیاده‌سازی `From for i16` " +#~ "دارد `i16` دارد، به این معنی که می‌توانیم یک متغیر " +#~ "`x` از نوع `i8` را با فراخوانی `i16::from(x)` به یک " +#~ "`i16` تبدیل کنیم. یا به شیوه ساده‌تر، با `x.into()` ، زیرا پیاده‌سازی `From` برای نوع `i16` به طور خودکار پیاده‌سازی`Into` برای نوع `i8` را ایجاد می‌کند." #~ msgid "" -#~ "The same applies for your own `From` implementations for your own types, so it " -#~ "is sufficient to only implement `From` to get a respective `Into` " +#~ "The same applies for your own `From` implementations for your own types, " +#~ "so it is sufficient to only implement `From` to get a respective `Into` " #~ "implementation automatically." #~ msgstr "" #~ "همین امر برای پیاده‌سازی‌های `From` خودتان برای انواع " #~ "خودتان نیز صدق می‌کند، بنابراین کافیست فقط `From` را " -#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` مربوطه " -#~ "را دریافت کنید." +#~ "پیاده‌سازی کنید تا به طور خودکار پیاده‌سازی `Into` " +#~ "مربوطه را دریافت کنید." #~ msgid "Execute the above program and look at the compiler error." #~ msgstr "برنامه فوق را اجرا و به خطای کامپایلر نگاه کنید." #~ msgid "Update the code above to use `into()` to do the conversion." #~ msgstr "" -#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` برای " -#~ "انجام تبدیل استفاده شود." +#~ "کد بالا را به گونه‌ای به‌روزرسانی کنید که از `into()` " +#~ "برای انجام تبدیل استفاده شود." #~ msgid "" #~ "Change the types of `x` and `y` to other things (such as `f32`, `bool`, " #~ "`i128`) to see which types you can convert to which other types. Try " #~ "converting small types to big types and the other way around. Check the " -#~ "[standard library documentation](https://doc.rust-lang.org/std/convert/trait." -#~ "From.html) to see if `From` is implemented for the pairs you check." +#~ "[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` برای تبدیل انواع‌ایی که بررسی می‌کنید " -#~ "پیاده‌سازی شده است یا نه." +#~ "نوع داده `x` و `y` را به چیزهای دیگری (مانند `f32`, `bool`, `i128`) " +#~ "تغییر دهید تا ببینید کدام انواع را می‌توانید به کدام انواع دیگر تبدیل " +#~ "کنید. سعی کنید انواع کوچک را به انواع بزرگ تبدیل کنید و برعکس. [مستندات " +#~ "کتابخانه استاندارد](https://doc.rust-lang.org/std/convert/trait.From." +#~ "html) را بررسی کنید تا ببینید آیا `From` برای " +#~ "تبدیل انواع‌ایی که بررسی می‌کنید پیاده‌سازی شده است یا نه." #~ msgid "Arrays and `for` Loops" #~ msgstr "آرایه‌ها و حلقه‌های `for`" @@ -24711,10 +25436,11 @@ msgstr "" #~ msgstr "دیدیم که یک آرایه را می‌توان به صورت زیر تعریف کرد: " #~ msgid "" -#~ "You can print such an array by asking for its debug representation with `{:?}`:" +#~ "You can print such an array by asking for its debug representation with " +#~ "`{:?}`:" #~ msgstr "" -#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}" -#~ "` چاپ کنید:" +#~ "می‌توانید چنین آرایه‌ای را با درخواست نمایش اشکال‌زدایی آن با `{:?}` چاپ کنید:" #~ msgid "" #~ "Rust lets you iterate over things like arrays and ranges using the `for` " @@ -24727,36 +25453,36 @@ msgstr "" #~ msgstr "سوال جایزه‌دار" #~ msgid "" -#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your " -#~ "argument and return types? Something like `&[&[i32]]` for a two-dimensional " -#~ "slice-of-slices. Why or why not?" +#~ "Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for " +#~ "your argument and return types? Something like `&[&[i32]]` for a two-" +#~ "dimensional slice-of-slices. Why or why not?" #~ msgstr "" #~ "آیا می‌توانید به جای ماتریس‌های 3 × 3 هاردکد شده از برش‌های `&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده کنید؟ " -#~ "چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. آیا امکان " -#~ "پذیر هست؟ چرا اره و چرا نه؟" +#~ "dir=ltr>`&[i32]` برای آرگومان و انواع برگشتی تابع خود استفاده " +#~ "کنید؟ چیزی شبیه `&[&[i32]]` برای برش-از-برش دو بعدی. " +#~ "آیا امکان پذیر هست؟ چرا اره و چرا نه؟" #~ msgid "" -#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality " -#~ "implementation." +#~ "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production " +#~ "quality implementation." #~ msgstr "" -#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." +#~ "برای دیدن یک پیاده‌سازی با کیفیت پروداکشن به جعبه [`ndarray`](https://docs.rs/ndarray/) سر بزنید." #~ 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) موجود است." +#~ "راه‌حل‌ها و پاسخ به بخش جایزه در بخش جواب‌ها](solutions-morning.md#arrays-" +#~ "and-for-loops) موجود است." #~ 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." +#~ "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` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که بعداً به " -#~ "ان خواهیم پرداخت." +#~ "استفاده از ارجاع `&array` در بخش `for " +#~ "n in &array` پیش‌نمایشی کوچکی از مسئله مالکیت است در قسمت عصر که " +#~ "بعداً به ان خواهیم پرداخت." #~ msgid "Without the `&`..." #~ msgstr "بدون استفاده از `&` ..." @@ -24766,77 +25492,80 @@ msgstr "" #~ "[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)" +#~ "حلقه به گونه‌ای می‌بود که آرایه را مصرف می‌کند. این تغییری [در ویرایش سال " +#~ "۲۰۲۱ معرفی شده است.](https://doc.rust-lang.org/edition-guide/rust-2021/" +#~ "IntoIterator-for-arrays.html)" #~ msgid "" -#~ "An implicit array copy would have occurred. Since `i32` is a copy type, then " -#~ "`[i32; 3]` is also a copy type." +#~ "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]` نیز یک نوع کپی است." #~ msgid "" -#~ "As we have seen, `if` is an expression in Rust. It is used to conditionally " -#~ "evaluate one of two blocks, but the blocks can have a value which then becomes " -#~ "the value of the `if` expression. Other control flow expressions work " -#~ "similarly in Rust." +#~ "As we have seen, `if` is an expression in Rust. It is used to " +#~ "conditionally evaluate one of two blocks, but the blocks can have a value " +#~ "which then becomes the value of the `if` expression. Other control flow " +#~ "expressions work similarly in Rust." #~ msgstr "" -#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده می‌شود " -#~ "که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در راست این " -#~ "بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک مقدار داشته " -#~ "باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." +#~ "همانطور که دیدیم، `if` در Rust یک عبارت است. عبارت `if` برای آن استفاده " +#~ "می‌شود که یکی از ۲ بلوک شرطی را در راست ایجاد کند. توجه داشته باشید که در " +#~ "راست این بلاک های `if` میتوانند یک مقدار را برگرداند و در اصطلاح یک " +#~ "مقدار داشته باشند. بقیه عبارات کنترل جریان نیز مشابه این کار میکنند." #~ msgid "" -#~ "The same rule is used for functions: the value of the function body is the " -#~ "return value:" +#~ "The same rule is used for functions: the value of the function body is " +#~ "the return value:" #~ msgstr "" #~ "قانون مشابه‌ای برای توابع نیز صدق می‌کند: آخرین مقدار در بلاک تابع مقدار " #~ "برگشتی است: " #~ msgid "" -#~ "The point of this slide is to show that blocks have a type and value in Rust. " +#~ "The point of this slide is to show that blocks have a type and value in " +#~ "Rust. " #~ msgstr "" #~ "هدف از این اسلاید نشان دادن این است که بلوک ها در Rust دارای نوع و مقدار " #~ "هستند. " #~ msgid "" -#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is closely " -#~ "related to the [`while let` loop](while-let-expressions.md). It will " -#~ "automatically call `into_iter()` on the expression and then iterate over it:" +#~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " +#~ "closely 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()` را روی عبارت فراخوانی می‌کند و " -#~ "سپس روی آن پیشمایش انجام می‌دهد:" +#~ "[حلقه `for`](https://doc.rust-lang.org/std/keyword.for.html) به طور " +#~ "نزدیکی به حلقه [حلقه `while let` ](while-let-expressions.md) مرتبط است. " +#~ "حلقه `for` به طور خودکار `into_iter()` را روی " +#~ "عبارت فراخوانی می‌کند و سپس روی آن پیشمایش انجام می‌دهد:" #~ msgid "You can use `break` and `continue` here as usual." #~ msgstr "" -#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده کنید." +#~ "مثل بقیه زبان‌ها می‌توانید از `break` و `continue` به صورت عادی استفاده " +#~ "کنید." #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "پیشمایش اندیس در زبان راست دارای سینتکس خاصی نمی‌باشد." #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "" -#~ "(0..10) یک محدوده است که ویژگی " -#~ "`Iterator` را پیاده‌سازی می‌کند." +#~ "(0..10) یک محدوده است که " +#~ "ویژگی `Iterator` را پیاده‌سازی می‌کند." #~ msgid "" -#~ "`step_by` is a method that returns another `Iterator` that skips every other " -#~ "element. " +#~ "`step_by` is a method that returns another `Iterator` that skips every " +#~ "other element. " #~ msgstr "" -#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن بقیه " -#~ "عناصر را برمی‌گرداند." +#~ "متد `step_by`, متدی است که یک `Iterator` دیگر با قابلیت در نظر نگرفتن " +#~ "بقیه عناصر را برمی‌گرداند." #~ 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()` تغییر دهید." +#~ "عناصر را در بردار تغییر دهید و خطاهای کامپایلر را توضیح دهید. بردار v را " +#~ "قابل تغییر کنید (با اضافه کردن `mut`) و حلقه `for` را به `for x in v.iter_mut()` تغییر دهید." #~ msgid "`loop` expressions" #~ msgstr "عبارات `loop`" @@ -24845,58 +25574,60 @@ msgstr "" #~ "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) وجود دارد که یک حلقه بی‌پایان ایجاد می‌کند." +#~ "در نهایت، [کلمه کلیدی `loop`](https://doc.rust-lang.org/reference/" +#~ "expressions/loop-expr.html#infinite-loops) وجود دارد که یک حلقه بی‌پایان " +#~ "ایجاد می‌کند." #~ msgid "Here you must either `break` or `return` to stop the loop:" #~ msgstr "" -#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده کنید:" +#~ "اینجا باید از `break` یا `return` برای توقف حلقه و خروج از آن استفاده " +#~ "کنید:" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" -#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break 8` ) و آن را چاپ کنید." +#~ "حلقه `loop` را با یک مقدار متوقف کنید (به عنوان مثال `break " +#~ "8` ) و آن را چاپ کنید." #~ msgid "" -#~ "Due to type inference the `i32` is optional. We will gradually show the types " -#~ "less and less as the course progresses." +#~ "Due to type inference the `i32` is optional. We will gradually show the " +#~ "types less and less as the course progresses." #~ msgstr "" -#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره کمتر و " -#~ "کمتر آن را نشان خواهیم داد." +#~ "به دلیل تعیین نوع ضمنی گذاشتن `i32` اختیاریست. با جلو رفتن در این دوره " +#~ "کمتر و کمتر آن را نشان خواهیم داد." #~ msgid "" -#~ "The following code tells the compiler to copy into a certain generic container " -#~ "without the code ever explicitly specifying the contained type, using `_` as a " -#~ "placeholder:" +#~ "The following code tells the compiler to copy into a certain generic " +#~ "container without the code ever explicitly specifying the contained type, " +#~ "using `_` as a placeholder:" #~ msgstr "" -#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، در " -#~ "یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به عنوان یک " -#~ "جایگزین برای اعلام نوع داده: " +#~ "کد زیر به کامپایلر می‌گوید که بدون اینکه کد به صراحت نوع داده را مشخص کند، " +#~ "در یک کانتینر عمومی (generic container) خاص کپی کند، با استفاده از _ به " +#~ "عنوان یک جایگزین برای اعلام نوع داده: " #~ msgid "" #~ "[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator." -#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/std/" -#~ "iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-lang.org/std/" -#~ "collections/struct.HashSet.html#impl-FromIterator%3CT%3E-for-HashSet%3CT," -#~ "+S%3E) implements." +#~ "html#method.collect) relies on [`FromIterator`](https://doc.rust-lang.org/" +#~ "std/iter/trait.FromIterator.html), which [`HashSet`](https://doc.rust-" +#~ "lang.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) آن را پیاده‌سازی می‌کند." +#~ "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) آن را پیاده‌سازی می‌کند." #~ msgid "Static and Constant Variables" #~ msgstr "متغیر‌های ایستا و ثابت" #~ msgid "" -#~ "The following code demonstrates why the compiler can't simply reuse memory " -#~ "locations when shadowing an immutable variable in a scope, even if the type " -#~ "does not change." +#~ "The following code demonstrates why the compiler can't simply reuse " +#~ "memory locations when shadowing an immutable variable in a scope, even if " +#~ "the type does not change." #~ msgstr "" -#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه که " -#~ "قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر غیر قابل " -#~ "تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." +#~ "کد زیر نشان می دهد که چرا کامپایلر نمی تواند به سادگی از مکان های حافظه " +#~ "که قبلا برای یک متغییر در نظر گرفته است به صورت مجدد وقتی که یک متغییر " +#~ "غیر قابل تغییر داریم استفاده کند. حتی اگر چه نوع داده تغییر نکند." #~ msgid "" #~ "This page offers an enum type `CoinFlip` with two variants `Heads` and " @@ -24909,18 +25640,19 @@ msgstr "" #~ msgstr "در هر دو، توابع مورد نیازشون در داخل یک بلاک `impl` تعریف می‌شوند." #~ 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:" +#~ "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` برای استخراج داده‌ها از هر فیلد استفاده کنید:" +#~ "می توانید شمارش های غنی تری را تعریف کنید که در آن انواع مختلف داده " +#~ "باشند. سپس می‌توانید از دستور `match` برای استخراج داده‌ها از هر فیلد " +#~ "استفاده کنید:" #~ msgid "" -#~ "The expression is matched against the patterns from top to bottom. There is no " -#~ "fall-through like in C or C++." +#~ "The expression is matched against the patterns from top to bottom. There " +#~ "is no fall-through like in C or C++." #~ msgstr "" -#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت از " -#~ "بالا به پایین نمی‌باشد." +#~ "بر خلاف زبان‌های برخلاف C یا `C++` طبیق الگو به صورت " +#~ "از بالا به پایین نمی‌باشد." #~ msgid "" #~ "The match expression has a value. The value is the last expression in the " @@ -24930,17 +25662,17 @@ msgstr "" #~ "`match` ای است که اجرا شده است." #~ 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. " +#~ "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 " -#~ "اولین طبیق الگو انجام شد جستجو متوقف میشود." +#~ "از بالا شروع می‌کنیم و به دنبال الگویی هستیم که با مقدار مطابقت داشته " +#~ "باشد، سپس کد پس از `=>` را اجرا می‌کنیم. بعد از اینکه " +#~ "توی match اولین طبیق الگو انجام شد جستجو متوقف میشود." #~ msgid "`match` inspects a hidden discriminant field in the `enum`." #~ msgstr "" -#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` را " -#~ "بررسی می کند." +#~ "دستور `match` یک فیلد تشخیصی پنهان (hidden discriminant field) در `enum` " +#~ "را بررسی می کند." #~ msgid "" #~ "It is possible to retrieve the discriminant by calling `std::mem::" @@ -24950,98 +25682,102 @@ msgstr "" #~ "تشخیصی پنهان را دریافت کرد." #~ msgid "" -#~ "This is useful, for example, if implementing `PartialEq` for structs where " -#~ "comparing field values doesn't affect equality." +#~ "This is useful, for example, if implementing `PartialEq` for structs " +#~ "where comparing field values doesn't affect equality." #~ msgstr "" -#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. قابلیت " -#~ "`PartialEq` بر برابری تأثیر نمی‌گذارد." +#~ "بهتره بدانیم که اگر `PartialEq` را برای ساختارهایی پیاده سازی کنیم. " +#~ "قابلیت `PartialEq` بر برابری تأثیر نمی‌گذارد." #~ msgid "" -#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` " -#~ "with a top level `struct Click { ... }`. The inlined version cannot implement " -#~ "traits, for example." +#~ "`WebEvent::Click { ... }` is not exactly the same as `WebEvent::" +#~ "Click(Click)` with a top level `struct Click { ... }`. The inlined " +#~ "version cannot implement traits, for example." #~ msgstr "" #~ "`WebEvent::Click { ... }` دقیقاً مانند `WebEvent::Click(Click)` با `struct Click { ... }" -#~ "` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها را " -#~ "پیاده‌سازی کند." +#~ "dir=ltr>`WebEvent::Click(Click)` با `struct Click " +#~ "{ ... }` در سطح بالا نیست.برای مثال, نسخه درون‌خطی نمی‌تواند ویژگی‌ها " +#~ "را پیاده‌سازی کند." #~ msgid "" #~ "Rust enums are packed tightly, taking constraints due to alignment into " #~ "account:" #~ msgstr "" -#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت های " -#~ "ناشی از هم ترازی:" +#~ "`enum`ها در Rust به صورت فشرده بسته بندی شده اند، با در نظر گرفتن محدودیت " +#~ "های ناشی از هم ترازی:" #~ msgid "" #~ "Internally Rust is using a field (discriminant) to keep track of the enum " #~ "variant." #~ msgstr "" -#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع فیلدهای " -#~ "`enum` استفاده می کند." +#~ "زبان Rust, به صورت داخلی از یک فیلد (discriminant) برای رهگیری نوع " +#~ "فیلدهای `enum` استفاده می کند." #~ msgid "Try out other types such as" #~ msgstr "سایر انواع‌داده را امتحان کنید، مانند:" #~ msgid "`dbg_size!(bool)`: size 1 bytes, align: 1 bytes," #~ msgstr "" -#~ "dbg_size!(bool): اندازه توی حافظه " -#~ "1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," +#~ "dbg_size!(bool): اندازه توی " +#~ "حافظه 1 بایت، فضای مورد نیاز برای align نیز 1 بایت است," #~ msgid "" -#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche optimization, " -#~ "see below)," +#~ "`dbg_size!(Option)`: size 1 bytes, align: 1 bytes (niche " +#~ "optimization, see below)," #~ msgstr "" -#~ "dbg_size!(Option): اندازه " -#~ "توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است (بهینه‌سازی خاص، " -#~ "در زیر ببینید)" +#~ "dbg_size!(Option): " +#~ "اندازه توی حافظه 1 بایت، ، فضای مورد نیاز برای align نیز 1 بایت است " +#~ "(بهینه‌سازی خاص، در زیر ببینید)" -#~ msgid "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," +#~ msgid "" +#~ "`dbg_size!(&i32)`: size 8 bytes, align: 8 bytes (on a 64-bit machine)," #~ msgstr "" -#~ "dbg_size!(&i32): اندازه توی حافظه " -#~ "۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ بیتی)" +#~ "dbg_size!(&i32): اندازه توی " +#~ "حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (روی ماشین ۶۴ " +#~ "بیتی)" #~ msgid "" #~ "`dbg_size!(Option<&i32>)`: size 8 bytes, align: 8 bytes (null pointer " #~ "optimization, see below)." #~ msgstr "" -#~ "dbg_size!(Option<&i32>): اندازه " -#~ "توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است (بهینه‌سازی " -#~ "اشاره‌گر NULL را در زیر ببینید)" +#~ "dbg_size!(Option<&i32>): " +#~ "اندازه توی حافظه ۸ بایت، ، فضای مورد نیاز برای align نیز ۸ بایت است " +#~ "(بهینه‌سازی اشاره‌گر NULL را در زیر ببینید)" #~ msgid "" #~ "Niche optimization: Rust will merge unused bit patterns for the enum " #~ "discriminant." #~ msgstr "" -#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع `Enum` " -#~ "ادغام می‌کند." +#~ "بهینه‌سازی خاص: Rust الگوهای بیتی استفاده نشده را برای discriminant نوع " +#~ "`Enum` ادغام می‌کند." #~ msgid "" -#~ "More complex example if you want to discuss what happens when we chain more " -#~ "than 256 `Option`s together." +#~ "More complex example if you want to discuss what happens when we chain " +#~ "more than 256 `Option`s together." #~ msgstr "" -#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ عدد " -#~ "`Option` را به صورت تو در تو صدا بزنیم بحث کنید." +#~ "مثال پیچیده‌تر اگر می‌خواهید در مورد اتفاقی که می‌افتد زمانی که بیش از ۲۶۵ " +#~ "عدد `Option` را به صورت تو در تو صدا بزنیم بحث کنید." #~ msgid "" -#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/" -#~ "flow_control/let_else.html) construct allows to do a destructuring assignment, " -#~ "or if it fails, execute a block which is required to abort normal control flow " -#~ "(with `panic`/`return`/`break`/`continue`):" +#~ "Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-" +#~ "example/flow_control/let_else.html) construct allows to do a " +#~ "destructuring 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) ضروری است:" +#~ "از نسخه 1.65، یک کلیدواژه مشابه به اسم [`let-else`](https://doc.rust-" +#~ "lang.org/rust-by-example/flow_control/let_else.html) اجازه می‌دهد تا یک " +#~ "انتساب به صورت destructuring انجام شود، یا اگر شکست خورد، یک بلوک را اجرا " +#~ "کند که برای خاتمه دادن به جریان کنترل عادی (با panic/return/break/" +#~ "continue) ضروری است:" #~ msgid "" -#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/match-" -#~ "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:" +#~ "The [`match` keyword](https://doc.rust-lang.org/reference/expressions/" +#~ "match-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` عمل می‌کند:" +#~ "[کلمه‌کلیدی `match`](https://doc.rust-lang.org/reference/expressions/match-" +#~ "expr.html) برای مطابقت یک مقدار در برابر یک یا چند الگو استفاده می‌شود. از " +#~ "این نظر، مانند یک سری عبارات `if let` عمل می‌کند:" #~ msgid "Save the match expression to a variable and print it out." #~ msgstr "" @@ -25049,71 +25785,76 @@ msgstr "" #~ msgid "Remove `.as_deref()` and explain the error." #~ msgstr "" -#~ ".as_deref() را حذف کنید و خطا را " -#~ "توضیح دهید." +#~ ".as_deref() را حذف کنید و " +#~ "خطا را توضیح دهید." #~ msgid "" -#~ "`std::env::args().next()` returns an `Option`, but we cannot match " -#~ "against `String`." +#~ "`std::env::args().next()` returns an `Option`, but we cannot " +#~ "match against `String`." #~ msgstr "" -#~ "std::env::args().next() یک `Option` را برمی‌گرداند،چرا نمی توانیم به عنوان " -#~ "`String` تطبیق الگو کنیم؟" +#~ "std::env::args().next() یک " +#~ "`Option` را برمی‌گرداند،چرا نمی توانیم به " +#~ "عنوان `String` تطبیق الگو کنیم؟" #~ msgid "" -#~ "`as_deref()` transforms an `Option` to `Option<&T::Target>`. In our case, " -#~ "this turns `Option` into `Option<&str>`." +#~ "`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>` تبدیل می‌کند." +#~ "dir=ltr>`Option` را به `Option<&T::Target>` تبدیل می‌کند. در مورد ما، این `Option` " +#~ "را به `Option<&str>` تبدیل می‌کند." #~ msgid "" -#~ "We can now use pattern matching to match against the `&str` inside `Option`." +#~ "We can now use pattern matching to match against the `&str` inside " +#~ "`Option`." #~ msgstr "" -#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` داخل " -#~ "`Option` استفاده کنیم." +#~ "اکنون می‌توانیم از تطبیق الگو برای مطابقت با `&str` " +#~ "داخل `Option` استفاده کنیم." #~ msgid "The `_` pattern is a wildcard pattern which matches any value." -#~ msgstr "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." +#~ msgstr "" +#~ "الگوی _ یک الگوی wildcard (هر حالتی) است که با هر مقداری مطابقت دارد." #~ 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`، " -#~ "به نمایش نحوه کارکرد انتساب کمک کرد." +#~ "می‌توان با جایگزینی یک کاراکتر`_` با یک متغیر، یا حذف نقل قول ها در اطراف " +#~ "`q`، به نمایش نحوه کارکرد انتساب کمک کرد." #~ msgid "You can demonstrate matching on a reference." #~ msgstr "می‌توانید تطبیق الگو را با یک ارجاع را نشان دهید." #~ msgid "" -#~ "This might be a good time to bring up the concept of irrefutable patterns, as " -#~ "the term can show up in error messages." +#~ "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) باشد، زیرا این اصطلاح می تواند در پیام های خطا ظاهر شود." +#~ "این ممکن است زمان خوبی برای مطرح کردن مفهوم الگوهای غیرقابل انکار " +#~ "(irrefutable patterns) باشد، زیرا این اصطلاح می تواند در پیام های خطا " +#~ "ظاهر شود." #~ msgid "You can also destructure `structs`:" #~ msgstr "همچنین می‌توانید `structs` را destructure کنید:" #~ msgid "" -#~ "Destructuring of slices of unknown length also works with patterns of fixed " -#~ "length." +#~ "Destructuring of slices of unknown length also works with patterns of " +#~ "fixed length." #~ msgstr "" -#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت کار می " -#~ "کند." +#~ "برای destructure کردن برش هایی با طول ناشناخته نیز با الگوهای طول ثابت " +#~ "کار می کند." #~ 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_ به یک الگو اضافه کنید. این یک عبارت بولین " -#~ "دلخواه است که در صورت مطابقت الگو اجرا می شود." +#~ "هنگام تطابق، می توانید یک _guard_ به یک الگو اضافه کنید. این یک عبارت " +#~ "بولین دلخواه است که در صورت مطابقت الگو اجرا می شود." -#~ msgid "You can use the variables defined in the pattern in your if expression." -#~ msgstr "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." +#~ msgid "" +#~ "You can use the variables defined in the pattern in your if expression." +#~ msgstr "" +#~ "می توانید از متغیرهای تعریف شده در الگو در عبارت `if` خود استفاده کنید." #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "روز ۱: تمرین‌های عصر" @@ -25129,36 +25870,41 @@ msgstr "" #~ 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." +#~ "integers. Then, revisit the solution and try to implement it with " +#~ "iterators." #~ msgstr "" -#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد صحیح " -#~ "حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی کنید." +#~ "ابتدا سعی کنید مشکل را به روش «ساده» با استفاده از حلقه‌های `for` و اعداد " +#~ "صحیح حل کنید. سپس، سعی کنید آن را با استفاده از `iterator`ها پیاده‌سازی " +#~ "کنید." #~ msgid "" -#~ "Memory management: stack vs heap, manual memory management, scope-based memory " -#~ "management, and garbage collection." +#~ "Memory management: stack vs heap, manual memory management, scope-based " +#~ "memory management, and garbage collection." #~ msgstr "" -#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، مدیریت " -#~ "حافظه مبتنی بر اسکوپ و جمع آوری زباله. " +#~ "مدیریت حافظه: پشته (Stack) در مقابل انباشت (Heap)، مدیریت دستی حافظه، " +#~ "مدیریت حافظه مبتنی بر اسکوپ و جمع آوری زباله. " -#~ msgid "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." -#~ msgstr "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." +#~ msgid "" +#~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." +#~ msgstr "" +#~ "Ownership: حرکت semantics،copying و cloning, borrowing و lifetimes." #~ msgid "Structs and methods." #~ msgstr "ساختارها و متدها." #~ msgid "" -#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc` " -#~ "and `Arc`." +#~ "The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, " +#~ "`Rc` and `Arc`." #~ msgstr "" -#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, `Rc` و " -#~ "`Arc`." +#~ "کتابخانه استاندارد: `String`, `Option` و `Result`, `Vec`, `HashMap`, " +#~ "`Rc` و `Arc`." #~ msgid "Modules: visibility, paths, and filesystem hierarchy." #~ msgstr "ماژول‌ها: قابل دیدن بودن, مسیرها و مدیریت سلسله مراتبی فایل‌سیستم" #~ msgid "First, let's refresh how memory management works." -#~ msgstr "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." +#~ msgstr "" +#~ "قبل از هر چیزی, آنچه درباره مدیریت حافظه میدونیم رو بروز رسانی کنیم." #~ msgid "The Stack vs The Heap" #~ msgstr "پشته (Stack) در مقابل انباشت (Heap)" @@ -25173,76 +25919,84 @@ msgstr "" #~ "If not done with care, this can lead to crashes, bugs, security " #~ "vulnerabilities, and memory leaks." #~ msgstr "" -#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های امنیتی " -#~ "و نشتی حافظه شود." +#~ "اگر با دقت انجام نشود، این می تواند منجر به خرابی، اشکال، آسیب‌پذیری‌های " +#~ "امنیتی و نشتی حافظه شود." #~ msgid "C Example" #~ msgstr "مثالی در زبان C" #~ msgid "You must call `free` on every pointer you allocate with `malloc`:" #~ msgstr "" -#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی کنید:" +#~ "باید `free` را برای هر اشاره‌گری که با `malloc` تخصیص می‌دهید، فراخوانی " +#~ "کنید:" #~ msgid "" -#~ "Memory is leaked if the function returns early between `malloc` and `free`: " -#~ "the pointer is lost and we cannot deallocate the memory. Worse, freeing the " -#~ "pointer twice, or accessing a freed pointer can lead to exploitable security " -#~ "vulnerabilities." +#~ "Memory is leaked if the function returns early between `malloc` and " +#~ "`free`: the pointer is lost and we cannot deallocate the memory. Worse, " +#~ "freeing the pointer twice, or accessing a freed pointer can lead to " +#~ "exploitable security vulnerabilities." #~ msgstr "" -#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، حافظه " -#~ "نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. بدتر از آن، " -#~ "آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد شده می‌تواند منجر " -#~ "به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." +#~ "اگر تابع بین `malloc` و `free` مقداری را بازگرداند و از تابع خارج شویم، " +#~ "حافظه نشت می‌کند: اشاره گر گم می‌شود و نمی‌توانیم حافظه را تخصیص‌زدایی کنیم. " +#~ "بدتر از آن، آزاد کردن مجدد اشاره گر یا دسترسی به یک اشاره گر که قبلا آزاد " +#~ "شده می‌تواند منجر به آسیب‌پذیری‌های امنیتی قابل سوءاستفاده شود." -#~ msgid "Constructors and destructors let you hook into the lifetime of an object." +#~ msgid "" +#~ "Constructors and destructors let you hook into the lifetime of an object." #~ msgstr "" -#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) شوید." +#~ "سازنده‌ها و مخرب‌ها به شما امکان می‌دهند تا به طول‌عمر یک شیء متصل (hook) " +#~ "شوید." #~ msgid "" -#~ "By wrapping a pointer in an object, you can free memory when the object is " -#~ "destroyed. The compiler guarantees that this happens, even if an exception is " -#~ "raised." +#~ "By wrapping a pointer in an object, you can free memory when the object " +#~ "is destroyed. The compiler guarantees that this happens, even if an " +#~ "exception is raised." #~ msgstr "" -#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، حافظه را " -#~ "آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک exception " -#~ "ایجاد شود." +#~ "با پیچیدن (wrapping) یک اشاره گر در یک شیء، می‌توانید هنگام تخریب شیء، " +#~ "حافظه را آزاد کنید. کامپایلر تضمین می‌کند که این اتفاق می‌افتد، حتی اگر یک " +#~ "exception ایجاد شود." #~ msgid "" -#~ "This is often called _resource acquisition is initialization_ (RAII) and gives " -#~ "you smart pointers." +#~ "This is often called _resource acquisition is initialization_ (RAII) and " +#~ "gives you smart pointers." #~ msgstr "" #~ "این اغلب به عنوان _resource acquisition is initialization_ (RAII) نامیده " #~ "می‌شود و به شما اشاره گرهای هوشمند می‌دهد." #~ msgid "" -#~ "The `std::unique_ptr` object is allocated on the stack, and points to memory " -#~ "allocated on the heap." +#~ "The `std::unique_ptr` object is allocated on the stack, and points to " +#~ "memory allocated on the heap." #~ msgstr "" -#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و به " -#~ "حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." +#~ "ابجکت `std::unique_ptr` در پشته تخصیص داده می‌شود و " +#~ "به حافظه‌ای که روی انباشت تخصیص داده شده اشاره می‌کند." -#~ msgid "At the end of `say_hello`, the `std::unique_ptr` destructor will run." +#~ msgid "" +#~ "At the end of `say_hello`, the `std::unique_ptr` destructor will run." #~ msgstr "" -#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` اجرا " -#~ "می‌شود." +#~ "در پایان `say_hello`، تابع مخرب `std::unique_ptr` " +#~ "اجرا می‌شود." #~ msgid "The destructor frees the `Person` object it points to." #~ msgstr "مخرب شیء `Person` را که به آن اشاره می‌کند، آزاد می‌کند." -#~ msgid "Special move constructors are used when passing ownership to a function:" -#~ msgstr "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" +#~ msgid "" +#~ "Special move constructors are used when passing ownership to a function:" +#~ msgstr "" +#~ "هنگام انتقال مالکیت به یک تابع از سازنده‌های مخصوص انتقال استفاده می‌شود:" #~ msgid "" -#~ "An alternative to manual and scope-based memory management is automatic memory " -#~ "management:" +#~ "An alternative to manual and scope-based memory management is automatic " +#~ "memory management:" #~ msgstr "" -#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار است:" +#~ "یک جایگزین برای مدیریت حافظه دستی و مبتنی بر اسکوپ، مدیریت حافظه خودکار " +#~ "است:" #~ msgid "The programmer never allocates or deallocates memory explicitly." #~ msgstr "برنامه نویس هیچ وقت به صورت صریح حافظه را تخصیص یا آزاد نمیکند." #~ msgid "" -#~ "A garbage collector finds unused memory and deallocates it for the programmer." +#~ "A garbage collector finds unused memory and deallocates it for the " +#~ "programmer." #~ msgstr "" #~ "یک جمع‌آوری زباله حافظه استفاده نشده را پیدا می‌کند و آن را برای برنامه‌نویس " #~ "تخصیص‌زدایی (آزاد) می‌کند." @@ -25264,15 +26018,15 @@ msgstr "" #~ msgid "Scope-based like C++, but the compiler enforces full adherence." #~ msgstr "" -#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را رعایت " -#~ "می‌کند." +#~ "مبتنی بر اسکوپ مانند C++، اما کامپایلر همه موارد را " +#~ "رعایت می‌کند." #~ msgid "" -#~ "A Rust user can choose the right abstraction for the situation, some even have " -#~ "no cost at runtime like C." +#~ "A Rust user can choose the right abstraction for the situation, some even " +#~ "have no cost at runtime like C." #~ msgstr "" -#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب است، " -#~ "برخی مانند C هزینه‌ای در زمان اجرا ندارند." +#~ "کاربر Rust می‌تواند انتخاب کند که کدام انتزاع برای وضعیت مورد نظر مناسب " +#~ "است، برخی مانند C هزینه‌ای در زمان اجرا ندارند." #~ msgid "Rust achieves this by modeling _ownership_ explicitly." #~ msgstr "زبان Rust این کار را با مدل‌سازی صریح مالکیت انجام می‌دهد." @@ -25280,25 +26034,26 @@ msgstr "" #~ msgid "" #~ "If asked how at this point, you can mention that in Rust this is usually " #~ "handled by RAII wrapper types such as [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), or [Arc](https://" -#~ "doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate ownership and " -#~ "memory allocation via various means, and prevent the potential errors in C." +#~ "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), or [Arc]" +#~ "(https://doc.rust-lang.org/std/sync/struct.Arc.html). These encapsulate " +#~ "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 جلوگیری می‌کنند." +#~ "اگر توی این مرحله از شما پرسیده شد که چطوری این کار انجام می‌شود, میتوانید " +#~ "به این موضوع که زبان راست معمولاً توسط انواع `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 جلوگیری می‌کنند." #~ 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." +#~ "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) هستند." +#~ "اگر درباره مخرب‌ها (destructors) از شما پرسیدند, مخرب ها معادل پیاده‌سازی " +#~ "[Drop](https://doc.rust-lang.org/std/ops/trait.Drop.html) هستند." #~ msgid "A destructor can run here to free up resources." #~ msgstr "یک مخرب می‌تواند در اینجا اجرا شود تا منابع را آزاد کند." @@ -25309,17 +26064,18 @@ msgstr "" #~ msgid "The heap data from `s1` is reused for `s2`." #~ msgstr "داده‌های انباشت از `s1` دوباره برای `s2` استفاده می‌شود." -#~ msgid "When `s1` goes out of scope, nothing happens (it has been moved from)." +#~ msgid "" +#~ "When `s1` goes out of scope, nothing happens (it has been moved from)." #~ msgstr "وقتی از اسکوپ `s1` خارج می‌شویم، هیچ اتفاقی نمی‌افتد." #~ msgid "" -#~ "If students ask about `derive`, it is sufficient to say that this is a way to " -#~ "generate code in Rust at compile time. In this case the default " +#~ "If students ask about `derive`, it is sufficient to say that this is a " +#~ "way 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` تولید می‌شوند." +#~ "اگر دانشجویان در مورد `derive` پرسیدند، کافی است بگوییم که این راهی برای " +#~ "تولید کد در`Rust` در زمان کامپایل است. در این مورد، پیاده‌سازی‌های پیش‌فرض " +#~ "صفت‌های `Copy` و `Clone` تولید می‌شوند." #, fuzzy #~ msgid "Drawing A Simple GUI" From 4a3f5affec2b8993339b37889cad9feb9af860dc Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 13 Oct 2024 23:18:12 +0330 Subject: [PATCH 87/92] fa: try to complete Farsi - part 4 --- src/running-the-course/translations.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/running-the-course/translations.md b/src/running-the-course/translations.md index 784e3668082..303b8eebcba 100644 --- a/src/running-the-course/translations.md +++ b/src/running-the-course/translations.md @@ -14,9 +14,9 @@ volunteers: - [Korean][ko] by [@keispace], [@jiyongp], [@jooyunghan], and [@namhyung]. - [Spanish][es] by [@deavid]. - [Ukrainian][uk] by [@git-user-cpp], [@yaremam] and [@reta]. -- [Farsi][fa] by [@DannyRavi], [@javad-jafari], [@Alix1383], [@moaminsharifi] , [@hamidrezakp] and [@mehrad77]. - . -Use the language picker in the top-right corner to switch between languages. +- [Farsi][fa] by [@DannyRavi], [@javad-jafari], [@Alix1383], [@moaminsharifi] , + [@hamidrezakp] and [@mehrad77]. . Use the language picker in the top-right + corner to switch between languages. ## Incomplete Translations From fdae4a0ec233591a57b59b659ce24ad68bcc8258 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 17 Oct 2024 00:06:49 +0330 Subject: [PATCH 88/92] fa: update fuzzy and untranslated 1 --- po/fa.po | 211 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 113 insertions(+), 98 deletions(-) diff --git a/po/fa.po b/po/fa.po index 36236006f39..cc70b86458b 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-10-13 22:50+0330\n" +"PO-Revision-Date: 2024-10-17 00:03+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -275,9 +275,8 @@ msgid "Destructuring Structs" msgstr "تخریب ساختارها" #: src/SUMMARY.md src/pattern-matching.md -#, fuzzy msgid "Destructuring Enums" -msgstr "Enum‌ های تفکیک‌‌پذیر" +msgstr "تخریب ساختار Enums" #: src/SUMMARY.md src/pattern-matching.md #: src/pattern-matching/let-control-flow.md @@ -717,7 +716,6 @@ msgid "Service API" msgstr "Service API" #: src/SUMMARY.md -#, fuzzy msgid "Service" msgstr "سرویس" @@ -743,28 +741,24 @@ msgid "Updating Implementations" msgstr "پیاده سازی" #: src/SUMMARY.md -#, fuzzy msgid "AIDL Types" -msgstr "انواع" +msgstr "AIDL Types" #: src/SUMMARY.md src/android/aidl/types/primitives.md msgid "Primitive Types" msgstr "انواع اولیه" #: src/SUMMARY.md src/android/aidl/types/arrays.md -#, fuzzy msgid "Array Types" -msgstr "آرایه‌ها" +msgstr "تایپ‌های اٰرایه‌ای" #: src/SUMMARY.md src/android/aidl/types/objects.md -#, fuzzy msgid "Sending Objects" -msgstr "آبجکت‌های موصوفی (Trait Objects)" +msgstr "Sending Objects" #: src/SUMMARY.md src/android/aidl/types/parcelables.md -#, fuzzy msgid "Parcelables" -msgstr "متغیرها" +msgstr "بسته‌بندی‌ها" #: src/SUMMARY.md src/android/aidl/types/file-descriptor.md msgid "Sending Files" @@ -908,9 +902,8 @@ msgid "Interoperability with C++" msgstr "قابلیت همکاری با ++C" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md -#, fuzzy msgid "Example Bindings" -msgstr "مثال‌ها" +msgstr "نمونه اتصال‌ها (Bindingها)" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Limitations of CXX" @@ -990,9 +983,8 @@ msgid "Bringing It Together - Exercise" msgstr "دور همی تمرین کنید" #: src/SUMMARY.md src/exercises/chromium/solutions.md -#, fuzzy msgid "Exercise Solutions" -msgstr "راه حل‌ها" +msgstr "راه‌حل‌های تمرین" #: src/SUMMARY.md msgid "Bare Metal: Morning" @@ -1158,9 +1150,8 @@ msgid "Threads" msgstr "تردها" #: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md -#, fuzzy msgid "Plain Threads" -msgstr "تردها" +msgstr "تردهای ساده" #: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/scoped.md msgid "Scoped Threads" @@ -1173,9 +1164,8 @@ msgstr "کانال‌ها" #: src/SUMMARY.md src/concurrency/channels.md #: src/concurrency/channels/senders-receivers.md -#, fuzzy msgid "Senders and Receivers" -msgstr "متد دریافتی" +msgstr "Senders و Receivers" #: src/SUMMARY.md src/concurrency/channels.md #: src/concurrency/channels/unbounded.md @@ -1193,9 +1183,8 @@ msgstr "`Send` و `Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/marker-traits.md -#, fuzzy msgid "Marker Traits" -msgstr "صفت‌های بیشتر" +msgstr "ویژگی‌های نشانگر" #: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" @@ -1274,9 +1263,8 @@ msgstr "Task" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md -#, fuzzy msgid "Channels and Control Flow" -msgstr "کنترل جریان پیشرفته" +msgstr "کانال‌ها و Control Flow" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/channels.md @@ -1458,17 +1446,16 @@ msgstr "" "داده شده اند." #: src/index.md -#, fuzzy msgid "" "[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " "Rust. We cover both classical concurrency (preemptively scheduling using " "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"‏[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " +"[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " "Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " "threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " -"استفاده از futures را پوشش خواهیم داد." +"استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -1494,7 +1481,7 @@ msgstr "" #: src/index.md msgid "Assumptions" -msgstr "فرض میشود" +msgstr "فرض می‌شود" #: src/index.md msgid "" @@ -1502,10 +1489,9 @@ msgid "" "statically-typed language and we will sometimes make comparisons with C and " "C++ to better explain or contrast the Rust approach." msgstr "" -"این دوره فرض می کندشما دانش برنامه نویسی دارید. \n" -" Rust یک زبان استاتیک تایپ است\n" -"و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می کنیم " -"تا رویکرد‌های Rust را بهتر توضیح دهیم یا در حالت مقایسه با آن قرار دهیم." +"این دوره فرض می‌کند که شما دانش برنامه‌نویسی دارید. Rust یک زبان استاتیک تایپ " +"است و ما گاهی اوقات زبان Rust را با C و C++ مقایسه می " +"کنیم تا رویکرد‌های Rust را بهتر توضیح دهیم." #: src/index.md msgid "" @@ -1521,9 +1507,9 @@ msgid "" "information to the slides. This could be key points which the instructor " "should cover as well as answers to typical questions which come up in class." msgstr "" -"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " -"اطلاعات بیشتری را ارائه دهیم.. این می تواند نکات کلیدی باشد که مدرس باید " -"پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." +"این یک نمونه از _speaker note_ هست. ما از این‌ها استفاده خواهیم کرد تا تا " +"اطلاعات بیشتری را ارائه دهیم.. این مورد می‌تواند شامل نکات کلیدی باشد که مدرس " +"باید آن را پوشش دهد و همچنین پاسخ به سوالات رایجی که در کلاس مطرح می شود." #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." @@ -2944,18 +2930,17 @@ msgstr "" "با ساختارهایی مانند تطابق الگو و مدیریت وابستگی داخلی دریافت می‌کنید." #: src/hello-world/benefits.md -#, fuzzy msgid "" "Experience with Java, Go, Python, JavaScript...: You get the same memory " "safety as in those languages, plus a similar high-level language feeling. In " "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++ (بدون " -"جمع‌آوری زباله) و همچنین دسترسی به سخت‌افزار سطح پایین (در صورت نیاز) دریافت " -"می‌کنید." +"تجربه با Java، Go، Python، JavaScript...: شما همان ایمنی حافظه (memory " +"safety ) را مانند آن زبان‌ها دریافت می‌کنید، به علاوه یک احساس زبان سطح بالا " +"مشابه را تجربه خواهید کرد. علاوه بر این، شما عملکرد سریع و قابل پیش‌بینی " +"مانند C و C++ (بدون garbage collector) و همچنین دسترسی " +"به سخت‌افزار سطح پایین (در صورت نیاز) دریافت می‌کنید." #: src/hello-world/playground.md msgid "" @@ -3087,7 +3072,6 @@ msgstr "" "تابع)." #: src/types-and-values/hello-world.md -#, fuzzy msgid "" "Macros being 'hygienic' means they don't accidentally capture identifiers " "from the scope they are used in. Rust macros are actually only [partially " @@ -3095,8 +3079,8 @@ msgid "" "html)." msgstr "" "«هاجنیک» (`hygienic‍`) بودن ماکرو به این معنی است که آنها به طور تصادفی " -"شناسه‌ها را از اسکوپ‌ای که در آن استفاده می‌شوند، ضبط نمی‌کنند. ماکروهای Rust در " -"واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" +"شناسه‌ها را از محدوده‌ای که در آن استفاده می‌شوند، ذخیره نمی‌کنند. ماکروهای Rust " +"در واقع فقط [تا حدی هاجنیک](https://veykril.github.io/tlborm/decl-macros/" "minutiae/hygiene.html هستند." #: src/types-and-values/hello-world.md @@ -3515,7 +3499,6 @@ msgstr "" "قرار خواهند گرفت." #: src/control-flow-basics/loops/for.md -#, fuzzy msgid "" "Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " "for an inclusive range." @@ -4826,11 +4809,10 @@ msgstr "" "زمان اجرا فراخوانی کرد (بر خلاف تعریف متغییری ثابت)" #: src/user-defined-types/const.md -#, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" "به این نکته اشاره کنید که `const` شبیه `constexpr` در `C++` عمل می کند." +"span> عمل می‌کند." #: src/user-defined-types/const.md msgid "" @@ -4919,6 +4901,8 @@ msgid "" "A type alias creates a name for another type. The two types can be used " "interchangeably." msgstr "" +"تایپ alias، نامی برای نوع دیگر ایجاد می کند. این دو نوع را می توان به جای " +"هم استفاده کرد." #: src/user-defined-types/aliases.md #, fuzzy @@ -5275,7 +5259,7 @@ msgstr "\"x.0 = 1, b = {b}, y = {y}\"" #: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" -msgstr "" +msgstr "\"y = 2, x = {i:?}\"" #: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" @@ -6070,7 +6054,7 @@ msgstr "\"شماره ای را انتخاب کرد: {:?}\"" #: src/generics/generic-functions.md msgid "\"picked a tuple: {:?}\"" -msgstr "" +msgstr "\"یک تاپل انتخاب کرد: {:?}\"" #: src/generics/generic-functions.md msgid "\"dog\"" @@ -7724,7 +7708,6 @@ msgstr "" "انعطاف‌پذیری را برای فراخوانی‌کننده فراهم می‌کند." #: src/std-traits/closures.md -#, fuzzy msgid "" "In contrast, when you have a closure, the most flexible you can have is `Fn` " "(which can be passed to a consumer of any of the 3 closure traits), then " @@ -8735,13 +8718,13 @@ msgstr "" "lang.org/std/ops/trait.Deref.html#more-on-deref-coercion)." #: src/smart-pointers/box.md -#, fuzzy msgid "" "Recursive data types or data types with dynamic sizes cannot be stored " "inline without a pointer indirection, which can be worked around using `Box`:" msgstr "" -"تایپ‌های داده بازگشتی یا تایپ‌های داده با اندازه‌های پویا نیاز به استفاده از " -"`Box` دارند:" +"تایپ‌های داده‌های بازگشتی یا انواع داده با اندازه‌های دینامیک را نمی‌توان به " +"صورت inline بدون pointer indirection ذخیره کرد، که می‌توان با استفاده از " +"`Box` آن کار را کرد:" #: src/smart-pointers/box.md #, fuzzy @@ -10246,6 +10229,8 @@ msgid "" "Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " "reference to the `Grid` in `GridIter`." msgstr "" +"این مشکل را با اجرای `IntoIterator` برای `&Grid` و ذخیره یک reference به این " +"`Grid` در `GridIter` برطرف کنید." #: src/iterators/intoiterator.md msgid "" @@ -10573,6 +10558,8 @@ msgid "" "A module can bring symbols from another module into scope with `use`. You " "will typically see something like this at the top of each module:" msgstr "" +"یک ماژول می‌تواند نمادها را از ماژول دیگری با `use` وارد محدوده کند. شما " +"معمولاً چیزی شبیه به این را در بالای هر ماژول خواهید دید:" #: src/modules/paths.md msgid "Paths" @@ -10600,7 +10587,7 @@ msgstr "به عنوان یک path مطلق:" #: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," -msgstr "" +msgstr "`crate::foo` به `foo` در ریشه جعبه فعلی اشاره دارد." #: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." @@ -10630,6 +10617,11 @@ msgid "" "`read_to_string` method on a type implementing the `Read` trait, you need to " "`use std::io::Read`." msgstr "" +"در بیشتر موارد، فقط مواردی که در یک ماژول ظاهر می‌شوند باید `use` شوند. با‌ " +"این‌حال، یک ویژگی (trait) باید در محدوده باشد تا بتوان هر method ای را روی آن " +"ویژگی فراخوانی کرد، حتی اگر نوعی که آن ویژگی را اجرا می کند قبلاً در محدوده " +"باشد. به عنوان مثال، برای استفاده از متد `read_to_string` در نوعی که ویژگی " +"`Read` را اجرا می‌کند، باید از `use std::io::Read` استفاده کنید." #: src/modules/paths.md msgid "" @@ -10660,9 +10652,8 @@ msgstr "" "دهید، بنابراین هر نوع ویجت باید ماژول خاص خود را داشته باشد." #: src/modules/exercise.md -#, fuzzy msgid "Cargo Setup" -msgstr "تنظیم" +msgstr "Cargo Setup" #: src/modules/exercise.md msgid "" @@ -10957,6 +10948,8 @@ msgid "" "Adding `#` in the code will hide it from the docs, but will still compile/" "run it." msgstr "" +"افزودن `#` به کد، آن را از مستندات پنهان می‌کند، اما همچنان آن را کامپایل/" +"اجرا می‌کند." #: src/testing/other.md msgid "" @@ -10999,6 +10992,9 @@ msgid "" "clippy warnings. Clippy has extensive documentation of its lints, and adds " "new lints (including default-deny lints) all the time." msgstr "" +"پس از رفع lintها، `clippy` را در سایت playground اجرا کنید تا هشدارهای " +"clippy نشان داده شود. Clippy مستندات گسترده‌ای از lintهای خود دارد و همیشه " +"lintهای جدید (از جمله default-deny lint) را اضافه می‌کند." #: src/testing/lints.md msgid "" @@ -11157,9 +11153,8 @@ msgstr "" "شامل:" #: src/error-handling.md -#, fuzzy msgid "Error Trait" -msgstr "صفت‌های بیشتر" +msgstr "ویژگی (Trait) خطا" #: src/error-handling.md msgid "thiserror and anyhow" @@ -11206,6 +11201,8 @@ msgid "" "A panic will \"unwind\" the stack, dropping values just as if the functions " "had returned." msgstr "" +"یک panic را \"باز\" ​​می‌کند و مقادیر را حذف می‌کند درست مثل اینکه توابع برگشته " +"باشند." #: src/error-handling/panics.md msgid "" @@ -11470,6 +11467,8 @@ msgid "" "A common alternative to a `From` implementation is `Result::map_err`, " "especially when the conversion only happens in one place." msgstr "" +"یک جایگزین رایج برای پیاده سازی `From`جهت `Result::map_err` است، به خصوص " +"زمانی که تبدیل‌ها فقط در یک مکان انجام می‌شود." #: src/error-handling/try-conversions.md msgid "" @@ -11487,6 +11486,9 @@ msgid "" "However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " "turns `Result` into `Option`." msgstr "" +"یک تابعی که `Result` را برمی‌گرداند دیگر نمی‌تواند از `?` در `Option` استفاده " +"کند و بالعکس. با این‌حال، `Option::ok_or` یک `Option` را به `Result` تبدیل " +"می‌کند در حالی که `Result::ok` «نتیجه» را به `Option` تبدیل می‌کند." #: src/error-handling/error.md msgid "Dynamic Error Types" @@ -11642,7 +11644,7 @@ msgstr "`anyhow::Result`یک type مستعار برای است`Result` can be:" msgstr "قسمت `T` از `نتیجه` می تواند باشد:" #: src/chromium/interoperability-with-cpp/error-handling.md -#, fuzzy msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " "be passed across the FFI boundary - for example `T` has to be:" @@ -17377,7 +17374,6 @@ msgid "Apply a patch to the crate." msgstr "یک وصله (patch) روی crate بزنید." #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md -#, fuzzy msgid "" "Patches should be kept in `third_party/rust/chromium_crates_io/patches/" "` - see for example the [patches against the `cxx` crate](https://" @@ -17386,9 +17382,9 @@ msgid "" "`gnrt` each time it upgrades the crate." msgstr "" "وصله‌ها (Patches) باید در`third_party/rust/chromium_crates_io/patches/" -"` نگهداری شوند - برای مثال [Patchها در مقابل `cxx` crate](https://" -"source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" -"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " +"` نگهداری شوند - برای مثال [Patchها در مقابل `](https://source." +"chromium.org/chromium/chromium/src/+/main:third_party/rust/" +"chromium_crates_io/patches/cxx/) - و هر بار که crate را upgrade می‌کند به‌طور " "خودکار توسط`gnrt` اعمال می‌شود." #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -17878,6 +17874,10 @@ msgid "" "with some LEDs and buttons, an I2C-connected accelerometer and compass, and " "an on-board SWD debugger." msgstr "" +"برای بخش میکروکنترلر دوره ما از [BBC micro:bit](https://microbit.org/) v2 به " +"عنوان مثال استفاده خواهیم کرد. این یک [برد توسعه](https://tech.microbit.org/" +"hardware/) مبتنی بر میکروکنترلر Nordic nRF52833 با چند LED و دکمه، شتاب‌سنج و " +"قطب‌نما متصل به I2C و یک دیباگر SWD روی برد است." #: src/bare-metal.md msgid "" @@ -17999,7 +17999,7 @@ msgstr "" #: src/bare-metal/minimal.md msgid "A minimal `no_std` program" -msgstr "" +msgstr "یک برنامه حداقلی از`no_std`." #: src/bare-metal/minimal.md msgid "This will compile to an empty binary." @@ -18132,6 +18132,9 @@ msgid "" "Most microcontrollers access peripherals via memory-mapped IO. Let's try " "turning on an LED on our micro:bit:" msgstr "" +"اکثر میکروکنترلرها از طریق IO دارای memory-map به تجهیزات جانبی " +"(peripherals) دسترسی دارند. بیایید سعی کنیم یک LED را در micro:bit خود روشن " +"کنیم:" #: src/bare-metal/microcontrollers/mmio.md #, fuzzy @@ -18228,7 +18231,7 @@ msgstr "" #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." -msgstr "" +msgstr "`cortex-m-rt` جدول برداری را از جمله موارد دیگر ارائه می‌دهد." #: src/bare-metal/microcontrollers/pacs.md msgid "" @@ -19095,6 +19098,10 @@ msgid "" "for DRAM, and another 1 GiB higher up for more devices. This matches the " "memory layout that QEMU uses." msgstr "" +"برای سادگی، ما فقط از یک pagetable کدگذاری شده استفاده می کنیم (به`idmap.S` " +"مراجعه کنید) که ۱ گیگابایت اول فضای آدرس را برای دستگاه‌ها، ۱ گیگابایت بعدی " +"را برای DRAM و ۱ گیگابایت دیگر را برای دستگاه‌های بیشتر نگاشت می‌کند. این با " +"چیدمان حافظه‌ای که QEMU استفاده می‌کند مطابقت دارد." #: src/bare-metal/aps/entry-point.md msgid "" @@ -20936,10 +20943,13 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"`‏ mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and " +"`SyncSender` implement `Clone` (so you can make multiple producers) but " +"`Receiver` does not." msgstr "" +"‏ mpsc مخفف Multi-Producer, Single-Consumer است. `Sender` و `SyncSender` " +"`Clone` را پیاده‌سازی می‌کنند (بنابراین می‌توانید چندین تولیدکننده بسازید) اما " +"`Receiver` این کار را نمی‌کند." #: src/concurrency/channels/senders-receivers.md msgid "" @@ -20989,12 +20999,18 @@ msgid "" "A call to `send` will abort with an error (that is why it returns `Result`) " "if the channel is closed. A channel is closed when the receiver is dropped." msgstr "" +"اگر کانال بسته شود، تماس برای `send` با یک error قطع می‌شود (به همین " +"دلیل`Result` را برمی‌گرداند. هنگامی که گیرنده از بین می رود یک کانال بسته " +"می‌شود." #: src/concurrency/channels/bounded.md msgid "" "A bounded channel with a size of zero is called a \"rendezvous channel\". " "Every send will block the current thread until another thread calls `recv`." msgstr "" +"یک کانال محدود ( bounded channel) با اندازه صفر را \"کانال ملاقات\" یا " +"\"rendezvous channel\" می‌‌نامند. هر ارسال، thread فعلی را مسدود می‌کند تا " +"زمانی که رشته دیگری `recv` را فراخواند." #: src/concurrency/send-sync.md msgid "Send" @@ -23673,13 +23689,12 @@ msgstr "" # check in browser again #: src/glossary.md -#, fuzzy msgid "" "Rust in Android: \n" "See [Rust in Android](android.md)." msgstr "" -"‏Rust در Android:\n" -"‏[Rust in Android](android.md) را ببینید." +"Rust در Android:\n" +"این [Rust in Android](android.md) را ببینید." #: src/glossary.md msgid "" From 66897ad96e6a5a471cba21a05d9a63cc975cc6b2 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 17 Oct 2024 00:20:52 +0330 Subject: [PATCH 89/92] =?UTF-8?q?fa:=20update=20fuzzy=20and=20untranslated?= =?UTF-8?q?=201.=DB=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- po/fa.po | 87 ++++++++++++++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/po/fa.po b/po/fa.po index cc70b86458b..de72293274e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-10-17 00:03+0330\n" +"PO-Revision-Date: 2024-10-17 00:20+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -586,7 +586,7 @@ msgstr "قابلیت دید" #: src/SUMMARY.md msgid "`use`, `super`, `self`" -msgstr "" +msgstr "`use`, `super`, `self`" #: src/SUMMARY.md src/modules.md src/modules/exercise.md msgid "Exercise: Modules for a GUI Library" @@ -640,7 +640,7 @@ msgstr "`Error` Trait" #: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md msgid "`thiserror` and `anyhow`" -msgstr "" +msgstr "`thiserror` و `anyhow`" #: src/SUMMARY.md msgid "Exercise: Rewriting with `Result`" @@ -954,12 +954,12 @@ msgstr "حل مشکلات" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "Build Scripts Which Generate Code" -msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کنند." +msgstr "ساخت اسکریپت‌هایی که کد را تولید می‌کنند" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" -msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند." +msgstr "ساخت اسکریپت‌هایی که ++C را Build می‌کند یا اقدامات دلخواه انجام می‌دهند" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md @@ -1113,7 +1113,7 @@ msgstr "جعبه‌های (Crates) کاربردی" #: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md msgid "`zerocopy`" -msgstr "" +msgstr "`zerocopy`" #: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md msgid "`aarch64-paging`" @@ -1125,16 +1125,15 @@ msgstr "`buddy_system_allocator`" #: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md msgid "`tinyvec`" -msgstr "" +msgstr "`tinyvec`" #: src/SUMMARY.md src/bare-metal/useful-crates/spin.md msgid "`spin`" msgstr "`spin`" #: src/SUMMARY.md -#, fuzzy msgid "`vmbase`" -msgstr "vmbase" +msgstr "`vmbase`" #: src/SUMMARY.md msgid "RTC Driver" @@ -1452,8 +1451,8 @@ msgid "" "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"[Concurrency](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان " -"Rust. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " +"[همروندی](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " +"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " "threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " "استفاده از futures را پوشش خواهیم داد." @@ -1953,14 +1952,12 @@ msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "چندین میانبر صفحه کلید مفید در mdBook وجود دارد:" #: src/running-the-course/keyboard-shortcuts.md -#, fuzzy msgid "Arrow-Left: Navigate to the previous page." -msgstr "Arrow-Left: به صفحه قبلی هدایت می کند." +msgstr "Arrow-Left: به صفحه قبلی هدایت می‌کند." #: src/running-the-course/keyboard-shortcuts.md -#, fuzzy msgid "Arrow-Right: Navigate to the next page." -msgstr "Arrow-Right: به صفحه بعدی هدایت می کند." +msgstr "Arrow-Right: به صفحه بعدی هدایت می‌کند." #: src/running-the-course/keyboard-shortcuts.md #, fuzzy @@ -1968,9 +1965,8 @@ msgid "Ctrl + Enter: Execute the code sample that has focus." msgstr "Ctrl + Enter: اجرای نمونه کدی که بر روی آن تمرکز شده است." #: src/running-the-course/keyboard-shortcuts.md -#, fuzzy msgid "s: Activate the search bar." -msgstr "s: نوار جستجو را فعال می کند." +msgstr "s: نوار جستجو را فعال می‌کند." #: src/running-the-course/translations.md msgid "" @@ -2586,7 +2582,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 @@ -4675,7 +4671,7 @@ msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" -" `Direction` یک type با گونه‌های مختلف است. دو مقدار `Direction` وجود دارد: " +"`Direction` یک type با گونه‌های مختلف است. دو مقدار `Direction` وجود دارد: " "`Direction::Left` و `Direction::Right`." #: src/user-defined-types/enums.md @@ -5478,7 +5474,7 @@ msgstr "" msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" "یک استفاده رایج از دستور `if let`، رسیدگی به مقادیر `Some` هنگام کار با " -"`Option` است:" +"`Option` است." #: src/pattern-matching/let-control-flow.md msgid "" @@ -6934,7 +6930,7 @@ msgid "" "resizable heap-allocated buffer:" msgstr "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) بافر قابل تغییر " -"اندازه و heap-allocated است." +"اندازه و heap-allocated است" #: src/std-types/vec.md msgid "\"v1: len = {}, capacity = {}\"" @@ -10201,7 +10197,7 @@ msgstr "ء `Item`: نوعی که باید تکرار شود، مانند `i8`،" #: src/iterators/intoiterator.md msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." msgstr "" -" `IntoIter`: یک «Iterator» تایپ است که با متد `into_iter` برگردانده شده است." +"`IntoIter`: یک «Iterator» تایپ است که با متد `into_iter` برگردانده شده است." #: src/iterators/intoiterator.md msgid "" @@ -10587,7 +10583,7 @@ msgstr "به عنوان یک path مطلق:" #: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," -msgstr "`crate::foo` به `foo` در ریشه جعبه فعلی اشاره دارد." +msgstr "`crate::foo` به `foo` در ریشه جعبه فعلی اشاره دارد" #: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." @@ -11575,7 +11571,7 @@ msgid "" "`anyhow` is often used by applications to help with error handling in " "functions, including adding contextual information to your errors." msgstr "" -" اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " +"اغلب `anyhow` توسط برنامه‌ها برای کمک به مدیریت خطا در توابع، از جمله افزودن " "اطلاعات متنی به خطاهای شما، استفاده می‌شود." #: src/error-handling/thiserror-and-anyhow.md @@ -11633,7 +11629,7 @@ msgid "" "it's again generally not a good choice for the public API of a library, but " "is widely used in applications." msgstr "" -" `anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " +"`anyhow::Error` اساساً پوششی (wrapper) در اطراف`Box` است. به این " "ترتیب معمولاً انتخاب خوبی برای API عمومی یک کتابخانه نیست، اما به طور گسترده " "در برنامه‌های مختلف استفاده می‌شود." @@ -12373,7 +12369,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" -"`CString` به `*const i8`: برای فراخوانی توابع C به یک اشاره‌گر نیاز دارید." +"`CString` به `*const i8`: برای فراخوانی توابع C به یک اشاره‌گر نیاز دارید" #: src/unsafe-rust/exercise.md msgid "" @@ -12381,7 +12377,7 @@ msgid "" "character," msgstr "" "از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " -"پیدا کند." +"پیدا کند" #: src/unsafe-rust/exercise.md msgid "" @@ -13054,8 +13050,8 @@ msgid "" "Binder generates a trait corresponding to the interface definition. trait to " "talk to the service." msgstr "" -"‏ Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " -"با سرویس" +" Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"با سرویس است." #: src/android/aidl/example-service/service-bindings.md msgid "_Generated trait_:" @@ -14116,7 +14112,7 @@ msgstr "\"Something went wrong!\"" #: src/android/logging.md src/android/interoperability/with-c/bindgen.md #: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" -msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین." +msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین" #: src/android/logging.md msgid "" @@ -14469,8 +14465,8 @@ msgid "" "will just be the name of the function. You can also use `#[export_name = " "\"some_name\"]` to specify whatever name you want." msgstr "" -"‏`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " -"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " +"`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " +"فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " "برای تعیین هر نامی استفاده کنید" #: src/android/interoperability/cpp.md @@ -15407,9 +15403,9 @@ msgid "" "Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" -"‏ `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " -"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust)، " -"کامپایلر Rust باینری که برای راه اندازی بارگیری شده است، بستگی دارد." +" `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " +"منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust) وابسته " +"است، کامپایلر Rust باینری که برای راه‌اندازی بارگیری (bootstrapping) شده است" #: src/chromium/cargo.md msgid "" @@ -17679,7 +17675,7 @@ msgstr "" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" -msgstr " برای جمع‌آوری آن --- تمرین کنید" +msgstr "برای جمع‌آوری آن --- تمرین کنید" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -17946,7 +17942,7 @@ msgstr "`Box`, `Cow`, `Arc`, `Rc`" #: src/bare-metal/no_std.md msgid "`Vec`, `BinaryHeap`, `BtreeMap`, `LinkedList`, `VecDeque`" -msgstr "" +msgstr "`Vec`, `BinaryHeap`, `BtreeMap`, `LinkedList`, `VecDeque`" #: src/bare-metal/no_std.md msgid "`String`, `CString`, `format!`" @@ -17999,7 +17995,7 @@ msgstr "" #: src/bare-metal/minimal.md msgid "A minimal `no_std` program" -msgstr "یک برنامه حداقلی از`no_std`." +msgstr "یک برنامه حداقلی از`no_std`" #: src/bare-metal/minimal.md msgid "This will compile to an empty binary." @@ -18434,7 +18430,7 @@ msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" -" برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " +"برای[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) " "نسخه‌های async از traitها را ارائه می دهد." #: src/bare-metal/microcontrollers/embedded-hal.md @@ -20075,11 +20071,10 @@ msgstr "" "بنابراین همه الگوهای بایت معتبر نیستند." #: src/bare-metal/useful-crates/zerocopy.md -#, fuzzy msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" -"‏ `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." +" `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" @@ -21111,7 +21106,7 @@ msgstr "به طور دقیق‌تر، تعریف این طور است:" #: src/concurrency/send-sync/sync.md msgid "`T` is `Sync` if and only if `&T` is `Send`" -msgstr "‏ `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد." +msgstr " `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد" #: src/concurrency/send-sync/sync.md msgid "" @@ -21324,10 +21319,10 @@ msgid "" "interface (another form of [interior mutability](../../borrowing/interior-" "mutability.md)):" msgstr "" -"‏[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " +"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " "می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " "یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" -"borrowing/interior-mutability.md)) فراهم می‌کند." +"borrowing/interior-mutability.md)) فراهم می‌کند" #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -21927,7 +21922,7 @@ msgid "" "complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" "doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -" ‏[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " +"[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) یک trait " "است، اجرا شده توسط objectهایی که نشان دهنده عملیاتی هستند که ممکن است هنوز " "کامل نشده باشد. می‌توان یک future را poll کرد و `poll` یک [`Poll`](https://" "doc.rust-lang.org/std/task/enum.Poll.html) را برمی‌گرداند." @@ -22016,7 +22011,7 @@ msgstr "" #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" -msgstr "‏[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است." +msgstr "[smol](https://docs.rs/smol/latest/smol/): ساده و سبک است" #: src/concurrency/async/runtimes.md msgid "" From d3c2c4f6c92c0151cd277f4177ddda4d1ab454d4 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 17 Oct 2024 00:34:25 +0330 Subject: [PATCH 90/92] fa: update fuzzy and untranslated 1.2 --- po/fa.po | 106 +++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/po/fa.po b/po/fa.po index de72293274e..3a11f621bc3 100644 --- a/po/fa.po +++ b/po/fa.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2024-09-11T22:10:46Z\n" -"PO-Revision-Date: 2024-10-17 00:20+0330\n" +"PO-Revision-Date: 2024-10-17 00:33+0330\n" "Last-Translator: alix1383 \n" "Language-Team: Persian\n" "Language: fa\n" @@ -207,7 +207,7 @@ msgstr "مراجع اشتراکی" #: src/SUMMARY.md src/references.md src/references/exclusive.md msgid "Exclusive References" -msgstr "مراجع انحصاری " +msgstr "مراجع انحصاری" #: src/SUMMARY.md src/references.md src/references/slices.md msgid "Slices" @@ -644,7 +644,7 @@ msgstr "`thiserror` و `anyhow`" #: src/SUMMARY.md msgid "Exercise: Rewriting with `Result`" -msgstr "تمرین: بازنویسی با «نتیجه»." +msgstr "تمرین: بازنویسی با `Result`" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4-afternoon.md src/unsafe-rust.md src/unsafe-rust/unsafe.md @@ -810,7 +810,7 @@ msgstr "Generated C++" #: src/SUMMARY.md msgid "C++ Bridge" -msgstr "پل ++C " +msgstr "پل ++C" #: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md msgid "Shared Types" @@ -826,7 +826,7 @@ msgstr "مدیریت خطا Rust" #: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md msgid "C++ Error Handling" -msgstr "مدیریت خطا ++C " +msgstr "مدیریت خطا ++C" #: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" @@ -945,7 +945,7 @@ msgstr "دانلود کردن Crateها" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Generating `gn` Build Rules" -msgstr "ایجاد قواعد `gn` Build." +msgstr "ایجاد قواعد `gn` Build" #: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md msgid "Resolving Problems" @@ -972,7 +972,7 @@ msgstr "بررسی‌ها و ممیزی‌ها" #: src/SUMMARY.md msgid "Checking into Chromium Source Code" -msgstr "کد‌های Chromium را بررسی کنید." +msgstr "کد‌های Chromium را بررسی کنید" #: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "Keeping Crates Up to Date" @@ -1451,10 +1451,10 @@ msgid "" "threads and mutexes) and async/await concurrency (cooperative multitasking " "using futures)." msgstr "" -"[همروندی](concurrency.md): یک کلاس یک روزه در مورد concurrency در زبان Rust. " -"ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با استفاده از " -"threadها و mutexها ) و async/await concurrency (multitasking مشارکتی) با " -"استفاده از futures را پوشش خواهیم داد." +"[همروندی](concurrency/welcome.md): یک کلاس یک روزه در مورد concurrency در " +"زبان Rust است. ما هر دو مورد concurrency کلاسیک (زمانبندی preemptively با " +"استفاده از threadها و mutexها ) و async/await concurrency (multitasking " +"مشارکتی) با استفاده از futures را پوشش خواهیم داد." #: src/index.md msgid "Non-Goals" @@ -2730,7 +2730,7 @@ msgstr "" msgid "Rust is a statically compiled language in a similar role as C++" msgstr "" "زبان Rust, یک زبان کامپایل شده ایستا است که نقشی مشابه C++ دارد." +"span> دارد" #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2746,15 +2746,15 @@ msgstr "" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." -msgstr "x86, ARM, WebAssembly, ..." +msgstr "x86, ARM, WebAssembly, ..." #: src/hello-world/what-is-rust.md msgid "Linux, Mac, Windows, ..." -msgstr "Linux, Mac, Windows, ..." +msgstr "Linux, Mac, Windows, ..." #: src/hello-world/what-is-rust.md msgid "Rust is used for a wide range of devices:" -msgstr ":راست برای طیف گسترده‌ای از دستگاه‌ها استفاده می‌شود" +msgstr "زبان Rust برای طیف گسترده‌ای از دستگاه‌ها استفاده می‌شود:" #: src/hello-world/what-is-rust.md msgid "firmware and boot loaders," @@ -2762,19 +2762,19 @@ msgstr "میان‌افزار (firmware) و بوت‌لودرها (boot loaders) #: src/hello-world/what-is-rust.md msgid "smart displays," -msgstr "نمایشگر‌های هوشمند" +msgstr "نمایشگر‌های هوشمند," #: src/hello-world/what-is-rust.md msgid "mobile phones," -msgstr "تلفن‌های همراه" +msgstr "تلفن‌های همراه," #: src/hello-world/what-is-rust.md msgid "desktops," -msgstr "رایانه‌های رومیزی" +msgstr "رایانه‌های رومیزی," #: src/hello-world/what-is-rust.md msgid "servers." -msgstr "سرورها" +msgstr "سرورها." #: src/hello-world/what-is-rust.md msgid "Rust fits in the same area as C++:" @@ -4054,8 +4054,8 @@ msgid "" "Copy the code below to and implement the " "function. This function only operates on 3x3 matrices." msgstr "" -"کد زیر را در کپی کرده و " -"توابع را پیاده‌سازی کنید:" +"کد زیر را در کپی کرده و توابع را پیاده‌سازی " +"کنید:" #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md @@ -5073,7 +5073,8 @@ msgstr "Generics: پارامتری‌سازی تایپ‌ها بر اساس تا msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" -"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌استاندارد و غنی Rust" +"کتابخانه‌استاندارد تایپ‌ها و traits: یک گردش در کتابخانه‌ استاندارد و ارزشمند " +"Rust." #: src/welcome-day-2.md msgid "" @@ -5195,7 +5196,7 @@ msgid "" "You might point out how some specific characters are being used when in a " "pattern" msgstr "" -"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد:" +"بهتر است که اشاره کنید چطوری میتوان از کاراکترهای خاص در الگو استفاده کرد" #: src/pattern-matching/match.md msgid "`|` as an `or`" @@ -6929,8 +6930,8 @@ msgid "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) is the standard " "resizable heap-allocated buffer:" msgstr "" -"[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) بافر قابل تغییر " -"اندازه و heap-allocated است" +"این [`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) بافر قابل " +"تغییر اندازه و heap-allocated است:" #: src/std-types/vec.md msgid "\"v1: len = {}, capacity = {}\"" @@ -7843,7 +7844,7 @@ msgstr "مدیریت آسان: پیرو فراخوانی‌های تابع اس #: src/memory-management/review.md msgid "Great memory locality." -msgstr "بهره‌وری عالی از حافظه" +msgstr "بهره‌وری عالی از حافظه." #: src/memory-management/review.md msgid "Heap: Storage of values outside of function calls." @@ -7859,7 +7860,7 @@ msgstr "کمی کندتر از stack: نیاز به برخی از عملیات #: src/memory-management/review.md msgid "No guarantee of memory locality." -msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه ندارد" +msgstr "هیچ تضمینی برای بهره‌وری بالا از حافظه ندارد." #: src/memory-management/review.md msgid "" @@ -9255,7 +9256,7 @@ msgstr "" "version=stable&mode=release&edition=2021&gist=0cb13be1c05d7e3446686ad9947c4671) " "اجرا کنید یا به اسمبلی در [Godbolt](https://rust.godbolt.org/) نگاه کنید. در " "سطح بهینه‌سازی \"DEBUG\"، آدرس‌ها باید تغییر کنند، در حالی که با تغییر به " -"تنظیم \"RELEASE\" ثابت می‌مانند." +"تنظیم \"RELEASE\" ثابت می‌مانند:" #: src/borrowing/shared.md msgid "" @@ -9630,7 +9631,7 @@ msgid "" "for at least `'a`." msgstr "" "این به این معناست که \"با توجه به اینکه `p1` و `p2` هر دو از `'a` بیشتر عمر " -"می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود.\"" +"می‌کنند، مقدار بازگشتی برای مدت `'a` معتبر خواهد بود." #: src/lifetimes/lifetime-annotations.md msgid "" @@ -10086,11 +10087,11 @@ msgstr "Iterators: شیرجه عمیق در ویژگی `Iterator`." #: src/welcome-day-4.md msgid "Modules and visibility." -msgstr "ماژول ها و قابلیت مشاهده" +msgstr "ماژول ها و قابلیت مشاهده." #: src/welcome-day-4.md msgid "Testing." -msgstr "تست‌کردن" +msgstr "تست‌کردن." #: src/welcome-day-4.md msgid "Error handling: panics, `Result`, and the try operator `?`." @@ -10583,7 +10584,7 @@ msgstr "به عنوان یک path مطلق:" #: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," -msgstr "`crate::foo` به `foo` در ریشه جعبه فعلی اشاره دارد" +msgstr "`crate::foo` به `foo` در ریشه جعبه فعلی اشاره دارد," #: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." @@ -12369,7 +12370,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "" -"`CString` به `*const i8`: برای فراخوانی توابع C به یک اشاره‌گر نیاز دارید" +"`CString` به `*const i8`: برای فراخوانی توابع C به یک اشاره‌گر نیاز دارید," #: src/unsafe-rust/exercise.md msgid "" @@ -12377,7 +12378,7 @@ msgid "" "character," msgstr "" "از `*const i8` به `&CStr`: به چیزی نیاز دارید که بتواند کاراکتر `\\0` را " -"پیدا کند" +"پیدا کند," #: src/unsafe-rust/exercise.md msgid "" @@ -12579,7 +12580,7 @@ msgstr "\"//! Crab\\n\"" #: src/android.md msgid "Welcome to Rust in Android" -msgstr "به Rust در اندروید خوش‌آمدید." +msgstr "به Rust در Android خوش‌آمدید" #: src/android.md msgid "" @@ -12971,7 +12972,7 @@ msgstr "" #: src/android/aidl.md msgid "Rust code can call existing AIDL servers," -msgstr "کد Rust می تواند سرورهای AIDL موجود را فراخوانی کند." +msgstr "کد Rust می تواند سرورهای AIDL موجود را فراخوانی کند," #: src/android/aidl.md msgid "You can create new AIDL servers in Rust." @@ -13050,7 +13051,7 @@ msgid "" "Binder generates a trait corresponding to the interface definition. trait to " "talk to the service." msgstr "" -" Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " +"Binder یک trait مطابق با تعریف interface تولید می‌کند. trait برای صحبت کردن " "با سرویس است." #: src/android/aidl/example-service/service-bindings.md @@ -14112,7 +14113,7 @@ msgstr "\"Something went wrong!\"" #: src/android/logging.md src/android/interoperability/with-c/bindgen.md #: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" -msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین" +msgstr "ساخت، push و اجرای باینری‌ها روی یک ماشین:" #: src/android/logging.md msgid "" @@ -14467,7 +14468,7 @@ msgid "" msgstr "" "`#[no_mangle]` نام‌گذاری معمول Rust را غیرفعال می‌کند، بنابراین نماد صادر شده " "فقط نام تابع خواهد بود. همچنین می‌توانید از `#[export_name = \"some_name\"]` " -"برای تعیین هر نامی استفاده کنید" +"برای تعیین هر نامی استفاده کنید." #: src/android/interoperability/cpp.md msgid "" @@ -15089,7 +15090,7 @@ msgstr "" #: src/chromium.md msgid "Welcome to Rust in Chromium" -msgstr "به Rust در Chromium خوش‌آمدید." +msgstr "به Rust در Chromium خوش‌آمدید" #: src/chromium.md msgid "" @@ -15358,7 +15359,7 @@ msgstr "" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" -msgstr "کتابخانه‌های فونت مانند `font-types`." +msgstr "کتابخانه‌های فونت مانند `font-types`" #: src/chromium/cargo.md msgid "" @@ -15403,7 +15404,7 @@ msgid "" "Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" -" `rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " +"`rustc` (کامپایلر Rust) که به نوبه خود به کتابخانه‌های LLVM، کامپایلر Clang، " "منابع `rustc` (برگرفته از GitHub، بررسی شده توسط تیم کامپایلر Rust) وابسته " "است، کامپایلر Rust باینری که برای راه‌اندازی بارگیری (bootstrapping) شده است" @@ -15648,7 +15649,7 @@ msgstr "" #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" -msgstr "شامل کد `unsafe` Rust." +msgstr "شامل کد `unsafe` Rust" #: src/chromium/build-rules/unsafe.md msgid "" @@ -16686,7 +16687,7 @@ msgstr "به هدف `rust_static_library` موجود در کنار `crate_root` #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "C++ headers will be generated at a sensible location, so you can just" -msgstr "‏ headerهای ++C در یک مکان منطقی تولید می‌شوند، بنابراین شما می‌توانید." +msgstr " headerهای ++C در یک مکان منطقی تولید می‌شوند، بنابراین شما می‌توانید" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "\"ui/base/my_rust_file.rs.h\"" @@ -16960,7 +16961,7 @@ msgstr "تعداد زیادی" #: src/chromium/adding-third-party-crates.md msgid "Consistent: `Cargo.toml`" -msgstr "یکپارچگی: `Cargo.toml`." +msgstr "یکپارچگی: `Cargo.toml`" #: src/chromium/adding-third-party-crates.md msgid "Typical library size" @@ -17535,7 +17536,7 @@ msgstr "‏ `git status` باید نشان دهد:" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Crate code in `//third_party/rust/chromium_crates_io`" -msgstr "کد Crate را در `//third_party/rust/chromium_crates_io`." +msgstr "کد Crate در `//third_party/rust/chromium_crates_io`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" @@ -20074,7 +20075,7 @@ msgstr "" msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" -" `zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." +"`zerocopy::byteorder` دارای تایپ‌های برای اعداد اولیه مطلع از byte-order است." #: src/bare-metal/useful-crates/zerocopy.md msgid "" @@ -20699,8 +20700,7 @@ msgid "" msgstr "" " همان ابزارهایی که به ما در دسترسی concurrent در یک thread واحد کمک می‌کنند " "(مانند یک تابع فراخوانی شده که ممکن است یک آرگومان را تغییر دهد یا مراجعی به " -"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات " -"می‌دهند. " +"آن را برای خواندن بعد ذخیره کند) ما را از مشکلات multi-threading نجات می‌دهند." #: src/concurrency/threads.md src/concurrency/shared-state.md #: src/concurrency/async.md @@ -20709,7 +20709,7 @@ msgstr "این بخش باید حدود ۳۰ دقیقه طول بکشد و شا #: src/concurrency/threads/plain.md msgid "Rust threads work similarly to threads in other languages:" -msgstr " threadهای Rust مانند threadها در زبان‌های دیگر کار می‌کنند:" +msgstr "threadهای Rust مانند threadها در زبان‌های دیگر کار می‌کنند:" #: src/concurrency/threads/plain.md msgid "\"Count in thread: {i}!\"" @@ -21106,7 +21106,7 @@ msgstr "به طور دقیق‌تر، تعریف این طور است:" #: src/concurrency/send-sync/sync.md msgid "`T` is `Sync` if and only if `&T` is `Send`" -msgstr " `T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد" +msgstr "`T` یک نوع `Sync` فقط و فقط زمانی که `&T` یک نوع `Send` باشد" #: src/concurrency/send-sync/sync.md msgid "" @@ -21322,7 +21322,7 @@ msgstr "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) تضمین " "می‌کند که حذف متقابل _و_ امکان دسترسی قابل تغییر (mutable) به \"T\" را در پشت " "یکread-only interface (شکل دیگری از [تغییرپذیری (mutable) داخلی](../../" -"borrowing/interior-mutability.md)) فراهم می‌کند" +"borrowing/interior-mutability.md)) فراهم می‌کند." #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" @@ -23371,7 +23371,7 @@ msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." msgstr "" -"‏Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید" +"Concurrency در Rust ‏[Concurrency in Rust](concurrency/welcome.md) را ببینید." #: src/glossary.md msgid "" From 38f5c855846225e7808c99d8850c9da15212eaba Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 17 Oct 2024 01:03:41 +0330 Subject: [PATCH 91/92] fa: fix msgid --- po/fa.po | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/po/fa.po b/po/fa.po index 3a11f621bc3..536f8d6896e 100644 --- a/po/fa.po +++ b/po/fa.po @@ -20938,13 +20938,10 @@ msgstr "\"دریافت شد: {:?}\"" #: src/concurrency/channels/senders-receivers.md msgid "" -"`‏ mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and " -"`SyncSender` implement `Clone` (so you can make multiple producers) but " -"`Receiver` does not." +"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " +"implement `Clone` (so you can make multiple producers) but `Receiver` does " +"not." msgstr "" -"‏ mpsc مخفف Multi-Producer, Single-Consumer است. `Sender` و `SyncSender` " -"`Clone` را پیاده‌سازی می‌کنند (بنابراین می‌توانید چندین تولیدکننده بسازید) اما " -"`Receiver` این کار را نمی‌کند." #: src/concurrency/channels/senders-receivers.md msgid "" From 1b84fff7ebff54a059856d181a27440fd4ce689f Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 18 Oct 2024 22:00:35 +0330 Subject: [PATCH 92/92] fix: translations.md restore sentence paragraph. --- src/running-the-course/translations.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/running-the-course/translations.md b/src/running-the-course/translations.md index 93b78a6dfce..f114a1d1854 100644 --- a/src/running-the-course/translations.md +++ b/src/running-the-course/translations.md @@ -16,9 +16,10 @@ volunteers: - [Korean][ko] by [@keispace], [@jiyongp], [@jooyunghan], and [@namhyung]. - [Spanish][es] by [@deavid]. - [Ukrainian][uk] by [@git-user-cpp], [@yaremam] and [@reta]. -- [Farsi][fa] by [@DannyRavi], [@javad-jafari], [@Alix1383], [@moaminsharifi] , - [@hamidrezakp] and [@mehrad77]. . Use the language picker in the top-right - corner to switch between languages. +- [Farsi][fa] by [@DannyRavi], [@javad-jafari], [@Alix1383], [@moaminsharifi], + [@hamidrezakp] and [@mehrad77]. + +Use the language picker in the top-right corner to switch between languages. ## Incomplete Translations